0

I have one spare Raspberry Pi 3 and I would like to use it as AirPlay receiving device to stream content from my iOS 10 iPhone to TV.

Is there any way how to do it?

I was trying using OSMC and enabling AirPlay, rPlay on Raspbian, but it does not work, I do not even see the Raspberry device in the list of AirPlay on my iPhone.

1

Not that this is helpful, because it doesn't work for streaming from the phone running iOS 10, but it does work for streaming from iTunes on macOS Sierra and iTunes 12.5.4.42.

Here is what I did after scouring the web for a while:

  • Enable audio jack:

    sudo amixer cset numid=3 1  
    
  • Get the latest updates:

    sudo apt-get update
    sudo apt-get upgrade
    
  • Update firmware:

    sudo rpi-update
    
  • Install the AirPlay emulator:

    sudo apt-get install shairplay
    
  • Create systemd service /etc/systemd/system/shairplay.service with this content:

    [Unit]
    Description=Shairplay daemon
    Requires=network.target
    Wants=avahi-daemon.service
    After=avahi-daemon.service
    
    [Service]
    Type=simple
    ExecStart=/usr/bin/shairplay -a %H
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
    
  • Enable shairplay serivce:

    systemctl enable shairplay
    
  • Start service or restart system to autostart the service

I can successfully stream to Raspberry Pi from my Mac, but not from the phone. Ugh..

0

shairport-sync appears to support streaming from an iOS 11 device. I'll put more details on configuration when I've finished setting it up.

shairport-sync is not available from the Raspbian package manager, so I had to build from source following these instructions (go to Building)

I ran the following commands

sudo apt-get install build-essential git xmltoman
sudo apt-get install autoconf automake libtool libdaemon-dev libpopt-dev libconfig-dev

Raspbian does not come with PulseAudio installed by default, so I didn't install it and instead used ALSA (which is recommended by the developer)

sudo apt-get install libasound2-dev
sudo apt-get install avahi-daemon libavahi-client-dev
sudo apt-get install libssl-dev

I didn't install anything optional after that.

git clone https://github.com/mikebrady/shairport-sync.git
cd shairport-sync
autoreconf -i -f

I went straight to the recommended configuration. Raspbian uses systemd, and I didn't install the pulseaudio backend as per above

./configure --sysconfdir=/etc --with-alsa --with-avahi --with-ssl=openssl --with-metadata --with-systemd
make
sudo make install

Finally to make it run at startup

sudo systemctl enable shairport-sync

Now to configure I did

cd etc 
sudo nano shairport-sync.conf #or your editor of choice

I edited the name in general and also the following:

output_backend = "pa"; 
volume_range_db = 30;

Per this issue for the RaspberryPi, seems the Digital Audio Converter (DAC) software got upgraded. So I went to /boot/config.txt and added audio_pwm_mode=2. And then rebooted. I plugged my 3.5mm cable into the audio jack and enabled airplay on my iOS device

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.