-
Notifications
You must be signed in to change notification settings - Fork 5
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
Semi freezes after a period of time #5
Comments
Hi rien333, Thanks for the detailed issue! I do not have the time now to dive into this directly, but maybe the problem is interference between Plato and inkvt? When you start inkvt.sh in Nickel, inkvt kills Nickel and takes control over the framebuffer. Plato, instead, will still be alive in the background. It might be that plato updates the framebuffer state while inkvt is running. However, that has never been a problem for me with KOReader. I'll try to reproduce the bug when I'm back at home. Maybe you have found out that keyboard over HTTP is a bit unstable too in general, I'm still trying to figure out a better way to fix this (maybe more into the direction of using the Kobo as VNC screen) For this:
Maybe @NiLuJe known that that means? Update region seems to be within the screen resolution. Sorry to chip you in if you don't want to be fixing problems here :) Kind regards, |
Unfortunately, the same thing happens with Nikel.
Strangely, Nickel seems to freeze faster (though this could be purely subjective). I'll experiment with ensuring that inkvt runs with full control over the framebuffer. So far, this has failed, probably because I can't get inkvt to properly work with fmon (it doesn't show up in my books, for some reason). I'll try and sort that out first.
ssh seems pretty stable and fairly straightforward, actually. (though it has some obvious drawbacks) It even forwards key combos correctly. |
Plato (EDIT: and Nickel, duh.) can definitely do hardware rotations, something which will definitely break inkvt right now (there'd need to be a checked fbink_reinit() + state refresh + whatever else might be needed to resync the new state w/ libvterm's state) at key places to deal with it; but dealing with it could arguably be construed as out of scope ^^). That would explain that one specific error log (and the subsequent lack of inkvt refreshes ;)). (FWIW, for legacy reasons, KOReader doesn't do hardware rotation, on the other hand. It'll setup the fb at startup and exit, but that's it). I haven't actually tried the KFMon script, but it looked sane, I'll double-check ;). Sidebar on compilers: https://github.com/koreader/koxtoolchain (TL;DR: kobo if you want a non-sucky GCC version, at the expense of needing to link against the STL statically; nickel if you want a sucky GCC version with which you'll be able to link against the STL dynamically). Ubuntu TCs might work in theory, but target a far too recent glibc, which will likely lead to stuff randomly breaking in fun and interesting ways at load or runtime. The official TC binaries provided by Kobo are essentially an old binary build of what koxtoolchain's nickel target will do, but will obviously do the job, if you can get them working on your system (never tried). |
As usual, I'd check what dmesg & htop have to say about whatever's happening next time you can replicate this. (It's conceivable that a broken MXCFB request could softlock the device. I should be dropping all the known offenders inside FBInk, but, who knows. dmesg should be helpful if that's actually the case). |
Good one! Totally forgot that dmesg is available on the Kobo. As far as htop goes, |
I was mainly wondering about something stuck in a busy-loop, since you mentioned some stuff behaving slower ;). |
@rien333 How fast is fast? :) I've been typing things in invt and frantically rotating my Libra H2O for quite a while now, over SSH in KOReader, but everything is still working fine.. (it did hang shortly after issueing a Could you still maybe send a
Looks good, that what I use too during development
Oh I thought you were using my Keyboard over HTTP hack :) Yeah ssh works quite straightforward :)
That doesn't sound like only inkvt is hanging.. (its not hooking into evdev, unless you did edit the main.cpp file to do that).
So the display still updates? Very strange.. |
@llandsmeer: KOReader doesn't do hardware rotation, as such, it won't trash the state behind inkvt's back like Nickel or Plato can ;). I alluded a bit to it in my original answer, but FBInk has a mechanism to deal with that:
In inkvt's case, in such instances, you'd also have to reissue an That said, whether you want to deal with that or not to begin with is debatable: in "normal" conditions, killing Nickel ensures something like that won't happen ;). |
Think in units of 10 seconds — no freezes are immediate, and I have used inkvt without problems for what felt like more than a minute, almost 2 minutes.
I was planning on reinstalling and recompiling everything in accordance with the recently updated instructions. Do you think you'll still find logs and binaries from my failed installation useful?
No, sorry for creating confusion. The kobo's display itself remains frozen, but if I were to host a tmux session on my PC, and then connect the kobo to this tmux session through ssh, that ssh session will still revieve keypresses send through inkvt, albeit with a significant delay and some other glitchiness. (I found this out, because the tmux session hosted on my PC suddenly started to move a bit after me trying to send keypresses during a freeze) (doesn't matter though, just a random observation) I'll post some logs/new results tomorrow! |
If it's no bother, it certainly can't hurt ;). |
I ran htop and dmesg on my failed installation (basically, the one I described in my opening post). This is what dmesg outputs after running
This seems to be largely with you guys predicted, inkvt has trouble drawing while plato is also using the screen (btw: I used this hacky Kobo terminal before, and I was able to run it alongside plato). Practically all the messages consisted of the "collision detected" message, though I also included the other messages I was able to find. Gonna try the new and improved installation instructions now! |
The collisions are somewhat to be expected given the patterns of ioctl generated by InkVT, so those don't worry me too much. The timeouts, on the other hand, is where things start to get interesting. What's interesting is that InkVT itself never waits on update completion, which tells me that those are actually Plato's refreshes going wonky. I'm not quite sure how that could come to be, unless something really upset the EPDC, leading to one of the softlocks I mentioned earlier. (In which case, reboot to recover. Or an mxcfb uninit/init might work, but I've never tried). |
Yeah I tried getting inkvt to launch with Nickel or Plato running yesterday as I thought that would make the difference, but I even couldn't get SSH access working in a day.. (I just always use KOReader's dropbear version)
Thank you very much (again, and also for the pull requests! 😄). A single extra ioctl() per draw request doesn't sound that bad. I think I'll hide it behind a env variable/argv for inkvt.sh (for people launcing it in the right ™️ way). |
Maybe this is the problem for Plato (eg. it doesnt' expect to be running in 8bit mode)? echo "Restoring original fb bitdepth @ ${ORIG_FB_BPP}bpp & rotation @ ${ORIG_FB_ROTA}" >>crash.log 2>&1
./fbdepth -d "${ORIG_FB_BPP}" -r "${ORIG_FB_ROTA}" >>crash.log 2>&1 |
Oh, if @rien333 launched inkvt via the script, definitely ^^. (I'd naively assumed he was running the binary directly by hand... :D). |
I guess so... maybe inkvt.sh should include a error message if it finds plato running |
Basically, I did something like this: from ssh, I ran
Maybe. Though hopefully most users will just launch inkvt normally. |
Okay, then, yeah, that'll definitely break Plato ;). |
Could reproduce a freeze at my kobo by issueing a [...]
[FBInk] MXCFB_SEND_UPDATE_V2: Invalid argument!
[FBInk] update_region={top=8, left=0, width=1264, height=1664}!
[FBInk] Failed to refresh the screen!
[...] But thats after the |
Ah that was a deployment problem (new inkvt.armhf binary wasn't overwritten..). With 1cd991c, inkvt handles rotations kind of ok (only inversions which do not change WxH screen size) Now I'll have to figure out how to fix the deployment |
Okay, I got everything to work, including kfmon integration. Maybe my mistake last time was not doing the import from nickel. CPU usage seems to be a lot higher compared to my last attempt (htop shows I've seen one freeze very similar to the one described in this thread, but now everything has been running smoothly for at least a few minutes. Thanks again for this cool project. I hope it will see other interesting improvements! I guess all my problems outlined in this thread have been resolved by the new and improved instructions (I like the auto-generated zip, very easy to install!). If I have any new, concrete problems I'll open a new issue. |
One really nice befenit of this, is that we get screen rotations working for free (using fbdepth -r <n>)! (#5).
Do not slow down inkvt when its being started in a sane environment. I'm not sure if its actually slower though, with all those fbink_reinit() calls. We also lose the ability to handle manual screen rotations, so maybe revert in the future? (#5)
Those last two commits should make inkvt handle arbitrary screen rotations when started from SSH, but keep functioning as before when launched from Nickel with kfmon (maybe that should fix the increased CPU usage, but I'm not sure)
Yes I'm very happy with that too (thanks @NiLuJe 😄). I think this thread brought some nice improvements to inkvt, thanks for showing you interest in this project :) |
The actual userland logic in Not quite sure there's any better 'spot' to put it in inkvt, though ;). |
I run inkvt over ssh. (for some reason, I can't kfmon to get inkvt show up in nikel, though the kfmon logs do show that inkvt is being registered, without errors). Though inkvt runs fine for a while, after a seemingly random — but short — period of time, inkvt freezes the screen. In addition to freezing the screen, I can't acces the underlying application anymore (e.g. if I would swipe while inkvt is running, the Plato reader would normally update the screen and show the next page). There are no errors shown in my ssh terminal, and I can still start new ssh sessions on the Kobo after the occurrence of the freeze. Oddly, if inkvt is in its frozen state, I can still send keypresses over http and ssh, but it takes a while for them to arrive.
To my knowledge, I followed your instructions carefully. Do you have any idea of what might be going wrong, and where/how to look for errors?
I run inkvt as as follows:
Generally, there are no errors upon the moment it freezes. This one time, inkvt did tell me the following (though this could be completely unrelated):
System info
I used the same compiler as you suggested to compile inkvt. I have a KOBO Clara HD, with the latest 2019 firmware (I haven't checked for firmware since 2020).
The text was updated successfully, but these errors were encountered: