Skip to content

Commit

Permalink
Use xochitl instead of remarkable-shutdown in rm2fb-server
Browse files Browse the repository at this point in the history
In the last software relase (2.6), new waveform modes were added to
xochitl to make the pinch-to-zoom feature work. Unfortunately, the
remarkable-shutdown binary was not updated to support those new
waveforms. As a consequence, using pinch-to-zoom with rm2fb results in a
less smooth experience than without rm2fb, since the screen gets
refreshed less frequently during the gesture.

See:

* <#322 (comment)>
* <ddvk/remarkable2-framebuffer#56>

To address this issue, this PR changes the rm2fb-server to preload the
`/usr/bin/xochitl` binary instead of `/usr/bin/remarkable-shutdown` in
both the `rm2fb-server` command and `rm2fb.service`.

A start condition is added to `rm2fb.service` to only start if the
librm2fb_server library actually exists on the filesystem. This is to
avoid having two concurrent xochitl processes running, as the loader
ignores non-existent files provided in LD_PRELOAD.

Test plan:

* Manually run `rm2fb-server` and `rm2fb-client xochitl`, make use of
  the pinch-to-zoom gesture, and make sure no message of the form
  `Unable to complete update: invalid waveform ( 6 )` appears in the
  server process.
* Check that the display continuously updates when using the
  pinch-to-zoom gesture, even if the `rm2fb.service` service is running
  and xochitl is started with `rm2fb-client xochitl`.
* Remove the `/opt/lib/librm2fb_server.so.1` symlink and restart
  `rm2fb.service`. The service should not start. Make sure that there’s
  no duplicate `xochitl` process in this case.
  • Loading branch information
matteodelabre committed Apr 2, 2021
1 parent 18eb01d commit 1bd9582
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package/rm2fb/package
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ maintainer="raisjn <[email protected]>"
license=MIT
pkgdesc="Interface to the reMarkable 2 framebuffer"
url="https://github.com/ddvk/remarkable2-framebuffer"
pkgver=1.0.1-1
pkgver=1.0.1-2
section="devel"

image=qt:v1.1
Expand Down
2 changes: 1 addition & 1 deletion package/rm2fb/rm2fb-server
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
LD_PRELOAD=/opt/lib/librm2fb_server.so.1 exec "$(command -v remarkable-shutdown)"
LD_PRELOAD=/opt/lib/librm2fb_server.so.1 exec "$(command -v xochitl)"
3 changes: 2 additions & 1 deletion package/rm2fb/rm2fb.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ After=opt.mount
StartLimitInterval=30
StartLimitBurst=5
Conflicts=
ConditionFileNotEmpty=/opt/lib/librm2fb_server.so.1

[Service]
ExecStart=/usr/bin/remarkable-shutdown
ExecStart=/usr/bin/xochitl
Restart=on-failure
RestartSec=5
Environment="HOME=/home/root"
Expand Down

0 comments on commit 1bd9582

Please sign in to comment.