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

PW5: Page turn animations #8974

Merged
merged 1 commit into from
May 5, 2022
Merged

Conversation

yparitcher
Copy link
Member

@yparitcher yparitcher commented Apr 6, 2022

enable page turn animations on supported platforms (PW5/MTK)

This creates a swipe animation when turning pages in the reader.

(for some reason, I happened to read a few pages in the stock reader and decided i like the effect ;)

Requires: koreader/koreader-base#1477

To Do:

  • PDF
  • Landscape (we dont rotate the FB so this must be adjusted)

This change is Reviewable

Copy link
Contributor

@poire-z poire-z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget ReaderPaging, with swipe east/west when in page mode, and swipe north/south when in scroll mode :)

frontend/device/generic/device.lua Outdated Show resolved Hide resolved
frontend/ui/elements/page_turns.lua Outdated Show resolved Hide resolved
frontend/apps/reader/modules/readerrolling.lua Outdated Show resolved Hide resolved
@NiLuJe
Copy link
Member

NiLuJe commented Apr 6, 2022

I was kinda wondering how best to go about that, but I hadn't really thought it through all that much ;).

The base stuff looks similar to what my notes appears to say about that ;p.

You went to the trouble of dealing with the whole direction thing in front, which I hadn't even wanted to start thinking about ;p.

My thought process stopped at "look at the places where I added software dithering support" for the right place to toggle the fb flag.

So, if this also works for PDFs, I'm probably sold, design-wise ;).

@yparitcher
Copy link
Member Author

Firstly, this was a draft to make sure I was going in the right direction. For now I just wired up crengine, but will work on PDF soon.

@Frenzie
This has to be enabled on a per page turn basis, so that it does not affect other refreshes. The lifecycle is: pageturn sets the flag to enabled for the next refresh and any refresh automaticy resets the flag to disabled. So in practice it will only ever be enabled for the short span between a pageturn and it's refresh. 99% of the time it is disabled.

I will update the language based on review, and the per document thing was a mistake, I was planning on taking it out :)

@NiLuJe
Copy link
Member

NiLuJe commented Apr 7, 2022

On another trivial note, I'm torn on whether to chuck the settings with page turns or with e-ink settings... ;).

@Frenzie
Copy link
Member

Frenzie commented Apr 7, 2022

This has to be enabled on a per page turn basis, so that it does not affect other refreshes.

On the downside, generically speaking it strikes me as a bit odd to do it that way. But I suppose it's not a huge bother.

Could someone post a video so I can see if this is something I might want to mock up in SDL real quick?

@NiLuJe
Copy link
Member

NiLuJe commented Apr 7, 2022 via email

@Frenzie
Copy link
Member

Frenzie commented Apr 7, 2022

Found a video. I'll think about it.

@yparitcher
Copy link
Member Author

On another trivial note, I'm torn on whether to chuck the settings with page turns or with e-ink settings... ;).

Same here :)

@yparitcher
Copy link
Member Author

This has to be enabled on a per page turn basis, so that it does not affect other refreshes.

On the downside, generically speaking it strikes me as a bit odd to do it that way. But I suppose it's not a huge bother.

Could someone post a video so I can see if this is something I might want to mock up in SDL real quick?

To be more precise, since we don't tag refreshes based on what caused them the FB has no way of knowing if the refresh is from a page turn or a menu action, and we don't want these animations when using the menus.

@NiLuJe

Don't worry, I have no plans on implementing halftone support for open menus ;)

@NiLuJe
Copy link
Member

NiLuJe commented Apr 7, 2022

Yeah, one of my early ideas went somewhere along the lines of adding a new refresh type so UIManager knows it could be animated, but that would open a huge can of overengineered worms in practice.

The fb flag toggled in base was indeed the least ugly (and simplest) design I had thought of so far ;).

@Frenzie
Copy link
Member

Frenzie commented Apr 7, 2022

Is the idea that it's always fullscreen or just whichever area you specify?

@NiLuJe
Copy link
Member

NiLuJe commented Apr 7, 2022

I've... never actually tried to pass it a smaller region, but given that it already overrides the waveform & update mode, I'd be inclined to say that it probably overrides the region, too (haven't checked, and can't recall wondering about that when reading the code, though).

What matters, design-wise, is that it's basically a flag we set in the ioctl struct, and as long as the flag is set, every refresh will honor the animation settings set in the ioctl's struct.

Which means it's fairly remote from our setDirty calls ;).

