Repository navigation
Conversation
MESSAGE_SET_REFRESH_MODE and MESSAGE_REQUEST_FULL_REFRESH called safetyWaitForEventLoopToCatchUp(), a fixed 1 s sleep on the client's handler thread, on every request -- including a switch to the mode that is already active. Apps that change modes often (KOReader through the shim, or anything that uses ANIM for scrolling and zooming) stall for a second each time. Ordering is already guaranteed: queued invocations to the same object run in FIFO order on the GUI thread, so the mode change always lands before later updates. What the sleep really bought was "the new mode has reached the screen before the client continues". This change keeps that guarantee but waits for the actual event: the change runs on the GUI thread, then the handler waits for the window's next frameSwapped / afterRendering, with a 300 ms timeout as a fallback. Requests that do not change the mode return immediately. Tested on a reMarkable Paper Pro Move (OS 3.29.1.0, AppLoad v0.6.0 + this patch): a mode switch to ANIM now takes ~40 ms before the next update is processed (was >= 1 s), same-mode requests take no time, and no frame-wait timeout fired in 30 minutes of mixed use.
|
Built and tested rM2 |
|
Good luck with your experiments. The delay is deliberately there, since we don't know if xochitl has correctly built in safety measures, when changing update modes rapidly after each other. You may or may not damage your screen (the actual hardware) with this update (probably most unsafe on the reMarkable Paper Pro or the reMarkable Paper Pro Move). The warranty explicitly mentions, that it does not cover damages caused by running third party software, so you'll need to be willing to take the risk yourself. I agree, the qtfb implementation in KOReader is horrible, so I don't use the upstream version, but a version where ui and content have the same update mode (so no changes in update mode during use). An app should never request a screen mode update, if it already uses the mode it wants to change to, but that part of the code is of course save to add. Also: Please, instead of creating verbose AI generated PR's, you should make a detailed bug report, by creating an issue. See the README:
|
|
Hi @ingatellent , since this is technically not a bug, I did not create an issue. |
|
I maintain Inkpage, an EPUB reader that runs through AppLoad on the Paper Pro Move. I have read this patch but have not tested it yet. The 1 s wait affects us even though we never change the refresh mode. We only send On the hardware concern from @ingatellent: I can't say whether rapid mode changes are safe for the panel, so I understand the
Would a middle ground work?
@asivery, would you accept that, and what minimum interval would you consider safe? |
Hi asivery! First of all, thank you for AppLoad. It is what makes third-party apps on the Paper Pro family possible at all, and it has been a joy to build on.
While writing a small app for my Paper Pro Move, I ran into a 1 s pause on every refresh-mode change and dug into why. Here is what I found, and a fix that I hope is useful.
Every time a qtfb app changes its refresh mode or asks for a full refresh, AppLoad currently pauses that app's connection for a fixed 1 second. This PR replaces the fixed pause with "wait until the change has actually been drawn", which on a Paper Pro Move takes about 40 ms (way faster). Apps that switch modes, such as KOReader, become noticeably more responsive.
No client changes are needed.
What this PR changes
The sleep is replaced with a small helper,
runOnGuiAndAwaitFrame():Perf
Measured on a reMarkable Paper Pro Move:
Compatibility: the socket protocol and the client libraries are unchanged, so existing apps work as before, only faster.
Testing
Built from v0.6.0 plus this patch with the CI toolchain image.
Tested on a reMarkable Paper Pro Move (OS 3.29.1.0):
[Update] Simplified PR.