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

Kindle Scribe: Random finger touch unresponsiveness #11482

Closed
mergen3107 opened this issue Feb 19, 2024 · 24 comments
Closed

Kindle Scribe: Random finger touch unresponsiveness #11482

mergen3107 opened this issue Feb 19, 2024 · 24 comments

Comments

@mergen3107
Copy link
Contributor

  • KOReader version: v2024.01-63
  • Device: Kindle Scribe (5.16.2)

Issue

I got some weird freezes in some case, but inconsistently.

  1. First one was when I had a vector-image heavy PDF file (scientific article) which I asked about recently. I don't remember what gesture I used to trigger the freeze.
  2. Two times when I did my diagonal swipe with two fingers in the direction of top right corner to summon bookmarks. I did a hard restart after each. This was surprisingly while I was reading an FB2 book!

Symptoms are the same. I do a gesture and KOReader freezes to touch.
I can put it to sleep, screensaver shows up alright.
I press power button again, and instead of saying "Use your gesture to unlock", it says "Unlock gesture is not setup, tap to unlock" (don't remember exact wording). Then it is frozen again.
I didn't have access to my laptop wtih SSH in all three times, but now I can't reproduce it neither.

Is there any pointers in the log? In the second freeze in (2) I enabled verbose logs.
I kept them on now, to be able to catch it again.

Thanks!

crash.log (if applicable)

crash_FREEZE.log.txt
crash_FREEZE_verbose.log.txt

@mergen3107
Copy link
Contributor Author

I have a suspicion that this is touch driver is acting up. I remembered another time when it froze like this last week: when I hit a link in the above mentioned PDF and wanted to go back via my two finger swipe left gesture.

Maybe Kindle's multitouch implementation is a hit or miss?

@mergen3107
Copy link
Contributor Author

I suspect two-finger swipes are somehow tripping the touch input device.

I see some messages in first log like “Restoring Kindle input” and “Inhibiting touch input” or something like that.

Then I also don’t know if those “closing touch device fd” are relevant or not, but maybe not - there appear before a usual clean exit with code 0.

@NiLuJe can you please suggest where should I dig? I think it might be related with:

  1. Two-finger swipes / multiswipe detection racing to determine the gesture
  2. Two-finger swipe / short diagonal swipe or other gestures racing with each other with no definitive resolution
  3. Two-finger swipe just being wonky by themselves.

I have yet to reproduce it live with SSH on. (As if with verbose logs this issue is not reproducible, but I must be tripping).

Sorry, I noticed that verbose log file is empty. I’ll try to reupload later if it’s still there on Kindle.

@mergen3107
Copy link
Contributor Author

mergen3107 commented Mar 1, 2024

So, it turns out verbose log was 0 KB on Kindle as well.

However, I got the same-looking freeze today during OTA update from 63 to 80 nightly.
It downloaded OK, then said "Do you want to install now?", I said - yes.
The popup window went away, but KOReader stayed where it was before update - on the book page, but no touch/swipe worked.

I then connected via sftp, and did killall reader.lua, and I saw Kindle home screen.
Touch worked OK. The verbose log-2 at the moment reported that it exited normally with code 0.
crash_FREEZE_verbose.log_2.log.txt

After I started KOReader again, OTA update installation started normally and then it restarted again as usual. Now it works OK.

I did not do any gestures during the OTA update, which makes me think this is not gesture-related.
Anything suspicious in the logs?

Zotero plugin?
Some other plugin?

@Frenzie
Copy link
Member

Frenzie commented Mar 1, 2024

Edit: pardon, but I forgot about what you'd written by the time I reached the possibly relevant part of the log. ;-)

@NiLuJe
Copy link
Member

NiLuJe commented Mar 1, 2024

So, it turns out verbose log was 0 KB on Kindle as well.

Whut?

That's not possible, even a non-verbose log will have some content in it.

That would imply severe filesystem shenanigans to me (or fuse proxy, if it's a pre-MTP FW).

@NiLuJe
Copy link
Member

NiLuJe commented Mar 1, 2024

That last log looks perfectly fine, on the other hand, so that's sort of strange. I'd have been curious to know what it was stuck on (e.g., strace it; hitting S with the process highlighted in htop will do that).

@mergen3107
Copy link
Contributor Author

So, it turns out verbose log was 0 KB on Kindle as well.

@NiLuJe
First, this file I lost was a result of me renaming crash.log to that new name in kterm (because I only had Kindle on hand at that time on a train).

First renaming was OK (non-verbose log), second was not (verbose log).

I'll try to htop it, thanks!

@mergen3107
Copy link
Contributor Author

So, to make it clear: crash.log itself was populated alright. Maybe then kterm messed up?

@mergen3107
Copy link
Contributor Author

I did it via cp file1 file2

@mergen3107
Copy link
Contributor Author

@NiLuJe
For a start, here is a strace from htop -p $(pidof reader.lua) (then pressed s) when I exit normally, FWIW:
TRACE_OK
TRACE_OK.txt

Meanwhile I am trying to catch the same freeze with strace open.
However, the strace window stays at the first line like this the whole time:

Trace of process 10344 - /mnt/us/koreader/luajit│./luajit ./reader.lua

strace: Process 10344 attached
09:37:12.154993 read(3,

Do you expect it to add more details when I get a freeze?
Please guide me here, since I have never used strace before :D

@NiLuJe
Copy link
Member

NiLuJe commented Mar 4, 2024

No need to follow the process, you can attach to it if/when hung, that'll be more than enough ;).

@mergen3107
Copy link
Contributor Author

I haven't been able to catch another freeze yet (moved to 2024.03 stable), but I got an idea.

Can it be that it is not the reader.lua that freezes, but only the input module breaks somehow?

I remember @NiLuJe said that the touch control is exclusive, so once KOReader takes the control, Kindle native can't. But what if Kindle UI still tries to gain the control back and succeeds in some cases?

@mergen3107
Copy link
Contributor Author

Is there a way I can send a command (say, "next page") via ssh in KOReader?

@NiLuJe
Copy link
Member

NiLuJe commented Mar 5, 2024

But what if Kindle UI still tries to gain the control back and succeeds in some cases?

It can't (at least not from userland via an EVIOCGRAB, that'll fail). If the input device is a virtual or uinput one and the state of it changes behind our back, that's another kettle of fish, though.

Regardless, a strace will tell what's happening in more details.

Is there a way I can send a command (say, "next page") via ssh in KOReader?

Dunno if something like that made it to @poire-z's HTTP plugin, I haven't had time to catch up quite yet ;).

@Frenzie
Copy link
Member

Frenzie commented Mar 5, 2024

You can send events, so the short answer is yes.

@mergen3107
Copy link
Contributor Author

If the input device is a virtual or uinput

I think we figured out that these /dev/input/eventX are not virtual ones, right?
Because virtual ones are in /sys/class/input/

@NiLuJe
Copy link
Member

NiLuJe commented Mar 5, 2024

There may still be a way for something to stop the kernel from reporting events at all (e.g., like what happened with the haptic buttons on the Voyage), dunno ;).

