{"id":513,"date":"2019-01-31T21:09:51","date_gmt":"2019-01-31T21:09:51","guid":{"rendered":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/?p=513"},"modified":"2019-04-24T18:19:09","modified_gmt":"2019-04-24T17:19:09","slug":"using-an-orange-pi-zero-as-airplay-speakers","status":"publish","type":"post","link":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/?p=513","title":{"rendered":"Using an Orange Pi Zero as Airplay Speakers&#8230;"},"content":{"rendered":"<h3>&#8230; and redirecting all sound from desktop Ubuntu to them.<\/h3>\n<p>Note that this system isn&#8217;t working perfectly for me and I&#8217;m finding the sound drops out about once a minute. I&#8217;m looking into other methods using pulseaudio.<\/p>\n<h5>On Orange Pi Zero<\/h5>\n<p>Set up an Orange Pi Zero and boot it using an Armbian installation (it will say &#8220;Welcome to ARMBIAN&#8221; when you log in).<\/p>\n<blockquote><p>sudo apt update<br \/>\nsudo apt upgrade armbian-config<br \/>\nsudo armbian-config<\/p><\/blockquote>\n<div id=\"attachment_514\" style=\"width: 744px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/wp-content\/uploads\/2019\/01\/armbian-config01.png\"><img aria-describedby=\"caption-attachment-514\" loading=\"lazy\" class=\"wp-image-514 size-full\" src=\"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/wp-content\/uploads\/2019\/01\/armbian-config01.png\" alt=\"armbian-config Main Menu\" width=\"734\" height=\"496\" srcset=\"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/wp-content\/uploads\/2019\/01\/armbian-config01.png 734w, https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/wp-content\/uploads\/2019\/01\/armbian-config01-300x203.png 300w\" sizes=\"(max-width: 734px) 100vw, 734px\" \/><\/a><p id=\"caption-attachment-514\" class=\"wp-caption-text\">armbian-config Main Menu<\/p><\/div>\n<p>Wait until it loads, then select &#8220;System&#8221; (arrow keys to move up and down, Enter to select).<\/p>\n<div id=\"attachment_515\" style=\"width: 744px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/wp-content\/uploads\/2019\/01\/armbian-config02.png\"><img aria-describedby=\"caption-attachment-515\" loading=\"lazy\" class=\"size-full wp-image-515\" src=\"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/wp-content\/uploads\/2019\/01\/armbian-config02.png\" alt=\"armbian-config System Menu\" width=\"734\" height=\"496\" srcset=\"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/wp-content\/uploads\/2019\/01\/armbian-config02.png 734w, https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/wp-content\/uploads\/2019\/01\/armbian-config02-300x203.png 300w\" sizes=\"(max-width: 734px) 100vw, 734px\" \/><\/a><p id=\"caption-attachment-515\" class=\"wp-caption-text\">armbian-config System Menu<\/p><\/div>\n<p>Scroll down to &#8220;Hardware&#8221; with the arrow keys and press Enter.<\/p>\n<div id=\"attachment_516\" style=\"width: 744px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/wp-content\/uploads\/2019\/01\/armbian-config03.png\"><img aria-describedby=\"caption-attachment-516\" loading=\"lazy\" class=\"size-full wp-image-516\" src=\"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/wp-content\/uploads\/2019\/01\/armbian-config03.png\" alt=\"armbian-config Hardware Menu\" width=\"734\" height=\"496\" srcset=\"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/wp-content\/uploads\/2019\/01\/armbian-config03.png 734w, https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/wp-content\/uploads\/2019\/01\/armbian-config03-300x203.png 300w\" sizes=\"(max-width: 734px) 100vw, 734px\" \/><\/a><p id=\"caption-attachment-516\" class=\"wp-caption-text\">armbian-config Hardware Menu<\/p><\/div>\n<p>Use arrow keys to select &#8220;analog-codec&#8221; (if it isn&#8217;t already) and then press space so that a &#8220;*&#8221; appears between the square brackets (if it isn&#8217;t there already).<br \/>\nPress Enter to Save.<\/p>\n<p>Right arrow to select &#8220;Exit&#8221; and press Enter.<\/p>\n<p>Right arrow to select &#8220;Cancel&#8221; and press Enter.<\/p>\n<p>Right arrow to select &#8220;Cancel&#8221; and press Enter.<\/p>\n<p>You have now enabled the audio output.<\/p>\n<blockquote><p>sudo apt install shairport-sync<\/p><\/blockquote>\n<p>You now have the sound server program running. Lets name it something different.<\/p>\n<blockquote><p>sudo nano \/etc\/shairport-sync.conf<\/p><\/blockquote>\n<p>Use the arrow keys to move the cursor to the start of the first line after &#8220;general =&#8221; that starts with a &#8220;\/\/&#8221;. Press return to add a new line above it.<\/p>\n<p>On the new line you created, press tab and then type (for example) :<\/p>\n<p>name = &#8220;Sitting Room Speakers&#8221;<\/p>\n<p>The part of the file should now look like this :<br \/>\n________________________________________________________________________________<br \/>\n\/\/ Sample Configuration File for Shairport Sync<br \/>\n\/\/ Commented out settings are generally the defaults, except where noted.<\/p>\n<p>\/\/ General Settings<br \/>\ngeneral =<br \/>\n{<br \/>\nname = &#8220;Sitting Room Speakers&#8221;<br \/>\n\/\/ name = &#8220;%H&#8221;; \/\/ This means &#8220;Hostname&#8221; &#8212; see below. This is the name th$<br \/>\n________________________________________________________________________________<\/p>\n<p>Press Ctrl+x<br \/>\nPress y<br \/>\nPress Return<\/p>\n<p>On mine I found that it was turned down really low, so had to turn it up. Run the following command to set the volume levels :<\/p>\n<blockquote><p>alsamixer<\/p><\/blockquote>\n<p>Left and right arrows select the &#8220;fader&#8221; &#8211; you want to push &#8220;Line Out&#8221; and &#8220;DAC&#8221; up. Push them both up until they start turning grey instead of green &#8211; you might want to return to this later to fine tune levels once you have music playing.<\/p>\n<p>Restart the Orange Pi Zero :<\/p>\n<blockquote><p>sudo reboot<\/p><\/blockquote>\n<h5>On Linux Desktop Computer (e.g. BeeLink S2)<\/h5>\n<blockquote><p>sudo apt update<br \/>\nsudo apt install paprefs pulseaudio-module-raop<\/p><\/blockquote>\n<p>Search for an application called &#8220;PulseAudio Preferences&#8221; (press the windows key and start typing)<\/p>\n<p>Check &#8220;Make discoverable Apple AirTunes sound devices available locally&#8221; and click &#8220;Close&#8221;.<\/p>\n<p>Restart the computer.<\/p>\n<p>Launch the &#8220;Settings&#8221; application and go to &#8220;Sound&#8221;. You should see your Orange Pi listed under &#8220;Output&#8221;. I have two versions appearing, one has what looks like a MAC address after it, the other my Orange Pi&#8217;s ip address. Use the latter.<\/p>\n<p>Note there is usually a couple of seconds of latency due to the buffering, but this is fine with music (not so much with video).<\/p>\n<h5>If the audio drops out once in a while&#8230;<\/h5>\n<p>The following command increases the priority of the shairport-sync server running on the Orange Pi Zero by setting all process run by the user (-u) &#8220;shairport-sync&#8221; to be very important. Hopefully this will help. Another option might be to increase the buffer size, although this would increase latency.<\/p>\n<blockquote><p>sudo renice -n -19 -u shairport-sync<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>&#8230; and redirecting all sound from desktop Ubuntu to them. Note that this system isn&#8217;t working perfectly for me and I&#8217;m finding the sound drops out about once a minute. I&#8217;m looking into other methods using pulseaudio. On Orange Pi Zero Set up an Orange Pi Zero and boot it using an Armbian installation (it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":218,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[13,42,12],"tags":[185,183,188,171,184,187,46,186],"jetpack_featured_media_url":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/wp-content\/uploads\/2017\/09\/LoggedIntoNeo-e1548970332180.png","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7g9vY-8h","_links":{"self":[{"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=\/wp\/v2\/posts\/513"}],"collection":[{"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=513"}],"version-history":[{"count":3,"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=\/wp\/v2\/posts\/513\/revisions"}],"predecessor-version":[{"id":528,"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=\/wp\/v2\/posts\/513\/revisions\/528"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=\/wp\/v2\/media\/218"}],"wp:attachment":[{"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=513"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}