{"id":1327,"date":"2012-01-16T22:52:24","date_gmt":"2012-01-16T20:52:24","guid":{"rendered":"http:\/\/www.void.gr\/kargig\/blog\/?p=1327"},"modified":"2012-01-16T22:52:24","modified_gmt":"2012-01-16T20:52:24","slug":"music-player-daemon-on-os-x","status":"publish","type":"post","link":"https:\/\/www.void.gr\/kargig\/blog\/2012\/01\/16\/music-player-daemon-on-os-x\/","title":{"rendered":"Music Player Daemon on OS X"},"content":{"rendered":"<p>I use a Mac Mini with OS X 10.5.8 as a media center connected to my TV and I wanted to install <a href=\"http:\/\/mpd.wikia.com\/\">Music Player Daemon<\/a> on it so I could control the music remotely from my laptop or phone. I mostly followed the <a href=\"http:\/\/mpd.wikia.com\/wiki\/MPD_on_OSX\">OS X guide from MPD&#8217;s wiki<\/a> to do it but I ran into some problems while trying to daemonize mpd.<\/p>\n<p>I got the following error while running mpd <em>without &#8211;no-daemon<\/em>:<\/p>\n<blockquote><p>The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().<br \/>\nBreak on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.<\/p><\/blockquote>\n<p>When I ran <strong>mpd &#8211;no-daemon<\/strong> everything was fine though. So in order to &#8220;solve&#8221; this problem I&#8217;ve changed the plist file to include a <a href=\"http:\/\/www.gnu.org\/software\/screen\/\">screen<\/a> invocation.<\/p>\n<p>My mpd.plist looks like that now:<br \/>\n<pre><code2>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;!DOCTYPE plist PUBLIC &quot;-\/\/Apple Computer\/\/DTD PLIST 1.0\/\/EN&quot; &quot;http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd&quot;&gt;\n&lt;plist version=&quot;1.0&quot;&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;dict&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;key&gt;Label&lt;\/key&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;mpd&lt;\/string&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;key&gt;ProgramArguments&lt;\/key&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;array&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;\/opt\/local\/bin\/daemondo&lt;\/string&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;--label=mpd&lt;\/string&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;--start-cmd&lt;\/string&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;screen&lt;\/string&gt; &lt;!-- path to screen --&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;-dmS&lt;\/string&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;mpd&lt;\/string&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;\/opt\/local\/bin\/mpd&lt;\/string&gt; &lt;!-- path to MPD --&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;-v&lt;\/string&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;--no-daemon&lt;\/string&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;\/Users\/kargig\/.mpd\/mpd.conf&lt;\/string&gt; &lt;!-- path to MPD config --&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;;&lt;\/string&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;--stop-cmd&lt;\/string&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;\/opt\/local\/bin\/mpd&lt;\/string&gt; &lt;!-- path to MPD, again --&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;--kill&lt;\/string&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;\/Users\/kargig\/.mpd\/mpd.conf&lt;\/string&gt; &lt;!-- path to MPD config, again --&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;;&lt;\/string&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/array&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;key&gt;RunAtLoad&lt;\/key&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;true\/&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;key&gt;Disabled&lt;\/key&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;false\/&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/dict&gt;\n&lt;\/plist&gt;\n<\/code2><\/pre><\/p>\n<p>So <em>launchctl<\/em> calls <em>daemondo<\/em> which calls <em>screen<\/em> which runs <em>mpd &#8211;no-daemon<\/em>, so mpd doesn&#8217;t crash.<\/p>\n<p>I use <a href=\"http:\/\/mpd.wikia.com\/wiki\/Client%3AMpdscribble\">mpdscribble<\/a> for scrobbling my music to <a href=\"http:\/\/last.fm\">last.fm<\/a>. Clients-wise, I use <a href=\"http:\/\/theremin.sigterm.eu\/\">Theremin<\/a> on OS X, <a href=\"http:\/\/gmpc.wikia.com\/wiki\/Gnome_Music_Player_Client\">Gnome Music Player Client\/gmpc<\/a> on Debian Linux and <a href=\"https:\/\/market.android.com\/details?id=com.namelessdev.mpdroid&#038;hl=en\">MPDroid<\/a> on Android. And all those connections over IPv6 of course, over my LAN&#8217;s <a href=\"http:\/\/en.wikipedia.org\/wiki\/Unique_local_address\">Unique Local Addresses<\/a> to be exact, mpd and all clients listed above work fine with IPv6.<\/p>\n<p><pre><code2> # lsof -n -i | grep ESTABLISHED | grep 6600\nmpd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 43025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kargig&nbsp;&nbsp; 12u&nbsp;&nbsp;IPv6 0x49c719c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0t0&nbsp;&nbsp;&nbsp;&nbsp;TCP [fdbf:aaaa:aab0:447d:216:XXff:feaa:11XX]:6600-&gt;[fdbf:aaaa:aab0:447d:222:XXff:fe1e:d8XX]:48703 (ESTABLISHED)\nmpd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 43025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kargig&nbsp;&nbsp; 15u&nbsp;&nbsp;IPv6 0x3127cd4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0t0&nbsp;&nbsp;&nbsp;&nbsp;TCP [fdbf:aaaa:aab0:447d:216:XXff:feaa:11XX]:6600-&gt;[fdbf:aaaa:aab0:447d:fadb:XXff:fe4f:aXX]:51113 (ESTABLISHED)\n<\/code2><\/pre><\/p>\n<p>Apart from MPD&#8217;s wiki there&#8217;s another nice blog post you can read to help you install mpd on OS X, <a href=\"http:\/\/www.foldplop.com\/blog\/2011\/05\/10\/integrating-mpd-with-os-x\/\">Integrating MPD with OS X<\/a>.<br \/>\nFor general reference on setting up mpd, <a href=\"https:\/\/wiki.archlinux.org\/index.php\/Music_Player_Daemon\">Archilinux has a fine wiki entry<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I use a Mac Mini with OS X 10.5.8 as a media center connected to my TV and I wanted to install Music Player Daemon on it so I could control the music remotely from my laptop or phone. I mostly followed the OS X guide from MPD&#8217;s wiki to do it but I ran [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"footnotes":""},"categories":[414,3,13],"tags":[33,441,301,445,595,163,438,440,443,444,439,437,446,442,448,447],"class_list":["post-1327","post","type-post","status-publish","format-standard","hentry","category-ipv6-networking","category-linux","category-macosx","tag-debian","tag-gmpc","tag-ipv6","tag-last-fm","tag-linux","tag-mac","tag-mac-mini","tag-mpd","tag-mpdroid","tag-mpdscribble","tag-music-player-daemon","tag-os-x","tag-scrobble","tag-theremin","tag-ula","tag-unique-local-address"],"aioseo_notices":[],"views":25540,"_links":{"self":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/1327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/comments?post=1327"}],"version-history":[{"count":5,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/1327\/revisions"}],"predecessor-version":[{"id":1332,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/1327\/revisions\/1332"}],"wp:attachment":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/media?parent=1327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/categories?post=1327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/tags?post=1327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}