FS#11619 - Restore pitch and speed settings on resume

Attached to Project: Rockbox
Opened by Frank Gevaerts (fg) - Friday, 10 September 2010, 17:49 GMT
Last edited by Frank Gevaerts (fg) - Friday, 10 September 2010, 18:07 GMT
Task Type Patches
Category Music playback
Status New
Assigned To No-one
Operating System SW-codec
Severity Low
Priority Normal
Reported Version Release 3.6
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


This patch should save pitch and speed settings to nvram, and restore them after reboot if needed.

If I read the code correctly, there should be enough room in nvram (and anyway, the way this is done doesn't apply to any targets that actually use real nvram)

This code compiles, but apart from that it's completely untested.

Of course, since this patch increments the nvram data version, you'll lose resume info the first time you reboot.
This task depends upon

Comment by Frank Gevaerts (fg) - Friday, 10 September 2010, 18:02 GMT
Missed a warning
Comment by Jens Arnold (amiconn) - Saturday, 11 September 2010, 09:28 GMT
Why nvram? If pitch and time stretch were to be made persistent, a setting would be better choice imo.
However, when pitch (and later time stretch) got added, they were not made persistent on purpose.
Comment by Frank Gevaerts (fg) - Saturday, 11 September 2010, 11:09 GMT
I know they're not persistent on purpose, but my understanding of why that's the case is that they are really specific to the audio you're listening to at a given moment, and in most cases not suitable for any other audio.

I fully agree with that reasoning, which is why I didn't make them a setting. They're only restored if playback is resumed from the position it was at at shutdown, which I think still matches the requirements of not being "too" permanent.

Actually, I suspect it might be a good idea to reset pitch and speed when starting a new playlist. That (together with this patch) would provide the most consistent behaviour: pitch and speed belong to the current playlist, *nothing* else. That also fits in nicely with them being stored in bookmarks.
Comment by Brian Hall (brihall) - Monday, 13 December 2010, 18:46 GMT
This patch has been working great for me the last two weeks. Built rockbox from svn specifically to use this patch. Saves me several minutes of my time per day, since I no longer have to set my desired playback speed for podcasts prior to starting my commute. I just power up and go. Thanks!

Seems like a good candidate for merging into mainline to me.
Comment by Alexander Levin (fml2) - Wednesday, 05 January 2011, 15:19 GMT
With the reset when starting a new playlist implemented, it would be an ideal candidate for inclusion into SVN. IMHO.
Comment by Rosso Maltese (asettico) - Friday, 22 July 2011, 13:05 GMT
Sync to r30189.
Comment by Frank Gevaerts (fg) - Sunday, 31 July 2011, 13:19 GMT
I agree that reset when starting a new playlist would be nice, but on the other hand it's been pointed out to me that it's useful to be able to set pitch/screen before starting a playlist (which you can do now, so breaking that would be a regression).

That means the ideal logic would be to only reset if pitch/speed haven't been changed since the last time playbacvk was active, which is slightly more tricky.
Comment by Brian Hall (brihall) - Monday, 26 September 2011, 22:13 GMT
I'd been using the older timestretch_v2.diff patch for awhile, but I wanted to rebuild with the current RB and use the new 11619 patch. Built fine and I've installed it, but now I can't get timestretch to work on the pitch screen- it doesn't let me increase playback speed by using left/right like it did before. I can use the dial to increase speed, but it doesn't maintain the pitch at all. I have toggled Sound Settings->Timestretch on and off (Yes/No) via the Context Menu and rebooted several times, but I can't get the old behavior with the new patch. This is on the Sansa E200R, svn r30602M-110925.

Is there something special I need to do after upgrading to the new patch? Process was, applied timestretch_v2.diff in reverse to remove it from my tree, make clean, svn update, apply 11610 patch, rebuild.
Comment by Brian Hall (brihall) - Friday, 14 October 2011, 14:18 GMT
Works again for me as of svn r30738M-111009

Comment by Zachary (Hawkwing) - Monday, 16 July 2012, 22:45 GMT
This patch, or something similar, should really be integrated into Rockbox. Having to reset the speed after startup is very annoying, and if it's the same audio playing as it was before shutdown there's no reason for it to play at a different speed.
Comment by Tons Of Questions (tonsofquestions) - Sunday, 10 December 2017, 20:32 GMT
I know this one is super old, but I've been starting to use listen to audiobooks with Rockbox, and I ran across this issue, too.

I would also love to have this feature - what kind of additional work would it take to get it over the line?