Rockbox Technical Forums

Support and General Use => Audio Playback, Database and Playlists => Topic started by: reptillikus on October 01, 2017, 08:42:23 AM

Title: playlists start over
Post by: reptillikus on October 01, 2017, 08:42:23 AM
I cant figure this out, and its driving me nuts.

6g iPod, running the new bootloader, installed via Rockbox Utility for about a week or two now.  Everything was working fine until a couple days ago, and then suddenly, this:
Listening to a playlist i created on my PC (m3u or m3u8, doesnt matter).  Pause and it auto-shuts off.   Turn rockbox back on later, and it picks up at the beginning of the playlist.  Every time.  If i create a dynamic playlist with Rockbox it works just fine, until I save it as a new playlist, then they do the same.  Weird thing is, they used to work just fine.  No changes made to them, nothing, they just randomly all stopped resuming.  Cant figure it out.
Title: Re: playlists start over
Post by: reptillikus on October 02, 2017, 08:59:33 AM
I'm at a complete loss. I recreated a playlist within rockbox and saved it, and it works fine. But every playlist I make on my PC, or even one I make on my iPod, copy to my PC, edit and put back on the iPod, will restart at the 1st track when the iPod powers down. I tried clearing my config file, but that didn't work. Then deleted the whole .rockbox folder and reinstalled via the Utility, and they still don't work right. I just don't get it.
Title: Re: playlists start over
Post by: Bilgus on October 02, 2017, 09:11:36 AM
it is probably missing a field that the rockbox created ones have try making a 2 song playlist on the device and the same two songs on one on the PC and then compare them in a Hex editor..
Title: Re: playlists start over
Post by: saratoga on October 02, 2017, 09:24:10 AM
At shutdown it should save the current resume position. I assume this is a normal shutdown and not the battery draining to zero, the player hard rebooting, etc?
Title: Re: playlists start over
Post by: reptillikus on October 02, 2017, 09:51:50 AM
Yeah I set idle poweroff to 1 min for testing. So normal shutdown.

Bilgus, you might be close to the solution. I think it might be the difference in file location relative to the root dir on my PC's HD vs on my iPod. I'm currently moving my music library to a different location on my PC, and will then try to recompile my playlists off my other (stock) iPod via winamp. It's gonna take about 2 hours so I'll report back with my results.
Title: Re: playlists start over
Post by: reptillikus on October 03, 2017, 01:45:12 PM
Ok, I've got it all figured out.

I'm chalking it up to my mistake, combined with a quirk of Rockbox I did not expect. So I wrote my playlists in WinAmp (and tried in foobar with the same results). So here's where I went wrong.
My directories on my PC are set up as:
C:\users\kevin\music\slayer (or any other band you prefer).
Playlists were in c:\users\kevin\playlists.

The catch is, on my iPod, the directories were f:\music and f:\playlists.

So by some quirk of Rockbox I did not expect, even tho the playlists would point to a directory that technically didn't exist on the iPod (users\kevin\music), the playlists would still play, but lose their place when the iPod powered off.  That was the problem. To get around this, I moved my music directory on my PC to a new location so I could put it in the root directory (d:\music & d:\playlists). I then reloaded my music library in WinAmp, and synced my other 'stock' iPod with it (i have 4 with various mods done). So when I synced that one, it rewrote all of my playlists to reflect the new music directory (d:\music). So now the directory locations on both the PC and iPod match, and just like that, all my playlists work again  8)
Title: Re: playlists start over
Post by: jhMikeS on October 03, 2017, 06:17:11 PM
This may solve the weirdness: http://gerrit.rockbox.org/r/1688
Title: Re: playlists start over
Post by: reptillikus on October 04, 2017, 01:52:09 PM
Adjusting the music dir structure on my PC to more closely match the rockbox directory has solved the issue.  Id have to move tunes back to the old location to test it.  I might yet over the weekend when i have more free time.
Title: Re: playlists start over
Post by: jhMikeS on October 04, 2017, 02:57:25 PM
It might but it's not a proper solution because the code put in place for resume was actually wrong. The patch should fix the inconsistency such that if had been correct, this thread never would have existed because your setup should have worked fine.


Edit: Testing  a similar setup with a couple files would be enough. There's no need to redo the entire music library.
Title: Re: playlists start over
Post by: jhMikeS on October 07, 2017, 02:01:23 PM
I put in the patch since it's the correct way to do it. I'll consider this issue dealt with unless something goes horribly wrong with the change.
Title: Re: playlists start over
Post by: fredex on October 27, 2017, 11:58:25 AM
Is the patch in #6, above, now available in the dev (daily??) builds?

I've had a similar problem for years on all my Sansa players (Fuze v2, clip zip) where some small number of audiobooks always start over at the first track whenever the player is restarted, so I'm wondering if I should try this fix... If not available in the dev builds, is there a build (based on 3.14) I can get that contains the fix, so I can try it?

