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

[Kobo Clara 2E] Koreader freezes randomly #9806

Closed
UserCel opened this issue Nov 18, 2022 · 117 comments
Closed

[Kobo Clara 2E] Koreader freezes randomly #9806

UserCel opened this issue Nov 18, 2022 · 117 comments
Labels
bug can't fix an issue that, by definition, cannot be fixed coming soon firmware Kobo out-of-date
Milestone

Comments

@UserCel
Copy link

UserCel commented Nov 18, 2022

  • KOReader version: 2022.10
  • Device: Kobo Clara 2E

Issue

The device randomly freezes, usually while reading but it happened at least once while browsing the settings. Doesn't happen often, about once a day, forcing me to shutdown the device using the power button.

Steps to reproduce

Use koreader for several hours.

crash.log (if applicable)

crash.log

Btw

Thanks for this piece of software, it works great most of the time :D

@NiLuJe
Copy link
Member

NiLuJe commented Nov 18, 2022

A few workarounds have been implemented in current nightlies, but the Clara 2E (like the Libra 2 & Nia) runs on a severely capricious board, so I can't guarantee a miracle cure ;).

@NiLuJe NiLuJe added bug coming soon Kobo out-of-date firmware can't fix an issue that, by definition, cannot be fixed labels Nov 18, 2022
@UserCel
Copy link
Author

UserCel commented Nov 19, 2022

I see, I guess I'll be on the lookout for improvements after the next release.
Thanks

@adhdandy
Copy link

Not sure if this is related, but I have noticed Koreader freezing when I try to jump to a chapter using the TOC. What fixed that for me was deleting fontinfo.dat, but I have had to do that twice now because it kept happening.

@NiLuJe
Copy link
Member

NiLuJe commented Nov 21, 2022

@adhdandy:

