2010-09-18

Nokia music library fix bash script

In my last post, I outlined a fix to a problem with Nokia E-series phones in which the music library fails to refresh if music files with certain properties are present.  I also mentioned:
I have saved a bash script in the root of my memory card which I can run at any time if I accidentally transfer new "bad" mp3s to my phone in the future.
Below are instructions to create and use this script.

First, create a text file in your Linux distribution - in Ubuntu, this simply involves opening gedit from the Applications menu or the command line.

Next, paste the text below into the empty file:
#!/bin/bash

# This script removes POPM frames from mp3 files so the Nokia music library does not choke on them.
# After the files are processed, the music library files are removed from the phone to force a refresh.
# This script should be placed in root of microSD card and run from there (i.e. when it is mounted as a filesystem).
# See http://e63tips.blogspot.com/2010/05/solution-to-music-library-does-not.html for more information.

if dpkg -s python-mutagen 2>/dev/null 1>/dev/null; then
    echo "Package python-mutagen is installed."
else
    echo "Installing python-mutagen..."
    gksudo apt-get install python-mutagen
    echo "Installation complete!"
fi
echo "Removing POPM frames from mp3 files in Music folder"
find Music/ -iname '*.mp3' -iname *.mp3 -exec mid3v2 --delete-frames=POPM '{}' \; &&
rm Private/101FFC31/mpxv1.mpd && rm Private/101ffca9/harvesterdb.dat
exit
Don't forget to replace /Music with the path to the top-level folder on your phone.  Now mount your phone via USB (or mount the microSD card using a card reader) and save the file to the root directory of the mounted filesystem as, for example, music_fix.sh.

Ensure that you make the script executable.  In Ubuntu, the an easy way to do this is to right-click on the saved file in Nautilus, choose Properties, click on the Permissions tab, and tick the checkbox next to the "Allow executing file as program option."

Now, if the music library refresh problem ever recurs, you can simply mount the phone or memory card and run this script.  In Ubuntu, you can do this by double-clicking on the file in Nautilus and selecting "Run in Terminal."

2 comments:

  1. hi jon!
    there is tis strange problem which many users of nokia e63 are facing....the problem is that while surfing internet on pc through the phone, it restarts/reboots itself in say 5-10 minutes...
    no amount of resetting helps and even when nokia care re-installs the os the problem persists.
    could u please take a look?

    ReplyDelete
  2. Sorry shubham, that problem is well beyond my capability, and anyway I no longer use an E63 - I have moved on to an Android phone. Good luck though!

    ReplyDelete