One of the cool things about the 3rd Gen Mazda 3’s is the Connect infotainment system. One of it’s capabilities is to play MP3 files off of a thumb drive inserted into one of it’s USB ports.
But, it has a problem with properly ordering the songs in an album for some reason. Here is the list from Black Sabbath’s Live Evil when selected in the album list:
NOTE: I’m assuming you have at least a basic understanding of Bash Shell scripting.
If you wanted to make an m3u file for each of the bands on your list, you could do something like:
for i in *
echo processing $i …
cd “$i”
find * -name ‘*.mp3’ -print | sort > “$i”.m3u
cd ..
done
This would create a <band_name>.m3u file in each directory of the band ( at the same level as the albums ).
Now, remember when I said for some reason the individual songs of each album was out of order when you selected artist->album ?
This can help with that too! By extending the album loop, using a tool like eyeD3 to read the id3 tags to get the track information. Being clever, you can even properly handle albums with multiple CD’s:
for band in *
do
cd “$band”
for album in *
do
unset list
declare -a list
echo processing $band – $album …
for song in *.mp3
do
track=$( eyeD3 –no-color “$song” 2>/dev/null | grep -oP ‘^track: Kd+’ )
disc=$( eyeD3 –no-color “$song” 2>/dev/null | grep -oP ‘^disc: Kd+’ )
if [ -z $disc ]; then disc=1 ; fi # no disc information
index=$(( disc*100 + track )) # handle more multi-disc albums
list[$index]=”$song”
done
for i in $( echo ${!list[@]} | sort -n )
do
echo “${list[$i]}” >> “$album”.m3u
done
cd .. # back to album list
cd .. # back to band list
done
And now, when selecting the Live Evil the play list menu …
The songs are in the correct order, just as they should be!
Some sample scripts, which are more complete, and better commented, then the examples presented here, as well as other ones, can be found in the Github Repository:
Have you tried out smaller USB drives (e.g. 4GB or 8GB) at reducing the boot time before music is playable? It takes nearly a minute until music is playable for me, 32GB drive, about 18GB of music on it (2017, latest infotainment software per dealership). I am considering maybe splitting up some music on 4 or 8GB drives, if they work better. Kind of like swapping CDs. 🙁 But the boot-up time is really irritating. Planning to check the scripts out! Thanks for posting this!
I’ve only used 16 and 32 gig drives. And noticed the index time is ridiculous. Never thought of trying smaller drives. Let me know who it works.