Wrong deduction ;). One is just the consequence of the other, but not this way around. That specific behavior is known to be extremely deadly to those capricious boards (#8414), which is why part of the workarounds involve disabling the racy bits of this specific interaction.

And the consequence of a hang is a hard-reboot, which is a very fine way to trigger filesystem corruption. Unlike most of our settings, the fontinfo.dat thing wasn't being defensive about writing data to disk ASAP, this has also been fixed (#9691).

@UserCel
Copy link
Author

UserCel commented Nov 22, 2022

@adhdandy:

Sadly this doesn't seem to be the case for me.

@NiLuJe:

I've been using the 20/11 nightly and this behavior persists, sadly these workarounds aren't too effective in my case (which you said might be the case :p).

crash.log
Log after the crash before relaunching koreader, seems to be the exact same thing as the monthly build, not that it says much to me..

@NiLuJe
Copy link
Member

NiLuJe commented Nov 22, 2022

Logs are woefully unhelpful unless they're verbose debug logs ;).

Keep in mind it's unlikely to be terribly helpful here anyway, since the hard-reboot will likely cause truncation (and since we're not the ones crashing, it wouldn't be terribly helpful anyway ^^).

This would probably require a live serial console to catch the actual kernel BUG/OOPS/PANIC, and possibly a custom more verbose kernel build to actually figure it out (... and the Clara 2E kernel hasn't been released yet anyway).

@ezuk
Copy link

ezuk commented Dec 25, 2022

Just wanted to note this is not out of date. It still happens even with the latest firmware (22.11).

@NiLuJe
Copy link
Member

NiLuJe commented Dec 25, 2022

Not so small nit: Don't confuse FW versions (i.e., Nickel, currently at 4.34 or 4.35), and KOReader releases (currently 2022.11) ;).

@ezuk
Copy link

ezuk commented Dec 26, 2022 via email

@Emblaze1816
Copy link

I am here to thank you guys for helping users with KOReader. Since random freezes are a known issue, I would like to know if there is a possible solution in sight for this problems or KOReader experience is bound to be broken on Clara 2E forever. I am not an expert, so please forgive my ignorance.

@ptakacs68
Copy link

I also have the same problem. These freezes are happening randomly (during page turning, brightness adjustment, menu navigation, etc) once in an hour.
I checked the crash.log file, but there is no extra log there that could be associated to the problem.
If you could give me some guidance how to gather more information about the problem (extra debug or trace logs on the Kobo or on the application side, performance monitoring, etc) I am happy to help.

@ezuk
Copy link

ezuk commented Jan 9, 2023

From my side, I'm about to give up on the Clara 2E as a compatible device. I think if the issue is device-specific, the KOReader docs should probably be updated to recommend people don't run it on this device (KOReader was the main reason I bought this unit).

@ezuk
Copy link

ezuk commented Jan 9, 2023

I've gone ahead and edited the Kobo page on the Wiki to indicate that the Clara 2E is only partially supported -- hopefully this would save others an expense on a device that doesn't work right.

@Emblaze1816
Copy link

@ezuk so, bad news in sight!? KOReader was the only reason why I bought it... Should I consider resell to someone who won't use KOReader?

@ezuk
Copy link

ezuk commented Jan 9, 2023

@ezuk so, bad news in sight!? KOReader was the only reason why I bought it... Should I consider resell to someone who won't use KOReader?

I think I am going to try and resell mine, yes... Same thing - KOReader was the only reason I got this device.

@NiLuJe
Copy link
Member

NiLuJe commented Jan 9, 2023

Unless someone can get me, at the very least, the actual kernel log from the OOPS/PANIC, no, there won't be any traction on this.

(Given that it seems like the watchdog gets tripped, you can't even hope to get it via USBNet after a hang, so this would probably require serial access).

And it would also probably require a custom kernel with extra epdc debugging to actually investigate... and the Clara 2E kernel sources haven't been released by Kobo ;o).

@ezuk
Copy link

ezuk commented Jan 9, 2023

Unless someone can get me, at the very least, the actual kernel log from the OOPS/PANIC, no, there won't be any traction on this.

Would having an actual device help at all? I can just send you mine (you won't have to send it back).

@NiLuJe
Copy link
Member

NiLuJe commented Jan 9, 2023

If the watchdog weren't an issue, I would have said yes, but I'm not a hardware tinkerer, so popping it open to get serial access is not going to happen (I have neither the tools nor the skills required), which means I wouldn't be able to do much with it :/. (Thanks, though!).

@NiLuJe
Copy link
Member

NiLuJe commented Jan 9, 2023

I'm also not going to lie and add that there's a bit of a "this should be the OEM's job" (of shipping actually working stuff) going on here, which adds to me not really be willing to sink my already very limited time into this.

@ezuk
Copy link

ezuk commented Jan 10, 2023

I'm also not going to lie and add that there's a bit of a "this should be the OEM's job" (of shipping actually working stuff)

I completely agree. The only thing giving me pause is that it doesn't seem to freeze on the native UI. Maybe they specced it very tightly and whenever we exceed something it breaks. It's hard for me to raise a warranty issue with the OEM because the base firmware seems to work. A tricky situation... That's why I think the best solution is to explicitly exclude this device from the list of supported devices.

@NiLuJe
Copy link
Member

NiLuJe commented Jan 10, 2023 via email

@NiLuJe
Copy link
Member

NiLuJe commented Jul 12, 2023

The "Bypass Wait For" setting is not checked, should I change it?

I assume this means you either ported your config from another device where you had it tweaked, or you tweaked it at one point.

Remove the mxcfb_bypass_wait_for entry from your settings.reader.lua (without KOReader running) to confirm that theory (the checkmark should then be checked on its own on that device).

(I'd like to confirm the automatic logic behaves, which is why I'm not saying: yeah, just tick it ;)).

@Bartvelp
Copy link

Bartvelp commented Jul 12, 2023

There is no entry in settings.reader.lua regarding mxcfb_bypass_wait_for. I presume my KOReader version is recent enough. I've pasted the entire contents below:

return {
    ["BookShortcuts_directory_action"] = "FM",
    ["SSH_allow_no_password"] = true,
    ["auto_disable_wifi"] = true,
    ["auto_save_settings_interval_minutes"] = 15,
    ["auto_standby_timeout_seconds"] = -1,
    ["auto_suspend_timeout_seconds"] = -1,
    ["autodim_duration_seconds"] = 5,
    ["autodim_fraction"] = 20,
    ["autodim_starttime_minutes"] = -1,
    ["autoshutdown_timeout_seconds"] = 604800,
    ["autoturn_distance"] = 1,
    ["autoturn_enabled"] = false,
    ["autoturn_timeout_seconds"] = 60,
    ["autowarmth_activate"] = 0,
    ["autowarmth_control_nightmode"] = true,
    ["autowarmth_control_warmth"] = true,
    ["autowarmth_fl_off_during_day"] = true,
    ["back_in_filemanager"] = "default",
    ["back_in_reader"] = "previous_location",
    ["back_to_exit"] = "prompt",
    ["bookmarks_items_font_size"] = 19,
    ["bookmarks_items_per_page"] = 14,
    ["closed_rotation_mode"] = 0,
    ["collate"] = "access",
    ["copt_status_line"] = 1,
    ["coverbrowser_initial_default_setup_done"] = true,
    ["cre_header_auto_refresh"] = 1,
    ["cre_header_battery"] = 1,
    ["cre_header_battery_percent"] = 0,
    ["cre_header_chapter_marks"] = 1,
    ["cre_header_clock"] = 1,
    ["cre_header_page_count"] = 1,
    ["cre_header_page_number"] = 1,
    ["cre_header_reading_percent"] = 0,
    ["cre_header_status_font_size"] = 20,
    ["cre_header_title"] = 1,
    ["debug"] = true,
    ["debug_verbose"] = true,
    ["default_highlight_action"] = "ask",
    ["dev_no_c_blitter"] = false,
    ["device_id"] = "11C4-SNIP",
    ["device_status_battery_interval_minutes"] = 10,
    ["device_status_battery_threshold"] = 20,
    ["device_status_battery_threshold_high"] = 100,
    ["device_status_memory_interval_minutes"] = 5,
    ["device_status_memory_threshold"] = 100,
    ["dicts_disabled"] = {},
    ["dicts_order"] = {},
    ["duration_format"] = "classic",
    ["exporter"] = {
        ["html"] = {
            ["enabled"] = false,
        },
        ["joplin"] = {
            ["enabled"] = false,
        },
        ["json"] = {
            ["enabled"] = false,
        },
        ["markdown"] = {
            ["formatting_options"] = {
                ["invert"] = "bold",
                ["lighten"] = "italic",
                ["strikeout"] = "strikethrough",
                ["underscore"] = "underline_markdownit",
            },
            ["highlight_formatting"] = true,
        },
        ["readwise"] = {
            ["enabled"] = false,
        },
        ["text"] = {
            ["enabled"] = false,
        },
    },
    ["filemanagermenu_tab_index"] = 3,
    ["folder_shortcuts"] = {},
    ["footer"] = {
        ["align"] = "center",
        ["all_at_once"] = true,
        ["auto_refresh_time"] = false,
        ["battery"] = true,
        ["battery_hide_threshold"] = 100,
        ["book_chapter"] = false,
        ["book_chapter_max_width_pct"] = 30,
        ["book_time_to_read"] = true,
        ["book_title"] = false,
        ["book_title_max_width_pct"] = 30,
        ["bookmark_count"] = false,
        ["bottom_horizontal_separator"] = false,
        ["chapter_progress"] = false,
        ["chapter_time_to_read"] = false,
        ["container_bottom_padding"] = 1,
        ["container_height"] = 14,
        ["disable_progress_bar"] = false,
        ["disabled"] = false,
        ["frontlight"] = true,
        ["frontlight_warmth"] = false,
        ["hide_empty_generators"] = false,
        ["item_prefix"] = "icons",
        ["items_separator"] = "bar",
        ["lock_tap"] = false,
        ["mem_usage"] = true,
        ["order"] = {
            [0] = "off",
            [1] = "page_progress",
            [2] = "pages_left_book",
            [3] = "pages_left",
            [4] = "book_time_to_read",
            [5] = "percentage",
            [6] = "chapter_time_to_read",
            [7] = "frontlight",
            [8] = "mem_usage",
            [9] = "wifi_status",
            [10] = "book_title",
            [11] = "book_chapter",
            [12] = "bookmark_count",
            [13] = "chapter_progress",
            [14] = "frontlight_warmth",
            [15] = "battery",
            [16] = "time",
            [17] = "custom_text",
        },
        ["page_progress"] = true,
        ["pages_left"] = false,
        ["pages_left_book"] = false,
        ["pages_left_includes_current_page"] = false,
        ["percentage"] = false,
        ["progress_bar_min_width_pct"] = 20,
        ["progress_bar_position"] = "alongside",
        ["progress_margin"] = false,
        ["progress_margin_width"] = 18,
        ["progress_pct_format"] = "0",
        ["progress_style_thick_height"] = 7,
        ["progress_style_thin"] = true,
        ["progress_style_thin_height"] = 5,
        ["reclaim_height"] = false,
        ["skim_widget_on_hold"] = false,
        ["text_font_bold"] = false,
        ["text_font_size"] = 14,
        ["time"] = true,
        ["toc_markers"] = false,
        ["toc_markers_width"] = 2,
        ["wifi_status"] = true,
    },
    ["frontlight_intensity"] = 3,
    ["frontlight_warmth"] = 20,
    ["ges_tap_interval_on_keyboard_ms"] = 0,
    ["highlight_lighten_factor"] = 0.2,
    ["highlight_long_hold_threshold_s"] = 3,
    ["home_dir"] = "/mnt/onboard/kobo_books",
    ["inertial_scroll"] = false,
    ["is_frontlight_on"] = true,
    ["keyboard_key_font_size"] = 22,
    ["keyboard_layouts"] = {},
    ["kosync"] = {
        ["auto_sync"] = true,
        ["checksum_method"] = 0,
        ["pages_before_update"] = 20,
        ["userkey"] = "snip",
        ["username"] = "username",
    },
    ["last_migration_date"] = 20220914,
    ["lastdir"] = "/mnt/onboard/kobo_books",
    ["lastfile"] = "/mnt/onboard/kobo_books/book.epub",
    ["metric_length"] = true,
    ["night_mode"] = false,
    ["notification_sources_to_show_mask"] = 60,
    ["page_turns_tap_zones"] = "default",
    ["panel_zoom_enabled"] = {
        ["cbt"] = true,
        ["cbz"] = true,
    },
    ["panel_zoom_fallback_to_text_selection"] = {
        ["pdf"] = true,
    },
    ["quickstart_shown_version"] = 202208000036,
    ["reader_footer_custom_text"] = "KOReader",
    ["reader_footer_custom_text_repetitions"] = "1",
    ["reader_footer_mode"] = 1,
    ["reverse_collate"] = false,
    ["screensaver_delay"] = "disable",
    ["screensaver_hide_fallback_msg"] = false,
    ["screensaver_img_background"] = "black",
    ["screensaver_message_position"] = "middle",
    ["screensaver_msg_background"] = "none",
    ["screensaver_show_message"] = true,
    ["screensaver_stretch_images"] = false,
    ["screensaver_type"] = "readingprogress",
    ["scroll_method"] = "classic",
    ["statistics"] = {
        ["calendar_browse_future_months"] = false,
        ["calendar_nb_book_spans"] = 3,
        ["calendar_show_histogram"] = false,
        ["calendar_start_day_of_week"] = 2,
        ["convert_to_db"] = true,
        ["is_enabled"] = true,
        ["max_sec"] = 120,
        ["min_sec"] = 5,
    },
    ["style_tweaks"] = {
        ["footnote-inpage_epub_smaller"] = true,
        ["footnote-inpage_fb2"] = true,
    },
    ["terminal_buffer_size"] = 16,
    ["terminal_font_size"] = 14,
    ["terminal_shell"] = "sh",
    ["text_lang_fallback"] = "en-US",
    ["toc_items_per_page"] = 14,
    ["vocabulary_builder"] = {
        ["enabled"] = true,
    },
    ["wifi_disable_action"] = "prompt",
    ["wifi_enable_action"] = "turn_on",
    ["wifi_was_on"] = true,
    ["wikireader-favorites"] = {
        [1] = "ereader",
    },
    ["wikireader_db_path"] = "/mnt/onboard/zim_articles.db",
}

@NiLuJe
Copy link
Member

NiLuJe commented Jul 12, 2023

Ohkay, I'll double-check the logic then, thanks ;o).

@NiLuJe
Copy link
Member

NiLuJe commented Jul 12, 2023

Nope, I definitely can't reproduce that :/.

But a quick look at your last_migration_date seems to imply that you're running an hella old version, which could explain that ;).

(Because it's from #9691 for the Clara 2E, which post-dates that).

@Bartvelp
Copy link

Bartvelp commented Jul 12, 2023

Oh sorry about that. I never updated past my intial install because I have some custom scripts I want to keep. I saw #7431 was in 2021 so that's why I presumed I was up-to-date enough.
In any case, enabling mxcfb_bypass_wait_for manually does not fix the issue.
I tried running klogd but it does not change the format of dmesg. But since the Timed out waiting for update completion is then not related, it wouldn't really change anything anyway.

Still super weird that an active SSH session prevents the issue.

BTW: thanks @ezuk for your heads-up that the SD is remove-able, good to know.

@NiLuJe
Copy link
Member

NiLuJe commented Jul 12, 2023

In any case, enabling mxcfb_bypass_wait_for manually does not fix the issue.

On which version?

I tried running klogd but it does not change the format of dmesg.

No, but it affects the syslog: check logread ;).

is then not related

Eeeh, jury's still out on that. It's a different symptom, and more benign, buuuuuuut....

Still super weird that an active SSH session prevents the issue.

Which issue? The full hang => watchdog reboot stuff is magically prevented by being plugged in or having Wi-Fi enabled (probably because power), so, since SSH involves either or those, not too surprising ;).

@su-id
Copy link

su-id commented Jul 18, 2023

No, the Sage (and Elipsa) run on a different SoC altogether. (As does the Elipsa 2E, but it's yet another SoC, which we can't support until the kernel sources are released).

The kernel source has been released on github/kobolabs. Not sure if it is complete source or not.

@su-id
Copy link

su-id commented Jul 18, 2023

@NiLuJe
Copy link
Member

NiLuJe commented Jul 18, 2023

The kernel source has been released on github/kobolabs.

I'm aware ;).

@NiLuJe
Copy link
Member

NiLuJe commented Jul 30, 2023

@ezuk kindly provided a device so that I may suffer with all of you ;p.

The amount of time the watchdog (?) takes to reboot the device is... weirdly fluid. My first attempt at getting it to hang took some mighty effort (by basically spending a couple minutes squiggling with finger_trace), and that took a very long while to reboot.
Next, I finally managed to kill it via the dreaded ToC jump marker, and that reboot came fairly quickly. The next one, noticeably longer.

Another extremely confusing thing: I have a significantly harder time getting it to hang if I... simply enable klogd & swap to a "to disk" syslogd. I haven't isolated if only klogd "helps" here, but that's super weird. (Also, I bump the console logging level to max via dmesg -n 8, not that it actually leads to more interesting output...).

(Note that this doesn't really definitely help, as that's the state I managed to hang it in via finger_trace).

TL;DR: Mysterious mystery is mysterious.

@NiLuJe
Copy link
Member

NiLuJe commented Jul 30, 2023

I haven't isolated if only klogd "helps" here

Spoiler alert: it doesn't.

@NiLuJe
Copy link
Member

NiLuJe commented Jul 30, 2023

not that it actually leads to more interesting output

i.e., the last thing logged by the kernel is a possibly not actually relevant (i.e., stale)

Jul 30 20:53:02 kobo user.info kernel: imx_epdc_v2_fb 20f4000.epdc: Ignoring collision withnewer update.

Which I'm pretty sure you don't actually need elevated logging to see, because that typo is familiar to me ;).

(And makes perfect sense in the context of ftrace, so, it's not spurious at all, it's the driver doing its job).

@NiLuJe
Copy link
Member

NiLuJe commented Jul 30, 2023

I have a significantly harder time getting it to hang

Sidebar: but not with getting some wait_for_completion ioctls to timeout, though. That happened fairly quickly regardless.

(I've disabled all the current workarounds for these tests, of course).

@Bartvelp
Copy link

Great that you got your hands on a device! That's very nice from @ezuk . Hopefully you can work your magic and figure this mysterious mystery out.

@NiLuJe
Copy link
Member

NiLuJe commented Jul 30, 2023

Just so I have stuff to test, any specific patterns you guys remember as "crash-prone"?

I haven't managed to get a Notification to hang so far, for example, but I've only tested basic stuff with a single notification (mainly frontlight stuff).

So far, my go-to is the jump marker, as that seems to be fairly "reliable" (when the kernel isn't being weird, at least ;p).

@Bartvelp
Copy link

Yes the only freezes I have experienced are seemingly random ones, and after following in document links, like from a TOC, or footnotes etc.

@UserCel
Copy link
Author

UserCel commented Jul 30, 2023

Just so I have stuff to test, any specific patterns you guys remember as "crash-prone"?

I haven't managed to get a Notification to hang so far, for example, but I've only tested basic stuff with a single notification (mainly frontlight stuff).

So far, my go-to is the jump marker, as that seems to be fairly "reliable" (when the kernel isn't being weird, at least ;p).

Well, since disabling the notifications I've been having a very smooth experience. Ignoring a couple of weeks during which the inner sd card got screwy and my device kept hanging (not crashing), got that solved by replacing it.
I think most of the crashes happened when I activated the night light with a gesture (with notifications) after a day of reading. I've also been reading far less than I had been.

@UserCel UserCel closed this as completed Jul 30, 2023
@UserCel UserCel reopened this Jul 30, 2023
@UserCel
Copy link
Author

UserCel commented Jul 30, 2023

I keep thinking that the "close with comment" is an option I need to disable before I press "comment" on my phone >:|

@NiLuJe
Copy link
Member

NiLuJe commented Jul 30, 2023

Another fun fact: someone must be aware that their Elan panel implementation has terrible accuracy issues (or, more specifically, properly registering stuff at all), because, when you enable Nickel's developer mode, the power LED will light up on registered touches ;p.

(Which I imagine serves as another reminder that "yup, we're not the ones fucking up, that kernel just sucks ass") ;).)

NiLuJe added a commit that referenced this issue Aug 1, 2023
…XP boards (#10771)

* Notification: Drop the fencing from #10083; it never actually helped, and had subtle side-effects we could do without.
* VirtualKeyBoard: Flash on close, otherwise, some of the fast refresh glitches may be burned into the working buffer until a flash. Making sure we flash ourselves prevent it from sticking around on the page ;).
* util: Move `writeToSysfs` to base (i.e., `ffi/util`), as we need it there (and it actually makes more sense there anyway ;p).
* Bump base for koreader/koreader-base#1645, which is where the actual workaround (hopefully) lives.

Re #8414, #9806, #10558
@griago
Copy link

griago commented Sep 21, 2023

After disabling "Battery level" in "Device status alert" no more freezes for me

@Jogai
Copy link

Jogai commented Sep 22, 2023

On a positive note; I've had the Clara 2E since last november, installed the 2022.11 release and didnt have any problems. Its just that I'm a bit afraid to "shake the jelly" when I update. Should I keep this combination of hard&software, or would a new release most probably not regress regarding this hw?

@NiLuJe
Copy link
Member

NiLuJe commented Sep 22, 2023

The aforementioned workarounds landed in 2023.08, make of that what you will ;).

@lbesnard
Copy link
Contributor

I've ve owned the libra 2 (latest firmare and koreader version installed) for a few weeks now. Been reading over 5 books, not a single issue so far. Either I'm lucky or you guys did a great job :)

@pazos pazos closed this as completed Oct 1, 2023
@NiLuJe
Copy link
Member

NiLuJe commented Oct 1, 2023

(Via #10771)

@Frenzie Frenzie added this to the 2023.08 milestone Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug can't fix an issue that, by definition, cannot be fixed coming soon firmware Kobo out-of-date
Projects
None yet
Development

No branches or pull requests