• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category User Interface → Themes
  • Assigned To No-one
  • Operating System iPod 5G
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by Nick_W - 2007-09-12
Last edited by jdgordon - 2008-10-16

FS#7762 - Add Scrub Mode Fast Forward and Rewind to iPod

This patch is designed to work with patch  FS#7555  (double click feature for iPod), although it can use any action to activate it (just remove the “ACCEPT_DOUBLE_CLICK” ifdefs).

This allows you to fast forward and rewind a song in the same way as in the iPod. If you add the double click patch, then add this patch, when in the WPS screen, double clicking on the “select” button puts the iPod in scrub mode. scrub right or left to ff/rew, and then press “select” or “play” to start playback from the selected position.

Any other button could be programmed for this action in place of “select”.

Other targets could also be added.

This patch enables double click for iPod nano (patch  FS#7555  just enables it for video). so it should work on both.

Synced to r14675 (Sept 12 2007)

Dosen’t work in the simulator for some reason.

Closed by  jdgordon
2008-10-16 11:18
Reason for closing:  Rejected
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

required the double click patch which was rejected. Also seems to be abandoned by the author.

sounds cool. fyi, the reason it doesn’t work in the simulator is because the simulator doesn’t use the firmware button code… it has it’s own key detect. i never got around to adding that to the double-click, because i don’t use the simulator.

Thanks for implementing the only feature of the retail OS UI I really like.

Added newline to end of patch to avoid patching error.

dip commented on 2007-09-29 22:56

Nice work, almost like the original firmware.

I have two comments:

1. When I start playback after scrubbing, a short time (about 1 second) from the previous position of the track is played and only then it starts playing from the new position. So it seems that there are buffered audio data in the memory which should be flushed before playback is started.

2. When starting scrubbing (and also when restarting playback after scrubbing) the scrollbar is cleared for a short time. This should be avoided.


I have a second generation Ipod mini (6GB). I downloaded the latest source from SVN, applied this patch and the one for double click. I then did a configure, make and make fullzip.

I then removed the .rockbox folder from my Ipod and copied the contents of the ZIPfile to my Ipod. The IPOD boots and works fine - but I don’t seem to be able to access scrub mode. Is there anything else I need to do?

I really really want this feature! :(

Here is a new version synced to todays build (1st Oct 2007).

The odd delay was caused by me using audio_pause() and audio_resume() on SW codec players (there is a 2 sec fade in/out on this). This I have fixed. Let me know if it is better.

Eddie, I haven’t tried this on a mini, and it dosen’t work with double click in the simulator, but I’ll take a look. It may not work with the older scroll wheel models.

By the way, add the patch for double click first! (I’m not sure if it makes a difference, but that’s the way it should work).

dip commented on 2007-10-01 22:17

I will test the new version.

One further comment: In the scrub mode of the original iPod firmware one has only press select to START scrub mode but not to STOP it. After releasing the scroll wheel playback is immediately started from the new position and after a while playing scrub mode is automatically switched off (you recognize that from the changed symbol in the progress bar). If you restart to rotate the wheel before scrub mode has switched off scrub mode is still active and the progress bar moves to the new position and so on.

Could that behavior implemented in you patch?

dip commented on 2007-10-02 22:42

The new version works great. The audio buffer is now correctly updated.
And when restarting playback the scrollbar is no longer cleared for a short time. But directly after the double click the scroll bar is still cleared and only restored when I start touching the scroll wheel.

Okay I’m really keen to get this going. Which revision of Rockbox should I check out from the SVN so that it’s compatible with both the double-click patch and the scrub patch?

Or better yet, is anyone able to set it up for me so that all that I need to do is build it and load it onto my ipod (2nd generation Mini)? If you’re happy to do this for me, send me an email containing a ZIP/tar.gz of the patched source to

I guess part of the problem is we’re not even sure this will work on the older ipods (such as the mini).

Thanks guys! Eddie

This looks a nice feature (or return of an old OF feature). Is this likely to be compatible with the old 1G and 2G iPods? I’ve never patched before, but I’ll have a go sometime soon

Also, to echo Dieter’s comment above, the original feature moved the play position indicator as the scroll wheel was adjusted (with playback still continuing at the original position), and then started playback at the new position once the wheel was released. This was much ‘sleeker’ than the current regular build functionality, where playback ceases while FF/RWD seeking is in progress …. is this feasible with the way Rockbox playback is implemented?


This looks a nice feature (or return of an old OF feature). Is this likely to be compatible with the old 1G and 2G iPods? I’ve never patched before, but I’ll have a go sometime soon

Also, to echo Dieter’s comment above, the original feature moved the play position indicator as the scroll wheel was adjusted (with playback still continuing at the original position), and then started playback at the new position once the wheel was released. This was much ‘sleeker’ than the current regular build functionality, where playback ceases while FF/RWD seeking is in progress …. is this feasible with the way Rockbox playback is implemented?



With the recent changes in SVN, I have had a hard time keeping my patches up to date, so I haven’t had much time to look at this patch. Hopefully I’ll be able to look at it over the next couple of days and provide an update. I’ll set up a version for older iPods to see if it works correctly.

As to Dieters comments, I don’t see the problem with the progress bar on my iPod - what exactly are you running rockbox on? it may help me find this oddity.

The various features that have been requested could be implemented, I don’t see anything in rockbox that would prevent this, I was actually implementing a “new feature request” that asked for a scrub mode that works the way it is currently implemented. The comment there was that having scrub mode time out on the iPod was irritating because if you didn’t notice while you were seeking, then it suddenly switched back into changeing the volume, and you had to go back into scrub mode. So the request was for scrub mode with a way of positively entering and exiting scrub mode without it timing out. I could add a menu item that would allow you to select this (say “scrub time out” 0 to manually exit, and 1, 2, 3 etc. secs for an automatic time out). I can also have the sound continue to play, and update while scrubbing (I actually turned this off intentionally).

I’ll post a new patch soon for you to try.


When you added these patches, did you edit rockbox\firmware\export\config-ipodmini2g.h and add the line:

/* define this to turn on double click captures */

Just before the final #endif ?
Right now double click is only enabled for Nano and Video. If you want to enable other iPods, you have to add this to the appropriate config.h file

It does say this in the double click patch page (but I guess that it’s not obvious).

I will add this to enable all iPods (so you don’t have to do this in future) in the next version of the patch.

dip commented on 2007-10-04 20:52

It seems that the problem with the progress bar (that is is cleared after the double click) is depending on the used wps. I use a wps in which the progress bar is not spanning the whole screen but only between two margins defined with the scrolling margin patch. When I switch to another wps which in which the scroll bar spans the whole screen the scroll bar is not cleared after the double click. I enclose my wps files for testing (it requires the album art patch and the scrolling margin patch).
Is this a “bug” of the srub-patch or of the scrolling margin patch?

I’ve just tried  FS#7555  (double click feature for iPod), along with scrub_ff_rew_V2.patch on my trusty old 2nd Gen touch wheel iPod, and it seems to work exactly as described.

I haven’t tried the scrolling margin patch yet, but I’ll report back if I manage to find and patch successfully.


When you added these patches, did you edit rockbox\firmware\export\config-ipodmini2g.h and add the line:

/* define this to turn on double click captures */

Just before the final #endif ?
Right now double click is only enabled for Nano and Video. If you want to enable other iPods, you have to add this to the appropriate config.h file

It does say this in the double click patch page (but I guess that it’s not obvious).

I will add this to enable all iPods (so you don’t have to do this in future) in the next version of the patch.


Here is the latest version of the patch, with all requested features added. I’ve also enabled all iPods (not nano and video as the double click patch does that).
There is a new setting in settings/General Settings/Playback/Fast-Forward/Rewind called Scrub Mode Timeout. If you set this to “off” then the patch works as previously (ie playback pauses, scrub to new position, select/play to pick up at new location). If you pick any other value, then when you double click to enter scrub mode, playback does not pause, and you can scrub back and forth as usual. If you stop scubbing for about 1 second or so, the playback will pick up at this location. Note - you are still in scrub mode until the time out period (with no activity) passes, unless you press select or play, and then you are back to normal playback.

I’ve had a little difficulty with what happens when you get to the end of a song, but you are still scrubbing (and the song is still playing), right now I just pause the song with about 1/2 second to go. But if anything is wrong with what I’ve done, that’s where it’ll be.

I did test this with Dieter’s dipod1 theme (which is for an iPod Video I guess) and it seemed to work fine. I also have a build with album art, scroll margins and a whole boat load of other stuff (using a modified nclix’s theme) and it worked properly on that also.

Give it a try and let me know how it works for you - synced to todays build (r14992) 5th Oct 2007.

dip commented on 2007-10-07 11:07

The new version works great! My problem that the scrolling bar is cleared when entering scrub mode is no longer there. Thanks.

I also like the new “original ipod” behavior (to end scrub mode automatically with timeout).

The only difference to the original is now that in the original ipod there appears a diamond like indicator at the end of the scroll bar to indicate scrub mode. With the patch one cannot recognize if scrub mode is on or off. This is in particular true if you use the “automatic” mode since music continues to play. I assume it will be difficult (or impossible) to display an indicator (since this must be dependent on the size/heigth/color of the scrolling bar) an option could be to set a wps flag indicating if scrub mode is on or off. In the wps a corresponding symbol could be shown (similar to shuffle or repeat mode) or it could perhaps even be possible to change the color of the scroll bar depending on the scrub status (I have to check if the image used for the scroll bar can be changed dynamically).

Can anyone shed any light on this error I’m getting under Cygwin:
$ patch –binary -p0 < scrub_ff_rew_v3.patch
patching file apps/action.h
patching file apps/lang/english.lang
Hunk #1 succeeded at 11390 with fuzz 1 (offset 49 lines).
patching file apps/gui/gwps-common.c
patch: malformed patch at line 270: static const uint16_t ff_rew_steps
[] = {


Comment by Mark Fawcus (yapper) - Monday, 08 October 2007, 02:39 GMT+13
Can anyone shed any light on this error I’m getting under Cygwin:

Yes, I had this problem when I downloaded the patch using wget. When I clicked on the patch in my browser, copy-pasted it into a text file (emacs) it patched fine.

However, I get the following error when I try and build against revision 14992 for an ipod mini 2g (I applied the double click patch first then scrub_ff_rew_v3):

eddie@merlin:~/rockbox/build$ make
make[1]: `rdf2binary’ is up to date.
make[1]: `convbdf’ is up to date.
make[1]: `codepages’ is up to date.
make[1]: `scramble’ is up to date.
make[1]: `ipod_fw’ is up to date.
make[1]: `bmp2rb’ is up to date.
CC drivers/button.c
drivers/button.c: In function ‘button_tick’:
drivers/button.c:152: error: ‘BUTTON_DBL’ undeclared (first use in this function)
drivers/button.c:152: error: (Each undeclared identifier is reported only once
drivers/button.c:152: error: for each function it appears in.)
drivers/button.c: In function ‘button_init’:
drivers/button.c:465: warning: implicit declaration of function ‘btn_set_double_ click_delay’ drivers/button.c:465: error: ‘DC_DELAY_DEF’ undeclared (first use in this function)
drivers/button.c: At top level:
drivers/button.c:615: warning: conflicting types for ‘btn_set_double_click_delay’ drivers/button.c:465: warning: previous implicit declaration of ‘btn_set_double_ click_delay’ was here
drivers/button.c: In function ‘btn_set_double_click_delay’:
drivers/button.c:616: error: ‘DC_DELAY_MIN’ undeclared (first use in this function)
drivers/button.c:617: error: ‘DC_DELAY_MAX’ undeclared (first use in this function)
drivers/button.c:618: error: ‘DC_DELAY_DEF’ undeclared (first use in this function)
drivers/button.c:621: error: ‘DC_DELAY_START’ undeclared (first use in this function)
make[1]: * [/home/eddie/rockbox/build/firmware/drivers/button.o] Error 1
* [build] Error 2

Can anyone else reproduce this error when building for an ipod mini 2g (or otherwise?)



I’m not sure why you are getting these errors, or having to download the patch via EMACS. I’ll post a resync patch in a few minutes, and I’ll to compile for the 2g iPod also.

It may help if you run “make clean” before runing make - I had to do this after syncing with SVN.


Here is a resynced patch to r15044. I hope this works correctly (I have to edit the patch to remove the double click patch, and I’m not sure that I’m doing this correctly).

Let me know if this works (after a “make clean”).


It sounds like /firmware/export/button.h is not getting updated with the double click patch. button.h should look like this:

/* Button modifiers */
#define BUTTON_REL 0×02000000 #define BUTTON_REPEAT 0×04000000 #define BUTTON_TOUCHPAD 0×08000000 #ifdef ACCEPT_DOUBLE_CLICK
#define BUTTON_DBL 0×08000000 #endif

#define DC_DELAY_MIN 100
#define DC_DELAY_MAX 500
#define DC_DELAY_DEF 300
#define DC_DELAY_START 30

void btn_set_double_click_delay(int delay);

#endif /* _BUTTON_H_ */

I’ve attached a zip of the build compiled for the 2g mini (no other patches applied though). Try this and see if it works.


I have thought about this, and I’m not sure what I can do about color or markers in the scroll bar. I’ll have to take a look. One thing I was thinking of is to add an extra mode to the playback indicator. Right now it displays playing, paused, fast forward, fast backward and stop (I think it does stop anyway). I could add an extra mode “scrubbing” with an icon to indicate this. This would need the WPS to be updated to display the new icon though.

I’ll see what can be done.

dip commented on 2007-10-09 14:12

That’s similar to what I meant. I’m quite sure that you cannot change the display of the scroll bar directly with your patch since it is too much depending on the used wps. But if your patch provides a wps tag indicating the scrub status one can amend the wps to display a corresponding information e.g. by an extended playing status icon.

Since I guess that an indicator placed more closely to the scroll bar itself would be more recognizable I thought if depending on that wps tag a wps can be drafted in which the color of the scroll bar is changed (which means that the image for the scroll bar is switched dynamically during its use). I don’t know if that is possible but will try it as soon as I have enough time. If this is not possible it could also be a solution to change only the color of the surrounding frame of the scroll bar (in most wps the scroll bar has such a frame) depending on the new wps tag. This should be possible since this frame is only a static image.

dip commented on 2007-10-09 23:56

After some trials I think directly changing the color of the progress bar dependig on a new wps play status tag is not possible since the bitmap for the progress bar is only loaded once. But it is possible to create a duplicate of the progress bar frame (most wps use) in a different color (with a transparent inner area) and to show this image depending on the playing status. As a test I changed my wps to show a red progress bar frame when pause status is detected and it works as expected. As soon as the wps playing status tag would be extended by a scrubbing status option this tag could be used to indicate scrub mode with a colored progress bar frame.

Thanks Nick, the attached build works perfectly - you’ve made my day :)

Now just to get this into the trunk :)
Getting the ‘cursor’ to show the current scrub position (like on the original Ipod s/w) would really be the icing on the cake.

Thanks very very much!

Nick, I’m still getting an error when attempting to apply your patch, but I’m not sure if it’s a result of your editing out of the double_click patch, or something weird in my Cygwin environment. I also had a problem with the double click patch (button.h wasn’t updating) but your post above helped fix that. This is what I see when attempting to apply your patch:
$ patch –binary -p0 < scrub_ff_rew_v3_r15044.patch
patching file apps/action.h
patching file apps/lang/english.lang
patching file apps/gui/gwps-common.c
patching file apps/gui/gwps-common.h
patching file apps/gui/gwps.c
patching file apps/settings.h
patch: malformed patch at line 332: int usb_stack_mode; /* device or host */

I’ve finally got it working by chopping the settings.h part out of the patch, and applying that bit manually. :)
Thanks for your work on this, Nick!!