@mergen3107
Copy link
Contributor Author

Sounds like a lot of fun

@mergen3107
Copy link
Contributor Author

I guess now I have a mild PTSD from Kobo Clara HD issues, when it turned out to be… the magnet.

I realized, that those cases of frozen touch were either on the train, airplane, or classroom, where I used Kindle with its magnetic cover semi-folded, so that Kindle stays upright.

I guess, I'll go and try to play around with magnet now :D

(This might explain everything to me expect why Kindle UI was the only one to dismiss finger touches)

@mergen3107
Copy link
Contributor Author

Magnet also doesn't explain why KOReader why showing "No gesture to unlock KOReader, tap to exit" during these first freezes. This looks more like a storage lock up.

@mergen3107 mergen3107 changed the title Random action freezes Kindle Scribe: Random finger touch unresponsiveness Mar 7, 2024
@mergen3107
Copy link
Contributor Author

@NiLuJe
Here is the dmesg between I caught the issue (very last time) and some time after (no luck it catching it again. Can you please see if there is anything hinting to the touch/input failures?
dmesg.txt

The only error keyword I see about the gyroscope:

[    5.872866] .(1)[597:modprobe][E]�3<BS_LOG><bma4xy_i2c_read><94>I2C xfer error
[    5.872888] .(1)[597:modprobe][E]�3<BS_LOG><bma4xy_probe><2649>Bosch Sensortec Device 1 CANNOT be detected!
[    5.872895] .(1)[597:modprobe][E]�3<BS_LOG><bma4xy_i2c_probe><250>BMA4xy Probe failed with err: -2
[    5.872933] .(1)[597:modprobe]bma4xy_acc: probe of 0-0019 failed with error -2

and the other is about uart pins:

[    0.376105] .(0)[1:swapper/0]mt6577-uart 11003000.serial: Error applying setting, reverse things back
[    0.376126] .(0)[1:swapper/0]mt6577-uart: probe of 11003000.serial failed with error -22

@NiLuJe
Copy link
Member

NiLuJe commented Mar 8, 2024

Nope. Then again, there was no guarantee there'd be anything visible in there to begin with ;).

@mergen3107
Copy link
Contributor Author

So, I still haven't caught that issue again reading everyday too, so frustrated.

However it seems to be resolved after 2024.3.1-1 (pen slots shenanigan resolved).

Thank you @NiLuJe if that's what solved it :D

Closing until I catch it again.

@mergen3107
Copy link
Contributor Author

For crossref, 2024.3.1-1 is this: #11520

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

3 participants