{"id":212,"date":"2016-01-09T08:05:26","date_gmt":"2016-01-09T15:05:26","guid":{"rendered":"http:\/\/www.meanboyfriend.com\/overdue\/?p=212"},"modified":"2016-01-09T08:05:26","modified_gmt":"2016-01-09T15:05:26","slug":"cooking-with-sound","status":"publish","type":"post","link":"http:\/\/www.meanboyfriend.com\/overdue\/2016\/01\/cooking-with-sound\/","title":{"rendered":"Cooking with sound"},"content":{"rendered":"<p>This project was to enable us to play audio content (music\/podcasts\/radio) from our iPhones\/iPad in the kitchen. It took me under an hour to complete&#8230;<\/p>\n<h3>Why?<\/h3>\n<p>We already use the Apple Airplay facility to play audio content in our living room using iOS devices + an AppleTV connected to a sound system. We wanted to get a similar setup in our kitchen at a low cost.<\/p>\n<h3>Time needed<\/h3>\n<p>The initial work took my under an hour, but then the subsequent troubleshooting (see <strong>Issues<\/strong> below) took\u00a0another couple of hours at least.<\/p>\n<h3>Kit<\/h3>\n<ul>\n<li>Raspberry Pi Model B<\/li>\n<li>Wifi Dongle<\/li>\n<li>Logitech mm50 (or similar)<\/li>\n<\/ul>\n<p>This set of kit was chosen for no better reason than I had it lying around not really doing anything (my son uses the Raspberry Pi sometimes but generally uses an old laptop rather than the Pi now).<\/p>\n<p>The Logitech mm50 (http:\/\/www.macworld.com\/article\/1046722\/logitechmm50.html) is an old iPod doc with an audio line in for a 3.5mm audio jack. As far as I can see the Logitech Pure-Fi Anywhere 2 is the same basic product (http:\/\/support.logitech.com\/en_us\/product\/pure-fi-anywhere2). You can pick either of these models up second hand on eBay for under \u00a330 (quite possibly much less).<\/p>\n<h3>Software<\/h3>\n<ul>\n<li>Raspbian Wheezy<\/li>\n<li>Shairport-sync (https:\/\/github.com\/mikebrady\/shairport-sync)<\/li>\n<\/ul>\n<p>This is open source software which enables streaming of audio (not video) content using Apple&#8217;s airplay protocol. It is a fork of the original Shairport software (which is no longer in development) but has added extra functions and seems to be under active development.<\/p>\n<h3>The Build<\/h3>\n<p>(ok, calling this a &#8216;build&#8217; is over selling it a bit &#8230;)<\/p>\n<p>All the software side of this project was based on the instructions at <a href=\"http:\/\/www.redsilico.com\/multiroom-audio-raspberry-pi\">http:\/\/www.redsilico.com\/multiroom-audio-raspberry-pi<\/a>. For my purposes I didn&#8217;t need a DAAP\/iTunes server because we only wanted to play audio directly from our iOS devices, which all support AirPlay already. I also already had the Raspberry Pi setup with the Wifi dongle so I basically started from the section headed &#8220;Install AirPlay software&#8221; using the instructions for shairport-sync.<\/p>\n<p>I also checked and read through the instructions for shairport-sync on the <a href=\"https:\/\/github.com\/mikebrady\/shairport-sync\">shairport-sync github page<\/a> to make sure I wasn&#8217;t missing anything.<\/p>\n<p>Having installed the software and got it running, I attached the Logitech speakers to the Pi and successfully played music from my phone to the Pi &#8211; the tech part was done.<\/p>\n<p>The Logitech mm50 (and the Logitech Pure-Fi Anywhere series) have two little metal feet that swing out at the back to stand up the speakers. I drilled a couple of small holes in each of these, then using these holes screwed the device upside down to the underside of a kitchen cabinet (and near a power socket but away from anything that might cause problems like steam from the kettle).<\/p>\n<p>Then I used a large drill bit to drill a large enough hole to fit through the wires\/connectors (the power cable for the Pi and the audio cable to join the Pi to the mm50). Finally, I put the Pi in the cupboard, pushe through the power and audio connectors, plugged everything in, and that was it &#8211; all done!<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/www.meanboyfriend.com\/overdue\/wp-content\/uploads\/2016\/01\/IMG_3184.jpg\" rel=\"attachment wp-att-219\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-219\" src=\"http:\/\/www.meanboyfriend.com\/overdue\/wp-content\/uploads\/2016\/01\/IMG_3184-1024x768.jpg\" alt=\"IMG_3184\" width=\"567\" height=\"425\" srcset=\"http:\/\/www.meanboyfriend.com\/overdue\/wp-content\/uploads\/2016\/01\/IMG_3184-1024x768.jpg 1024w, http:\/\/www.meanboyfriend.com\/overdue\/wp-content\/uploads\/2016\/01\/IMG_3184-300x225.jpg 300w, http:\/\/www.meanboyfriend.com\/overdue\/wp-content\/uploads\/2016\/01\/IMG_3184-768x576.jpg 768w, http:\/\/www.meanboyfriend.com\/overdue\/wp-content\/uploads\/2016\/01\/IMG_3184-400x300.jpg 400w\" sizes=\"auto, (max-width: 567px) 100vw, 567px\" \/><\/a><\/p>\n<h3>Issues<\/h3>\n<p>I immediately tested the setup and it worked perfectly &#8211; I was able to stream music, BBC radio iPlayer content, Podcast content from my phone to the Pi.<\/p>\n<p>However when I came back the next day and tried to use it again, my phone didn&#8217;t display the Pi as an Airplay option. I found that various things seemed to make the Pi display as an Airplay option again, but it always went away when it wasn&#8217;t in use and I had to somehow &#8216;trigger&#8217; it again (one odd thing was that the Pi continued to display as an Airplay source in iTunes on my Mac, even when it didn&#8217;t appear on my phone). I reported this as <a href=\"https:\/\/github.com\/mikebrady\/shairport-sync\/issues\/197\">an issue on the shairport-sync Github site<\/a> and the developer (<a href=\"https:\/\/github.com\/mikebrady\">Mike Brady<\/a> &#8211; who is very responsive and helpful) responded with some hints. After doing quite a bit of Googling, digging into how so called &#8216;zero-conf&#8217; works, and looking at documentation around Airplay, I finally found the issue was not with shairport-sync or any of these things, but actually the Wifi dongle I was using going into some low power mode which meant it\u00a0needed a prompt to &#8216;wake up&#8217; and work.<\/p>\n<p>I found this issue documented with a solution at\u00a0<a href=\"https:\/\/www.raspberrypi.org\/forums\/viewtopic.php?t=61665\">https:\/\/www.raspberrypi.org\/forums\/viewtopic.php?t=61665<\/a>).<\/p>\n<p>In brief, the solution is:<\/p>\n<blockquote><p>In the directory \/etc\/modprobe.d\/ make a file called 8192cu.conf<br \/>\nAdd the following lines to the file and save it:<\/p>\n<pre><code># Disable power management\r\noptions 8192cu rtw_power_mgnt=0 rtw_enusbss=0<\/code><\/pre>\n<\/blockquote>\n<p>Once I&#8217;d done this a rebooted, the system worked without a problem.<\/p>\n<p><a href=\"http:\/\/www.meanboyfriend.com\/overdue\/wp-content\/uploads\/2016\/01\/IMG_3187.jpg\" rel=\"attachment wp-att-216\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-216\" src=\"http:\/\/www.meanboyfriend.com\/overdue\/wp-content\/uploads\/2016\/01\/IMG_3187-1024x768.jpg\" alt=\"IMG_3187\" width=\"567\" height=\"425\" srcset=\"http:\/\/www.meanboyfriend.com\/overdue\/wp-content\/uploads\/2016\/01\/IMG_3187-1024x768.jpg 1024w, http:\/\/www.meanboyfriend.com\/overdue\/wp-content\/uploads\/2016\/01\/IMG_3187-300x225.jpg 300w, http:\/\/www.meanboyfriend.com\/overdue\/wp-content\/uploads\/2016\/01\/IMG_3187-768x576.jpg 768w, http:\/\/www.meanboyfriend.com\/overdue\/wp-content\/uploads\/2016\/01\/IMG_3187-400x300.jpg 400w\" sizes=\"auto, (max-width: 567px) 100vw, 567px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This project was to enable us to play audio content (music\/podcasts\/radio) from our iPhones\/iPad in the kitchen. It took me under an hour to complete&#8230; Why? We already use the Apple Airplay facility to play audio content in our living room using iOS devices + an AppleTV connected to a sound system. We wanted to&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-212","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.meanboyfriend.com\/overdue\/wp-json\/wp\/v2\/posts\/212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.meanboyfriend.com\/overdue\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.meanboyfriend.com\/overdue\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.meanboyfriend.com\/overdue\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.meanboyfriend.com\/overdue\/wp-json\/wp\/v2\/comments?post=212"}],"version-history":[{"count":4,"href":"http:\/\/www.meanboyfriend.com\/overdue\/wp-json\/wp\/v2\/posts\/212\/revisions"}],"predecessor-version":[{"id":221,"href":"http:\/\/www.meanboyfriend.com\/overdue\/wp-json\/wp\/v2\/posts\/212\/revisions\/221"}],"wp:attachment":[{"href":"http:\/\/www.meanboyfriend.com\/overdue\/wp-json\/wp\/v2\/media?parent=212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.meanboyfriend.com\/overdue\/wp-json\/wp\/v2\/categories?post=212"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.meanboyfriend.com\/overdue\/wp-json\/wp\/v2\/tags?post=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}