<?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>Unwinding the Stack &#187; mpd</title>
	<atom:link href="http://thestaticvoid.com/tag/mpd/feed/" rel="self" type="application/rss+xml" />
	<link>http://thestaticvoid.com</link>
	<description>Explorations in Computing</description>
	<lastBuildDate>Thu, 22 Jul 2010 20:25:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Music Player Daemon on OpenSolaris</title>
		<link>http://thestaticvoid.com/post/2009/12/04/music-player-daemon-on-opensolaris/</link>
		<comments>http://thestaticvoid.com/post/2009/12/04/music-player-daemon-on-opensolaris/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 01:44:36 +0000</pubDate>
		<dc:creator>James Lee</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[mpd]]></category>
		<category><![CDATA[opensolaris]]></category>
		<category><![CDATA[packages]]></category>

		<guid isPermaLink="false">http://thestaticvoid.com/?p=188</guid>
		<description><![CDATA[MPD is essential software for me. It&#8217;s one of the few music players out there for Unix that does gapless playback and ReplayGain. It&#8217;s also nice that, because it&#8217;s a daemon, I&#8217;m not bound to any particular interface. Fortunately, there is a really good one in the form of Sonata. MPD is not included in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki">MPD</a> is essential software for me.  It&#8217;s one of the few music players out there for Unix that does gapless playback and ReplayGain.  It&#8217;s also nice that, because it&#8217;s a daemon, I&#8217;m not bound to any particular interface.  Fortunately, there is a really good one in the form of <a href="http://sonata.berlios.de/">Sonata</a>.</p>
<p>MPD is not included in OpenSolaris yet, so last weekend I built some packages for it.  The build has been stable for me and I&#8217;m happy with the state of the packages so I thought I&#8217;d share them.  First add my <a href="http://pkg.thestaticvoid.com:10000/">package repository</a>:</p>
<pre class="terminal">
$ <kbd>pfexec pkg set-authority -O http://pkg.thestaticvoid.com:10000/ thestaticvoid</kbd>
</pre>
<h3>MPD</h3>
<p>This package and its dependencies require OpenSolaris 2009.06 or newer.  Install it by typing <tt>pfexec pkg install mpd</tt>.  The following formats are supported:</p>
<pre class="terminal">
$ <kbd>mpd -V</kbd>
...
Supported decoders:
[mad] mp3 mp2
[vorbis] ogg oga
[oggflac] ogg oga
[flac] flac
[audiofile] wav au aiff aif
[faad] aac
[mp4] m4a mp4
[mpcdec] mpc
[wavpack] wv

Supported outputs:
shout null fifo ao solaris httpd 

Supported protocols:
file:// http://
</pre>
<p>I plan on adding ffmpeg support soon which will add support for even more codecs.</p>
<p>To run MPD, create a configuration file in your home directory like</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">port&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;6600&quot;<br />
music_directory &nbsp; &nbsp; &nbsp; &nbsp; &quot;~/music&quot;<br />
playlist_directory &nbsp; &nbsp; &nbsp;&quot;~/.mpd/playlists&quot;<br />
db_file &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;~/.mpd/mpd.db&quot;<br />
log_file &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;~/.mpd/mpd.log&quot;</div></div>
<p>Create any directories from the configuration file that don&#8217;t exist, such as <tt>~/.mpd/playlists</tt> and start the daemon by running <tt>mpd ~/.mpdconf</tt> as your user.  It will immediately build a library of your music.</p>
<p>Alternatively, mpd can be run system-wide, which just seems more appropriate to me for whatever reason.  The only complicated part about this is that you have to give MPD permission to write to the audio device.  Edit <tt>/etc/logindevperms</tt>, find the <tt>/dev/sound/*</tt> lines and change the mode to 0666 so that they look like:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/console&nbsp; &nbsp; 0666&nbsp; &nbsp; /dev/sound/*&nbsp; &nbsp; &nbsp; &nbsp; # audio devices<br />
/dev/vt/active&nbsp; 0666&nbsp; &nbsp; /dev/sound/*&nbsp; &nbsp; &nbsp; &nbsp; # audio devices</div></div>
<p>Logout and log back in for the settings to take effect.  Then modify <tt>/etc/mpd.conf</tt> to your liking and start the daemon by typing <tt>svcadm enable mpd</tt>.  You may have to <tt>svcadm refresh manifest-import</tt> for SMF to load the mpd manifest.</p>
<h3>mpdscribble</h3>
<p>I also built a package for <a href="http://mpd.wikia.com/wiki/Client:Mpdscribble">mpdscribble</a> which is a mature, well-maintained scrobbler for <a href="http://www.last.fm/">Last.fm</a>.  Install it by typing <tt>pfexec pkg install mpdscribble</tt>.  Set your Last.fm or Libre.fm username and password in <tt>/etc/mpdscribble.conf</tt> and start the daemon with <tt>svcadm enable mpdscribble</tt>.  That&#8217;s all there is to it.</p>
<h3>Sonata</h3>
<p>Sonata is a lightweight cilent for MPD.  Looks pretty nice too:</p>
<p><img src="http://thestaticvoid.com/wordpress/wp-content/uploads/2009/12/sonata.png" alt="Sonata" title="Sonata" width="408" height="326" class="aligncenter size-full wp-image-201" /></p>
<p>Because Sonata requires Python 2.5, and OpenSolaris 2009.06 only really supports Python 2.3, this package requires build 127 or newer.  Install it by typing <tt>pfexec pkg install sonata</tt>.  It can be launched from the Applications->Sound &#038; Video menu.</p>
]]></content:encoded>
			<wfw:commentRss>http://thestaticvoid.com/post/2009/12/04/music-player-daemon-on-opensolaris/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