dip commented on 2007-10-10 19:18

Like Eddie I think getting the ‘cursor’ to show the current scrub position (like with the original ipod firmware) would be the icing on the cake. But I have come now to the conclusion that it is not the scrub mode patch which have to take this action but the respective WPS. As previously mentioned, since the height and color of the progress bar depends on the used WPS this patch cannot display a suitable ‘cursor’.

However, this patch could provide an additional WPS scrub indicator tag (e.g. %S) for loading a ‘scrub cursor’ image. The designer of the WPS can then design an scrub indicator which matches to the used progress bar in color, size, type etc. (e.g. a diamond like indicator like in the original ipod firmware). This patch can then check if the %S tag is set and if it is the corresponding image is shown on the current scrub position and if not it will only show the regular progress bar without scrub cursor.

In addition, an extension to the WPS playback mode tag %mp (either one additional status for scrub mode or two additional status for rewind scrub mode and forward scrub mode) could be defined to indicate the current scrub mode in the status bar, but for me more important would be the first mentioned tag %S.

Any comments to this idea?

Dieter: It sounds like a fantastic idea. I really think this feature should go into the trunk. The original Apple firmware wasn’t great, but this was one thing they really got right.


OK I have the cursor code working.

I haven’t implemented a WPS indicator yet - this may prove to be enough. One thing I notice, on a nano screen, the cursor is quite small - should I make it bigger (or a different color?) - right now it’s set for inverse, so that you can always see it no matter what color the background is.

