AirPi – AirPlay audio with Raspberry


update here

I always wanted to stream music from my music player using network to serve each room. With AirPlay, Apple gave me an easy way to achieve it, but requires more device from that company. An Airport Express costs 99$/€, and even if I love my iPhone and my MacBook, I will never pay for a an Airport or AppleTV device.

With RaspberryPi, the foundation gave me the solution ! Around 30$/€ and some recycled extras, and we are up to enjoy AirPlay Audio, open source and low-cost. It relies on shairport, and we’ll make it without pluging any keyboard, mouse or display.

If we need a Video support, just deal with RaspBMC. But if you only want an audio player, read the rest of the post ;)

Install Raspbian “wheezy”
Follow instructions given on the official raspberry website. Once you have your SD card ready, insert it in your Pi then plug Ethernet and Power cables in.

First boot and login
To log into your Pi with SSH, you need to know its IP adress.
If you have a decent DHCP/DNS server on your network, the Pi should have been registered on your DNS, so try ping raspberrypi from your computer command-line.

If it doesn’t work, you may try to log into your router to see DHCP leases/allocations.
You can also try all IPs of your network range, or use a network scanner like Fing (iOS) or Scapy (python).

 

When you have your Pi’s IP, you can login using SSH :
On Windows, you will need to download and install Putty.
On Linux/MacOS, open a terminal then type : ssh pi@raspberrypi (or replace raspberrypi with its IP)
When prompted, type the password raspberry

Right now, the first thing to do is to configure your raspbian :

pi@raspberrypi:~$ sudo raspi-config

I suggest to first update, then expand the filesystem, change the password, the locale and timezone. Keep SSH enabled and desktop start disabled. Finish and reboot when prompted.
It may take some time to expand the filesystem at reboot. Just wait few minutes then login using ssh again.

Gaining root access
root user is disabled for login, but you can become root if you are already logged to avoid multiple sudo

pi@raspberrypi:~$ sudo su
root@raspberrypi:/home/pi# cd
root@raspberrypi:~#

Upgrade Debian
At this step, it’s a good idea to upgrade pre-installed packages :

root@raspberrypi:~# aptitude update
root@raspberrypi:~# aptitude upgrade

Change audio output
To force audio output to stereo jack, a single line is required :

root@raspberrypi:~# amixer cset numid=3 1

Install shairport
Before download and compile shairport, we need to install prerequisites :

root@raspberrypi:~# aptitude install git libao-dev libssl-dev libcrypt-openssl-rsa-perl libio-socket-inet6-perl libwww-perl avahi-utils

Then download shairport sources and compile it :

root@raspberrypi:~# git clone https://github.com/albertz/shairport.git shairport
root@raspberrypi:~# cd shairport
root@raspberrypi:~/shairport# make

Finally, launch shairport foreground :

root@raspberrypi:~/shairport# ./shairport.pl -a AirPi

You can now use your iDevice to try AirPlay audio, don’t forget to plug an headphone or speakers into the 3.5mm stereo jack.

If you want or need your Pi load automatically shairport, follow next procedure :

root@raspberrypi:~/shairport# make install
root@raspberrypi:~/shairport# cp shairport.init.sample /etc/init.d/shairport
root@raspberrypi:~/shairport# cd /etc/init.d
root@raspberrypi:/etc/init.d# chmod a+x shairport
root@raspberrypi:/etc/init.d# update-rc.d shairport defaults

Before starting the daemon, we have to add the AP Name in the launch parameters. Edit the file usingnano shairport then change the DAEMON_ARGS variable line so it looks like to :

DAEMON_ARGS="-w $PIDFILE -a AirPi"

Replace AirPi by whatever you want, save, quit and start the service to enjoy shairport in background and your AirPi :

root@raspberrypi:/etc/init.d# ./shairport start

To go more further, we can replace the Ethernet cord by a WIFI USB dongle, make a hole in a tupperware case for the power and audio cord, then place the Pi inside to get a bathroom-ready AirPi ;)

You may notice some glitchy noise. This is due to the analog output, which is not a real DAC, but a simple PWM generator. A USB sound card will give you a better audio quality.

This entry was posted in  RaspberryPi by  trouch. Bookmark the  permalink.