The only other ideas I had were fairly clunky, or much more code for no good reason (in no particular order: a new refresh type for setDirty that we'd only use for page turns instead of partial, or a new flag passed along from UIManager, àla dither flag).

That one (basically poking at ffi/fb_mxcfb directly from front, and the the actual ioctl flag flipping the flag right after so it's one-shot) was the least intrusive and most elegant solution I could think of back when I was wondering about how to implement this myself ;).

@NiLuJe
Copy link
Member

NiLuJe commented Apr 7, 2022

Haven't had time to think that one through entirely, but, FWIW, my original notes were aiming for switching the flag as close as possible to the actual ReaderView paint call, i.e., here:

-- Most pages should not require dithering
self.dialog.dithered = nil
-- For KOpt, let the user choose.
if self.ui.paging then
if self.document.hw_dithering then
self.dialog.dithered = true
end
else
-- Whereas for CRe,
-- If we're attempting to show a large enough amount of image data, request dithering (without triggering another repaint ;)).
local img_count, img_coverage = self.document:getDrawnImagesStatistics()
-- With some nil guards because this may not be implemented in every engine ;).
if img_count and img_count > 0 and img_coverage and img_coverage >= 0.075 then
self.dialog.dithered = true
-- Request a flashing update while we're at it, but only if it's the first time we're painting it
if self.state.drawn == false then
UIManager:setDirty(nil, "full")
end
end
self.state.drawn = true
end

@yparitcher
Copy link
Member Author

always fullscreen

It was entertaining to see the fulscreen swipe left every time i touched a menu itmen when first testing this :)

@yparitcher
Copy link
Member Author

rotation was taken care of in base.

This now supports Cre both in page mode or scroll mode (however not while panning, as it would be jarring.)

onPageChangeAnimation is in ReaderView so that i can easily add PDF support in ReaderPaging

@yparitcher yparitcher marked this pull request as ready for review April 8, 2022 01:03
@@ -1004,6 +1004,9 @@ function ReaderRolling:_gotoPos(new_pos, do_dim_area)
else
self.view.dim_area:clear()
end
if self.current_pos and not UIManager.currently_scrolling then
self.ui:handleEvent(Event:new("PageChangeAnimation", new_pos > self.current_pos))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation.

Will this do a horizontal (left/right) swipe animation, or vertical ? Feels like when in scroll mode, it should be vertical - but I don't seem to see support for vertical in here or in the base PR.

Copy link
Member Author

@yparitcher yparitcher Apr 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

horizontal.

This only happens when changing a page (via a left/right tap or swipe) so it makes sense to go L/R.
When panning (U/D) this is disabled as the full screen animation interferes with the pan refresh rate.

but I don't seem to see support for vertical in here or in the base PR.

I did not add it as it is not needed, but very easy to add in later if wanted.

frontend/apps/reader/modules/readerview.lua Outdated Show resolved Hide resolved
@yparitcher
Copy link
Member Author

rebased on master

@NiLuJe
Copy link
Member

NiLuJe commented May 3, 2022

Are we all happy with the hooking point and event-based approach?

(My previous ideas didn't go so far as dealing with direction, which is why I had more leeway in the implementation of the ideas sketched out earlier ;p).

@yparitcher yparitcher added this to the 2022.05 milestone May 4, 2022
@yparitcher
Copy link
Member Author

Bumped base

Kindle PW5 (MTK) with hardware support
Currently only in Crengine
@yparitcher yparitcher merged commit 54ead5f into koreader:master May 5, 2022
@yparitcher yparitcher deleted the swipe_animation branch May 5, 2022 14:48
@yparitcher
Copy link
Member Author

@NiLuJe

I get a reproducible freeze of the screen (needing a reboot to clear) when turning a few pages quickly, then opening TOC (with a gesture) changing to a new chapter and quickly turning a few more pages.
How can i debug /iron this out?

also sometimes when i had to hard reboot the kindle settings file gets overwritten on next start deleting all my settings

@NiLuJe
Copy link
Member

NiLuJe commented Jun 14, 2022

On which FW version?

You can try to see what dmesg has to say about it, but depending on how/when exactly it freezes, that might be easier said than done without serial access ;).

As per the settings, my guess would be on a fuse proxy shenanigan (i.e., /mnt/us vs. /mnt/base-us)...

@yparitcher
Copy link
Member Author

5.14.1.1

@yparitcher
Copy link
Member Author

here is the syslog pulled over ssh / wifi. The device still works just the hwtcon (screen) crashed. I wonder if i could just reload the module

[!]220613:204635 [ 6714.110045] .(0)[146:dispatch_pipeli][HWTCON ERR]power on MMSYS domain @hwtcon_driver_enable_mmsys_power,671
[!]220613:204635 [ 6714.321399] .(0)[146:dispatch_pipeli][CMDQ]===== SW timeout Pre-dump 0 handle:0xdb868200 pkt:0xd83ea000 thread:4 state:1 =====
[!]220613:204635 [ 6714.321429] .(0)[146:dispatch_pipeli][CMDQ][INFO]IRQ:0x0000ffff Execing:0 Thread:-1 CURR_LOADED_THR:0x00000000 THR_EXEC_CYCLES:0x00000236
[!]220613:204635 [ 6714.321441] .(0)[146:dispatch_pipeli][CMDQ][INFO]THR_TIMER:0x0 BUS_CTRL:0x2 DEBUG:0x0 0x0 0x0 0x0
[!]220613:204635 [ 6714.321471] .(0)[146:dispatch_pipeli][CMDQ][INFO]Thread 4 PC:0xe21e11b8(0x4181c1b8) 0x80008001:0x2000000c => Wait And Clear Event:CMDQ_EVENT_WB_WDMA_DONE
[!]220613:204635 [ 6714.321471]  value:0
[!]220613:204635 [ 6714.321484] .(0)[146:dispatch_pipeli][CMDQ][INFO]===== Error Thread Status index:4 enabled:1 scenario:0 =====
[!]220613:204635 [ 6714.321500] .(0)[146:dispatch_pipeli][CMDQ][INFO]PC:0x4181c1b8 End:0x4181c1d0 Wait Token:0x8001000c IRQ:0x0 IRQ_EN:0x13
[!]220613:204635 [ 6714.321512] .(0)[146:dispatch_pipeli][CMDQ][INFO]Timeout Cycle:0 Status:0x2 reset:0x0 Suspend:0 sec:0 cfg:4 prefetch:0 thrsex:0
[!]220613:204635 [ 6714.321526] .(0)[146:dispatch_pipeli][CMDQ][INFO]handle:0xdb868200 pkt:0xd83ea000 scenario:8 pri:100 hw pri:4 state:1 flag:0xffc0
[!]220613:204635 [ 6714.321541] .(0)[146:dispatch_pipeli][CMDQ][INFO]va:0xe21e1000 pa:0x4181c000 last inst (0xe21e11c0) 0x40000000:00000001 0x10000000:00000008
[!]220613:204635 [ 6714.321553] .(0)[146:dispatch_pipeli][CMDQ][INFO]cmd size:464 buffer size:3840 available size:3376
[!]220613:204635 [ 6714.321566] .(0)[146:dispatch_pipeli][CMDQ][INFO]Reorder:0 Trigger:6714119968929 Got IRQ:0x0 Wait:6714119981544 Finish:0
[!]220613:204635 [ 6714.321574] .(0)[146:dispatch_pipeli][CMDQ][INFO]Caller pid:146 name:dispatch_pipeli
[!]220613:204635 [ 6714.531329] .(0)[146:dispatch_pipeli][CMDQ]===== SW timeout Pre-dump 1 handle:0xdb868200 pkt:0xd83ea000 thread:4 state:1 =====
[!]220613:204635 [ 6714.531361] .(0)[146:dispatch_pipeli][CMDQ][INFO]IRQ:0x0000ffff Execing:0 Thread:-1 CURR_LOADED_THR:0x00000000 THR_EXEC_CYCLES:0x00000236
[!]220613:204635 [ 6714.531373] .(0)[146:dispatch_pipeli][CMDQ][INFO]THR_TIMER:0x0 BUS_CTRL:0x2 DEBUG:0x0 0x0 0x0 0x0
[!]220613:204635 [ 6714.531402] .(0)[146:dispatch_pipeli][CMDQ][INFO]Thread 4 PC:0xe21e11b8(0x4181c1b8) 0x80008001:0x2000000c => Wait And Clear Event:CMDQ_EVENT_WB_WDMA_DONE
[!]220613:204635 [ 6714.531402]  value:0
[!]220613:204635 [ 6714.531416] .(0)[146:dispatch_pipeli][CMDQ][INFO]===== Error Thread Status index:4 enabled:1 scenario:0 =====
[!]220613:204635 [ 6714.531432] .(0)[146:dispatch_pipeli][CMDQ][INFO]PC:0x4181c1b8 End:0x4181c1d0 Wait Token:0x8001000c IRQ:0x0 IRQ_EN:0x13
[!]220613:204635 [ 6714.531444] .(0)[146:dispatch_pipeli][CMDQ][INFO]Timeout Cycle:0 Status:0x2 reset:0x0 Suspend:0 sec:0 cfg:4 prefetch:0 thrsex:0
[!]220613:204636 [ 6714.741391] .(0)[146:dispatch_pipeli][CMDQ]===== SW timeout Pre-dump 2 handle:0xdb868200 pkt:0xd83ea000 thread:4 state:1 =====
[!]220613:204636 [ 6714.741421] .(0)[146:dispatch_pipeli][CMDQ][INFO]IRQ:0x0000ffff Execing:0 Thread:-1 CURR_LOADED_THR:0x00000000 THR_EXEC_CYCLES:0x00000236
[!]220613:204636 [ 6714.741433] .(0)[146:dispatch_pipeli][CMDQ][INFO]THR_TIMER:0x0 BUS_CTRL:0x2 DEBUG:0x0 0x0 0x0 0x0
[!]220613:204636 [ 6714.741462] .(0)[146:dispatch_pipeli][CMDQ][INFO]Thread 4 PC:0xe21e11b8(0x4181c1b8) 0x80008001:0x2000000c => Wait And Clear Event:CMDQ_EVENT_WB_WDMA_DONE
[!]220613:204636 [ 6714.741462]  value:0
[!]220613:204636 [ 6714.741476] .(0)[146:dispatch_pipeli][CMDQ][INFO]===== Error Thread Status index:4 enabled:1 scenario:0 =====
[!]220613:204636 [ 6714.741492] .(0)[146:dispatch_pipeli][CMDQ][INFO]PC:0x4181c1b8 End:0x4181c1d0 Wait Token:0x8001000c IRQ:0x0 IRQ_EN:0x13
[!]220613:204636 [ 6714.741505] .(0)[146:dispatch_pipeli][CMDQ][INFO]Timeout Cycle:0 Status:0x2 reset:0x0 Suspend:0 sec:0 cfg:4 prefetch:0 thrsex:0
[!]220613:204636 [ 6714.951374] .(0)[146:dispatch_pipeli][CMDQ]===== SW timeout Pre-dump 3 handle:0xdb868200 pkt:0xd83ea000 thread:4 state:1 =====
[!]220613:204636 [ 6714.951404] .(0)[146:dispatch_pipeli][CMDQ][INFO]IRQ:0x0000ffff Execing:0 Thread:-1 CURR_LOADED_THR:0x00000000 THR_EXEC_CYCLES:0x00000236
[!]220613:204636 [ 6714.951416] .(0)[146:dispatch_pipeli][CMDQ][INFO]THR_TIMER:0x0 BUS_CTRL:0x2 DEBUG:0x0 0x0 0x0 0x0
[!]220613:204636 [ 6714.951444] .(0)[146:dispatch_pipeli][CMDQ][INFO]Thread 4 PC:0xe21e11b8(0x4181c1b8) 0x80008001:0x2000000c => Wait And Clear Event:CMDQ_EVENT_WB_WDMA_DONE
[!]220613:204636 [ 6714.951444]  value:0
[!]220613:204636 [ 6714.951457] .(0)[146:dispatch_pipeli][CMDQ][INFO]===== Error Thread Status index:4 enabled:1 scenario:0 =====
[!]220613:204636 [ 6714.951473] .(0)[146:dispatch_pipeli][CMDQ][INFO]PC:0x4181c1b8 End:0x4181c1d0 Wait Token:0x8001000c IRQ:0x0 IRQ_EN:0x13
[!]220613:204636 [ 6714.951485] .(0)[146:dispatch_pipeli][CMDQ][INFO]Timeout Cycle:0 Status:0x2 reset:0x0 Suspend:0 sec:0 cfg:4 prefetch:0 thrsex:0
[!]220613:204636 [ 6715.161403] .(0)[146:dispatch_pipeli][CMDQ]===== SW timeout Pre-dump 4 handle:0xdb868200 pkt:0xd83ea000 thread:4 state:1 =====
[!]220613:204636 [ 6715.161433] .(0)[146:dispatch_pipeli][CMDQ][INFO]IRQ:0x0000ffff Execing:0 Thread:-1 CURR_LOADED_THR:0x00000000 THR_EXEC_CYCLES:0x00000236
[!]220613:204636 [ 6715.161445] .(0)[146:dispatch_pipeli][CMDQ][INFO]THR_TIMER:0x0 BUS_CTRL:0x2 DEBUG:0x0 0x0 0x0 0x0
[!]220613:204636 [ 6715.161475] .(0)[146:dispatch_pipeli][CMDQ][INFO]Thread 4 PC:0xe21e11b8(0x4181c1b8) 0x80008001:0x2000000c => Wait And Clear Event:CMDQ_EVENT_WB_WDMA_DONE
[!]220613:204636 [ 6715.161475]  value:0
[!]220613:204636 [ 6715.161487] .(0)[146:dispatch_pipeli][CMDQ][INFO]===== Error Thread Status index:4 enabled:1 scenario:0 =====
[!]220613:204636 [ 6715.161504] .(0)[146:dispatch_pipeli][CMDQ][INFO]PC:0x4181c1b8 End:0x4181c1d0 Wait Token:0x8001000c IRQ:0x0 IRQ_EN:0x13
[!]220613:204636 [ 6715.161516] .(0)[146:dispatch_pipeli][CMDQ][INFO]Timeout Cycle:0 Status:0x2 reset:0x0 Suspend:0 sec:0 cfg:4 prefetch:0 thrsex:0
[!]220613:204636 [ 6715.191203] .(1)[0:swapper/1][cmdq] queue cmdq timeout thread:4
[!]220613:204636 [ 6715.191553] -(0)[16469:kworker/u4:0][cmdq][err] timeout for thread:0xe0c28300 idx:4 usage:2 @cmdq_thread_handle_timeout_work,1092
[!]220613:204636 [ 6715.191575] -(0)[16469:kworker/u4:0][cmdq][err] task:0xd83eac40 timeout:true pkt:0xd83ea000 size:464 pc:0x4181c1b8 inst:0x2000000c80008001 @cmdq_buf_dump_schedule,840
[!]220613:204636 [ 6715.191597] .(0)[16469:kworker/u4:0][CMDQ][ERR]============== [CMDQ] Begin of Error 0 =============
[!]220613:204636 [ 6715.191609] .(0)[16469:kworker/u4:0][CMDQ][WARNING]not enable SMI dump now
[!]220613:204636 [ 6715.191621] .(0)[16469:kworker/u4:0][CMDQ][ERR]** [Module] hwtcon **
[!]220613:204636 [ 6715.191629] .(0)[16469:kworker/u4:0][CMDQ][ERR]** [Error Info] Refer to instruction and check engine dump for debug**
[!]220613:204636 [ 6715.191649] .(0)[16469:kworker/u4:0][CMDQ][ERR]Thread 4 error instruction:0xe21e11b8 0x80008001:0x2000000c => Wait And Clear Event:CMDQ_EVENT_WB_WDMA_DONE
[!]220613:204636 [ 6715.191664] .(0)[16469:kworker/u4:0][CMDQ][ERR]CMDQ_SYNC_TOKEN_VAL(idx:12) of CMDQ_EVENT_WB_WDMA_DONE is 0
[!]220613:204636 [ 6715.191698] .(0)[16469:kworker/u4:0][CMDQ][ERR]===== Error Thread Status index:4 enabled:1 scenario:0 =====
[!]220613:204636 [ 6715.191713] .(0)[16469:kworker/u4:0][CMDQ][ERR]PC:0x4181c1b8 End:0x4181c1d0 Wait Token:0x8001000c IRQ:0x0 IRQ_EN:0x13
[!]220613:204636 [ 6715.191730] .(0)[16469:kworker/u4:0][CMDQ][ERR]Timeout Cycle:0 Status:0x2 reset:0x0 Suspend:1 sec:0 cfg:4 prefetch:0 thrsex:0
[!]220613:204636 [ 6715.191743] .(0)[16469:kworker/u4:0][CMDQ][ERR]============ [CMDQ] Error Thread PC ============
[!]220613:204636 [ 6715.191776] .(0)[16469:kworker/u4:0][CMDQ][ERR]Thread 4 PC:0xe21e11b8(0x4181c1b8) 0x80008001:0x2000000c => Wait And Clear Event:CMDQ_EVENT_WB_WDMA_DONE
[!]220613:204636 [ 6715.191776]  value:0
[!]220613:204636 [ 6715.191792] .(0)[16469:kworker/u4:0][CMDQ][ERR]========= [CMDQ] Error Task Status =========
[!]220613:204636 [ 6715.191818] .(0)[16469:kworker/u4:0][CMDQ][ERR]handle:0xdb868200 pkt:0xd83ea000 scenario:8 pri:100 hw pri:4 state:1 flag:0xffc0
[!]220613:204636 [ 6715.191846] .(0)[16469:kworker/u4:0][CMDQ][ERR]va:0xe21e1000 pa:0x4181c000 last inst (0xe21e11c0) 0x40000000:00000001 0x10000000:00000008
[!]220613:204636 [ 6715.191871] .(0)[16469:kworker/u4:0][CMDQ][ERR]cmd size:464 buffer size:3840 available size:3376
[!]220613:204636 [ 6715.191893] .(0)[16469:kworker/u4:0][CMDQ][ERR]Reorder:0 Trigger:6714119968929 Got IRQ:0x0 Wait:6714119981544 Finish:0
[!]220613:204636 [ 6715.191914] .(0)[16469:kworker/u4:0][CMDQ][ERR]Caller pid:146 name:dispatch_pipeli
[!]220613:204636 [ 6715.191931] .(0)[16469:kworker/u4:0][CMDQ][ERR]============ [CMDQ] CMDQ Status ============
[!]220613:204636 [ 6715.191945] .(0)[16469:kworker/u4:0][CMDQ][ERR]IRQ:0x0000ffff Execing:0 Thread:-1 CURR_LOADED_THR:0x00000000 THR_EXEC_CYCLES:0x00000236
[!]220613:204636 [ 6715.191961] .(0)[16469:kworker/u4:0][CMDQ][ERR]THR_TIMER:0x0 BUS_CTRL:0x2 DEBUG:0x0 0x0 0x0 0x0
[!]220613:204636 [ 6715.191974] .(0)[16469:kworker/u4:0][CMDQ][ERR]============ [CMDQ] Clock Gating Status ============
[!]220613:204636 [ 6715.191982] .(0)[16469:kworker/u4:0][CMDQ][ERR][CLOCK] common clock ref:2
[!]220613:204636 [ 6715.191991] .(0)[16469:kworker/u4:0][CMDQ][ERR]============== [CMDQ] End of Error 0 =============
[!]220613:204636 [ 6715.192000] .(0)[16469:kworker/u4:0][CMDQ][ERR]============ [CMDQ] SMI Status ============
[!]220613:204636 [ 6715.192007] .(0)[16469:kworker/u4:0][CMDQ][WARNING]not enable SMI dump now
[!]220613:204636 [ 6715.192015] .(0)[16469:kworker/u4:0][CMDQ][ERR]============ [CMDQ] MMSYS_CONFIG ============
[!]220613:204636 [ 6715.192024] .(0)[16469:kworker/u4:0][CMDQ][ERR]============ [CMDQ] Engine Status ============
[!]220613:204636 [ 6715.192033] .(0)[16469:kworker/u4:0][CMDQ][ERR]====== engine group HWTCON status =======
[!]220613:204636 [ 6715.192044] .(0)[16469:kworker/u4:0][HWTCON ERR]dump reg begin @hwtcon_driver_cmdq_timeout_dump,1087
[!]220613:204636 [ 6715.192053] .(0)[16469:kworker/u4:0][HWTCON ERR]14004000: 0x00000000 @hwtcon_driver_cmdq_timeout_dump,1092
[!]220613:204636 [ 6715.192063] .(0)[16469:kworker/u4:0][HWTCON ERR]regal status:0x80000004 func:0x0 @hwtcon_driver_cmdq_timeout_dump,1095
[!]220613:204636 [ 6715.192083] .(0)[16469:kworker/u4:0][HWTCON ERR]DPI enable:0 irq status: 0x000007f9 clock[1] power[1] @hwtcon_driver_cmdq_timeout_dump,1100
[!]220613:204636 [ 6715.192091] .(0)[16469:kworker/u4:0][HWTCON ERR]WDMA Event:0 @hwtcon_driver_cmdq_timeout_dump,1101
[!]220613:204636 [ 6715.192100] .(0)[16469:kworker/u4:0][HWTCON ERR]dump reg end @hwtcon_driver_cmdq_timeout_dump,1103
[!]220613:204636 [ 6715.192109] .(0)[16469:kworker/u4:0][CMDQ][ERR]============ [CMDQ] Error Command Buffer ============
[!]220613:204636 [ 6715.192121] .(0)[16469:kworker/u4:0][CMDQ]buffer 0 va:0xe21e1000 pa:0x4181c000
[!]220613:204636 [ 6715.192147] .(0)[16469:kworker/u4:0]e21e1000: 00000103 90018010 fffffc00 02000000  ................
[!]220613:204636 [ 6715.193342] .(0)[16469:kworker/u4:0]e21e1010: 00000001 91018040 80008000 90018030  ....@.......0...
[!]220613:204636 [ 6715.194524] .(0)[16469:kworker/u4:0]e21e1020: 00000103 90019010 fffffc00 02000000  ................
[!]220613:204636 [ 6715.195705] .(0)[16469:kworker/u4:0]e21e1030: 00000001 91019040 80008000 90019030  ....@.......0...
[!]220613:204636 [ 6715.196886] .(0)[16469:kworker/u4:0]e21e1040: 00000001 9001a00c 00000050 9001a014  ........P.......
[!]220613:204636 [ 6715.198067] .(0)[16469:kworker/u4:0]e21e1050: 00000001 9001a008 2c00ffff 02000000  ...........,....
[!]220613:204636 [ 6715.199247] .(0)[16469:kworker/u4:0]e21e1060: 40010000 9101a038 fffffffe 02000000  ...@8...........
[!]220613:204636 [ 6715.200428] .(0)[16469:kworker/u4:0]e21e1070: 00000001 9101d070 dfffffff 02000000  ....p...........
[!]220613:204636 [ 6715.202270] .(0)[16469:kworker/u4:0]e21e1080: 20000000 9101d004 fffffffd 02000000  ... ............
[!]220613:204636 [ 6715.203545] .(0)[16469:kworker/u4:0]e21e1090: 00000002 9101d004 00000003 9001a000  ................
[!]220613:204636 [ 6715.204825] .(0)[16469:kworker/u4:0]e21e10a0: fffffffe 02000000 00000001 9101d044  ............D...
[!]220613:204636 [ 6715.206109] .(0)[16469:kworker/u4:0]e21e10b0: fffffffd 02000000 00000002 9101d044  ............D...
[!]220613:204636 [ 6715.207380] .(0)[16469:kworker/u4:0]e21e10c0: fffffff7 02000000 00000008 9101d044  ............D...
[!]220613:204636 [ 6715.208638] .(0)[16469:kworker/u4:0]e21e10d0: ffffffef 02000000 00000010 9101d044  ............D...
[!]220613:204636 [ 6715.209829] .(0)[16469:kworker/u4:0]e21e10e0: ffffffbf 02000000 00000000 9101d044  ............D...
[!]220613:204636 [ 6715.211258] .(0)[16469:kworker/u4:0]e21e10f0: fffe0000 02000000 0001ff10 9101d014  ................
[!]220613:204636 [ 6715.212802] .(0)[16469:kworker/u4:0]e21e1100: 01200000 9001df08 00400000 9001df04  .. .......@.....
[!]220613:204636 [ 6715.214006] .(0)[16469:kworker/u4:0]e21e1110: 00400000 9001df00 04d40670 9001d00c  ..@.....p.......
[!]220613:204636 [ 6715.215186] .(0)[16469:kworker/u4:0]e21e1120: 00000003 9001df0c 7fffffff 02000000  ................
[!]220613:204636 [ 6715.216359] .(0)[16469:kworker/u4:0]e21e1130: 00000000 9101d0c4 ffffffbf 02000000  ................
[!]220613:204636 [ 6715.217532] .(0)[16469:kworker/u4:0]e21e1140: 00000000 9101d060 fffffff7 02000000  ....`...........
[!]220613:204636 [ 6715.218704] .(0)[16469:kworker/u4:0]e21e1150: 00000000 9101d060 fffffc0f 02000000  ....`...........
[!]220613:204636 [ 6715.219878] .(0)[16469:kworker/u4:0]e21e1160: 00000000 9101d028 c000c000 02000000  ....(...........
[!]220613:204636 [ 6715.221162] .(0)[16469:kworker/u4:0]e21e1170: 04d00306 9101d020 c000c000 02000000  .... ...........
[!]220613:204636 [ 6715.222340] .(0)[16469:kworker/u4:0]e21e1180: 00000040 9101d024 00000000 9001d0d0  @...$...........
[!]220613:204636 [ 6715.223530] .(0)[16469:kworker/u4:0]e21e1190: 00000000 9001d0d4 fffffffe 02000000  ................
[!]220613:204636 [ 6715.224710] .(0)[16469:kworker/u4:0]e21e11a0: 00000001 9101d028 fffffffe 02000000  ....(...........
[!]220613:204636 [ 6715.225883] .(0)[16469:kworker/u4:0]e21e11b0: 00000000 9101d028 80008001 2000000c  ....(.......... 
[!]220613:204636 [ 6715.227178] .(0)[16469:kworker/u4:0][CMDQ][ERR]=========== [CMDQ] End of Full Error 0 ==========
[!]220613:204636 [ 6715.227194] .(0)[16469:kworker/u4:0][CMDQ][AEE]hwtcon in CMDQ IRQ:0x00, INST:(0x2000000c, 0x80008001), OP:WAIT EVENT:CMDQ_EVENT_WB_WDMA_DONE
[!]220613:204636 [ 6715.227217] -(0)[16469:kworker/u4:0][CMDQ][ERR]flush handler handle:0xdb868200 err:-110 timeout:1000 thread:4
[!]220613:204636 [ 6715.227430] .(1)[146:dispatch_pipeli][CMDQ][ERR]handle:db868200 wait flush failed err:-110
[!]220613:204636 [ 6715.227475] .(1)[146:dispatch_pipeli]------------[ cut here ]------------
[!]220613:204636 [ 6715.227535] .(1)[146:dispatch_pipeli]WARNING: CPU: 1 PID: 146 at /home/builder/yocto/source/repo/kernel/linux-bellatrix/drivers/misc/mediatek/hwtcon_v2/hwtcon_core.c:1969 hwtcon_core_trigger_pipeline+0x514/0x954 [hwtcon_v2]
[!]220613:204636 [ 6715.227541] .(1)[146:dispatch_pipeli]Modules linked in: usb_f_ecm bf448000   (null) 7398 0  wmt_cdev_bt bf43f000   (null) 19651 0 (O) g_ether bf43a000   (null) 3241 0  usb_f_rndis bf42f000   (null) 16886 0  u_ether bf428000   (null) 8853 0  wlan_drv_gen4m bf1f2000   (null) 1932490 0 (O) wmt_chrdev_wifi bf1e9000   (null) 12897 0 (O) wmt_drv bf0ba000   (null) 1031974 0 (O) usb_f_mass_storage bf0a4000   (null) 36254 0  libcomposite bf092000   (null) 39653 0  configfs bf086000   (null) 24508 0  pt_i2c bf081000   (null) 5137 0  pt bf04b000   (null) 162495 0  opt3001 bf043000   (null) 13031 0  falcon bf037000   (null) 29694 0 (PO) hwtcon_v2 bf000000   (null) 164896 0  [last unloaded: g_mass_storage]
[!]220613:204636 [ 6715.227660] -(1)[146:dispatch_pipeli]CPU: 1 PID: 146 Comm: dispatch_pipeli Tainted: P           O    4.9.77-lab126 #1
[!]220613:204636 [ 6715.227664] -(1)[146:dispatch_pipeli]Hardware name: Generic DT based system
[!]220613:204636 [ 6715.227698] -(1)[146:dispatch_pipeli][<c01111b4>] (unwind_backtrace) from [<c010d6f8>] (show_stack+0x10/0x14)
[!]220613:204636 [ 6715.227714] -(1)[146:dispatch_pipeli][<c010d6f8>] (show_stack) from [<c0419c24>] (dump_stack+0x94/0xa8)
[!]220613:204636 [ 6715.227732] -(1)[146:dispatch_pipeli][<c0419c24>] (dump_stack) from [<c0128b1c>] (__warn+0xec/0x104)
[!]220613:204636 [ 6715.227744] -(1)[146:dispatch_pipeli][<c0128b1c>] (__warn) from [<c0128c2c>] (warn_slowpath_null+0x20/0x28)
[!]220613:204636 [ 6715.227786] -(1)[146:dispatch_pipeli][<c0128c2c>] (warn_slowpath_null) from [<bf00a4b4>] (hwtcon_core_trigger_pipeline+0x514/0x954 [hwtcon_v2])
[!]220613:204636 [ 6715.227853] -(1)[146:dispatch_pipeli][<bf00a4b4>] (hwtcon_core_trigger_pipeline [hwtcon_v2]) from [<bf00a990>] (hwtcon_core_dispatch_pipeline+0x9c/0x104 [hwtcon_v2])
[!]220613:204636 [ 6715.227893] -(1)[146:dispatch_pipeli][<bf00a990>] (hwtcon_core_dispatch_pipeline [hwtcon_v2]) from [<c0149410>] (kthread+0x10c/0x124)
[!]220613:204636 [ 6715.227908] -(1)[146:dispatch_pipeli][<c0149410>] (kthread) from [<c0108bd0>] (ret_from_fork+0x14/0x24)
[!]220613:204636 [ 6715.227916] .(1)[146:dispatch_pipeli]---[ end trace 51acdb4e6a6c5576 ]---
[!]220613:204637 [ 6716.225185] .(1)[10660:rx_thread]ICMPv6: [mtk_net]RA: ndisc_router_discovery, rt d65d0000, set route expires since lifetime 1800 finite
[!]220613:204639 [ 6717.920208] .(0)[13919:kworker/0:2]bd71827-power bd71827-power.4.auto: clamp_soc:58, curr:-101898, vbat:3926000, vsys:3927000, vsys_min:3900000, cc:0x42e3afe, stressed/safe_charging:0/0, cycle:3

@NiLuJe
Copy link
Member

NiLuJe commented Jun 14, 2022 via email

@yparitcher
Copy link
Member Author

I saw that
5.14.3 still crashes :( And now i am stuck with this new UI (free ads) :(

@NiLuJe
Copy link
Member

NiLuJe commented Jun 14, 2022

Damn :/.

Only thing I can think of would be bracketing the anims with the same weird double refreshes we talked about in the strace log...

@NiLuJe
Copy link
Member

NiLuJe commented Jun 14, 2022 via email

@NiLuJe
Copy link
Member

NiLuJe commented Jun 14, 2022

Okay, no, given the repro, the Libra 0 jump marker thingy is probably irrelevant.

That leaves leaving fast mode disabled:

-- Enable the so-called "fast" mode, so as to prevent the driver from silently promoting refreshes to REAGL.
self.screen:_MTK_ToggleFastMode(true)

And eventually trying to match the ioctl pattern we saw in the logs (which might include switching to the wait_for_any ioctl, which requires fast mode to be off).


As for the settings, LuaSettings could probably handle the fuse shenanigans better by switching to the .old if the main file is 0 bytes (which, I think is what happens here).

@NiLuJe
Copy link
Member

NiLuJe commented Jun 14, 2022

As for the settings, LuaSettings could probably handle the fuse shenanigans better by switching to the .old if the main file is 0 bytes (which, I think is what happens here).

Or... not.

ok, stored = pcall(dofile, new.file)
if ok and stored then
new.data = stored

stored is nil when reading a 0-byte file, so this is effectively already handled sanely.

Which means the fuse proxy borks the file in a sneakier manner...

@yparitcher
Copy link
Member Author

I downgraded back to 5.14.1.1 as the new UI was driving me crazy. between half of the screen being ads (popular content) and the ui helpfully reminding me that i have airplane mode on and do i want to turn it off. 👎

When i have time I might try to play around with the fast mode / fencing the refreshes

@yparitcher
Copy link
Member Author

@NiLuJe

It was the jump marker thing, I disabled it and it stopped crashing.

@yparitcher
Copy link
Member Author

Changing the refresh function did not help. #8414 (comment)

But changing followed_link_marker to true does fix it.
So it seems it is the unmark refresh that is the issue

yparitcher added a commit to yparitcher/koreader that referenced this pull request Jun 23, 2022
@yparitcher
Copy link
Member Author

yup it is the unmark refresh, (whether using refreshFast/DU or refreshUI/AUTO ) being run while trying to use SwipeAnimations

Fixed in #9245
Disable animations for that refresh ;)

yparitcher added a commit to yparitcher/koreader that referenced this pull request Jun 23, 2022
@mergen3107
Copy link
Contributor

To Do:

  • PDF

@yparitcher
Do you still have interest in this? :)

@yparitcher
Copy link
Member Author

To Do:

  • PDF

@yparitcher
Do you still have interest in this? :)

Don't have time.
You can try, however be aware that in pdf / Mupdf, there are many modes of viewing, with corresponding many turn directions. (In one zoomed in mode, we can go 1. down 2. up&right 3. down again, in one page). So it will be hard to accurately determine, if and which direction a animation should occur.

@mergen3107
Copy link
Contributor

Thanks!
Are there any options for directions?
Only left-right, up-down?

Is there something like "fade" (think about PowerPoint slide transition analogy).

@NiLuJe
Copy link
Member

NiLuJe commented Dec 3, 2023

Only left-right, up-down?

Yup, essentially L<->R or T<->B.

c.f., https://github.com/NiLuJe/FBInk/blob/f7f80f019f7c32cedc0f4aa6b717708fbed2472b/eink/mtk-kindle.h#L144-L151

@NiLuJe
Copy link
Member

NiLuJe commented Dec 3, 2023

Is there something like "fade" (think about PowerPoint slide transition analogy).

What happens in practice looks very much like a rolling fade ;).

But a "static" fade, no, as that's essentially what already happens without animations ;).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants