DEV Community

Shuffle Fail: Fixing my car stereo with code!

James Turner on December 28, 2018

Background I have a 40-ish minute commute to work and love blasting music in my car (sorry if you were in the car next to me). I bought ...
Collapse
 
phlash profile image
Phil Ashby

Nice workaround :)

Did you consider re-ordering the directory entries, rather than bulk copying many GB to the USB? Assuming it's FAT, then it's well documented.. should still be easier than reversing the car radio!

Collapse
 
turnerj profile image
James Turner

Nope, I didn't consider doing that though it would be a lot more efficient! My method does take a several minutes to run currently where really I am only wanting to shuffle my music and sync any new music to it.

I haven't tried to play with a file system at a lower level like that before though now that you've brought it up, the thought does intrigue me and maybe I'll do a followup post if I do it. :)

Collapse
 
phlash profile image
Phil Ashby

Actually it occurs to me that plain old renaming should do the trick - move (aka rename) to a temporary folder, then move back in desired order - this re-writes the directory, no special knowledge required :)

Collapse
 
turnerj profile image
James Turner

Yeah, the title is a little disingenuous. While it would totally be interesting to work out how to modify the embedded code (and maybe I will at some point just for fun), what I came up with got me close enough to my goal that I didn't try to pursue other options.

Hopefully it was a somewhat interesting article nonetheless 🙂