MP3 Playlists & my sanity

Message
Author
Marv1
Posts: 24
Joined: Tue Nov 18, 2014 7:38 pm

MP3 Playlists & my sanity

#1 Post by Marv1 »

This post has nothing to do with MX, sorry.
This post is purely about my sanity.

Here's the first few lines of a playlist generated by the utility FAPG that my Sandisk mp3 player refuses to accept. In fact, it is adamant that the playlist is "empty":

#EXTM3U
#EXTINF:291,0Simon and Garfunkel - Bridge Over Troubled Water
00Simon and Garfunkel - Bridge Over Troubled Water.mp3
#EXTINF:185,1The Sound of Silence Original Version from 1964.mp3
01The Sound of Silence Original Version from 1964.mp3

Here's a playlist that this stupid Sandisk mp3 player is happy use:

#EXTM3U
#EXTINF:245,Pink Floyd - Speak To Me/Breathe
01 Speak to Me-Breathe.mp3
#EXTINF:213,Pink Floyd - On The Run
02 On the Run.mp3

Obviously they are both in files with an "m3u" extension. They are both owned by me and with 777 permissions and located in the same sub-dir's as the actual music they relate to.

I have tried building playlists using other methods, i've found none that work. I've even read the mp3 playlist format documents. ME! The original RTFM guy.
Sandisk say it works with playlists produced by Windows (is it called "media player"?).

But please, what's the *Borising Brexit* DIFFERENCE?

One other insanity, when i do the command(S) below they ONLY find the m3u file in main (root) dir
- i.e. not the one's in any of the sub-dirs - inc the Pink dir!
I can't see this being related to the playlist issue but it is to my sanity.

ls -lR *.m3u
dir -lR *.m3u
Linux user # 519546
O/S: MX-21.1_x64 &
CPU: Intel i7-2600 @ 3.4GHz
Mem: 16GiB
Prt: Xerox Phaser 6280N

Switzerland has Dignitas the UK has DCA's, Bankers and Lawyers.

User avatar
arjaybe
Posts: 479
Joined: Wed Jul 12, 2006 6:51 pm

Re: MP3 Playlists & my sanity

#2 Post by arjaybe »

Marv1 wrote: Sat Aug 24, 2019 9:49 am
#EXTM3U
#EXTINF:291,0Simon and Garfunkel - Bridge Over Troubled Water
00Simon and Garfunkel - Bridge Over Troubled Water.mp3
#EXTINF:185,1The Sound of Silence Original Version from 1964.mp3
01The Sound of Silence Original Version from 1964.mp3

Here's a playlist that this stupid Sandisk mp3 player is happy use:

#EXTM3U
#EXTINF:245,Pink Floyd - Speak To Me/Breathe
01 Speak to Me-Breathe.mp3
#EXTINF:213,Pink Floyd - On The Run
02 On the Run.mp3
I see two differences. The non-working file has the song numbering starting at 00 while the working one starts at 01, and the non-working file has no space between the number and the song name while the working one does have a space.
Green Comet
Space particles.

Marv1
Posts: 24
Joined: Tue Nov 18, 2014 7:38 pm

Re: MP3 Playlists & my sanity

#3 Post by Marv1 »

I have re-named the mp3 files to start at one and added a space between the number and the fn. Then i re-created the playlist. Some of the sub-dir's were already in that format. The Leonard Cohen list, shown below, was supplied with the album. As you can see, it's very basic but that's all the standard requires - and it does work, except not on Sandisk.

Unfortunately, Sandisk still doesn't want to play with the new list.
It still claims it's empty - DUH:

Updated playlist:

Code: Select all

#EXTM3U
#EXTINF:291,1 Simon and Garfunkel - Bridge Over Troubled Water
01 Simon and Garfunkel - Bridge Over Troubled Water.mp3
#EXTINF:185,2 The Sound of Silence Original Version from 1964.mp3
02 The Sound of Silence Original Version from 1964.mp3
Output from "ls" command:

Code: Select all

00new1.m3u
01 Simon and Garfunkel - Bridge Over Troubled Water.mp3
02 The Sound of Silence Original Version from 1964.mp3
Leonard Cohen:

Code: Select all

#EXTM3U
01. Suzanne.mp3
02. The Stranger Song.mp3
I don't suppose anyone has a playlist that has been created by Windows Media thing??
Linux user # 519546
O/S: MX-21.1_x64 &
CPU: Intel i7-2600 @ 3.4GHz
Mem: 16GiB
Prt: Xerox Phaser 6280N

Switzerland has Dignitas the UK has DCA's, Bankers and Lawyers.