110 THOUGHTS ON “AIRPI – AIRPLAY AUDIO WITH RASPBERRY

  1. ddg on  5 August 2012 at 2 h 24 min  said:

    Thanks!

  2. DagA on  5 August 2012 at 15 h 03 min  said:

    Thanks! Everything worked ok until I did the part on making it a daeamon. I can’t start the service because it says buffer value must be > 30 and < 512? Where can I set that value?

    • trouchon  5 August 2012 at 15 h 48 min  said:

      No idea about what happened for you.
      If you succeed to launch a process foreground, you may have altered the init script.

    • Peteron  20 October 2012 at 22 h 53 min  said:

      I got that error when I mistakenly launched “./shairport” instead of “./shairport.pl”, so check your postfixes :)

  3. hi this is an interesting piece sant’ve learned a bit of

  4. Fantastic article – thanks for putting this together! No installation problems whatsoever. I now have an airplay-enabled car :)

  5. NorA on  15 August 2012 at 15 h 18 min  said:

    After playing 2-4 min, im starting to get cropping sound with underuns. Its kinda useless now. Any way to fix? I have tryed two times on fresh rasbian install.

  6. FYI, This version of shairport will crash immediately as soon as an iOS6 device connects to it. To work around this problem, you’ll need to install this fork of shairporthttps://github.com/hendrikw82/shairport – unfortunately it requires an additional perl module – but you can get it at https://github.com/njh/perl-net-sdp

    • trouchon  16 August 2012 at 21 h 14 min  said:

      I think the most reasonable things to do is to wait at least the GM release of iOS6 ! But thanks for the recommandation. I will update when iOS6 will be release.

    • And in more detail, here’s how to switch to the hendrikw82 version of shairport, handling the perl-net-sdp stuff.

      sudo su
      cd /etc/init.d
      ./shairport stop
      cd
      mv shairport shairport_old
      aptitude install libmodule-build-perl
      git clone https://github.com/njh/perl-net-sdp.git perl-net-sdp
      cd perl-net-sdp
      perl Build.PL
      ./Build
      ./Build test
      ./Build install
      cd
      git clone https://github.com/hendrikw82/shairport.git shairport
      # and the rest is repeating the install instructions from the original post
      cd shairport
      ./shairport.pl -a AirPi
      # check it works then Ctrl-C
      make install
      cp shairport.init.sample /etc/init.d/shairport
      cd /etc/init.d
      chmod a+x shairport
      update-rc.d shairport defaults
      nano shairport
      # edit DAEMON_ARGS line: eg DAEMON_ARGS=”-w $PIDFILE -a AirPi”
      ./shairport start

  7. Leigh on  20 August 2012 at 1 h 31 min  said:

    Thanks for the tutorial – as Adam states – You will need to use the revised version of shairport for ios6 – but it seems a lot less buggy that the initial RaspBMC version I use to run, its just replaced one of my Apple Expresses :)

    Cheers

  8. Darren on  20 August 2012 at 19 h 49 min  said:

    Thanks for the tutorial – a real godsend! I am having one problem though and its driving me insane…

    I can see my Pi via Airplay from any of my iOS devices. So, in that respect I know it is installed and receiving audio, as it was sending to the analogue output as per your instructions above. I also have an external USB device setup, and I know this is working OK because if I type “aplay [soundfile]” it plays with no problems. However when I send audio from my Mac to the Pi via AirFoil, I get nothing. Its almost as if the audio is internally routing to the onboard soundcard or something.

    Any ideas? I’ve a feeling it is easily solved by my fairly limited Linux knowledge is making this rather hard…

    many thanks!

    • trouchon  20 August 2012 at 20 h 33 min  said:

      Did you try to plug an headphone or speakers on the Pi jack ?

      Another thing, when launching shairport foreground, it may give you some log to explain the problem. I don’t have a usb sound card to try it…

    • Darrenon  20 August 2012 at 21 h 54 min  said:

      I started something playing via AirPi and plugged the same lead into the headphone socket. No joy. Given it did work before, I’m assuming that output is now disabled… but still nothing is coming from the USB soundcard.

      The weird thing is that if I just do a simple “airplay [file]” then it *does* play from the USB soundcard. So by default (unless I’m presuming something wrongly here) audio is going to the USB device…

      I’m stumped. How can I launch Shairport in the foreground? That might at least give me some more info to go on…

    • trouchon  20 August 2012 at 23 h 25 min  said:

      it’s explained in this article !
      root@raspberrypi:~/shairport# ./shairport.pl -a AirPi

    • Darrenon  21 August 2012 at 10 h 09 min  said:

      My apologies!

      Ran it, and get the following:

      “avahi daemon terminated or ‘avahi-publish-service’ binary not found at ./shairport.pl line 236, line 23.”

    • trouchon  21 August 2012 at 19 h 22 min  said:

      Really weird, as avahi is used for the discovery protocol (Bonjour), so you should not be able to see your Pi with the iPhone Music player. Check you have it with sudo aptitude install avahi-utils.

  9. Lewis on  20 August 2012 at 22 h 02 min  said:

    Anyone tried connecting to gtihub.com today?

    My connection keeps timing out and I’m unable to clone shairport. Tried hendrikw82 with same result

    Any ideas?

  10. trn on  20 August 2012 at 23 h 53 min  said:

    Hey, thanks for the excelent tip!
    Do you have any idea on how to get it running on XBian? …using hdmi audio.

    • Darrenon  21 August 2012 at 11 h 26 min  said:

      Would it not be the same process? I guess it depends if you mean “running in XBMC on Xbian” or just “running on the Xbian distro itself”…

    • trouchon  21 August 2012 at 19 h 27 min  said:

      to use hdmi audio output :
      amixer cset numid=3 2

      but XBian may suffer the same issue than RaspBMC and openELEC, on the sound driver.

  11. Stephen Champney on  21 August 2012 at 12 h 33 min  said:

    Having problems installing, which seem to be based around the e2fslibs package – when I run the aptitude upgrade, it has problems installing this package, and then the shairport installation fails because it “cannot create a file for the e2fslibs package.” Any ideas anyone?

    • trouchon  21 August 2012 at 19 h 16 min  said:

      certainly an issue with the package repository, try again later (sudo aptitude update && aptitude upgrade)

  12. GwaveOne on  23 August 2012 at 21 h 30 min  said:

    Very nice tutorial! Thanks!
    Is it possible to send play/pause and forward/backward commands to the iOS Device?
    This would be very nice.

  13. Swello on  26 August 2012 at 23 h 46 min  said:

    This is exactly what I’m looking for – great stuff, thanks!

    My current situation is that I have audio working well via the headphone out into my hi-fi amp – but the sound quality is (as expected) noticeably worse than my current optical connection between my Airport Express and my Hi-fi DAC (Cambridge Audio DAC Magic) – so I’m looking to use USB audio from the Pi.

    I have tried AirPi with both the DAC Magic and a portable Ibasso D12 DAC/Amp combo and in both cases, I get no audio and the following error:


    ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition ‘cards.BRCM bcm2835 AL.pcm.front.0:CARD=0′
    ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib conf.c:4720:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM front

    missing frame.
    bye!”

    Is there a further step to have it recognise these DACs? Any help appreciated.

    • according to the rasberrypi.org theres issues with Audio using USB not many devices recognized yet so as with most DAC hardware we will have to wait. for them to fix the USB issue

  14. Fantastic step by step instructions – worked first time, thank you. As a linux newbie, I’m totally reliant on this kind of stuff to get me started – otherwise I’d be lost. Alas, the stereo sound quality of the Pi is just too rubbish to be of use. Sure, USB sound cards might help, or I could take the digital audio from the HDMI port I guess. However, this all spoils the ‘everything in one small, cheap box’ promise of the Pi. For now, it’ll be relegated to me playing with linux rather than doing very much useful with it. Anyhow, thanks again for getting me this far and enabling me to make that decision!

  15. Garry on  28 August 2012 at 5 h 21 min  said:

    Thanks for sharing! This is fantastic and works perfectly.

  16. Awesome post! Thanks for writing this all up. It worked flawlessly for me. I also added the following line to the shairport script to have the output volume of the RaspberryPi set to the maximum (without clipping) upon starting the service:
    amixer set PCM 1dB
    amixer set PCM 1dB-

    The reason for the two commands is for some reason, “amixer set PCM 0dB” doesn’t have any affect on the volume (although amixer reports it’s set to 0dB gain).

    • Martin Dellon  4 October 2012 at 23 h 02 min  said:

      Hi Arsham, thanks for the tip about the max volume control. As a complete newbie I could do with some step-by-step instructions though?

      I don’t know what / where the shairport script is or how to add those two lines to it. Sorry for asking such a basic question. Have searched for help but come up blank.

      As an aside, audio quality on the pi from the analogue audio jack is much improved – definitely usable now!

  17. airpo on  21 September 2012 at 9 h 39 min  said:

    very helpful article, unfortunately i made the recent raspian update (2012-09-18-wheezy-raspbian) after that shairport didnt work anymore. I re-did all your steps but when i try to start shairport via ./shairport.pl -a AirPi i get the following error:
    avahi daemon terminated or ‘avahi-publish-service’ binary not found at ./shairport.pl line 236, line 23.
    bash: DATA: Datei oder Verzeichnis nicht gefunden

    Any idea to solve the problem are appreciated.
    thx

  18. Same here! I guess it would be better to wait for the latest version of raspbmc and install shairport on top of it …

  19. Found a fix!
    You have to install this Perl module (https://github.com/njh/perl-net-sdp#readme) and then use this branch of shairport (https://github.com/hendrikw82/shairport#readme).

    Works perfectly for me, and the sound quality is noticeably improved as well !

  20. Venky on  24 September 2012 at 2 h 44 min  said:

    Excellent Post. Audio worked fine. No issue. No distortion.
    But I don’t get video. When I play a movie, I get the audio via my RasPi but the video is still in my iPhone. How do I also stream the video to my RasPi?

    Venky

    2012-09-18-wheezy-raspbian
    sound over HDMI.

    • No luck so far. I am going to explore xmbc in RasPi.
      I guess shairport is based on AirPlay V1 (Audio Only). Video is supported only in AirPlay V2.

  21. To get the current release going just install cpanminus, configure cpan for “sudo” and install the Net::SDP package as a last additional requirement.

    # sudo apt-get install cpanminus
    # cpan

    when asked go for “sudo” and close the cpan shell with quit
    # sudo cpanm Net::SDP

    Now you are good for the shairport fork
    # git clone https://github.com/hendrikw82/shairport
    and continue like before

  22. TheGuardian on  27 September 2012 at 10 h 14 min  said:

    A new firmware upgrade improved the audio quality, the ‘pop’ sound on first sound is also much less (analog output). Howto:http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=17788&p=176847

  23. By the way, I had one of these USB sound cards lying around:
    http://www.amazon.com/Behringer-UCA202-USB-Audio-Interface/dp/B000J0IIEQ

    And it worked with the RPi with very little effort, powered off the RPi and everything. Sounds pretty good testing through DJ headphones.

    I did edit one file to set the USB device as default:

    sudo nano /etc/asound.conf

    commented out whatever’s there, and added:

    #USB audio
    pcm.!default {
    type hw
    card CODEC
    device 0
    }
    ctl.!default {
    type hw
    card CODEC
    }

    CODEC is the name ALSA sees it as.

    Now I got a DIY airport express for only the low low price of an RPi + USB card + wifi dongle + Power adapter + case + lots of my time futzing around ;) But hey, it’s for fun.

    Hope this helps someone, as I think we’re all finding the analog audio out just plain sucks.

  24. Chris on  30 September 2012 at 17 h 09 min  said:

    If I were using a USB Wi-Fi dongle, could I theoretically create an ad-hoc network and use airplay over that, essentially eliminating the need for the router? I’m really new to linux so sorry if that’s a dumb question.

  25. Paul on  2 October 2012 at 19 h 22 min  said:

    “Can’t locate Net/SDP.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at ./shairport.pl line 48.
    BEGIN failed–compilation aborted at ./shairport.pl line 48.”

    appears when I try to ./shairport.pl -a AirPi

    What am I missing?

    • “If you get the error message “Can’t locate Net/SDP.pm in @inc” execute the following command as root and accept all defaults during configuration of cspan:

      cpan install Net::SDP

      Now it seems to work :)

    • Karanon  10 October 2012 at 22 h 44 min  said:

      This is stupid, but how do you execute a command as root?

    • thanks very much, this solved my problem :)

  26. Isaac Zac on  9 October 2012 at 20 h 14 min  said:

    I have install the fix for ios 6(I think I installed it right with the git clone command)and I have installed hairtunes as it was saying it cant work with out it and I did the cpan command now it has an error saying:
    Audio StreampBUu6RCdyFv9r2r8nFfvHw==sh: 1: /root/shairport/hairtunes: Permission denied
    Use of uninitialized value $portdesc in pattern match (m//) at ./shairport.pl line 684.
    Use of uninitialized value $portdesc in concatenation (.) or string at ./shairport.pl line 684.
    avahi daemon terminated or ‘avahi-publish-service’ binary not found at ./shairport.pl line 237.

    Help me thanks.

    • Isaac Zacon  9 October 2012 at 21 h 53 min  said:

      Nevermind I did some random things and I got it to work. Sorry I cant tell you cause I cant remember.

  27. Chris on  10 October 2012 at 0 h 01 min  said:

    Great stuff! But I have a problem:
    after typing ./shairport.pl -a AirPi there comes: Can’t locate Net/SDP.pm in @NC (@INC contains etc/perl user/local…….) at ./shairport.pl line 48. BEGIN failed–compilation aborted at ./shairport.plline 48.
    Someone an idea??
    Thanks!

  28. Karan on  10 October 2012 at 22 h 46 min  said:

    is it
    “sudo ./shairport.pl “

  29. menno on  16 October 2012 at 21 h 18 min  said:

    I’m running into some problems:

    root@raspberrypi:~/shairport# ./shairport.pl -a AirPi
    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = “UTF-8″,
    LANG = “en_GB.UTF-8″
    are supported and installed on your system.
    perl: warning: Falling back to the standard locale (“C”).
    Can’t locate Net/SDP.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at ./shairport.pl line 48.
    BEGIN failed–compilation aborted at ./shairport.pl line 48.

  30. Thanks to you guys for helping with this! must say! It is much more stable than what i experience with raspbmc! So thumps up! and also thumbs up for you @Paul for

    cpan install Net::SDP

    I would not have guessed!

  31. Scottish Dave on  22 October 2012 at 14 h 01 min  said:

    I’ve had trouble with shairport crashing when I disconnect and the reconnect. I have found disabling ipv6 on osx sorted it out for me.

  32. Rob on  30 October 2012 at 18 h 50 min  said:

    So I get this error:
    root@XBian:~/shairport# ./shairport.pl -a AirPi
    Failed to create client object: Daemon not running
    avahi daemon terminated or ‘avahi-publish-service’ binary not found at ./shairport.pl line 237, line 23.

  33. Chris Paterson on  3 November 2012 at 6 h 35 min  said:

    Anyone find that the most recent version of itunes can’t see the AirPlay server?

  34. Guus on  3 November 2012 at 14 h 25 min  said:

    I have tried everything but can’t get it to work. Continuously running into the ‘avahi-publish-service’ problem.

    Is there an easier way of doing this. I’m a Linux newbie and am not seeing the forest for the trees.

    Thanks

  35. trouch on  3 November 2012 at 14 h 48 min  said:

    Please tell which distro you are using when posting your issues.
    Did you double check prerequisites given in the article ?

    • I am using wheezy and I finally got it to work. I was apparently missing some packages.

      Thanks for all the instruction.

  36. Peter on  13 November 2012 at 22 h 51 min  said:

    Hi all
    Great post.
    I’ve installed latest wheezy (oct 18) and used the IOS6 fix.
    Everything worked out of the box from start.
    The only problem i have in this first test, is a loud ‘click’ when i switch music to the Pi
    first time. (Not so good for the loudspeakers at high volume)

    Anyone else seen this ?
    br,
    Peter C

  37. RyPi on  17 November 2012 at 3 h 40 min  said:

    Excellent, not only is this a brilliant guide, it really works, thanks to the comments too.

  38. Milos on  9 December 2012 at 0 h 30 min  said:

    If you have issue with avahi service try this on arch:
    systemctl enable /usr/lib/systemd/system/avahi-daemon.service

  39. Manuel Parra on  16 December 2012 at 13 h 35 min  said:

    What if I want to do the opposite? Stream audio from the RaspberryPi to another Airplay receiver?

    I was thinking of using the command line mplayer on the RaspberryPi to play the file and send the audio to an airplay speaker. Maybe send it to another RaspberryPi with shairport on it or my Apple TV.

  40. Hi Trouch,

    Thanks so much for this, got my pi working perfectly.

    Just a tip for anyone looking for a cheep all-in-one USB speaker I have my pi working first time with a Altec Lansing Orbit USB iML237. It’s powered from the pi so no batteries or additional power sources and uses it own sound card so no pops like the built in card. It only cost me £20 from eBay and sounds amazing for the size. No drivers needed just plug in and boot pi that’s it! :-)

    Has anyone had any success with making their pi read only which would allow the power to be cut without a shutdown on a regular basis?

    Thanks,
    Dom

  41. PS has anyone tried multiple AirPi’s, do they stay in sync like the apple AirPlay devices?

    Thanks,
    Dim

  42. Jordan on  29 December 2012 at 11 h 01 min  said:

    Hi, I have managed to get it all running, however, it does not appear on my iPhone. Do you have any suggestions?

  43. Steven on  30 December 2012 at 17 h 16 min  said:

    Hi, I have this setup but now everytime I try to access the pi through iTunes it isn’t visible, although when using this tool I get this screen —http://www.chorkley.co.uk/pi/screen_shots/bonjour_error.png and —http://www.chorkley.co.uk/pi/screen_shots/iTunes_screenshot.png

    Can anyone help me?

  44. Andrew on  3 January 2013 at 14 h 36 min  said:

    Hi All,
    Having some issues with the audio via HDMI. I’ve set everything up correctly, and can see the device showing in iTunes, but when I redirect the audio to it, the amplifier that it’s connected to shows no audio. Well, it detects something, but just flashes then goes out, then flashes again and goes out.

    I’ve set amixer cset numid=3 2 to make sure the audio goes through the HDMI, but still nothing.

    It’s a Sony muteki amplifier that it’s connected to, and I can see the video on the TV perfectly.

    When I connect my laptop in via the same HDMI cable, the audio works perfectly.

    Any suggestions would be great!

    • trouchon  3 January 2013 at 15 h 48 min  said:

      Did you try with with the analog output (and a headset for instance) to check AirPi is correctly working ?

  45. Damian on  4 January 2013 at 4 h 07 min  said:

    I’m getting far too many overruns on both HDMI and with the headphone jack outputs.

    I’ve built both the versions of shairport mentioned in this article, yet the symptoms are still there.

    This is on the latest Raspbian running on a Model B using an RJ-45 connection.

    Any suggestions.

    Damian

  46. Ikav on  4 January 2013 at 13 h 24 min  said:

    Hi, Thank you for a great tutorial. I have done all but cannot make work. Actually it all works fine, just no sound comes out from analog audio out nor HDMI. I have tried test audio (..front.wav) and that worked. My iPod touch lets me select AirPi, then I start play, it shows album cover in few seconds, the play icon on the iPod status bar shows fine but there so sound coming out from the RPi output. Could somebody help? I am new to Raspberry Pi.
    Thank you

    • trouchon  4 January 2013 at 15 h 40 min  said:

      how do you start airpi ?
      using the /etc/init.d startup script or using shairport directly from the command line ?
      By using shairport foreground on the command line, you may have some error display to understand what happen.

  47. Ikav on  4 January 2013 at 17 h 05 min  said:

    Thanks for your reply trouch. It starts at boot from the /etc/init.d folder. I have stopped it and started manually from the command line: in shairport folder “./shairport.pl -a AirPi”, after few seconds it shows line “Established under name ‘xxxxxx@AirPi’” (where xxxxxx is a string of digits and letters) and stays there, no errors or other messages. AirPi is now available on iPod. Still no audio from outputs. I wonder if I need to add a user to a group/session as a warning “PulseAudio configured for per-user session” shows while booting up or halting.
    Thank you for your help.

  48. Hallo zusammen,

    vielen Dank für die super Anleitung, ich bin an dem Absturz bei iOS 6 Geräten fast verzweifelt.
    Mir als relativ unerfahrenen Nutzer ist es mit dieser Anleitung auf Anhieb gelungen auf einem Rechner den Dienst ganz normal zu starten und zu stoppen. Auf einem zweiten hatte ich eine alte Version von Shairport (die ohne iOS 6 UNterstützung installiert und bin gemäß dieser Anleitung vorgegangen. Wenn ich Shareport über /usr/local/bin/shairport.pl starte läuft es einwandfrei. Wenn ich versuche es über den Dienst zu starten /etc/init.d/shairport start läuft es nicht.
    Hatte mehrfach alles wieder deinstalliert und wieder installiert, aber ich finde den Fehler nicht und habe keine Ahnung wo ich suchen soll.
    /etc/init.d/shairport status
    liefert
    status: Unknown job: shairport
    Das bekomme ich aber auch auf dem Rechner angezeigt, bei dem es funzt.

    Der Rechner auf dem es funzt ist ein eeePC mit 12.10 32 bit
    Der Rechner auf dem es nicht funzt ein normaler Quadcore mit 12.10 und 64 Bit.

    Die /etc/init.d/shairport ist identisch, bis auf den Namen (-a XYZ)

    Kann mich einer in die richtige Richtung schubsen?
    Bin seit 2 Stunden am googeln und finde keinen Anhalt.

    Danke!!
    Daniel

  49. mike on  5 January 2013 at 17 h 51 min  said:

    as soon as I try to launch shairport I get this error:

    Can’t locate Net/SDP.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at ./shairport.pl line 48.
    BEGIN failed–compilation aborted at ./shairport.pl line 48.

  50. Turtlefish on  6 January 2013 at 17 h 21 min  said:

    Newbie here, I’m following your instructions, but get the following error:

    shairport.git/info/refs not found – did you run git update-server info on the server..

    Tried for both ‘albertz’ and ‘hendrikw82′ .git URL

    A little help?

  51. mark3rr on  6 January 2013 at 22 h 43 min  said:

    I only get this message when I want to execute shairport:

    root@raspberrypi:/usr/local/bin# ./shairport.pl -a AirPi
    Can’t exec “avahi-publish-service”: No such file or directory at ./shairport.pl line 275.
    Can’t exec “dns-sd”: No such file or directory at ./shairport.pl line 280.
    Can’t exec “mDNSPublish”: No such file or directory at ./shairport.pl line 286.
    could not run avahi-publish-service nor dns-sd nor mDNSPublish at ./shairport.pl line 290.
    **************************************
    * IO::Socket::INET6 not present! *
    * Install this if iTunes won’t play. *
    **************************************
    what should I do now? Im running on a raspi..

  52. Kwijibo007 on  7 January 2013 at 14 h 31 min  said:

    Great tutorial thanks!

    Just one question, when running as daemon, is any of the output shown when running in the foreground outputed to a log? If so, where is it?

  53. kim on  8 January 2013 at 15 h 29 min  said:

    can’t get it to work – although shairport does seem to be running with an “Established under name ‘xxxxxxxxxxxxxxxxxxxxxx@Airpi.

    When doing the perl Build.pl command i get
    root@raspberrypi:/perl-net-sdp# perl Build.PL
    WARNING: the following files are missing in your kit:
    Makefile.PL
    META.yml
    Please inform the author.

    Created MYMETA.yml and MYMETA.json
    Creating new ‘Build’ script for ‘Net-SDP’ version ’0.07′

    Is this the reason why I can’t see Airpi -and any answers how I can make it work??

  54. kim on  9 January 2013 at 12 h 12 min  said:

    as you were – one can ignore the error messages. It works on the ipad. I was trying to get it to work with Android’s airtwist – which doesn’t work.

  55. Rob on  12 January 2013 at 1 h 52 min  said:

    Great tutorial, thanks!

    All’s working fine until I quit Terminal on my Mac. As soon as I quit, AirPi closes and the music stops. I need to reopen Terminal and go through the startup process again.

    Shouldn’t the raspberrypi keep running in whatever state it was in regardless of whether Terminal is open or not.

    Also, I lose the command line when it starts. I’ve pasted below what happen inside Terminal once it starts. That just keeps writing lines about missing packets every minute or so.

    Any help greatly appreciated!

    —————————————-

    root@raspberrypi:~/shairport# ./shairport.pl -a AirPi
    Established under name ’7F827F25C26E@AirPi’
    Audio StreamkZTkqR01xYesa27Iyh+kQw==ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front

    missing frame.
    requesting resend on 1 packets (port 53210)
    requesting resend on 1 packets (port 53210)
    requesting resend on 1 packets (port 53210)
    requesting resend on 1 packets (port 53210)
    requesting resend on 1 packets (port 53210)
    requesting resend on 1 packets (port 53210)
    requesting resend on 1 packets (port 53210)
    requesting resend on 1 packets (port 53210)
    requesting resend on 1 packets (port 53210)
    requesting resend on 1 packets (port 53210)
    requesting resend on 1 packets (port 53210)
    requesting resend on 1 packets (port 53210)
    requesting resend on 1 packets (port 53210)
    requesting resend on 9 packets (port 53210)

    • As I finished typing my last post it cut out again. This is what the final response was:

      ——

      missing frame.
      bye!

    • Sorted it out.

      I was starting the app with:

      ./shairport.pl -a AirPi

      rather than

      ./shairport start (as outlined in the instructions.)

      All’s working beautifully, thanks!

  56. imseamless on  16 January 2013 at 1 h 57 min  said:

    Anyone have any luck getting video out? I understand the limitations of airplay v1 (audio only), but since they’re doing it in RaspMC (so I’ve heard) I assume it’s possible.

    Thanks for the instructions- works great using both analog and digital outputs.

  57. Owen on  17 January 2013 at 19 h 57 min  said:

    I get this error when trying to start the Airpi…
    Can’t locate Net/SDP.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at ./shairport.pl line 48.
    BEGIN failed–compilation aborted at ./shairport.pl line 48.

    • jlsantaon  18 January 2013 at 15 h 15 min  said:

      I Have the same problem

    • jlsantaon  18 January 2013 at 15 h 17 min  said:

      Exactly

      root@raspberrypi:~/shairport# ./shairport.pl -a AirPi

      Can’t locate Net/SDP.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at ./shairport.pl line 48.
      BEGIN failed–compilation aborted at ./shairport.pl line 48.

    • jlsantaon  18 January 2013 at 17 h 36 min  said:

      Solved Thx Paul

      Paul on 2 October 2012 at 19 h 28 min said:

      “If you get the error message “Can’t locate Net/SDP.pm in @inc” execute the following command as root and accept all defaults during configuration of cspan:

      cpan install Net::SDP

      Now it seems to work :)

  58. Steven on  18 January 2013 at 13 h 14 min  said:

    I know this isn’t in line with the intent of the original hack, but I have a windows box on my network near my media centre already, so I installed a virtual box with Ubuntu and followed the recipe. Worked perfectly first time.
    I just have a problem with the sound quality (remember I’m not using a raspberry yet)
    I have good network speeds even in the virtual box, and the sound coming through from the box (if I play an mp3 or something) is great, but streaming from my phone or ipad the quality is horrendous, I am new to this kind of stuff, I was just wondering if anyone can point me in a direction of where I can find come kind of tweakable values for the streaming quality or audio output quality for the stream specifically.
    I’ve ordered a Raspberry – and when it arrives, I want to set it up as an in-car system. but if possible, I’d like to keep my virtualbox setup for my living room.

    • Stevenon  18 January 2013 at 16 h 21 min  said:

      If I run as root – sudo ./shairport/shairport.pl -a Air.Buntu
      The sound quality is a lot better – I’d be really interested to know what the difference is.
      And if it runs as a deamon / service at startup, the sound is bad again.
      Any ideas or suggestions?
      Steve

  59. Paul on  18 January 2013 at 13 h 21 min  said:

    AirPi is now running on Raspian “wheezy” powered Pi. Thank you for all the tips and comments – they were invaluable. There are still big pops on start up and between songs – but USB sound card is an easy fix. No project is ever really finished, so my next challenge is to get the audio to play via FM 100 MHz from GPIO pin 4 as I’ve seen with RadioPi. My car has no AUX jack, so I need to feed the radio receiver. Any hints on how to draw on the AirPi as the source rather than a .WAV file?

    • Stevenon  18 January 2013 at 15 h 30 min  said:

      That would be awesome! :)

    • Stevenon  4 February 2013 at 12 h 16 min  said:

      Hi,
      I’ve tried the radio thing and it didn’t seem to have good reception at all. I had a bit of trouble finding which pin to put the antenna wire on, the youtube video had it on pin 4 and the wiki had it on GPIO4 which I think is something like pin 16 (without pics) so I tried a few ways, with no real boost in signal. I still want to get it working tho, I think it’s a great idea.

  60. Que on  20 January 2013 at 19 h 01 min  said:

    Set the Volume Level to Maximum

    amixer cset numid=1 400

  61. Super travail, merci !

  62. Eric on  1 February 2013 at 20 h 34 min  said:

    Works like a charm – Thanks for posting excellent instructions. Got it working precisely under one hour.

  63. Eric on  1 February 2013 at 22 h 22 min  said:

    I’m able to send audio out to HDMI port instead of stereo jack port.

    As root, issue mixer cset numid=3 2 (comment: 0=default, 1=stereo, 2=hdmi)
    At first it didn’t work a couple of times, I then issued this command:
    modprobe snd_bmc2835

    it then works for me.
    Hope it works for you too.

  64. Guus on  4 February 2013 at 19 h 47 min  said:

    I have AirPi running now for quite a while with good results. About 99.5% stable. I use a USB DAC (UD100 – excellent!) with a small Tripath amp and some small speakers. This is my bathroom stereo. So thanks for the instructions and all the updates!

    I would now like to light up a LED when Shairport is running (as a service) and another LED when Shairport receives a stream, i.e. when it is connected to a source.

    Has anyone tried this or worked on this? I have not yet had any experience with GPIO programming but I guess I should start with that!?

    Thanks

  65. George on  11 February 2013 at 19 h 58 min  said:

    Hello there, I have tried to follow these instructions as best as I can. I have been using the root user, I have made sure that my debian has been updated, I installed the prerequisiites and the shairport sources. (I did install them the wrong way round if that would make a difference) but when I try to launch Shairport I keep getting this error:

    Can’t locate Net/SDP.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at ./shairport.pl line 48.
    BEGIN failed–compilation aborted at ./shairport.pl line 48.

    Please help me!

    Thanks

    • Try the following sequence:

      cd ~
      sudo apt-get install libmodule-build-perl
      sudo apt-get install libao-dev libssl-dev libcrypt-openssl-rsa-perl libio-socket-inet6-perl libwww-perl
      sudo apt-get install git-core
      git clone https://github.com/njh/perl-net-sdp.git perl-net-sdp
      cd perl-net-sdp
      sudo perl Build.PL
      sudo ./Build
      sudo ./Build test
      sudo ./Build install
      cd
      sudo apt-get install avahi-utils
      git clone https://github.com/hendrikw82/shairport.git shairport
      # and the rest is repeating the install instructions from the trouch.com post
      cd shairport
      sudo make
      sudo ./shairport.pl -a AirPi
      # check if it works then Ctrl-C
      sudo make install
      sudo cp shairport.init.sample /etc/init.d/shairport
      cd /etc/init.d
      sudo chmod a+x shairport
      sudo update-rc.d shairport defaults
      sudo nano shairport
      # edit DAEMON_ARGS line: eg DAEMON_ARGS=”-w $PIDFILE -a AirPi”
      Ctrl-X, Y, Enter
      sudo ./shairport start

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值