Skip to content

Add experimental reMarkable 1/rM2 windowed build (rm1 feature)#1

Open
sliekens wants to merge 3 commits into
MaximeRivest:mainfrom
sliekens:feature/rm1
Open

Add experimental reMarkable 1/rM2 windowed build (rm1 feature)#1
sliekens wants to merge 3 commits into
MaximeRivest:mainfrom
sliekens:feature/rm1

Conversation

@sliekens

@sliekens sliekens commented Jul 6, 2026

Copy link
Copy Markdown

Summary

Optional reMarkable 1 / rM2 support alongside unchanged default Paper Pro builds. Compiles with --features rm1 for armv7 windowed AppLoad/qtfb; default aarch64 targets are untouched.

What changes

  • rm1 cargo feature — 1404×1872 display, Wacom digitizer, FBFMT_RM2FB, no quill takeover
  • qtfb / evdev wire layouts — keyed off target_pointer_width (32 vs 64 bit), not product
  • Pen input — Wacom axis rotation map, AppLoad qtfb-shim-32bit via launch script, qtfb pen fallback when evdev grab fails
  • Windowed mode polish — footstep stamps (takeover-only upstream experiment) disabled in qtfb; tighter touch+pressure filtering to avoid stray ink
  • Build / installbuild-rm1.sh, external.manifest.rm1.json, appload-launch-rm1.sh, README section

Tested on

reMarkable 1.0, OS 3.22.0.64, xovi arm32 + AppLoad v0.4.2, OpenAI HTTP oracle.

Not included

quill takeover, 5-finger quit, power-button sleep — Paper Pro / takeover only.

sliekens and others added 2 commits July 6, 2026 15:47
Optional armv7 qtfb/AppLoad target alongside unchanged default Paper Pro
builds. Gated by --features rm1: 1404x1872 display, Wacom pen + axis map,
qtfb-shim launch script. qtfb/evdev wire layouts follow target pointer width
(32 vs 64 bit). Windowed mode also falls back to qtfb pen events when evdev
grab fails or AppLoad input shim is active — safe for existing aarch64 builds.
Disable takeover-only footstep stamps when running inside AppLoad; they
read as random spatters on e-ink windowed builds. Tighten pen filtering:
require BTN_TOUCH with pressure > 40, and ignore hover pressure noise.
Copilot AI review requested due to automatic review settings July 6, 2026 14:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an experimental reMarkable 1 / rM2 windowed (qtfb) build path gated behind a new rm1 Cargo feature, while keeping the default Paper Pro build behavior unchanged.

Changes:

  • Introduces rm1 feature flags for resolution, framebuffer format, and digitizer handling (Wacom vs Paper Pro marker).
  • Updates qtfb and evdev parsing to handle 32-bit vs 64-bit ABI layout differences via target_pointer_width.
  • Adds armv7 build/install artifacts (build script, AppLoad launcher, external manifest) and documents the new workflow.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
riddle/src/qtfb.rs Adds ABI-dependent parsing helpers for init reply and userinput messages (32-bit vs 64-bit layout).
riddle/src/pen.rs Adds rm1 Wacom ranges, 32/64-bit input_event parsing, and rm1 axis-to-screen rotation mapping.
riddle/src/main.rs Changes raw-pen selection logic and gates the “footstep stamp” experiment behind takeover mode.
riddle/src/fb.rs Makes screen dimensions feature-dependent (Paper Pro vs rm1/rm2).
riddle/src/display.rs Selects qtfb fmt/geometry per feature and tweaks refresh mode for rm1.
riddle/scripts/appload-launch-rm1.sh New AppLoad launcher that preloads the 32-bit qtfb shim for rm1/rm2 windowed mode.
riddle/external.manifest.rm1.json New AppLoad manifest for the rm1/rm2 windowed bundle.
riddle/Cargo.toml Adds rm1 feature and updates crate description to mention optional windowed build.
riddle/build-rm1.sh New cross-build script producing a dist-rm1/ bundle for tablet install.
riddle/.cargo/config.toml Adds armv7 linker configuration.
README.md Documents the experimental rm1/rm2 windowed build steps and constraints.
.gitignore Ignores the riddle/dist-rm1/ build output directory.
Comments suppressed due to low confidence (1)

riddle/src/qtfb.rs:107

  • recv may return fewer than 32 bytes; the code only checks n <= 0 and then parses fixed offsets. If the init reply is short (or malformed), this can mis-parse shm_key/shm_size and attempt to open/mmap the wrong segment. Add a minimum-length check keyed off the ABI before calling parse_init_reply.
        let mut reply = [0u8; 32];
        let n = unsafe { libc::recv(fd, reply.as_mut_ptr() as *mut libc::c_void, 32, 0) };
        if n <= 0 {
            unsafe { libc::close(fd) };
            return Err(io::Error::new(

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread riddle/src/main.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 41400c229e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md
- build-rm1.sh and appload-launch-rm1.sh: executable bit (100755)
- qtfb connect: reject truncated init replies before parsing
- main.rs: document why qtfb-shim path keeps pen_dev without EVIOCGRAB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants