This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#11288 - Sansa Fuze v2 scrollwheel lockup after 20 minutes - fix
Attached to Project:
Rockbox
Opened by Chris Savery (csavery) - Tuesday, 18 May 2010, 04:09 GMT+2
Last edited by Thomas Martitz (kugel.) - Thursday, 20 May 2010, 17:42 GMT+2
Opened by Chris Savery (csavery) - Tuesday, 18 May 2010, 04:09 GMT+2
Last edited by Thomas Martitz (kugel.) - Thursday, 20 May 2010, 17:42 GMT+2
|
DetailsHere's a patch to test for the scroll wheel lockup bug.
It appears to be working fine for me but I'm not completely sure about wheel acceleration and any subtle behaviours. It does work for me after about 30 minutes. Tested against r26214. Please feel free to test and let me know if something is wrong. :) |
This task depends upon
Closed by Thomas Martitz (kugel.)
Thursday, 20 May 2010, 17:42 GMT+2
Reason for closing: Fixed
Additional comments about closing: r26175, also see comments
Thursday, 20 May 2010, 17:42 GMT+2
Reason for closing: Fixed
Additional comments about closing: r26175, also see comments
The loop interval is changed from 3ms (+/- 1ms) to 10ms (+/- 10ms), doesn't it change the wheel behaviour too much ?
Also when giving the intervals you assume HZ=100.
While it's unlikely to change, it's better if you do something like (30*HZ) / 1000 for 30ms
I didn't notice any difference in the feel of the scrolling but I did notice that wheel acceleration was ineffective.
I think this is due to the low resolution of the HZ timer which is made worse by the inversion into a velocity value.
I was modifying the define values as suggested when it occurred to me of a better solution that keeps the high res kernel timer.
I'm just testing this method now and will post shortly if it works.
It should maintain the res needed for useful acceleration, and would be a much simpler change.
btw that's a mistake up above, actual test build was r26114. I seem to be all butter fingers today.
Wheel feel and acceleration both work the same and it didn't lock up after 30 minutes.
This one makes a very simple change using the current hi-res timer.
Normally we compare the time difference "v" with WHEEL_LOOP_INTERVAL but now if it is less than zero I assume a wrap has occurred and I re-sync the last_wheel_post time before returning. This throws away the first wheel click if after about 23 minutes but I think we can live with that as the following clicks are back in sync and get responded to.
Let me know if any problems.
This makes this patch no longer relevant.
I don't think the test condition for WHEEL_LOOP_INTERVAL really did much because in my reading of the code it seems that hardware polling for the wheel occurred at 200Hz. This meant that the minimum interval between possible clicks was 5ms. Since the test condition detected and removed clicks below 3ms I think it would have made very little difference to how the wheel ultimately behaved. Removing the test condition is likely just as good as my fix which prevented it from locking on negative values (overflows).
I sync'd my code to r26185 today and didn't notice any change in wheel use but I didn't try a 30 minute test because this code is now reverted to r26059, before the test condition was inserted, and that code worked ok.
On the fuzev2, there's no polling. Each wheel change (4 per physical click) generates an interrupt, i.e. the function is run. The fuzev1 wheel is read by polling.
I probably got mixed up in the code regarding polling. It's still very new to me.