Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Stereo reading mp3 files in wrong order (from USB pen-drive) (Read 22692 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Stereo reading mp3 files in wrong order (from USB pen-drive)

Reply #25
Yes, rewriting the filesystem is easy to do when dealing with FAT, since it can just read the entire thing to memory, reorder the directory entries, then rewrite it back to disk, all without having to touch any of the files or even the allocation bitmap.

Re: Stereo reading mp3 files in wrong order (from USB pen-drive)

Reply #26
I used a tool called Fatsort for my old car stereo.  It basically rewrites the FAT (table of contents) in alphanumeric order.  On my 128GB flash drive with about 15,000+ tracks, it only took about a minute.

Thanks a lot! ; that fixed a annoying issue on my AGPTEK-U3(8GB) MP3 player with track listing order (which was one of the most obvious complaints I had with the device). it used to seem totally random, but now the MP3 track listing in all folders is listed as expected (like how it works on a typical file manager for a OS)...

'01. song name.mp3' to '02. song name.mp3' to '03. song name.mp3' and so on (which is how I setup Foobar2000 to output files I made converted from FLAC). before using that and just transferring the songs to the device/MicroSD card it seemed totally random as it could be something like... '04. song name.mp3' to '01. song name.mp3' to '09. song name.mp3' etc.

I got lucky stumbling into this thread as 'fatsort' works well on Linux (Linux Mint v20.1-Cinnamon) as it was easy enough to use, as after installing it (i.e. "sudo apt install fatsort" (or search for 'fatsort' in 'Software Manager' to install it)) with your device/memory (MicroSD etc) connected, you simply run the following two commands from terminal...

Code: [Select]
umount /dev/sdX
sudo fatsort -n /dev/sdX

NOTE (in relation to the above 'code'): where "X" is replaced with the location of your device/memory stick in FAT32 format. NOTE: a easy way to find the location of your device etc you want to use on 'fatsort' is to run the 'lsblk' (that's LSBLK) from terminal to find the location of your device first before running the 'code' stuff above. or if you don't want to use terminal for that just open the typical file manager as, at least in Mint v20.1-Cinnamon, you can simply hover mouse pointer over the connected device under the 'Devices' section in file manager and it will show you the exact location of the device.

then you just sit back and it goes through the directories of your FAT32 memory stick etc and once done I put the 16GB MicroSD memory card back into my AGPTEK-U3(8GB) MP3 player and when accessing the directories through the device they are listed normally now like how they are in a typical file manager on ones OS (Win/Linux) unlike before where it seemed totally random how things were ordered and was a little annoying.

p.s. I got some of that info from... https://fatsort.sourceforge.io/fatsort.1.html
For music I suggest (using Foobar2000)... MP3 (LAME) @ V5 (130kbps). NOTE: using on AGPTEK-U3 as of Mar 18th 2021. I use 'fatsort' (on Linux) so MP3's are listed in proper order on AGPTEK-U3.

Re: Stereo reading mp3 files in wrong order (from USB pen-drive)

Reply #27
Since you are using a mac rsync would probably work in place of robocopy, but I have never tested it.

This app seems to be the most used one among the free Mac alternatives to Robocopy. What do you think about it, from the description in the link?
`
I've encountered players like this before.  They don't care about tags, filenames or timestamps.  It is the order in the FAT on the USB stick that matters.

Format your USB stick so that it is empty.  Next, make sure your filenames sort properly then use robocopy to copy all your files and folders in one go.  That way they will be written out in alphabetical order.  If you want to add something you need to format and re-copy everything again to make sure the order is still correct.

Since you are using a mac rsync would probably work in place of robocopy, but I have never tested it.



I've tried everything on a Mac, including "fatsort" which I installed via Brew. "rsync" was the only one which worked. It actually reads (and writes) the directory in alphabetic order.
"rsync" actually works on a Mac! Thanx!

"rsync" is a complex command with many capabilities. I'll just post what worked for me, you're free to consult "man rsync" to see what's going on under the hood.

rsync -ravzh /absolute/path/to/source/directory /Volume/name_of_your_mounted-drive

MacOS mounts removable drives in the hidden directory /Volumes.

Re: Stereo reading mp3 files in wrong order (from USB pen-drive)

Reply #28
Did you run fatsort on the unmounted volume?  This always worked for me
Code: [Select]
fatsort -c -n /dev/<device>

Replace <device> with whatever your USB device is.

Re: Stereo reading mp3 files in wrong order (from USB pen-drive)

Reply #29
could be that this weird device orders files by the address of the actual content on disk?
that could also explain why re-doing a copy makes a difference while fatsort doesn't.
a fan of AutoEq + Meier Crossfeed

Re: Stereo reading mp3 files in wrong order (from USB pen-drive)

Reply #30
that could also explain why re-doing a copy makes a difference while fatsort doesn't.
As could operator error.  Re-doing a copy is a straightforward file operation; messing with the FAT requires an unmounted file system (in Linux).
It's your privilege to disagree, but that doesn't make you right and me wrong.

 

Re: Stereo reading mp3 files in wrong order (from USB pen-drive)

Reply #31
I suspect that this may be down to long-filenames of the music files and the way that compatibility is provided to legacy systems using unique 8.3 names. https://en.wikipedia.org/wiki/8.3_filename

Renaming the files, prepending a zero padded number, in the desired play-order may well fix the problem.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)