If you have scrub_mode_timeout set to off (ie 0), the cursor does not display. If it is set to anything else, then the cursor will display, and should work almost like the apple version. I’ll have a think about the scrub_mode cursor bitmap image as Dieter was describing (I’m not sure the WPS actually knows the current scrub position) - it may be a bit overcomplicated - have a look at this first (its prety simple).

I’ve tested it on several Themes, and all work well. The “dithered” progress bar looks a bit odd, but it still works. I’ve tested it with a build having albumart, scroll_margins etc.etc. and it works fine there as well.

This does also affect the “normal” fast forward/rewind using the FF/REW keys as well - but this could be an additional benefit. Again if scrub_mode_timeout is “off” then FF/REW works the usual way.

Anyway, have a play, and let me know if the WPS tag is still needed.

If you have trouble with the patch, let me know - I think it’s remenants of the double click patch hanging around that causes the issue. I’ve attached just the scrub mode patch, plus a patch that contains both scrub_mode and double_click (so you can just apply one patch to do both.

I’ve included a build for the mini 2g for Eddie (in case he has problems compiling).

This is synced to r15077 (Oct 11th 2007).

Thank you very, very much! :)

Nick, I used 15078 code and the combined patch applied perfectly. I’ve just built it for the 1G2G iPod and I think you’ve got it just right!