At the moment there is one audiobook for which that seems to happen all the time.

all my playlists are generated by a Linux shellscript, make-m3u, all in exactly the same way, and they are created from the point of view of the SD card, so they all have the correct path-to-file in them. if I understand the patch description (and I may well not) it is some kind of discrepancy between the playlist and database?????

thank in advance!
Title: Re: playlists start over
Post by: TheAlmightyGuru on October 30, 2017, 01:06:59 PM
I'm having the same problem on my ClipZip using the build from today (and all previous ones since 3.14). I can load a pre-made m3u playlist and it will play songs just fine. But after I shut off my ClipZip and turn it back on, it will restart the playlist from the beginning rather than play from where the last song left off.

If you need more info or to try a test of anything, just let me know!
Title: Re: playlists start over
Post by: fredex on October 30, 2017, 07:59:14 PM
Guru: that's exactly what happens to me, but its only on a very few playlists, and not 100% of the time (only about 90%  >:( ) I'm currently playing one that has been bad and this time thru, so far, its working fine. Go Figure.

If instead of selecting the playlist, I go to the folder where the files are and start playing them, they work fine. its onlywith my m3u8 playlist that it usually fails.

If you're using the latest build and it doesn't solve it, then either (1) the fix didn't get into current builds, or (2) we've got another problem entirely.

I'd like to get a reply from jhMikeS regarding the disposition of the patch. that would shed a bit of light on it.
Title: Re: playlists start over
Post by: saratoga on October 30, 2017, 08:42:07 PM
That patch was committed on the 7th, so if it didn't fix it, then you've got a different problem.
Title: Re: playlists start over
Post by: TheAlmightyGuru on October 31, 2017, 09:01:56 AM
I've found a pattern!

When the songs in the playlist begin with a current or parent directory operator, Rockbox fails to remember the last song after shutdown and restarts the playlist from the beginning. For example, this playlist will fail to remember:

./Artist/Song 1.ogg
./Artist/Song 2.ogg

And so will this one:

../Music/Artist/Song 1.ogg
../Music/Artist/Song 2.ogg

However, when I remove the current or parent directory operator, Rockbox properly remembers the last song. So, this one works:

Artist/Song 1.ogg
Artist/Song 2.ogg

Fredex, can you verify this on your ClipZip?
Title: Re: playlists start over
Post by: fredex on November 09, 2017, 08:55:50 PM
Guru:
All my playlists have the absolute path to the audio files, e.g:
/<microSD1>/AUDIOBOOKS/Lois-Mcmaster-Bujold/TheSharingKnife/Beguilement/The Sharing Knife, Vol. 1  Beguilement (Unabridged)  [File 01 of 19].mp3
I made a directory named "Playlists" on the root of the builtin storage. all the audio files go in a directory tree on the microSD card. the program I use to generate the playlists is coded to use the runtime path instead of the path of the folder when it is mounted as a Linux filesystem, so if the SD card is mounted as "/run/media/fredex/AUDIOBOOKS/... it replaces the "/run/media/fredex" with "/<microSD1>" which works fine on dozens of playlists.

and, I just recently played thru one of the playlists that always misbehaves, and this time it worked fine. Go figure!

Thanks for the idea.

Fred
Title: Re: playlists start over
Post by: TheAlmightyGuru on November 10, 2017, 10:38:40 AM
Interesting, it seems like the problem isn't just related to absolute or relative paths, I wonder if there are two similar issues.

I just updated to the latest build, but I'm still seeing the same behavior with absolute versus relative pathing on mine. A relative path playlist -always- loses its place and resets to the beginning of the first track when I shut off my ClipZip while an absolute path playlist properly remembers the track and position.

If you have time, could you test this behavior on yours? Here is my file structure:

.\
---absolute.m3u
---relative.m3u
---MUSIC\
------song1.ogg
------song2.ogg

absolute.m3u contains the following lines:
MUSIC\song1.ogg
MUSIC\song2.ogg

relative.m3u contains the following lines:
.\MUSIC\song1.ogg
.\MUSIC\song2.ogg

To perform the test, here is what I did:

Absolute
1.) Open the files list, and run absolute.m3u and song1.ogg begins playing.
2.) Push right to start song2.ogg. Let it play a few seconds in.
3.) Turn off the ClipZip by pressing power.
4.) Turn on the ClipZip with the power button.
5.) song2.ogg continues to play from the same track location as when it was shut off.

Relative
1.) Open the files list, and run relative.m3u and song 1 begins playing.
2.) Push right to start song2.ogg. Let it play a few seconds in.
3.) Turn off the ClipZip by pressing power.
4.) Turn on the ClipZip with the power button.
5.) song1.ogg plays from the very beginning.

