{"id":4963,"date":"2016-06-19T21:32:47","date_gmt":"2016-06-19T19:32:47","guid":{"rendered":"http:\/\/www.knottinbotswana.com\/?p=4963"},"modified":"2016-06-19T21:44:08","modified_gmt":"2016-06-19T19:44:08","slug":"raspberry-pi-headless-music-machine","status":"publish","type":"post","link":"http:\/\/www.knottinbotswana.com\/index.php\/2016\/06\/raspberry-pi-headless-music-machine\/","title":{"rendered":"Raspberry Pi Headless Music Machine"},"content":{"rendered":"<p>One of the motivations for <a href=\"http:\/\/www.knottinbotswana.com\/index.php\/2016\/06\/rotel-repair\/\">getting my amplifier working again<\/a> was the need to listen to music on a system with more depth and weight than a set of Logitech 2.1s can provide.<\/p>\n<p>Since I left my CD collection in the UK my sources are all mp3, with a <a href=\"https:\/\/soundcloud.com\/knottinbotswana\" target=\"_blank\">Soundcloud habit<\/a> as well.<\/p>\n<p>So, how to listen?\u00a0 Well, I also have a Raspberry Pi habit, and they have an audio out (in my case on a Model B it&#8217;s a headphone jack).<\/p>\n<figure id=\"attachment_4995\" aria-describedby=\"caption-attachment-4995\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.knottinbotswana.com\/rotel-ra-931-stereo-amplifier-fed-from-a-raspberry-pi\/\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-4995\" src=\"http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/rotel-pi-300x169.jpg\" alt=\"Rotel RA-931 stereo amplifier fed from a Raspberry Pi B.\" width=\"300\" height=\"169\" srcset=\"http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/rotel-pi-300x169.jpg 300w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/rotel-pi-768x432.jpg 768w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/rotel-pi.jpg 1024w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/rotel-pi-150x84.jpg 150w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/rotel-pi-400x225.jpg 400w\" sizes=\"(max-width: 300px) 85vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-4995\" class=\"wp-caption-text\">Rotel RA-931 stereo amplifier fed from a Raspberry Pi B.<\/figcaption><\/figure>\n<h3><!--more-->Installation<\/h3>\n<p>After some browsing for headless options, i.e. they are controlled from remote devices so don&#8217;t need a monitor, I decided to run with <a href=\"https:\/\/www.mopidy.com\/\" target=\"_blank\">Mopidy<\/a>.<\/p>\n<p>As I already had a Pi running I started with the <a href=\"https:\/\/docs.mopidy.com\/en\/latest\/installation\/debian\/#debian-install\" target=\"_blank\">Debian instructions<\/a>, bad idea.\u00a0 Lots of error messages apparently boiling down to the fact that I was running Wheezy rather than Jessie. Rather than fight against the tide I downloaded Jessie and tried again. Similar story, probably due to Mopidy needing lots of other gubbins to work.<\/p>\n<p>Next stop was to find a ready-made img with Mopidy and all its gubbins pre-configured, something like <a href=\"http:\/\/www.pimusicbox.com\/\" target=\"_blank\">Pi MusicBox<\/a>.<\/p>\n<p>That worked well enough, I could at least access it through a browser on the main computer, but it wouldn&#8217;t (and still hasn&#8217;t) indexed any media files accessed over a network connection.<\/p>\n<h3>Tinkering<\/h3>\n<p>To get it playing mp3 files from another computer I decided to mount the network drive as a folder in the default MusicBox directory on the Pi:<\/p>\n<blockquote>\n<pre>mkdir \/music\/MusicBox\/<em>&lt;appropriate name, e.g. PC-MAP&gt;<\/em><\/pre>\n<pre>mount.cifs \/\/<em>&lt;Pi IP address, e.g. 192.168.2.6&gt;<\/em>\/<em>&lt;shared directory name&gt;<\/em> \/music\/MusicBox\/&lt;appropriate name, e.g. PC-MAP&gt; -o username=&lt;network drive username&gt;,password=&lt;network drive password&gt;<\/pre>\n<\/blockquote>\n<p>I haven&#8217;t yet rebooted the Pi, so not entirely sure if the network drive will mount itself or if I will have to find the right place to put the script so it mounts automatically.<\/p>\n<p>I&#8217;ve also plugged a USB stick into the Pi&#8217;s powered USB hub, and I can play music from there.\u00a0 Long term plan here in Gaborone will be to have a portable disk drive permanently connected to the Pi with all my mp3s on it, and another unit in Francistown reading from the NAS (the NAS and the portable drive being kept in sync by <a href=\"https:\/\/en.wikipedia.org\/wiki\/Sneakernet\" target=\"_blank\">sneakernet<\/a> (<a href=\"http:\/\/www.xkcd.com\/949\/\" target=\"_blank\">see<\/a> <a href=\"https:\/\/what-if.xkcd.com\/31\/\" target=\"_blank\">also<\/a>), so working as backup system as well).<\/p>\n<p>Next step will to be work out why MusicBox isn&#8217;t indexing my tunes.<\/p>\n<div id='gallery-1' class='gallery galleryid-4963 gallery-columns-2 gallery-size-medium'><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon landscape'>\n\t\t\t\t<a href='http:\/\/www.knottinbotswana.com\/musicbox-pc-map\/'><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"206\" src=\"http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-pc-map-300x206.jpg\" class=\"attachment-medium size-medium\" alt=\"Pi MusicBox - default folder in a web browser.\" aria-describedby=\"gallery-1-4997\" srcset=\"http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-pc-map-300x206.jpg 300w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-pc-map-768x527.jpg 768w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-pc-map-1024x703.jpg 1024w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-pc-map-150x103.jpg 150w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-pc-map-400x275.jpg 400w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-pc-map.jpg 1411w\" sizes=\"(max-width: 300px) 85vw, 300px\" \/><\/a>\n\t\t\t<\/div>\n\t\t\t\t<figcaption class='wp-caption-text gallery-caption' id='gallery-1-4997'>\n\t\t\t\tPi MusicBox &#8211; default folder with a mapped network drive PC-MAP in a web browser.\n\t\t\t\t<\/figcaption><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon landscape'>\n\t\t\t\t<a href='http:\/\/www.knottinbotswana.com\/musicbox-networkfolder-2\/'><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"206\" src=\"http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-networkfolder-1-300x206.jpg\" class=\"attachment-medium size-medium\" alt=\"Pi MusicBox - browsing files from another computer\" aria-describedby=\"gallery-1-5000\" srcset=\"http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-networkfolder-1-300x206.jpg 300w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-networkfolder-1-768x527.jpg 768w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-networkfolder-1-1024x703.jpg 1024w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-networkfolder-1-150x103.jpg 150w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-networkfolder-1-400x275.jpg 400w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-networkfolder-1.jpg 1411w\" sizes=\"(max-width: 300px) 85vw, 300px\" \/><\/a>\n\t\t\t<\/div>\n\t\t\t\t<figcaption class='wp-caption-text gallery-caption' id='gallery-1-5000'>\n\t\t\t\tPi MusicBox &#8211; browsing files from another computer.\n\t\t\t\t<\/figcaption><\/figure>\n\t\t<\/div>\n\n<h3>What does work?<\/h3>\n<p>I&#8217;ve spent the day dropping SoundCloud links into the Stream menu, and they sound great.\u00a0 Except it won&#8217;t load tracks from an artist&#8217;s page or parse a playlist.\u00a0 So basic rather than advanced &#8220;working.&#8221;<\/p>\n<figure id=\"attachment_4999\" aria-describedby=\"caption-attachment-4999\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.knottinbotswana.com\/musicbox-streams\/\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-4999\" src=\"http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-streams-300x206.jpg\" alt=\"Pi MusicBox - SoundCloud streaming control panel in a web browser.\" width=\"300\" height=\"206\" srcset=\"http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-streams-300x206.jpg 300w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-streams-768x527.jpg 768w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-streams-1024x703.jpg 1024w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-streams-150x103.jpg 150w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-streams-400x275.jpg 400w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-streams.jpg 1411w\" sizes=\"(max-width: 300px) 85vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-4999\" class=\"wp-caption-text\">Pi MusicBox &#8211; SoundCloud streaming control panel in a web browser.<\/figcaption><\/figure>\n<p>It will play all the files in a directory that you browse to.<\/p>\n<p>I can lie in bed and control what is playing and how loud through my smartphone.<\/p>\n<figure id=\"attachment_5001\" aria-describedby=\"caption-attachment-5001\" style=\"width: 169px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.knottinbotswana.com\/musicbox-on-note\/\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5001\" src=\"http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-on-note-169x300.png\" alt=\"Pi MusicBox - controlled through a smartphone's browser.\" width=\"169\" height=\"300\" srcset=\"http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-on-note-169x300.png 169w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-on-note-768x1365.png 768w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-on-note-576x1024.png 576w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-on-note-84x150.png 84w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-on-note-400x711.png 400w, http:\/\/www.knottinbotswana.com\/wp-content\/uploads\/2016\/06\/musicbox-on-note.png 1440w\" sizes=\"(max-width: 169px) 85vw, 169px\" \/><\/a><figcaption id=\"caption-attachment-5001\" class=\"wp-caption-text\">Pi MusicBox &#8211; controlled through a smartphone&#8217;s browser.<\/figcaption><\/figure>\n<h3>What next?<\/h3>\n<p>Well, maybe try some of the plug-ins for MusicBox for file handling and interface wise, and or other flavours of headless music player to see if there are any that work better without having to fettle the heck out of them.<\/p>\n<p>At the end of the day the Pi ecosystem is for those that like to tinker and fettle, anybody with access to decent electronics stores and no inclination to tinkering and fettling should look elsewhere.<\/p>\n<p>Me?\u00a0 I&#8217;m contemplating a couple of Pi Model 2s with DAC and RCA output boards.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the motivations for getting my amplifier working again was the need to listen to music on a system with more depth and weight than a set of Logitech 2.1s can provide. Since I left my CD collection in the UK my sources are all mp3, with a Soundcloud habit as well. So, how &hellip; <a href=\"http:\/\/www.knottinbotswana.com\/index.php\/2016\/06\/raspberry-pi-headless-music-machine\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Raspberry Pi Headless Music Machine&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,11,9],"tags":[319,318,317,175],"_links":{"self":[{"href":"http:\/\/www.knottinbotswana.com\/index.php\/wp-json\/wp\/v2\/posts\/4963"}],"collection":[{"href":"http:\/\/www.knottinbotswana.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.knottinbotswana.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.knottinbotswana.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.knottinbotswana.com\/index.php\/wp-json\/wp\/v2\/comments?post=4963"}],"version-history":[{"count":5,"href":"http:\/\/www.knottinbotswana.com\/index.php\/wp-json\/wp\/v2\/posts\/4963\/revisions"}],"predecessor-version":[{"id":5005,"href":"http:\/\/www.knottinbotswana.com\/index.php\/wp-json\/wp\/v2\/posts\/4963\/revisions\/5005"}],"wp:attachment":[{"href":"http:\/\/www.knottinbotswana.com\/index.php\/wp-json\/wp\/v2\/media?parent=4963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.knottinbotswana.com\/index.php\/wp-json\/wp\/v2\/categories?post=4963"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.knottinbotswana.com\/index.php\/wp-json\/wp\/v2\/tags?post=4963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}