[SOLVED] Sorting USB / SD card for mp3 player

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
flyingrhino
Level 4
Level 4
Posts: 250
Joined: Sat Apr 04, 2015 8:55 pm

[SOLVED] Sorting USB / SD card for mp3 player

Post by flyingrhino »

Many car stereo mp3 players use fat32 formatted usb or sd card for storage.
This file system stores files in the order they were copied, and many mp3 players don't sort by filename, but simply play in the order the files were stored.

Simple solution -

Code: Select all

apt-get install fatsort
Get info on your device first -
Plug in AND UNMOUNT your device

Code: Select all

sudo fatsort -l /dev/sdb1  (unmounted partition where the mp3 live)
sudo fatsort -i /dev/sdb1
Sort the files:

Code: Select all

sudo fatsort -c /dev/sdb1
pgmer6809
Level 4
Level 4
Posts: 228
Joined: Sun Mar 04, 2012 9:06 pm

Re: [SOLVED] Sorting USB / SD card for mp3 player

Post by pgmer6809 »

I have not tried fatsort, will have to give that a go. However there is another approach
Does your mp3 player handle playlists? If that is the case you can create a .m3u file with the names of the tracks in the order you want them.
you can just do a ls >myplaylist.m3u and have the files in alphabetical order.

This could be preferable because if you add some new tracks to the USB stick you do not have to completely rewrite the stick, you can just recreate the playlist file.

Of course it is also fairly trivial to have your playlist in other than alphabetical order, either manually or with a playlist generating app.

for more info start here:
https://en.wikipedia.org/wiki/Playlist
pgmer6809
flyingrhino
Level 4
Level 4
Posts: 250
Joined: Sat Apr 04, 2015 8:55 pm

Re: [SOLVED] Sorting USB / SD card for mp3 player

Post by flyingrhino »

Playlists are ok if you want to manage a collection, but for simple tasks (and if the player doesn't support playlists), then sorting the dir in place is by far the easiest.

I used to have an alpine car stereo that read all the files then sorted them in memory, but it would take 1 min per 300 songs every time the car was started, and if the sort took longer than the current play then it would screw up the listing.
My new alpine is "smarter" - it doesn't pre-read anything, but goes off the dir order. I actually prefer this approach.
giles

Re: [SOLVED] Sorting USB / SD card for mp3 player

Post by giles »

followed these instructions and kept getting error from fatsort.....eventually discovered 3 hidden folders on USB STICK, removed these and fatsort worked a treat
flyingrhino
Level 4
Level 4
Posts: 250
Joined: Sat Apr 04, 2015 8:55 pm

Re: [SOLVED] Sorting USB / SD card for mp3 player

Post by flyingrhino »

I also created "directorySplitter" python program to copy files to USB while splitting up into sensible sized dirs.
Shared here for everyone to benefit: https://github.com/flyingrhinonz/directorySplitter
Post Reply

Return to “Tutorials”