Skip to content
/ recept Public

Pen event interception for line smoothing on the reMarkable 2 tablet

License

Notifications You must be signed in to change notification settings

funkey/recept

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReCept: Remarkable Intercept

A small library to intercept and smooth pen events on the reMarkable 2 tablet. This fixes the infamous "jagged lines" issue some users of the reMarkable 2 experience.

before vs after

Disclaimer

This is not an official reMarkable product, and I am in no way affiliated with reMarkable. I release this library in the hope that it is helpful to others. I can make no guarantee that it works as intended. There might be bugs leading to device crashes.

Installation

You need access to a Linux machine to install the fix. On that machine:

  1. Connect your reMarkable 2 with the USB-C cable.
  2. Clone this repository, i.e., run git clone https://github.com/funkey/recept in a terminal.
  3. Change into the repository with cd recept.
  4. Run ./install.sh.

The install script will make several ssh connections to your device. For that, it needs to know the IP address or hostname of your device. If you haven't set up public key authentication before, it will also ask for a password. You can find both the IP address and password in "Settings" -> "Help" -> "Copyrights and licenses", at the bottom.

If you want to uninstall the fix, simply enter 0 when asked for the smoothing value in the install script.

Will it increase the latency?

In short, yes. The pen events themselves are not delayed (the filter itself consists only of a handful of integer operations, which are likely negligible). However, since we forward the average position of the past N events instead of the actual event, the reported position is somewhere close to the N/2-last event received. How much that actually increases latency depends on how fast events come in. As an example, if the pen sends 1000 events per second and the filter size N is 8, the mean will trail the actual pen position by around 4 milliseconds. This calculation assumes isochronous events, which might not be the case.

How does it work?

ReCept uses the LD_PRELOAD trick, which in this case intercepts calls to open and read. Whenever /dev/input/event1 is opened by xochitl (the GUI running on the tablet), librecept remembers the file handle. Subsequent reads from this handle are transparently filtered with a moving average of size 16 by default.

About

Pen event interception for line smoothing on the reMarkable 2 tablet

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published