X3 Library Hack! Super fast library update, proper tag (ID3 v2) & playlist support!
Apr 19, 2014 at 1:54 PM Thread Starter Post #1 of 15

angelosc

New Head-Fier
Joined
Apr 19, 2014
Posts
6
Likes
13
As a previous iPod Classic owner, I have a very well maintained iTunes library.
 
When I considered the X3, I knew there would be a few problems:
1. No official tool to sync the X3 on my Mac (easy work around with rsync and USB mass storage)
2. Library support is built into X3 instead of the host computer (I assume I could just update the library on the X3)
3. No playlist support (I didn't feel it was that) important
 
But once I got the X3, there were more problems than anticipated:
1. iTunes maintains ID3 v2.4 tags and leaves the ID3 v1 tags untouched, v1 tags are either broken due to encoding or outdated
2. X3 only reads ID3 v1 tags with GB18030 encoding
3. Library updates on X3 takes forever... 
4. Playlist support is quite important, esp when the UI on X3 is not as easy to navigate as on the iPod
 
I tried fixing the problem by copying the ID3 v2 info to ID3 v1, which causes loss of info (UTF-8 vs GB18030, 15-character field width etc).
X3 also had issue reading info like genre, etc, from M4A files.
 
So I set off to make my own tools in fixing the above issues, with the following targets and assumptions:
1. Unicode library support for MP3 (ID3 v2.4), M4A (AAC & ALAC)
2. Much faster library refresh using CPU on Mac / PC (6000 songs update in less than 2 min)
3. Piggyback M3U playlist support into Library/Album section
4. Runs on Mac (maybe Linux & other Unix-like system too, not tested)
5. Correct track ordering when viewed in album mode
–. Currently no plan to support FLAC & cue sheet in library as they are not supported by iTunes and thus does not exists in my library
 
https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-prn1/t1.0-9/10258086_10152319469225758_7343830039475598923_n.jpg
*Above: The first 3 items, preceded by a "." in their name in this view are playlists imported from M3U files.
 
I have most of the functions written (in Python) and right now mostly bug free (as far as it works on my iTunes library).
But it's still work in progress and requires quite some polish for your grandma to use:
1. No GUI, CLI only
2. Requires manual configuration (needs to install an extra program and Python packages)
3. Bugs? Maybe
 
It will probably work on other folder structures besides iTunes.
If there are people who are interested, I may just release the code.
 
Anyone?
 
Apr 23, 2014 at 12:49 PM Post #7 of 15
Sorry, I was too occupied by work and being sick for the last 2 days.
 
tjw321 & fburgos01, thank you very much for your interest, I have just posted the code to GitHub:
https://github.com/angelos-se/X3LibTool
 
You may download the code either using the GitHub application or use the "Download ZIP" button on the right.
There are 2 more tools needed before the code will run:
AtomicParsley http://sourceforge.net/projects/atomicparsley/
eyeD3 http://eyed3.nicfit.net
 
Usage:
In Terminal, change directory to the folder where your files are stored (eg: I copy (rsync) my whole iTunes music folder to my Fiio, so I just do cd ~/Music/iTunes/iTunes Music/Music) and run the code (I save my code at ~/X3LibTool/CreateDB.py, so I execute ~/X3LibTool/CreateDB.py)
 
Once the code finishes running, it will place the usrlocal_media.db file on your desktop, and you'll just need to copy that file onto the internal storage of your Fiio X3.
 
If you encounter error on line 175, it probably means that you are running the script from the working directory and the script cannot find any of your music files.
* The code running happily.
 
Apr 24, 2014 at 8:12 AM Post #9 of 15
Both dependencies are available for Windows, but I don't have a Windows PC to test. You are welcomed to try it out. (I'm guessing some of the path needs to be changed.)
If you can tell me what breaks, or better yet send in patches, I'm more than happy to integrated them into the code.
 
Apr 25, 2014 at 11:45 AM Post #10 of 15
Just an update for some Win32 porting efforts.
 
Somehow it looks like the CMD shell or something else in Windows is not handling Unicode file names properly.
http://stackoverflow.com/questions/3789924/python-os-walk-and-japanese-filename-crash
 
I can run the script after patching a few lines here and there but it only works with English file names...
 
 
Aghhhhhh... Windblow always...
 
May 14, 2014 at 2:13 AM Post #11 of 15
Im in ubuntu but i think im doing something wrong

I put the createdb.py on the directory of the music and type CreateDB.py and the output is command missing


Sent from my GT-I9192 using Tapatalk
 
May 14, 2014 at 2:16 AM Post #12 of 15
Im in ubuntu but i think im doing something wrong

Instaled the eyeD3-0.7.4 as instructed by the webpage

Then downloaded atomicparsley and put the binary in /usr/bin

On terminal

I put the createdb.py on the directory of the music and type CreateDB.py and the output is command missing


Sent from my GT-I9192 using Tapatalk


Can't edit ill quote myself

Sent from my GT-I9192 using Tapatalk
 
May 28, 2014 at 2:52 AM Post #13 of 15
Hi,
 
i forked your github repo and added FLAC and AIFF support. Please review my pull-request.
 
https://github.com/angelos-se/X3LibTool/pull/1
 
Are there any ideas what we should add next to the tool?
 
Regards,
Andi
 
Jul 19, 2014 at 9:07 PM Post #14 of 15
The command not found in ubuntu is die to the fact, that the current directory is not in the search path. Use './script.py' (if the script is equipped with a first line giving the path to python) or 'python script.py'.
Another possible cause: your location of python is different than that given in the script. In this case simply correct the path.
- notdarkyet
 
Jul 20, 2014 at 10:49 AM Post #15 of 15
I am looking to try to get this up and running on windows since my X3 library does not seem to update very well using 2.1 firmware.  If anyone has this up and running, please let me know if there are any issues.  I am going to install the two python apps and python for windows.  Anything else?
 

Users who are viewing this thread

Back
Top