FS#10883 - clickwheel stops working when its used during the bookmark setting process

Attached to Project: Rockbox
Opened by sven plaga (sagemfreak1) - Tuesday, 29 December 2009, 22:07 GMT
Last edited by Tomer Shalev (tomers) - Monday, 04 January 2010, 14:04 GMT
Task Type Patches
Category Drivers
Status Unconfirmed
Assigned To No-one
Operating System iPod 4G Grayscale
Severity Low
Priority Normal
Reported Version Release 3.4
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


if bookmark=ask is set and the mpeg is stopped, the user is asked for pressing select (for make bookark) or any key (for discard)
on apple devices: if the clickwheel is used for discarding, the bookmark is not set (as intended) but the clickwheel is not working anymore.
to get the clickwheel working again, the keyboard lock has to be set and unset and select has to be pressed.
This task depends upon

Comment by sven plaga (sagemfreak1) - Wednesday, 30 December 2009, 03:28 GMT
possible solution to that issue:

i am very new in rockbox programming, but ive figuered out a solution (i will create some patch files tomorrow). i assume, that the clickwheel does not produce a BUTTON_REL. so the get_action_worker() exits with a return ACTION_NONE; every time the clickwheel is moved.

i dont kow why, but if the programm is back in the menue or the filelist, the get_action_worker() continues exiting with ACTION_NONE on line 213 (return ACTION_NONE; /* "safest" return value */). this is going on until a key (eg select) is pressed. then the clickwheel is responding again.

to ignore clickwheel slides, ive, extended action.h with new YESNO actions:

/* yesno screen */
ACTION_YESNO_DECLINE, // patch by sven
ACTION_YESNO_IGNORE, // patch by sven

then ive defined the new keyactions in keymap-ipod.c

static const struct button_mapping button_context_yesno[] = {

}; /* button_context_yesno */

finally ive reacting on the new ignore action in yesno.c

switch (button)

case ACTION_YESNO_IGNORE: // patch by sven - ignore list for some keys
// a slide on the apple clickwheel has no BUTTON_REL
// so simply ignore slides ...
/* ignore some SYS events that can happen */

now i will cleanup the code and create clean patch files.

good night
Comment by sven plaga (sagemfreak1) - Wednesday, 30 December 2009, 14:12 GMT
update: that bug also happen, when the last mp3 is played. if the volume is changed using the clickwheel slider and the end of that mp3 is reached, the slider is not working in the main menu/filelist.

ive tracked down this malfunction to action.c:

if ((context != last_context) && ((last_button & BUTTON_REL) == 0))
if (button & BUTTON_REL)
last_button = button;
last_action = ACTION_NONE;
/* eat all buttons until the previous button was |BUTTON_REL
(also eat the |BUTTON_REL button) */
splashf(0,"action %8x",button); // debug message for tracking the bug
return ACTION_NONE; /* "safest" return value */ // <================ if the bug is active, we return here, until a normal key is pressed.
last_context = context;

Comment by sven plaga (sagemfreak1) - Wednesday, 30 December 2009, 16:45 GMT
this is a patch which solves the 2 issues by a little modification in action.c. not optimized for other devices than ipods. tested on ipod2g with great success.

cu on irc!
Comment by Thomas Martitz (kugel.) - Saturday, 02 January 2010, 18:20 GMT
I think there's several tasks describing this very problem.

Anyway, please provide your real name (edit your flyspray profile) if you want your patches committed.
Comment by sven plaga (sagemfreak1) - Monday, 04 January 2010, 00:16 GMT
ive updated my user profile (i added a new mail adress too - its my current work mail adress).

is it necessary to open a new patch task for getting the patch committed?
Comment by Thomas Martitz (kugel.) - Monday, 04 January 2010, 00:18 GMT
No. I hope someone has time to look at your patch soon.
Comment by sven plaga (sagemfreak1) - Monday, 04 January 2010, 00:56 GMT
fine! then my patch in FS#10892 should be reviewed too. both patches are targeting a similar problem.

rockbox is a great project - i hope i will have time to make more contributions in the future.
Comment by Thomas Martitz (kugel.) - Monday, 04 January 2010, 15:09 GMT
There's a patch at  FS#10097 , you may want to have a look it.