<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Xaprb &#187; Music</title>
	<atom:link href="http://www.xaprb.com/blog/category/music/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xaprb.com/blog</link>
	<description>Stay curious!</description>
	<lastBuildDate>Thu, 09 Feb 2012 03:58:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to digitize records with Ubuntu, a USB Turntable and Audacity</title>
		<link>http://www.xaprb.com/blog/2008/08/30/how-to-digitize-records-with-ubuntu-a-usb-turntable-and-audacity/</link>
		<comments>http://www.xaprb.com/blog/2008/08/30/how-to-digitize-records-with-ubuntu-a-usb-turntable-and-audacity/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 22:18:21 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Audacity]]></category>
		<category><![CDATA[easyTAG]]></category>
		<category><![CDATA[FLAC]]></category>
		<category><![CDATA[HP Media Vault]]></category>
		<category><![CDATA[Ion]]></category>
		<category><![CDATA[LP Records]]></category>
		<category><![CDATA[MP3]]></category>
		<category><![CDATA[OGG]]></category>
		<category><![CDATA[Sennheiser]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[USB Turntable]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/2008/08/30/how-to-digitize-records-with-ubuntu-a-usb-turntable-and-audacity/</guid>
		<description><![CDATA[I&#8217;ve been digitizing my LP collection recently and thought I&#8217;d share a quick howto, since I haven&#8217;t seen a good complete tutorial on the whole process online. Hopefully this will show up on Google and people can find it. It takes time Before I begin, I want to make a few comments about the process [...]


<strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2006/04/28/how-to-find-next-and-previous-records-in-sql/' rel='bookmark' title='Permanent Link: How to find next and previous records in SQL'>How to find next and previous records in SQL</a></li>
<li><a href='http://www.xaprb.com/blog/2010/01/05/switching-from-ubuntu-to-fedora-and-thunderbird-to-claws-mail/' rel='bookmark' title='Permanent Link: Switching from Ubuntu to Fedora, and Thunderbird to Claws Mail'>Switching from Ubuntu to Fedora, and Thunderbird to Claws Mail</a></li>
<li><a href='http://www.xaprb.com/blog/2007/07/24/ubuntu-on-dell-inspiron-1501/' rel='bookmark' title='Permanent Link: Ubuntu on Dell Inspiron 1501'>Ubuntu on Dell Inspiron 1501</a></li>
<li><a href='http://www.xaprb.com/blog/2008/11/05/how-to-set-up-host-interface-networking-for-virtualbox-on-ubuntu/' rel='bookmark' title='Permanent Link: How to set up host interface networking for VirtualBox on Ubuntu'>How to set up host interface networking for VirtualBox on Ubuntu</a></li>
<li><a href='http://www.xaprb.com/blog/2008/10/22/how-to-swap-caps-lock-and-esc-keys-in-ubuntu/' rel='bookmark' title='Permanent Link: How to swap Caps-lock and Esc keys in Ubuntu'>How to swap Caps-lock and Esc keys in Ubuntu</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been digitizing my LP collection recently and thought I&#8217;d share a quick howto, since I haven&#8217;t seen a good complete tutorial on the whole process online.  Hopefully this will show up on Google and people can find it.</p>

<span id="more-557"></span>

<h3>It takes time</h3>

<p><a href="http://www.amazon.com/gp/product/B001B9SH4U?ie=UTF8&#038;tag=xaprb-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=B001B9SH4U" style="float:right"><img src='http://www.xaprb.com/blog/wp-content/uploads/2008/08/ion_lp_to_cd.jpg' alt='Ion LP to CD converter' /></a>Before I begin, I want to make a few comments about the process overall.  I&#8217;ve borrowed the turntable I&#8217;m using (actually borrowed two, from different people) and read a lot on the Internet about this.  It strikes me that most people posting on the forums underestimate how much time it takes to convert LPs to digital form.  Sometimes there is no way to just replace the LP with a CD, but I&#8217;ve decided to do so in many cases.  I suppose another alternative is to get a system that&#8217;s more automated, such as the one I&#8217;ve linked at the right.  Maybe that helps take some of the tedious time-consuming steps out of it.  But I haven&#8217;t tried it.  I think it&#8217;s worth it for some of my LPs that are not available on CD, or that cost upwards of $50 on CD.</p>

<p>I also read on the internet about someone who played their LPs at 45RPM and then pitch-shifted them back to normal speed.  This person reported there was no audible difference between doing this and recording the music at 33.3RPM.  I listened to the files they&#8217;d posted and I have to say I thought the difference was as plain as day.  Perhaps they were not listening over decent-quality speakers or headphones.  But the 45RPM file sounded utterly <em>horrible</em> to me.  I don&#8217;t think this is a good technique at all.</p>

<p>In short, I doubt it can be sped up.  Just count on it taking time.</p>

<h3>Set up the equipment</h3>

<p><a href="http://www.amazon.com/gp/product/B000PZQPP4?ie=UTF8&#038;tag=xaprb-20&#038;link_code=as3&#038;camp=211189&#038;creative=373489&#038;creativeASIN=B000PZQPP4" style="float:right"><img src='http://www.xaprb.com/blog/wp-content/uploads/2008/08/ion_usb_turntable.jpg' alt='Ion USB Turntable' /></a>Aside from your computer, you really need nothing else than a USB turntable.  The most popular ones seem to be those made by Ion, aka Numark.  I&#8217;ve pasted an Amazon product link to the right for one of the ones I am currently using.  The other I&#8217;m using is a slightly different model from the same company.</p>

<p>There are other ways &#8212; you don&#8217;t have to use a USB turntable.  You can use a higher-quality turntable and put the input into your sound card, and so on and so on.  But this is how I&#8217;m doing it.</p>

<p>When I plugged the turntable into my USB port, I saw the following in dmesg:</p>

<pre>[ 2813.605274] usb 4-1: new full speed USB device using ohci_hcd and address 2
[ 2813.694013] usb 4-1: configuration #1 chosen from 1 choice
[ 2813.697148] input: Burr-Brown from TI USB Audio CODEC  as /devices/pci0000:00/0000:00:13.3/usb4/4-1/4-1:1.3/input/input13
[ 2813.721924] input,hidraw3: USB HID v1.00 Device [Burr-Brown from TI USB Audio CODEC ] on usb-0000:00:13.3-1
[ 2813.901813] usbcore: registered new interface driver snd-usb-audio</pre>

<p>And that was it.  No further ado, no drivers required.  You may recognize the name <a href="http://en.wikipedia.org/wiki/Burr-Brown_Corporation">Burr-Brown</a>.  They make a lot of analog-to-digital (and vice versa) converters.</p>

<p>The next step is to get some recording software.  I used <a href="http://www.audacityteam.org/">Audacity</a> for recording the LPs.</p>

<pre>sudo apt-get install audacity</pre>

<p>This installed libflac++6 also.  I configured Audacity by selecting Edit-Preferences, and in &#8220;Recording&#8221; selected the &#8220;ALSA: USB Audio CODEC: USB Audio (hw:1,0)&#8221; input.  On my computer I had trouble enabling playthrough (a feature that lets you listen to what you&#8217;re recording).  So I left that unchecked.</p>

<h3>Record the LP</h3>

<p>Actually recording the LP is straightforward.  Just start Audacity recording, then start the turntable and lower the needle.  I&#8217;m not going to tell you about cleaning the LP and all that&#8230; you probably know it already.</p>

<p>Once you have recorded some music, you probably want to chop it up into individual songs and export them as MP3, OGG, or FLAC.  (I&#8217;m loving FLAC.  <a href="http://www.xaprb.com/blog/2008/08/02/how-i-hacked-the-hp-media-vault-to-support-ogg-and-flac-files/">My HP Media Vault streams FLAC</a> to me via iTunes or Rhythmbox just fine.)  I experimented with a variety of ways to do that.  I settled on the following method.</p>

<ol>
<li>Record the first side, then press Stop and flip the LP over.  Press Record again and record the other side.  I do this because when I export the songs, Audacity embeds the song number in the song&#8217;s meta-data, and if I record one side at a time I get two sets of songs which begin at track number 1, which is a hassle.  Each side will be recorded in a separate track in Audacity.</li>
<li>Trim the silence (and the noise of the needle dropping, etc) from the start and end of each side&#8217;s music.  You can just highlight it with your mouse and press Delete.</li>
<li>Find the start of each song.  (Hint: you can use the Home and End keys to move the cursor all the way to the start and end of the whole recording.)  Put the cursor where you want in the track by clicking into the track.  You can use the arrow keys to move it to the left and right for fine adjustments, and zooming in and out is helpful too of course.</li>
<li>Label the start of each song by pressing Ctrl-B and typing the song&#8217;s name.</li>
</ol>

<p><a style="float:right" href='http://www.xaprb.com/blog/wp-content/uploads/2008/08/audacity_vinyl_digital.png' title='Audacity after recording both sides and labelling songs'><img src='http://www.xaprb.com/blog/wp-content/uploads/2008/08/audacity_vinyl_digital.thumbnail.png' alt='Audacity after recording both sides and labelling songs' /></a> When you&#8217;re done, the result should look like the image on the right.  Now you&#8217;re ready to export the files.  </p>

<p>Use File-Export Multiple to do this.  Choose the type of files you want to create and adjust the settings if you wish.  To make sure each labeled song becomes its own file, select the option to split the file based on labels, and name the files using the label/track name.</p>

<p>During the export process you&#8217;ll also get the chance to edit the recording&#8217;s meta-data, such as the artist and album name.  This is fine, but the dialog box to do this is touchy &#8212; if you press Enter it will assume you&#8217;re done and just start exporting files even if you&#8217;re not ready.  If you cancel the export and restart, it won&#8217;t show the meta-data dialog box again, but you can get to it via File &#8211; Open Metadata Editor.  I got into the habit of editing the meta-data that way to begin with so I didn&#8217;t have to fuss with the dialog later.</p>

<p>Audacity names the files after the tracks, but it doesn&#8217;t have any flexibility about file naming.  So you can&#8217;t tell it to place the song number at the beginning of the filenames, for example; and thus the files won&#8217;t sort in the right order when you view them in your file browser.  I just use <a href="http://easytag.sourceforge.net/">easyTAG</a> to quickly fix the track names after the export is done.  I also use it to insert the year meta-data, since Audacity doesn&#8217;t seem to do this in a way other programs understand.  There are a few settings you might want to tweak with easyTAG too; I disabled the auto-scan at startup and a few others to make it behave the way I wanted.</p>

<p>I found easyTAG a little confusing so I have uploaded a screenshot of it with labeled steps.  Once I&#8217;ve selected the directory containing my files, I press the button to select all the files, then the green scan button; that pops up the scanner dialog.  On this dialog (this took me a long time to figure out!) I press the green scan button once again; then I press the Save button on the main toolbar once again and it applies the changes I made (renaming, filling in the album year, etc).  (To fill in the album year, select all the files and fill in the year, then press the small dot to the right of the year to apply the change to all selected files.)</p>

<p><a href='http://www.xaprb.com/blog/wp-content/uploads/2008/08/easytag.png' title='How to rename files and fix meta-data with easytag'><img src='http://www.xaprb.com/blog/wp-content/uploads/2008/08/easytag.thumbnail.png' alt='How to rename files and fix meta-data with easytag' /></a></p>

<p>And that&#8217;s about all.  I had a few incidents with Audacity where I tried to play tracks from one recording while another window was recording, but the good thing is it recovers from crashes beautifully; I didn&#8217;t lose any recordings.</p>

<h3>Audio quality</h3>

<p><a style="float:right" href="http://www.amazon.com/gp/product/B0001FTVE0?ie=UTF8&#038;tag=xaprb-20&#038;link_code=as3&#038;camp=211189&#038;creative=373489&#038;creativeASIN=B0001FTVE0"><img src='http://www.xaprb.com/blog/wp-content/uploads/2008/08/sennheiser_595.jpg' alt='Sennheiser 595' /></a>The audio quality sounds pretty good to me, by most counts.  I mean, there&#8217;s the inevitable record noise and some clicks (a lot of my records are things like old Mike Oldfield albums and early Tangerine Dream, Jeff Beck, and the like).  But even though there are ways to remove this noise, I&#8217;d rather have all the noise and all the music, than some of the noise and only some of the music.  I&#8217;m not listening to the noise, I&#8217;m listening to the music.  I have a beautiful pair of Sennheiser HD 590s (linked the 595s at right &#8212; the 590s are discontinued, but they&#8217;re the nicest headphones I&#8217;ve ever owned; very bright, but easy to drive from a portable music player (no dedicated amp needed) and extremely light and comfortable) and it really sounds good.  You can probably guess that I&#8217;m not saving the files as crummy low-bit-rate MP3 files.</p>

<p>The USB turntables I&#8217;m using aren&#8217;t audiophile-quality.  There is some wow and flutter.  It&#8217;s acceptable to me.  If you think you&#8217;ll be bothered, use higher-end equipment.  Personally, I don&#8217;t go down this path, because for me it&#8217;s a road with no end.  I know people who spend many thousands (or tens of thousands) of dollars on each piece of their system: pre-amps, turntables, tone arms, cartridges and needles.  (Got a $6000 needle anyone?)  I don&#8217;t see myself ever spending the price of a small house on audio equipment; I&#8217;d rather put the money into buying more music, rather than more equipment.  But if you&#8217;re that kind of person, you probably aren&#8217;t reading this article anyway.</p>

<h3>Summary</h3>

<p>Converting LPs into digital form the way I&#8217;ve shown is fairly time-consuming and tedious.  You have to record the LP; then trim out the unwanted parts of the recording; then find the start of each song and type in the song name; then the artist and album information.  I multitask while I&#8217;m doing other things, but I still notice the amount of time I&#8217;m spending on it.  Hopefully this article helps you cut some of the repetitive work out yourself, or decide whether you want to get into this before you buy the equipment.</p>

<p><strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2006/04/28/how-to-find-next-and-previous-records-in-sql/' rel='bookmark' title='Permanent Link: How to find next and previous records in SQL'>How to find next and previous records in SQL</a></li>
<li><a href='http://www.xaprb.com/blog/2010/01/05/switching-from-ubuntu-to-fedora-and-thunderbird-to-claws-mail/' rel='bookmark' title='Permanent Link: Switching from Ubuntu to Fedora, and Thunderbird to Claws Mail'>Switching from Ubuntu to Fedora, and Thunderbird to Claws Mail</a></li>
<li><a href='http://www.xaprb.com/blog/2007/07/24/ubuntu-on-dell-inspiron-1501/' rel='bookmark' title='Permanent Link: Ubuntu on Dell Inspiron 1501'>Ubuntu on Dell Inspiron 1501</a></li>
<li><a href='http://www.xaprb.com/blog/2008/11/05/how-to-set-up-host-interface-networking-for-virtualbox-on-ubuntu/' rel='bookmark' title='Permanent Link: How to set up host interface networking for VirtualBox on Ubuntu'>How to set up host interface networking for VirtualBox on Ubuntu</a></li>
<li><a href='http://www.xaprb.com/blog/2008/10/22/how-to-swap-caps-lock-and-esc-keys-in-ubuntu/' rel='bookmark' title='Permanent Link: How to swap Caps-lock and Esc keys in Ubuntu'>How to swap Caps-lock and Esc keys in Ubuntu</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2008/08/30/how-to-digitize-records-with-ubuntu-a-usb-turntable-and-audacity/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How I hacked the HP Media Vault to support OGG and FLAC files</title>
		<link>http://www.xaprb.com/blog/2008/08/02/how-i-hacked-the-hp-media-vault-to-support-ogg-and-flac-files/</link>
		<comments>http://www.xaprb.com/blog/2008/08/02/how-i-hacked-the-hp-media-vault-to-support-ogg-and-flac-files/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 22:46:55 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[BusyBox]]></category>
		<category><![CDATA[DAAC]]></category>
		<category><![CDATA[Firefly]]></category>
		<category><![CDATA[FLAC]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[HP Media Vault]]></category>
		<category><![CDATA[iRiver]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[iTunes Server]]></category>
		<category><![CDATA[MP3]]></category>
		<category><![CDATA[OGG]]></category>
		<category><![CDATA[Rhythmbox]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/2008/08/02/how-i-hacked-the-hp-media-vault-to-support-ogg-and-flac-files/</guid>
		<description><![CDATA[Let me begin by saying &#8220;I am so not a gadget guy.&#8221; I don&#8217;t have an iPhone. Heck, I didn&#8217;t have a cellphone at all until April when I joined Percona as a consultant. I don&#8217;t ooh and aah over other people&#8217;s gadgets most of the time. I don&#8217;t have, you know, that kind of [...]


<strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2008/10/09/maatkit-thanks-vantage-media/' rel='bookmark' title='Permanent Link: Maatkit thanks Vantage Media'>Maatkit thanks Vantage Media</a></li>
<li><a href='http://www.xaprb.com/blog/2010/02/22/charset-support-in-mysql-is-really-not-all-that-complex/' rel='bookmark' title='Permanent Link: Charset support in MySQL is really not all that complex'>Charset support in MySQL is really not all that complex</a></li>
<li><a href='http://www.xaprb.com/blog/2009/09/29/what-data-types-does-your-innovative-storage-engine-not-support/' rel='bookmark' title='Permanent Link: What data types does your innovative storage engine NOT support?'>What data types does your innovative storage engine NOT support?</a></li>
<li><a href='http://www.xaprb.com/blog/2006/10/11/donate/' rel='bookmark' title='Permanent Link: Support'>Support</a></li>
<li><a href='http://www.xaprb.com/blog/2007/03/03/new-support-options-for-innotop/' rel='bookmark' title='Permanent Link: New support options for innotop'>New support options for innotop</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Let me begin by saying &#8220;I am so not a gadget guy.&#8221;  I don&#8217;t have an iPhone.  Heck, I didn&#8217;t have a cellphone at all until April when I joined Percona as a consultant.  I don&#8217;t ooh and aah over other people&#8217;s gadgets most of the time.  I don&#8217;t have, you know, that kind of envy.  I&#8217;m sure you see where this is going: I got a gadget and I think it&#8217;s really cool.</p>

<p>Anyway, my wife and I have a bunch of computers (desktops and laptops) and we had been feeling the pain for a long time: the files were only on one computer, and we wanted them available.  I built a file server and then realized that it was going to be really expensive in terms of power alone, so I went back to USB drives for backups, and kept thinking about it.</p>

<p style="float:right"><a href="http://www.amazon.com/gp/product/B0015313O8?ie=UTF8&#038;tag=xaprb-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=B0015313O8"><img border="0" src="http://www.xaprb.com/files/HPMediaVault.jpg" width="160" height="160" alt="HP Media Vault"></a></pre>

<p>After a long time I decided to buy an <a href="http://www.amazon.com/gp/product/B0015313O8?ie=UTF8&#038;tag=xaprb-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=B0015313O8">HP Media Vault</a> and install ultra-low-power, oversized disks in it -- I did that, and will write about it elsewhere.  And then I discovered that it has a media server in it.  And not being a gadget guy, I had honestly never heard about these things before.  Really.  I read up on it a little bit and decided hell, sharing files is nice, but I have about a thousand CDs that could go on this thing, and my wife has hundreds too.  That's even better than file sharing!  I copied the music from her iTunes library to the shared Music folder on the server and boom, Rhythmbox magically saw it all.  I couldn't believe I'd never heard about this before.  Best thing since sliced bread.</p>

<p>I even had all my music ripped already to my <a href="http://www.xaprb.com/blog/2005/10/05/review-of-the-iriver-hd340/">iRiver HD340</a>.  In OGG format.  And then I found out the HP Media Vault doesn't support OGG format.  <a href="http://www.imdb.com/title/tt0093779/">Boo!  Boo! Rubbish! Filth! Slime!</a></p>

<p>So I fixed that.  Now I'll show you how.</p>

<h3>Disclaimer</h3>

<p>If you try what's on this page and something breaks, it is your fault, not mine.  I make this information available without any warranties or representations.</p>

<h3>The basics: log into the server</h3>

<p>The HP documentation for the Media Vault is totally incomplete and assumes you want to install their GUI program and control the thing from your Windows desktop.  There's a much better way.  The Media Vault has a full-featured web interface.  Log into the web console.  I'm going to assume that your HP Media Vault's DNS name is hpmediavault, so you can <a href="http://hpmediavault/">log into it with this URL</a>.  Once you do, set the admin password to secure the server.  Remember it.</p>

<p>The next fun thing: the server runs GNU/Linux and has SSH enabled by default.  Yes, that's right: you can just SSH into the thing!  The password you set in the previous step is now your SSH password.  Your SSH username is root, no matter what you set the admin username to.</p>

<p>Next, open up a terminal and SSH right in:</p>

<pre>ssh root@hpmediavault</pre>

<p>Type the password you chose in the previous step.  You should see the following:</p>

<pre>baron@kanga:~$ ssh root@hpmediavault
root@hpmediavault's password: 


BusyBox v1.01 (2008.02.08-22:41+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

-sh: can't access tty; job control turned off
# 
</pre>

<p>As you can see, the server runs with a stripped-down set of command-line tools called BusyBox.  You're golden.  Let's get working on installing OGG and FLAC support.  This will not be hard at all if you can use a command-line editor.</p>

<h3>Step 1: install ipkg</h3>

<p>Behind the scenes, the Media Vault's media streaming is provided by <a href="http://fireflymediaserver.org/">Firefly</a>, formerly known as mt-daapd (<a href="http://en.wikipedia.org/wiki/Digital_Audio_Access_Protocol">DAAP</a> is the iTunes server protocol).  This is a Free Software media server, and it's highly capable.  But the version that ships on the device is old and doesn't support OGG.  You're going to fix that by installing a newer version.  But first, you have to install a package management system that will install the newest Firefly software for you.</p>

<p>The package management system is <a href="http://handhelds.org/moin/moin.cgi/Ipkg">ipkg, the Itsy Package Management System</a>.  It's really easy to install.  First, let's see where your hard drives are mounted:</p>

<pre># mount
/dev/md6 on /share/1000 type ext3 (data=writeback)
</pre>

<p>If yours isn't /share/1000, use a different value in the following commands.  Now you want to make an installation directory and change to that directory:</p>

<pre># mkdir -p /share/1000/tmp &#038;&#038; cd /share/1000/tmp</pre>

<p>Now let's find the installation image to download.  Go look here for the latest version of the image:</p>

<p><a href="http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/unstable/">http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/unstable/</a></p>

<p>Search for "hpmv2-bootstrap" on that page.  You should find a file something like this: hpmv2-bootstrap_1.2-4_arm.xsh.  Copy the link location for that, and go back to your command prompt.  Now download the file to the Media Vault, substituting the correct URL into the command below:</p>

<pre>
# wget http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/unstable/hpmv2-bootstrap_1.2-4_arm.xsh
</pre>

<p>And now, just execute it:</p>

<pre># sh ./hpmv2-bootstrap_1.2-4_arm.xsh</pre>

<p>You should see "Setup complete" when it's done.  That's it.  It installs itself and mounts the installation directory as /opt, which is where all your software will appear in the future.  This will persist after a reboot.  You can see the changes with the mount command:</p>

<pre># mount
/dev/md6 on /share/1000 type ext3 (data=writeback)
/share/1000/.optware on /opt type ext3 (rw)
</pre>

<p>Before you move on, update its cache of available software:</p>

<pre># ipkg update</pre>

<p>I got this installation procedure from <a href="http://tech.groups.yahoo.com/group/hackingthemediavault/message/259">the Yahoo group on hacking the Media Vault</a>.</p>

<h3>Step 2: Install Firefly Nightly</h3>

<p>I wasn't able to determine whether the latest stable Firefly release has OGG streaming enabled, so I installed the latest nightly release.  At some point in the future I'm sure a stable release will have it, but I breathed a prayer to Saint Hewlett and installed the nightly, following <a href="http://tech.groups.yahoo.com/group/hackingthemediavault/message/338">instructions I also found on Hacking the Media Vault</a>.  Fortunately it seems to work fine for me.  Here's how I did it:</p>

<pre># ipkg install mt-daapd-svn</pre>

<p>Pretty easy.  After you do this, it will download a bunch of things and install them until it says "Successfully terminated."  Now you need to configure it.</p>

<p>You probably noticed that the installation said "To complete this installation, make any necessary changes
to the config file in  /opt/etc/mt-daapd/mt-daapd.conf, and
start the daemon by running /opt/etc/init.d/S60mt-daapd".  Here's how to do that.</p>

<pre># vi /opt/etc/mt-daapd/mt-daapd.conf</pre>

<p>If you like a different editor, feel free to use it.  I like vi.  Here are the lines that you need to change:</p>

<pre>
mp3_dir = /share/1000/Music                                            
servername = HPMediaVault                                              
extensions = .mp3,.m4a,.m4p,.ogg,.flac                                 
</pre>

<p>I'm assuming you are keeping the defaults, as I did on mine.  All my music is in the Music share, I want to keep the same server name (what shows up in iTunes/Rhythmbox), and I want to add .ogg and .flac to the extensions Firefly will index and stream.</p>

<h3>Step 3: Stop the built-in server, start the new one</h3>

<p>Next you need to stop the built-in media server and start the one you just installed.  Here's how to see what's running:</p>

<pre># ps -eaf | grep daap
32530 nobody     1096 S < /usr/sbin/mt-daapd 
32531 nobody     1984 S < /usr/sbin/mt-daapd 
32160 root        488 S   grep daap 
</pre>

<p>There are two processes running.  This is normal.  Let's stop them:</p>

<pre># killall mt-daapd</pre>

<p>If you now run the ps command above, you shouldn't see anything running.  You can start the new server:</p>

<pre># /opt/etc/init.d/S60mt-daapd</pre>

<p>Now you should be able to see the daemon running:</p>

<pre># ps -eaf | grep daap
32681 nobody     3796 S   /opt/sbin/mt-daapd -c /opt/etc/mt-daapd/mt-daapd.conf
32682 nobody     4512 D   /opt/sbin/mt-daapd -c /opt/etc/mt-daapd/mt-daapd.conf
32703 root        488 S   grep daap 
</pre>

<p>Notice that it's a different binary running -- not the one in /usr/sbin.</p>

<p>At this point you ought to be able to start up your favorite music player (iTunes, Rhythmbox) and stream OGG and FLAC files from the media server.  Test that before you go on to the next little bit.</p>

<h3>Step 4: Change which media server starts on boot</h3>

<p>There's one last little detail.  If you shut down your Media Vault and restart it, the old media server will start instead of the new one.  The GNU/Linux variant on the Media Vault doesn't have any nice init scripts, so I had to hunt around to find out how to do this.</p>

<p>After a bit of poking, I found that the /etc/inc/func_daapd.inc script has the start and stop commands.  The startup process for the Media Vault is written in PHP, oddly enough.  Here are the relevant lines:</p>

<pre>
   144         $ret=mwexec("/usr/sbin/mt-daapd -k");
   147         killbyname("mt-daapd","");
   162         $ret=mwexec("/usr/sbin/mt-daapd");
</pre>

<p>I commented them out and changed them to</p>

<pre>
   143          $ret=mwexec("/opt/etc/init.d/S60mt-daapd -k");
   144  #       $ret=mwexec("/usr/sbin/mt-daapd -k");
   161          $ret=mwexec("/opt/etc/init.d/S60mt-daapd");
   162  #        $ret=mwexec("/usr/sbin/mt-daapd");
</pre>

<p>Notice I didn't change the killbyname command, since once it is started the binary has the same command name as the old one did.  I tested restarting the Media Vault and after restart, it was working OK again.  I do not know whether the built-in command to reset the media server will work with these changes; I suspect not.  But if you want to do that, you can log in and do it from the command line.</p>

<h3>Conclusion</h3>

<p>If you followed the steps I listed above, your Media Vault ought to be serving FLAC and OGG files in WAV format to your music player (audiophiles, rejoice: your FLAC is not downconverted to MP3!).</p>

<p>After doing this, I have to say I think this piece of equipment is pretty darned awesome, and I'm really happy I bought a low-power, quiet, small, fun gadget that I have full control over.  And I haven't even talked about sharing files yet!  That'll be another post.</p>

<h3>Postscript</h3>

<p>A few miscellaneous things I've learned:</p>

<p>The default mt-daapd configuration file doesn't have a defined rescan_interval.  This means it'll never notice when you add music to your filesystem.  But you can poke it via the web interface (http://hpmediavault:3689/index.html; the username is empty, the password is defined in your config file) to make it update.  Also, and I'm not sure how well this works, there's an option to gzip the list of songs, which might make startup quite a bit faster when your iTunes/Rhythmbox connects and gets the song list.  This is documented in the config file too. <strong>Update: I've been running my server this way for a while and it seems to run fine.</strong></p>

<p><strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2008/10/09/maatkit-thanks-vantage-media/' rel='bookmark' title='Permanent Link: Maatkit thanks Vantage Media'>Maatkit thanks Vantage Media</a></li>
<li><a href='http://www.xaprb.com/blog/2010/02/22/charset-support-in-mysql-is-really-not-all-that-complex/' rel='bookmark' title='Permanent Link: Charset support in MySQL is really not all that complex'>Charset support in MySQL is really not all that complex</a></li>
<li><a href='http://www.xaprb.com/blog/2009/09/29/what-data-types-does-your-innovative-storage-engine-not-support/' rel='bookmark' title='Permanent Link: What data types does your innovative storage engine NOT support?'>What data types does your innovative storage engine NOT support?</a></li>
<li><a href='http://www.xaprb.com/blog/2006/10/11/donate/' rel='bookmark' title='Permanent Link: Support'>Support</a></li>
<li><a href='http://www.xaprb.com/blog/2007/03/03/new-support-options-for-innotop/' rel='bookmark' title='Permanent Link: New support options for innotop'>New support options for innotop</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2008/08/02/how-i-hacked-the-hp-media-vault-to-support-ogg-and-flac-files/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