Thanks!
Title: Re: playlists start over
Post by: jhMikeS on November 14, 2017, 03:50:32 PM
Sure, I'll try it ASAP. Those are all relative paths since the don't start with "/" (root). The only difference is the explicit current-directory dot.

I do have a playlist with paths of the form "./a/b/c/d.xxx" (and "a/b/c/d.xxx", "/a/b/../c/d.xxx", etc.) and the tracks do in fact resume just fine. It was created for the purpose of testing path code and playlist behavior with new file code. The only difference it is a mix of various path forms.

Will get back to you.
Title: Re: playlists start over
Post by: TheAlmightyGuru on November 16, 2017, 03:06:10 PM
Thanks jhMikeS!  :)
Title: Re: playlists start over
Post by: TheAlmightyGuru on November 20, 2017, 02:00:23 PM
I found something new that might help you in the debug process.

First, as you pointed out, proper absolute pathing requires starting with a root. I tried the following, and both songs are properly remembered:

\<microSD1>\Music\Artist\Song 1.ogg
\<microSD1>\Music\Artist\Song 2.ogg

I also tried using a relative double-dot parent path; both songs forget, just like a single dot:

..\Music\Artist\Song 1.ogg
..\Music\Artist\Song 2.ogg

Next, I tried a mixed playlist like this, and unexpectedly, both songs are properly remembered, even the relative path:

\<microSD1>\Music\Artist\Song 1.ogg
.\Music\Artist\Song 2.ogg

But, interestingly, when I reverse the order, the second song is remembered, but the first song is not:

.\Music\Artist\Song 1.ogg
\<microSD1>\Music\Artist\Song 2.ogg

I'm guessing that, when a playlist is loaded, a flag is supposed to be set. In version 3.13, the flag was always set no matter what path type was used. However, in 3.14, something was changed so that the flag would not be set on a line that begins with a dot.

This would explain why my third test remembers the position of the relative path track (because a non-dot path track was played first and set the flag), and also why in my fourth test the relative path track did not work (because a non-dot path track had not been played to set the flag). And also why in my previous tests a path without a slash or dot would be remembered properly.

I hope this helps!
Title: Re: playlists start over
Post by: fredex on November 24, 2017, 02:25:51 PM
Gee, I never considered using relative paths within a playlist, because I had no idea what the CWD is when invoking a playlist, nor how to find out. if it was Linux I could write a shellscript to find out, I guess. how does one find out?

I haven't seen it documented anywhere, so I wonder why you would assume relative paths to the files listed in a playlist would find the actual files?

Not criticizing, just wondering.
Title: Re: playlists start over
Post by: saratoga on November 24, 2017, 05:41:07 PM
m3u paths are relative to the folder containing the playlist.
Title: Re: playlists start over
Post by: TheAlmightyGuru on November 29, 2017, 10:49:16 AM
@fredex: I find that relative-path playlists are more modular. As Saratoga said, M3Us with a relative path start in the folder where the M3U file is located. On my SD card, I keep my files stored like so:

root
----Playlists
--------Playlist1.m3u
--------Playlist2.m3u
----Music
--------Artist1
------------Song1.ogg
------------Song2.ogg
--------Artist2
etc.

By using a relative path in the M3U playlists, I can plug my ClipZip into my PC, and load the playlist in foobar2000, and it will find all the songs properly. Or, I can take the SD card out, pop it into a phone or tablet, and the playlists will work there too. This way I only ever have to maintain a single playlist collection and it will work on every device and program I use; it's pretty convenient.

When I started using Rockbox, I just assumed relative path playlists would work, and for several years, it has supported them just fine. Rockbox still finds the songs properly, the only problem (since version 3.14+) is remembering where the playlist left off.
Title: Re: playlists start over
Post by: TheAlmightyGuru on January 02, 2018, 02:49:34 PM
I'm trying to determine if this playlist bug is specific to the Sansa ClipZip, or is a general Rockbox issue, but, unfortunately, I only have a ClipZip. Could a couple other Rockbox users with different devices help me out? I've created some test files which you can download here: http://www.thealmightyguru.com/PlaylistTest.zip (http://www.thealmightyguru.com/PlaylistTest.zip)

To run the test, unzip the files and copy them to your device, then do the following:

1.) Using your player, open the PlaylistTest folder.
2.) Launch the Remembers.m3u playlist.
3.) Let the song play for a few seconds.
4.) Turn off your player.
5.) Turn your player back on.
6.) Rockbox should begin playing the song from where it left off as it's supposed to.

Then,

1.) Using your player, open the PlaylistTest folder.
2.) Launch the Forgets.m3u playlist.
3.) Let the song play for a few seconds.
4.) Turn off your player.
5.) Turn your player back on.
6.) Rockbox will instead start the song from the beginning.

Please let me know if you get similar results and what type of player you're using, thanks!