dip commented on 2007-10-13 14:26

With my theme (see above there is the problem that the new cursor is not vertically centered in the progress bar but sits a little below the middle line. This causes that the cursor leaves some pixels inverted below the progress bar when it is moved which will never be cleared (it’s hard to explain, the best is to try it and you will see the problem).

I still think the cursor should be something which can be defined in an image file to be able to adapt it to the desired WPS.

And I liked the previous behavior more that the head of the progress bar moves when scrubbing (and also when normal fast forwarding and rewinding). With the new version only the cursor is moved and the progress bar jumps only when playback restarts. I would prefer that the cursor moves together with the head of the progress bar.


After much work I have finally got the custom cursor to work.

WPS now has a new tag %S. This should go near the start of the WPS script (usually after %X and %P). Syntax is %S|scrub.bmp| (or whatever the custom cursor bmp is called). I suggest using a transparent bmp, so that the scroll bar shows through. I have included a sample theme using a transparent scrub cursor (modified dipod1 theme).
If the %S tag is not present in the WPS script, then a default cursor (as previously) is used.

For all this to work, the “scrub mode timeout” has to be set to something other than 0. If it is set to 0 (default) then no cursors are used (and there is no timeout).

I have tested this with my fully loaded build (album art etc.) and the dipod1 theme and everything seems OK. This is synced to todays build (r15144).

The is for the ipod 2g for Eddie. Eddie do you still need this or can you compile OK now?

Try it out and let me know what you think. Extensive testing (different BMP’s, sizes etc, different themes and so on) would be appreciated.


Found a bug already. If you double click (enter scrub mode) but don’t actually scrub, the remains of the custom scrub cursor are left behind. I have already fixed this.

if you want to fix it yourself, add
as shown below (in scrub_ffwd_rewind in the file /apps/gui/gwps-common.c)

if (!update) /* we havent scrubbed yet, so just show progress as normal */

 wps_state.scrubbed=true; /* now we have scrubbed used later to clean up wps */  

Sorry for the snafu.

Hi Nick,

I am able to build successfully using the latest revision from SVN and the patch scrub_ff_rew_plus_double_click_patch.patch

Cheers for your time + effort


Just a small suggestion: “S” might not be the best choice for the scrub bitmap because it’s used in the progressbar-slider patch. On a modded version of this I use for my build I use “Z”. Otherwise great patch!

dip commented on 2007-10-21 22:16

Great addition of the image tag. Thanks a lot.

I found only one small bug. When starting scrub mode while playback is paused, the scrub mode timeout doesn’t work. You have then to press play or select to end scrub mode.

And one (very) small display issue. When, after moving the scrub indicator, the touchwheel is released and the progress bar jumps to the moved indicator, the indicator “jumps” sometimes one or two pixels forward or backward. You can see it best if you pause playback and then scrub forward. When you relase the touchwheel and the progressbar adjusts forward to the scrub indicator, the scrub indicator moves back a little bit. But you really have to look very closely so that not a big deal (I’m mentioning it only for completeness).

Finally, for people who like it more that the head of the progressbar moves together with the scrub indicator it would be great if this behavior could be set as an option (especially since with the current version even the “regular” fast forward and rewind is changed in this respect).

I just needed to inform you all about a few things.
1. Blind people cannot use this patch. The voice string for lang_scrub_mode_timeout is not filled out. I have attached a lang file with the string filled out.
There is something else, but it is slipping my mind.
This is my first patch, and I cannot get it write. It will ask you for file to patch just type apps/lang/english.lang.

You can manually edit that patch so it’ll work, make the top look like this:
*** apps/lang/english.lang Wed Oct 24 07:46:37 2007
— apps/lang/english.lang Wed Oct 24 07:50:18 2007

What does the time matter?

It doesn’t, I’m copying and pasting here. The time exists in your original patch, the only thing I changed is what is actually different.

Thanks for the comments guys,

I’ll look into Dieter’s comments (about the jump etc.) next week (I’m in Europe right now, so no time to work on this - I’ll be back in Canada next week).

I’ll look at the english patch as well, but I don’t really see how blind people would use this patch anyway. Normal ff/rewind would work just fine for them, scrub mode does requires some visual interaction (otherwise how do you tell where you are scrubbing to in the song?).

Anyway, I’ll pick up next week, and see if I can add an option such as Dieter suggests.

Any other suggestions for the wps tag? Dieter suggested %S, Travis suggests %Z (Which is a little random for me) - any other suggestions? what about a two letter tag (%Sc or %sc for example “scrub cursor” perhaps).

That was kinda spur of the moment for me, I just ran through the parser and picked the first letter I could think of that was not taken. Though if you think of the cursor as the “zipper” it might not be so random…:o) %Sc or %sc are both solid choices.

Well, we cannot tell where we are in normal ff/rw mode either. And doesn’t this patch need to be synced now mob is in?

BUMP - Is there still work on this?

kiese commented on 2008-06-10 17:13

how can i include this in my rockbox for ipod video?

i dont check to compile the hole stuff. absolutly the hole source stuff.

kiese commented on 2008-06-10 17:15

oh da fehlt ein w vor dem hole
hole means whole ;-)

This is never going to be synced again. Since double-click was rejected there really isn’t any point. If you guys are really wanting to use it I have a copy of it in my set of patches for my build at You’ll need to apply progressbar-slider as well as double-click to use it though since my personal version I had to modify to coexist with that patch.


Available keyboard shortcuts


Task Details

Task Editing