Model Year 2018 and Newer I've solved the USB alphabetic playback problem, sort of.

  1. Welcome to Subaru XV Crosstrek Forum – General discussion forum for the Subaru XV

    Welcome to Subaru XV Crosstrek Forum - a website dedicated to all things Subaru XV.

    You are currently viewing our forum as a guest, which gives you limited access to view most discussions and access our other features. By joining our community, at no cost, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is free, fast and simple, Join Subaru XV Crosstrek Forum today!
     
Results 1 to 10 of 10
Like Tree1Likes
  • 1 Post By dwasifar

Thread: I've solved the USB alphabetic playback problem, sort of.

  1. #1
    Senior Member
    Join Date
    Jan 2019
    Posts
    247

    I've solved the USB alphabetic playback problem, sort of.

    As many others have discovered, USB flash drive playback is stupid.

    On my car, it ignores the folder structure and the track numbers in favor of indexing every mp3 file on the drive alphabetically and playing them in that order. I have to wonder, whose brainiac idea was that? Who would sit down and deliberately code for this? But I digress.

    After a fair amount of experimenting and some wheel-reinventing, I confirmed that currently the only way to preserve one's desired playback order is to add sequential prefixes to the title fields of the ID3v2 tags.

    Doing that manually in a tag editor would be tedious beyond belief. So I scripted the process, using not only numeric characters but also alpha and special ASCII characters in the prefixes. Using those extra characters allows the script to index up to 4225 tracks with only a two-character prefix, leaving more room on the display to show the actual title.

    I start by assembling the desired folder structure by copying tracks and folders into a staging folder. Then I run the script. It does any necessary renaming to make the folders and files compatible with a standard FAT32 flash drive, then copies them onto the USB stick one at a time, adding the appropriate title tag prefix to preserve the sort order, and syncing the write after each file to prevent other kinds of sequencing problems. All I have to do is wait for it to finish.

    I'm glad to share the script with whoever wants it. But there's a catch. It's written for Linux.

    If you run Linux, good on you, and you can use the script pretty much as it is, after adding a package or two from your repositories.

    If you're a Mac user and reasonably technical, you might be able to adapt the script for use on your platform.

    Windows users can't run this script, sorry; but if you're a programmer you might look at it to see how you could reproduce it in Windows.

    Just send me a PM if you're interested.

  2. Remove Advertisements
    Subaru XV Forum
    Advertisements
     

  3. #2
    Member
    Join Date
    Jan 2018
    Location
    Denver
    Posts
    92
    The alphabetical sorting blew my mind when I bought this car. As a firmware engineer, I also can't wrap my head around how anybody thought this was a good idea. It's almost harder to do it this way than the millions of other approaches that all make more sense than alphabetical order.

    I gave up on USB drives and have instead just gotten in the habit of using Android Auto, unfortunately. Otherwise I'd probably give your solution a shot. I wish there was a way to leave a USB drive plugged in to use as a backup if my phone wasn't plugged in.

  4. #3
    Junior Member Cpt_Floyd's Avatar
    Join Date
    Oct 2016
    Location
    Mesa, Arizona
    Posts
    20
    I have 2 - 64 Gig flash drives each about 90% full of .mp3's in the subi at any time.

    I have them sorted by: each artist is a folder, each album is a folder in that folder.
    I did at one point use windows media to play these on my windows machine here at work if that makes any difference.

    mine are listed, by album, then the songs are listed in the proper order when you navigate to LIST and tap into the album folder.
    or they play in the order listed when you navigate to a different album.

    so not sure what'chall been partaking of, but so glad I don't have the issues with my music you all do.
    anyone wants to come out to the desert I will let you try out one of my drives, just to check.
    I do keep one plugged into the USB port located under the arm rest at all times.
    never tried playing one from the console USB port. going to have to give it a shot...
    And if the band you're in starts playing different tunes
    I'll see you on the dark side of the moon.

  5. Remove Advertisements
    Subaru XV Forum
    Advertisements
     

  6. #4
    Member
    Join Date
    Nov 2015
    Location
    Massachusetts
    Posts
    40
    So just a quick thought........ good job, to begin.

    As I understand how you explain the process, I would change it from writing the new tags as you copy the file to the flash drive one by one to editing the tags of all the files and then copying the files.. it's such a small change and almost meaningless but I personally would want all my tags edited on the hard drive first and then proceed to a copying function...

    I've never needed to rename tags for sorting/playback reasons but I've worked with id3 tags in some programs I've developed in the past, ages ago it seems, and could port/clone this for Windows if there was a widespread desire to have such a function.

  7. #5
    Member
    Join Date
    Jan 2018
    Location
    Denver
    Posts
    92
    Quote Originally Posted by Cpt_Floyd View Post
    I have 2 - 64 Gig flash drives each about 90% full of .mp3's in the subi at any time.

    I have them sorted by: each artist is a folder, each album is a folder in that folder.
    I did at one point use windows media to play these on my windows machine here at work if that makes any difference.

    mine are listed, by album, then the songs are listed in the proper order when you navigate to LIST and tap into the album folder.
    or they play in the order listed when you navigate to a different album.

    so not sure what'chall been partaking of, but so glad I don't have the issues with my music you all do.
    anyone wants to come out to the desert I will let you try out one of my drives, just to check.
    I do keep one plugged into the USB port located under the arm rest at all times.
    never tried playing one from the console USB port. going to have to give it a shot...
    I'm not sure exactly how my head unit handled USB drives because I gave up so long ago, but I remember my biggest gripe was that it was literally impossible to get it to play albums in album order. I organize my music the same way you described- folders by artist, subfolders by album. Full ID3 tags, and the filenames are such that sorting the album directory by filename order would result in the mp3s being in the correct order. I seem to remember being able to navigate to a specific album, but the album would then play in alphabetical order. I also don't think I could get it to auto-play the next album like my aftermarket head unit in my old Honda Civic used to do.

  8. #6
    Junior Member Cpt_Floyd's Avatar
    Join Date
    Oct 2016
    Location
    Mesa, Arizona
    Posts
    20
    someone want to explain how to get deep into the tag stuff, maybe I could print out something that might help,
    One thing I noticed that I still have to try harder to do, is that this is in the 18+ section, and I do have a 2016.......
    feel like a little kid or something, lol.
    Last edited by Cpt_Floyd; 04-24-2019 at 10:07 PM.
    And if the band you're in starts playing different tunes
    I'll see you on the dark side of the moon.

  9. #7
    Senior Member CRAZYHAWK's Avatar
    Join Date
    Jul 2015
    Location
    NORTHERN NJ
    Posts
    983
    I would try this in iTunes.
    Right click on a track.
    Right click on Song Info,
    Add characters to the song.
    2016 Crosstrek Limited Crystal White / Black leather
    (GRD - 23) Moonroof Package W/Navigation/Eyesight
    Auto-dim Mirror/Homelink + Alarm/shock sensor + Side moldings

    Polk Audio DB651 front speakers + de Auto Key 5000k HID kit
    Alla Lighting LED backup 921 800 Lumen
    Philips 9011 HIR1 Diode Dynamics XML2 5000k Fog Lights
    SpyTec A118-C Dash Cam

  10. #8
    Senior Member
    Join Date
    Jan 2019
    Posts
    247
    Quote Originally Posted by JustSubn View Post
    So just a quick thought........ good job, to begin.

    As I understand how you explain the process, I would change it from writing the new tags as you copy the file to the flash drive one by one to editing the tags of all the files and then copying the files.. it's such a small change and almost meaningless but I personally would want all my tags edited on the hard drive first and then proceed to a copying function...
    I have reasons for doing it that way.

    One of the other quirks of flash drives is that to reliably get things off them in order, you have to write them individually in order, and then sync the write each time. If you just issue a bulk copy command to the OS, the OS will write them in whatever order it wants to, and they may not read sequentially.

    So since I have to loop through the file list to do the writes anyway, it makes more sense to do both operations in one loop rather than do two loops (one to rename and another to write) and hope they stay synced.

    Also, I don't really want to alter the tags on the files in the staging folder, because if I run the script again on the same files, it'll put a prefix on a prefix. So what the script actually does is make a temp copy of a file, alter the tag on the copy, and write the copy to the USB stick, and likewise for the next file and on through the list. By the same token, to be precise, it renames the files to FAT32 compliance upon copy, not in the staging folder. I didn't go into those details because I didn't expect anyone to call me on it. I'm impressed that you thought it through.

  11. #9
    Senior Member
    Join Date
    Jan 2019
    Posts
    247
    Quote Originally Posted by CRAZYHAWK View Post
    I would try this in iTunes.
    Right click on a track.
    Right click on Song Info,
    Add characters to the song.
    A thousand times?

  12. #10
    Senior Member
    Join Date
    Jan 2019
    Posts
    247
    Quote Originally Posted by Cpt_Floyd View Post
    someone want to explain how to get deep into the tag stuff, maybe I could print out something that might help,
    Well, in Linux, I'm using a commandline utility called id3v2. With that utility, you can dump the raw tag data from any file and see what's really in it, not just what your music player tells you about; and you can add, delete, and modify the contents of tags with text commands. It has a brief self-contained help section that explains how to use it and how to get more information on what the various tag frames mean.

    Add to that a shell scripting language like bash, and that's all I really needed.

Similar Threads

  1. ['18+] My 2 USB ports in the console sort of stopped working.
    By MiniSQ in forum Interior, Audio, and HVAC
    Replies: 13
    Latest Post: 11-28-2017, 04:04 PM
  2. USB music playback on the OEM headunit is a buggy mess
    By aerdil in forum Interior, Audio, and HVAC
    Replies: 5
    Latest Post: 12-11-2015, 02:03 PM
  3. USB playback issues with stock stereo
    By bbawden in forum Interior, Audio, and HVAC
    Replies: 1
    Latest Post: 07-16-2015, 03:26 PM
  4. I've Owned Cars before, my Crosstek XV is the first car I've loved
    By psusubes in forum Subaru XV General Discussion Forum
    Replies: 4
    Latest Post: 10-18-2014, 01:17 PM
  5. Music pauses during playback via USB
    By jsnyd in forum Interior, Audio, and HVAC
    Replies: 0
    Latest Post: 02-10-2014, 03:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBadvanced CMPS v4.1.2