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

restream never shuts down on the reMarkable #103

Open
frederik-elwert opened this issue Feb 1, 2024 · 1 comment
Open

restream never shuts down on the reMarkable #103

frederik-elwert opened this issue Feb 1, 2024 · 1 comment

Comments

@frederik-elwert
Copy link

When launching reStream.sh on the host, the corresponding restream process is started on the reMarkable. But when closing the window on the host, the process still runs on the remarkable. Since it has a quite high CPU load, this causes the battery of the reMarkable to deplete quickly.

I saw in the reStream.sh that it’s supposed to kill the restream process in the end, but that does not seem to happen.

So I think there are two scenarios:

  • reStream.sh is shut down using Ctrl+C in the terminal window. In that case, it correctly kills the process on the reMarkable.
  • One simply closes the ffplay windows, which also ends reStream.sh, but in that case the process on the reMarkable is left running.

Would it be possible to detect that second case and also terminate the process?

@rien
Copy link
Owner

rien commented Feb 1, 2024

We currently trap signals related to exiting and then kill the process running on the reMarkable:

reStream/reStream.sh

Lines 124 to 129 in 006d83e

# kill reStream on remarkable at the end.
# shellcheck disable=SC2016
exit_rm() {
ssh_cmd 'kill $(pidof restream)'
}
trap exit_rm EXIT INT HUP

We are probably missing an exit signal (probably SIGPIPE or SIGCHLD), so detecting which signal it is and adding it would probably resolve the issue.

However, I also think we should be able to detect this in the process running on the reMarkable itself by looking whether the stdin and/or stdout channels are still being read from.

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

No branches or pull requests

2 participants