Automating MusicIP with GenPuid
From SqueezeboxWiki
TBD
Contents |
Background
GenPuid is a command-line utility for generating the analysis data that the MusicIP mixer requires. GenPuid is part of the MusicDNS music recognition tools. GenPuid is free for non-commercial use.
Using this command-line interface has several advantages over the alternatives:
- It doesn't require Java, unlike the GUI interface for the mixer.
- Some people report it is faster than performing this analysis through the mixer.
- Since it is command-line driven it can be easily scheduled to run at convenient times.
This wiki page describes installation and use of this utility. Following these instructions means you need never access the MusicIP headless server web page. new music you add to your library will automatically be analysed by MusicIP. It won't happen immediately, though, but given the mixes are random you can't rely on the music you've just added appearing in your mixes anyway.
Before following these instructions you should have the MusicIP mixer installed and working as described here.
Downloading and Installation
this applies to Linux headless servers. This should also be possible on Windows - editors are encouraged to add those instructions to this page.
base some of it on http://musicbrainz.org/doc/genpuid
the first step to getting genpuid is obtaining a license key. Keys are free for non-commercial use and just require the creation of an account at the MusicDNS website here: https://secure.musicip.com/dns/license.jsp
Following registration the MusicDNS page on that website provides download links for GenPuid: https://secure.musicip.com/account-musicdns.jsp
document the example installation location of /opt/genpuid
mention that your system has to be able to run that binary (Linux x86 32-bit only, at time of writing, although ia64 might be able to run it with compatibility libraries).
Running the Scanner
mention the cache (must be readable by the mixer; if you want the mixer to be able to add to it through rescans then it should also be able to write to it)
An option you have when running the scanner is to archive the analysis. The archiving process writes identification information for the analysed music to the music file tags such that re-analysis of those files will complete very quickly if you have to do it in the future (eg because you've lost your MusicIP cache or you've reorganised your music file structure and want to rescan the new structure).
Analysis archiving is optional and is a tradeoff between security of losing them if the MusicIP cache is lost or corrupted (which may be important to you if you have a slow machine as the database may take a very long time to generate), and the risk of your music files' tags being corrupted by the GenPuid tool. Your author does not use archived tags as he finds the time to re-analyse the whole library is manageable, and the time to recreate tags would be very high indeed.
Archiving is achieved by adding the "-archive" option to the genpuid command.
give example command-line (can be the same line as in the cron.daily script below). this example doesn't use tag archiving
Scheduling Automatic Rescans
talk about adding a cron.daily
An example cron.daily script (called, for example, /etc/cron.daily/musicip) is shown below. This example does not use the archiving option (using it would simply mean adding "-archive" in the same way that the "-m3lib" option is already present):
#!/bin/bash
KEY=1234567890abcdef1234567890abcdef
CACHE=/var/cache/musicip/cache
MUSICDIR=/mnt/media/Music
GENPUIDDIR=/opt/genpuid
cd "${GENPUIDDIR}"
exec /usr/bin/nice ./genpuid ${KEY} -m3lib="${CACHE}" -r "${MUSICDIR}"

