Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use xochitl instead of remarkable-shutdown in rm2fb-server #325

Merged
merged 2 commits into from
Apr 2, 2021

Conversation

matteodelabre
Copy link
Member

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:

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.

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.
@matteodelabre matteodelabre added the packages Add or improve packages of the repository label Apr 2, 2021
@raisjn
Copy link
Contributor

raisjn commented Apr 2, 2021

yes, it works fine but problematically remux is sending it SIGSTOP signals when remux runs because rm2fb now has the bin of 'xochitl' (since remux doesn't assume it is "owning" a process, it scans for all processes that use the bin specified in the draft file).

@matteodelabre
Copy link
Member Author

Fixed this with a patch to the server library to overwrite argv[0] after initialization. That way, the value visible in /proc/<pid>/cmdline is rm2fb-server (or a prefix of that string if argv[0] was not large enough to begin with). I did not change the value in /proc/<pid>/comm since remux does not use it, so it will still contain xochitl.

Copy link
Contributor

@raisjn raisjn left a comment

Choose a reason for hiding this comment

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

verified it now works with remux

@matteodelabre matteodelabre merged commit 12e6fb4 into testing Apr 2, 2021
@matteodelabre matteodelabre deleted the package/rm2fb/fix-2.6-waveforms branch April 2, 2021 15:53
matteodelabre added a commit to ddvk/remarkable2-framebuffer that referenced this pull request Apr 8, 2021
raisjn pushed a commit to ddvk/remarkable2-framebuffer that referenced this pull request Apr 10, 2021
danshick pushed a commit to danshick/toltec that referenced this pull request May 5, 2021
…v#325)

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:

* <toltec-dev#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`.

This PR also contains a patch to prevent rm2fb-server from appearing as xochitl in process lists. This is done by overwriting `argv[0]` after the library is initialized. This is necessary to prevent remux from mistakenly killing rm2fb-server.

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.
danshick added a commit to danshick/toltec that referenced this pull request May 5, 2021
LinusCDE pushed a commit that referenced this pull request Jun 3, 2021
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`.

This PR also contains a patch to prevent rm2fb-server from appearing as xochitl in process lists. This is done by overwriting `argv[0]` after the library is initialized. This is necessary to prevent remux from mistakenly killing rm2fb-server.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages Add or improve packages of the repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants