🎧 Success! Turning an Android Phone into an iPod Backup

If you’ve been following my blog for any length of time, you know I enjoy listening to music. Perhaps “enjoy” is too weak a word. I love listening to music. I have since I was a kid, and I would lug a briefcase of hand-recorded cassettes to camp. I jury-rigged my own cassette player to car interface in my first cars. I’ve used various Walkmen, Discmen, and finally iPod Classics … all in a quest to have all my music with me at all times. Further, I don’t want any of this streaming crap, where you are only leasing the music from the music companies at any time. I want my albums, with my album covers, when and where I want them without a dependence on an Internet connection. Albums in the cloud? Feh!

In this quest, I’ve modified my iPod Classics to remove the spinning hard disk, using the iFlash card to replace the hard disk with solid state memory. I used the iFlash Dual card to put in 2 256GB SD cards, making each iPod Classic have 512GB, or about 477-483 GiB. But there is a limitation on the iPod Classic software — it gets wonky and likes to reboot over about 42K tracks. So my iPods only have part of my collection. I have two iPod Classics, each with the same collection of music synced to iTunes regularly. If you need a good person to do iPod hardware mods in Southern California, let me know and I’ll get you in touch with my guy (who is out in Pasadena).

How many songs do I have? Right now, just over 56K.

So I’ve been searching for a solution to have all the songs on my phone. I will not use an iPhone. I don’t want to pollute and confuse the iTunes ecosystem. I’ve been using Android phones that can accept SD card storage. There are many mid-brand models that do — I’m currently using a Samsung A51 with a 512GB card.

Previously, I had been using the combination of iSyncr and Rocket Player from JRT Studio. But they sold their company about 2 years ago, and the new owners screwed the pooch and broke the software. I NO LONGER RECOMMEND iSyncr and Rocket Player. Under the new owners, Muma Studios, the software no longer works and is overpriced. The key advantage of their software and this combination was: (a) the player could play from storage; (b) the player had an equivalent of smart playlists; (c) it synchronized the music between my PC and Android, and (d) the synchronization tool could move metadata (ratings, last played, etc.) to and from iTunes.

I’m pleased to say that I’ve found a new solution. It isn’t turnkey — you’ll need to do a bit of fiddling and a sync takes about 1/2 hour. But it works. Here’s what you need:

  1. An Android phone with SD card storage. The Samsung A series works will (the high end line seems to not take SD cards). There were also some Motorolas and Pixels, as I recall from my last search. Here’s a search for appropriate phones.
  2. Syncthing. Syncthing is a continuous file synchronization program. It synchronizes files between two or more computers in real time, safely protected from prying eyes. There are versions of the software available for almost any platform, and it is free.
  3. Gone Mad Music Player. (Google Play). This is a customizable music player, with loads of skins, that supports the equivalent of smart playlists and can play music from SD card. There are a few limitations: the smart playlists aren’t as smart as in iTunes (that is: not all of fields you can test on in iTunes are available in GMMP); the ability to bookmark in a track works different (i.e., in GMMP you bookmark as you are playing to come back; in iTunes it is a “Remember Position” flag on a per-track basis (useful for podcasts and audiobooks; GMMP does have a setting that allows me to Auto-Bookmark all podcasts, which should work for me); there is no per-track “skip when shuffling” flag — instead, it is a global setting of Audio>Other>Stop After Each Track (yes, I know, not quite the same — I use skip when shuffling to create smart playlists of podcasts, and if every track is “skip when shuffling”, it stops after each track). But it’s about the best I can find. This has a small one-time fee to move from the trial version. That is well worth it.
  4. Perl. Either Strawberry Perl or ActiveState Perl; both are free for personal use. Perl is the tool I use for the script I wrote. Right now, I’m also using a Visual Basic script adapted from one written by Steve MacGuire (TuringTest2 on the Apple Support Forums (iTunes for Windows; iPod). I hope, one day, to move that functionality into perl as VBScript is being deprecated by Microsoft. That will also require me to understand better the iTunes COM interface.

Here’s how the process works for me right now.

Setup

  1. Synchronize your phone with Android. I’ve got syncthing set up to “mirror” my iTunes Media Library to the SD card on my phone (send only on the PC, receive only on the phone). This took a bit of figuring out to get the SD pathname correct.
  2. Get GMMP, and get it set up to look only in where you have stored your music on your phone. Do a scan to have it find all your music. Set up equivalent smart playlists in GMMP to your iPod playlists
  3. Add another directory to syncthing — this time, you want bi-directional syncing between the GMMP directory on your phone (in my case, /storage/emulated/0/gmmp) and a directory you create on your PC (in my case, it was d:\dpf\music\GMMP).
  4. Create a directory, GMMPStatFix, to hold the scripts and such (in my case, d:\dpf\music\GMMPStatFix\).

Updating.

  1. Synchronize iTunes and your phone. I don’t normally leave syncthing running, so I start it up on both ends and wait for everything to be synchronized.
  2. Start up GMMP on your phone and do a scan to find all the new tracks (Settings > Scan)
  3. Backup your Stats in GMMP (Settings > Backup > Backup Stats). This creates a stats.xml file, which syncthing then copies to the GMMP directory on your PC.
  4. Once stats.xml is copied to your PC, go into iTunes and Export your iTunes library into the GMMPStatFix directory (File > Export > Library). Save it as iTunes.xml
  5. Run the updatestats.bat file. This file runs both the perl script GMMPStatFix.pl and the VBScript ExportImport.vbs, which is a slightly modified version of Steve’s script (primarily, to work with ASCII files instead of Unicode). This is what the perl script does:
    1. Copies the stats.xml file from the GMMP directory to GMMPStatFix.
    2. Runs the perl script, which does the following: It slurps in the old stats.xml file, if it exists. It slurps in the new stats.xml file. It then chews that stuff with the iTunes XML file. This allows it to figure out the new information for the stats.xml file in terms of ratings, last played, and playcount (I don’t care about skip counts). It will also figure out when the ratings, playcount, and last played needs to be updated in iTunes. It will warn if there are computed Album Ratings, which I hate. It then generates a new stats.xml file, and a file of changes to be made to iTunes.
    3. The perl script also extracts all the playlists, and creates them in a subdirectory of GMMPStatFix called playlists. This includes the current (static) versions of smart playlists. These are all prefixed with (iT). To move the playlists to your phone, simply create a playlists directory in your Media library on your PC, and copy those playlists you want on your phone to that media library. When syncthing syncs, it will copy them over, and your next GMMP scan will add them to your GMMP library.
    4. The perl script lastly invokes ExportImport.vbs to make the changes to iTunes if there are changes to be made. I’m working on fixing the dialog boxes so it doesn’t confirm everything, but does output to STDERR what it is doing.
    5. Lastly, it copies the stats.xml file back into the GMMP directory.
  6. Syncthing then copies the stats.xml file back to the phone.
  7. Once stats.xml has been updated on the phone, go into GMMP and Settings > Restore Stats.
  8. Close syncthing on both sides if you want.

That’s it. Both sides updated.

If you want a current copy of the perl script and the modified VBScript script, just drop me a note at faigin -at cahighways -dot org, and I’ll get them to you (or comment here).

 

Share