HydrogenAudio

Lossy Audio Compression => MP3 => MP3 - General => Topic started by: gcalvo on 2015-10-17 19:28:48

Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: gcalvo on 2015-10-17 19:28:48
Hello everybody!

I am new to the forum and I am here to ask for your help, for I have been trying searching for a solution around the internet but with no eventual success. I am extremely new to this kind of stuff, and I really hope you guys can solve my problem.

For many years, since the "MP3 revolution" started, I have been listening to music only from my computer, and my biggest problem was to find the good speakers. In order to start using again my cd's and vinyls, I have recently bought a compact stereo system (Pioneer Pioneer X-HM11-S) which also has a USB input.

As the thread title suggests, the problem is that often the stereo plays the songs in a folder in the wrong order and, being I what I think you would call "album guy", I HATE THAT.

Searching on the internet I have found many advices regarding softwares for tagging and metadata editing, and I have installed one of these (Kid3) on my Macbook. Yet, I don't seem to understand how to use it correctly, because the problem is still there. I have tried with tutorials, guides and everything but none of these has really helped me. Probably I am too noob even to understand these explanations, I don't know.

Is there anyone who knows how to solve my problem and can give me some step-by-step instructions?

I thank you all in advance for your help and apologize if this topic has been already dealt with somewhere else in the forum.
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: JabbaThePrawn on 2015-10-17 22:13:16
Hard to say without more detail from you, but maybe the order your setup is playing the files is down to it ordering playback by filename instead of by the metadata's track numbers.

Or some software may require a zero before numbers 1 to 9. I don't know of any music software that does, but if I have 15 images, numbered 1 to 15, then my (rather old) graphics software will display them in order 1, 10, 11, 12, 13, 14, 15, 2, 3, 4, 5, 6, 7, 8, etc.

Not sure if that's as clear as I could have made it, but if you see any pattern in the playback that is alphabetical or matches the numbers thing, you might check the way your filenames are laid out.
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: KozmoNaut on 2015-10-17 22:14:50
Does your stereo understand and display tag information? If it doesn't do that, it's probably a "dumb" MP3 player that simply plays back the files in the order it finds them. The MP3 player I added to my car certainly does this. No matter the tags or file names, it will play back the files in the order they were originally written to the USB drive.
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: JabbaThePrawn on 2015-10-17 22:19:13
gcalvo, can you open the folder of one of your albums in the Mac version of File Explorer and look at the way the actual files are named? If you could copy'n'paste those filenames from a troublesome album into a post on here, it might give us an idea what needs to be done.
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: greynol on 2015-10-17 22:19:29
No matter the tags or file names, it will play back the files in the order they were originally written to the USB drive.

Have you tried changing the file creation date?
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: saratoga on 2015-10-18 01:59:41
Searching on the internet I have found many advices regarding softwares for tagging and metadata editing, and I have installed one of these (Kid3) on my Macbook. Yet, I don't seem to understand how to use it correctly, because the problem is still there. I have tried with tutorials, guides and everything but none of these has really helped me. Probably I am too noob even to understand these explanations, I don't know.


http://docs.pioneer.eu/Manuals/X_HM11_K_YO...manual/?Page=31 (http://docs.pioneer.eu/Manuals/X_HM11_K_YOM200149_0002_manual/?Page=31)

According to your players manual, it doesn't support file tags or playing songs in alphabetical order.  Instead it plays them in the order they're listed in the file system. 
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: Coreda on 2015-10-18 03:07:16
http://docs.pioneer.eu/Manuals/X_HM11_K_YO...manual/?Page=31 (http://docs.pioneer.eu/Manuals/X_HM11_K_YOM200149_0002_manual/?Page=31)

According to your players manual, it doesn't support file tags or playing songs in alphabetical order.  Instead it plays them in the order they're listed in the file system.


Quote from: Manual link=msg=0 date=
The order in which the folder and file names are displayed depends on the order in which the folders or files were recorded on the USB storage device