User avatar
arjaybe
Posts: 479
Joined: Wed Jul 12, 2006 6:51 pm

Re: MP3 Playlists & my sanity

#4 Post by arjaybe »

Marv1 wrote: Sat Aug 24, 2019 12:24 pm
Updated playlist:

Code: Select all

#EXTM3U
#EXTINF:291,1 Simon and Garfunkel - Bridge Over Troubled Water
01 Simon and Garfunkel - Bridge Over Troubled Water.mp3
#EXTINF:185,2 The Sound of Silence Original Version from 1964.mp3
02 The Sound of Silence Original Version from 1964.mp3
I notice a difference between your m3u and the ones I have. Here's mine:

Code: Select all

#EXTINF:376,Birds of fire - Blues national (marseillaise)
Yours -- EXTINF:291,1 -- has a comma 1, and mine just the comma. Of course, I have no idea whether mine would play on your Sandisk.

Unfortunately (although I've never considered it unfortunate) I haven't used the Windows media player so I don't have any WMP m3u files around. Have you tried googling for Sandisk m3u?
Green Comet
Space particles.

User avatar
Old Giza
Posts: 426
Joined: Wed Apr 16, 2014 10:31 pm

Re: MP3 Playlists & my sanity

#5 Post by Old Giza »

One other insanity, when i do the command(S) below they ONLY find the m3u file in main (root) dir
- i.e. not the one's in any of the sub-dirs - inc the Pink dir!
I can't see this being related to the playlist issue but it is to my sanity.

Code: Select all

ls -lR *.m3u
dir -lR *.m3u
ls and dir can't do that, I think.

You want:

Code: Select all

find . -name *.m3u -type f -print
Replace the dot after "find" with the directory to start searching from, if not the current directory.

Marv1
Posts: 24
Joined: Tue Nov 18, 2014 7:38 pm

Re: MP3 Playlists & my sanity

#6 Post by Marv1 »

arjaybe wrote: Sat Aug 24, 2019 1:35 pm
I notice a difference between your m3u and the ones I have. Here's mine:

Code: Select all

#EXTINF:376,Birds of fire - Blues national (marseillaise)
Yours -- EXTINF:291,1 -- has a comma 1, and mine just the comma. Of course, I have no idea whether mine would play on your Sandisk.
[/quote]

Thanks ... RJB
As you say, there is a diff. However, according to the standard for m3u playlists, the first line (the one that is different) doesn't actually need to be there. It's effectively a comment field. An optional human readable comment with a few extra bits in.

The only thing essential for a playlist in m3u format can be created using the following (quoted from link):
You don’t actually need anything other than a text editor and bash to create a custom m3u playlist.

Code: Select all

ls > myplaylist.m3u
Edit the playlist using your favourite text editor if desired.
unix2dos myplaylist.m3u
https://leehblue.com/making-playlists-f ... -in-linux/
Note the: unix2dos # More later!

Although, IMVHO, i think using the "-1" option on the "ls" would make it easier
i.e.

Code: Select all

ls -1 > myplaylist.m3u
Either way, you can see the an m3u playlist should only need to have a list of the fn's (song titles).
I think that, strictly dancing, sorry, speaking, it does not even need a header to say it is a playlist.
i.e. The ".m3u" extension is adequate.

However, i did have another Google (i'd looked when i first bought the Sandisk player) and after a lot of reading, i found loads of solutions ... which needed Windows WMA.
Except for ...
One/some suggested Easytag - didn't work for me.
Puddletag - installed but never tried as i noticed someone mentioning "lf''s" and "cr's".
I'm pretty old school. I even did a Unix SysOps Advanced course in the 80's (which i didn't understand at all except for learning loads of ways to totally destroy a Unix sysytem). But i did remember something about line endings.
And that's when i found the post i quoted above.

It mentioned << FANFARE >>
[flashing lights]
unix2dos
[/flashing lights]
I threw that against one i had made earlier (sorry) and call me Ishmael - IT WORKED! THEY WORKED!
Although i must have picked up an old version for the play everything list, so that still needs to be looked at.

Thank you
Thank you
Thank you

Thank you to everyone ...
with the exception of Sandisk and the clowns who clearly believe that the world still revolves around Windoze.
Linux user # 519546
O/S: MX-21.1_x64 &
CPU: Intel i7-2600 @ 3.4GHz
Mem: 16GiB
Prt: Xerox Phaser 6280N

Switzerland has Dignitas the UK has DCA's, Bankers and Lawyers.

Marv1
Posts: 24
Joined: Tue Nov 18, 2014 7:38 pm

Re: MP3 Playlists & my sanity

#7 Post by Marv1 »

Old Giza wrote: Sat Aug 24, 2019 5:52 pm
One other insanity, when i do the command(S) below they ONLY find the m3u file in main (root) dir
- i.e. not the one's in any of the sub-dirs - inc the Pink dir!
I can't see this being related to the playlist issue but it is to my sanity.

Code: Select all

ls -lR *.m3u
dir -lR *.m3u
ls and dir can't do that, I think.
You want:

Code: Select all

find . -name *.m3u -type f -print
Replace the dot after "find" with the directory to start searching from, if not the current directory.
That would certainly account for it not working LOL
And many thanks for your "find" command Giza.

Although, does it not seem strange that:

Code: Select all

ls -l *.csv # for example
Works fine.
But when to add the "R" option it doesn't?
i.e.

Code: Select all

ls -lR *.csv
After all, the help for the "ls" and "dir" commands does say:
-R, --recursive list subdirectories recursively
Linux user # 519546
O/S: MX-21.1_x64 &
CPU: Intel i7-2600 @ 3.4GHz
Mem: 16GiB
Prt: Xerox Phaser 6280N

Switzerland has Dignitas the UK has DCA's, Bankers and Lawyers.

User avatar
Old Giza
Posts: 426
Joined: Wed Apr 16, 2014 10:31 pm

Re: MP3 Playlists & my sanity

#8 Post by Old Giza »

Although, does it not seem strange that:

Code: Select all

ls -l *.csv # for example
Works fine.
But when to add the "R" option it doesn't?
i.e.

Code: Select all

ls -lR *.csv
After all, the help for the "ls" and "dir" commands does say:

-R, --recursive list subdirectories recursively
You have to think like the shell when forecasting what your instruction will do. It looks like the command "ls" uses the arguments "-lR" to operate on the option "*.csv". In which case you would obtain the results you expect. But that's not what happens.

Before "ls" even sees your input, the shell pre-processes it in a number of ways. One of the things it does is "filename expansion". It will convert your "*.csv" to whatever filenames match that pattern. In this case, only looking in the current directory. But you could specify any directory along with it, eg "work/*.csv" and that will get expanded too to actual filenames.

Now, when "ls" gets those expanded filenames as its arguments, it applies the "R" to them. If you had just specified a directory, say "work" as your option instead of "*.csv", then ls would list the sub-directories of work. But ls cannot list subdirectories of expanded *.csv or even work/*.csv since those expand to actual filenames, not directories.

Long explanation, hopes that makes sense, even if it looks deceptive on the surface. All the shell commands work that way. In short, ls is a lister, not a searcher, and it can only list the contents of its filename expanded arguments.

User avatar
arjaybe
Posts: 479
Joined: Wed Jul 12, 2006 6:51 pm

Re: MP3 Playlists & my sanity

#9 Post by arjaybe »

Marv1, when I googled I found that this seems to be a known problem with Sandisk.
Green Comet
Space particles.

Marv1
Posts: 24
Joined: Tue Nov 18, 2014 7:38 pm

Re: MP3 Playlists & my sanity

#10 Post by Marv1 »

Old Giza wrote: Sun Aug 25, 2019 10:30 am You have to think like the shell when forecasting what your instruction will do. It looks like the command "ls" uses the arguments "-lR" to operate on the option "*.csv". In which case you would obtain the results you expect. But that's not what happens.
Before "ls" even sees your input, the shell pre-processes it in a number of ways. One of the things it does is "filename expansion". It will convert your "*.csv" to whatever filenames match that pattern. In this case, only looking in the current directory. But you could specify any directory along with it, eg "work/*.csv" and that will get expanded too to actual filenames.
Now, when "ls" gets those expanded filenames as its arguments, it applies the "R" to them. If you had just specified a directory, say "work" as your option instead of "*.csv", then ls would list the sub-directories of work. But ls cannot list subdirectories of expanded *.csv or even work/*.csv since those expand to actual filenames, not directories.
Long explanation, hopes that makes sense, even if it looks deceptive on the surface. All the shell commands work that way. In short, ls is a lister, not a searcher, and it can only list the contents of its filename expanded arguments.
What a terrific explanation (he said after reading it a couple of times very, very slowly).
Thanks very much for your help, time and effort Giza. It is very much appreciated.
Linux user # 519546
O/S: MX-21.1_x64 &
CPU: Intel i7-2600 @ 3.4GHz
Mem: 16GiB
Prt: Xerox Phaser 6280N

Switzerland has Dignitas the UK has DCA's, Bankers and Lawyers.

Post Reply

Return to “General”