So it's either the data modified/created timestamp that is affecting the order, or possibly even some internal list. Whoever wrote this into the firmware was not thinking straight.
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: Hotsoup on 2015-10-18 03:37:05
I have to use a program called DriveSort (http://www.anerty.net/software/file/DriveSort.php)after I change the contents of my USB drive. I have a DEH6300UB.
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: washu on 2015-10-18 04:14:16
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.

Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: gcalvo on 2015-10-18 12:12:16
First of all, I would like to thank you all for your contributions and help, thanks a lot indeed!

Searching on the internet I have found many advices regarding softwares for tagging and metadata editing, and I have installed one of these (Kid3) on my Macbook. Yet, I don't seem to understand how to use it correctly, because the problem is still there. I have tried with tutorials, guides and everything but none of these has really helped me. Probably I am too noob even to understand these explanations, I don't know.


http://docs.pioneer.eu/Manuals/X_HM11_K_YO...manual/?Page=31 (http://docs.pioneer.eu/Manuals/X_HM11_K_YOM200149_0002_manual/?Page=31)

According to your players manual, it doesn't support file tags or playing songs in alphabetical order.  Instead it plays them in the order they're listed in the file system.


Weirdly enough, I hadn't checked that. Thanks, this certainly defines the problem and the possible solutions much more clearly.

Quote
gcalvo, can you open the folder of one of your albums in the Mac version of File Explorer and look at the way the actual files are named? If you could copy'n'paste those filenames from a troublesome album into a post on here, it might give us an idea what needs to be done.


Sure, here is one of the troublesome albums/folders:
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: gcalvo on 2015-10-18 12:44:26
Since you are using a mac rsync would probably work in place of robocopy, but I have never tested it.


This app (http://macdownload.informer.com/superduper3/) 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?
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: washu on 2015-10-18 16:11:45
This app (http://macdownload.informer.com/superduper3/) 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 can't see anything in the description that says it copies files in alphabetical order and I don't own a Mac to try it on.  Many programs do copy in the correct order so it is worth a try.  The important thing is to copy all your files in one go, so whatever copy program you are using can sort them.  The simplest way is to copy all the albums you want on the USB stick into a single folder on your HD first.
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: gottogo99 on 2015-10-18 19:20:51
I'm sure you need to use a program like Drivesort mentioned in post #8, but you are on a Mac.  Assuming you can't use a PC, have a look here:  https://discussions.apple.com/thread/4774960 (https://discussions.apple.com/thread/4774960), which leads to:  http://www.luisrios.eti.br/public/en_us/projects/yafs/ (http://www.luisrios.eti.br/public/en_us/projects/yafs/).
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: saratoga on 2015-10-18 20:05:45
Alternatively, rather than using some questionable device with a firmware from the late 1990s, plug in a phone, tablet Chromecast or some other modern playback device.  Then you don't have to bother with usb or fat32 file order at all.
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: DVDdoug on 2015-10-18 20:16:05
I have a cheap laptop plugged into my living room stereo/home theater system.    (My "main laptop" has an HDMI port and Blu-Ray drive, but it cost 3 times as much as the cheap one.)

An iPod would work too (with the headphone output or a docking interface).  I've got an iPod Classic with about 15,000 songs.  It "lives" in my car and plugs into my car stereos.  (Sometimes I move it to my 2nd vehicle.)  It costs a  lot more than a thumb drive but it holds my entire music library and "everything" is compatible with the iPhone dock interface, and you can take advantage of all the features (such as playlists).
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: [JAZ] on 2015-10-18 21:23:51
Alternatively, rather than using some questionable device with a firmware from the late 1990s, plug in a phone, tablet Chromecast or some other modern playback device.  Then you don't have to bother with usb or fat32 file order at all.


This is not the type of answer that I would expect from you.

If the user said "I've seen that device" or "I've bought something 2nd hand.." or "Recently someone gave me...", then guiding him to a more cappable device could be reasonable.

When the user says "I've recently bought xxx", when that xxx is not expensive but it's not free either, and when such device's manual says "© 2012", that answer doesn't help.

Of course, it doesn't help either that the user is on a Mac, because that also limits his possibilities on the applications side, because a Windows solution was already given, although there is now another one with multiplatform support.

Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: saratoga on 2015-10-18 21:37:00

Alternatively, rather than using some questionable device with a firmware from the late 1990s, plug in a phone, tablet Chromecast or some other modern playback device.  Then you don't have to bother with usb or fat32 file order at all.


This is not the type of answer that I would expect from you.


Why not?  He wants to play back file by album, which his stereo does not support.  Obvious answer:  use another device you already have that supports this via line out, or just spend a tiny fraction of what the stereo costs for a wifi streaming device. 


Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: greynol on 2015-10-18 21:38:18
What would help most is to have the parties responsible* fix the issue and refrain from selling garbage like this in the future.

I recommend the OP do his share and return the damn thing, listing this issue as the reason.

If that isn't possible then I recommend the OP give the product a scathing review, listing this issue as the reason and then buy one of these:
https://www.hydrogenaud.io/forums/index.php?showtopic=110158 (https://www.hydrogenaud.io/forums/index.php?showtopic=110158)

(*) I'm sure this thing was not only manufactured by a second- or third-party, but was probably designed by a second- or third-party as well.
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: gcalvo on 2015-10-20 12:57:54
Quick question: what happens if, instead of transferring the files to the USB device by using one of the mentioned softwares, I just select all the folders/albums together and copy them on the device simultaneously? I mean, just copy and paste but all the albums together.

I am asking because, and forgive my noobness, I am apparently not able to properly use any of the suggested programs. Both because I do not have a basic knowledge of the concepts (like "root" or "FAT" and so on) and because I don't have much time to invest in "studying" these things or the softwares' instructions in depth. It would be easier if I found a video tutorial of a similar operation on a mac, but I haven't
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: saratoga on 2015-10-20 17:05:44
Your PC will choose some song order for you.
Title: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: gcalvo on 2015-10-21 02:43:02
I have apparently solved the problem by following your advices, guys. Eventually, after having tried several applications (not even when I was a Linux user it took me so long to find a good and easy alternative to Win software), I have found this software (http://www.freefilesync.org/download.php), which I used to transfer all the albums in one go to the pen-drive. Finally all the tracks are where they are supposed to be.

Thanks a lot everybody for your help!
Title: Re: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: Wattt on 2021-04-04 21:52:46
KozmoNaut at reply #2 is correct.  My new Pioneer car stereo plays back in order of when file was "created" (not the original CD track creation date, but the creation (copying) of the file onto the USB drive), irrespective of other tags such as filename or title.  I confirmed this this using the app mp3tag.  You would think the player would sort by filename or the title field, but no.

Unfortunately, if you modify the created date using mp3tag (i.e., change the date/timestamp to a value that reflects your desired track order), it does not work.  You are only changing the display value for purposes of the app.  The underlying datestamp remains the same.

Then I discovered the DriveSort app, here: https://www.techmadeplain.com/2014/how-to-sort-music-flash-drive-car-stereo/.  Read the hyperlink describing the app, as you may have to also download a Windows 10 C++ update.  Then download and install the app.  Note that DriveSort uses filenames to sort the files.

Thus, before using DriveSort, you have to have name your tracks in such a way as to force them to sort in your desired sequence.  I used the app at https://sourceforge.net/projects/filerandomizer/files/latest/download to add random digits (two digits) to the beginning of the filenames to create an explicit random shuffle.

Once you have your files appropriately named, DriveSort will force-sort them to to the alphanumeric filename order for purposes of your player (at least, it worked with my Pioneer).  (I don't know how DriveSort overrides Pioneer's reliance on the datestamp of the track, but whatever, it works.)
Title: Re: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: Porcus on 2021-04-04 22:40:31
KozmoNaut at reply #2 is correct.  My new Pioneer car stereo plays back in order of when file was "created" (not the original CD track creation date, but the creation (copying) of the file onto the USB drive), irrespective of other tags such as filename or title.  I confirmed this this using the app mp3tag.  You would think the player would sort by filename or the title field, but no.

Well the thread is five years. But your new car stereo ... does that mean new as in recently produced, or recently acquired in your second-hand car?


(I don't know how DriveSort overrides Pioneer's reliance on the datestamp of the track, but whatever, it works.)
Likely because everything you wrote about datestamp is incorrect.
Imagine a defragmenter. It will move files around on your hard drive. Of course, that means it writes the data anew and then it updates the pointer and the metadata in the file allocation table.
If the player traverses the device from first block, then rewriting the whole thing in correct (=desired) order will fix the problem.
Title: Re: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: kode54 on 2021-04-05 04:38:01
Maybe it relies on the order of the directory entries, which aren't sorted in any particular order on FAT, except that long filename entries are grouped by their actual file.
Title: Re: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: Replica9000 on 2021-04-06 23:49:59
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. 
Title: Re: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: kode54 on 2021-04-07 02:02:22
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.
Title: Re: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: ThaCrip on 2021-04-16 08:35:32
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
Title: Re: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: smatiauda on 2023-10-28 04:53:14
Since you are using a mac rsync would probably work in place of robocopy, but I have never tested it.

This app (http://macdownload.informer.com/superduper3/) 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.
Title: Re: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: Replica9000 on 2023-10-28 14:40:01
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.
Title: Re: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: magicgoose on 2023-10-29 20:21:04
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.
Title: Re: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: fooball on 2023-10-30 06:41:08
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).
Title: Re: Stereo reading mp3 files in wrong order (from USB pen-drive)
Post by: Nick.C on 2023-10-30 07:46:53
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.