aircast icon indicating copy to clipboard operation
aircast copied to clipboard

Installation on Raspberry

Open TS-Tec opened this issue 8 years ago • 5 comments

Sounds like a great project!

Can someone please give a instruction how to install on a Raspberry Pi? I tried to manually execute the commands in provision.sh and failed :(

Thank you very much!

TS-Tec avatar Dec 23 '16 09:12 TS-Tec

Hey TS-Tec,

I haven't got a Raspberry PI myself, but it appears this Redditor might have some working instructions in their comment https://www.reddit.com/r/Chromecast/comments/54wz7x/aircast_airplay_to_chromecast_audio_bridge/dara938/

ains avatar Dec 27 '16 16:12 ains

@TS-Tec

I was able to install aircast to my Raspberry Pi with Raspbian Jessie. Basically I followed two readme manuals. I started with shairport-sync one.

  1. Clone https://github.com/mikebrady/shairport-sync into /home/pi/git/shairport-sync
  2. Follow the manual until "Build the application" section.
  3. My configuration was ./configure --with-alsa --with-avahi --with-ssl=openssl --with-metadata --with-soxr --with-stdout --with-systemd --sysconfdir=/etc
  4. While in /shairport-sync directory, run:
make
sudo make install
  1. I skipped the part of setting up shairport-sync as autostart service. Since it may get into a conflict with aircast (especially if the same port is used).

After this I switched to manual in aircast provision.sh. No need to deal with vagrant, as we already have linux in Raspberry Pi.

  1. I cloned https://github.com/ains/aircast into /home/pi/git/aircast

  2. While in /aircast directory, install python stuff:

sudo apt-get install python-dev python-pip
sudo apt-get install flac libflac-dev
sudo pip install -r requirements.txt
  1. Install supervisor for autostarting the service:
sudo apt-get install supervisor
  1. Set supervisor config:
cat | sudo tee /etc/supervisor/conf.d/aircast.conf > /dev/null <<- EOM
[program:aircast]
command=python /home/pi/git/aircast/src/main.py
autostart=true
autorestart=true
stderr_logfile=/var/log/aircast.err.log
stdout_logfile=/var/log/aircast.out.log
username=pi
EOM
  1. And the final step:
sudo service supervisor restart

My problem was that I have two devices Chromcast on TV and Google Home which I wanted to use as AirPlay speaker. To config aircast to use a specific device (not a first from available) I used a fork https://github.com/gtg922r/aircast. And my supervisor aircast.conf command was:

  1. Configure specific device:
sudo nano /etc/supervisor/conf.d/aircast.conf
  1. Update the command line with:
command=python /home/pi/git/aircast/src/main.py  --chromecast=Kitchen

Everything works fine and the aircast autostarts when Raspberry Pi is rebooted. I can see my "Kitchen" Google Home in iOS list of AirPlay devices. Music works good, but there is a 2 sec sound delay if you try to watch any video at your iOS device while streaming sound to Chromecast device. And that is a real bummer.

eugenet8k avatar Jan 02 '17 20:01 eugenet8k

I have followed eugenet8k's process but get no sound out of the chromecst.

I did get an error on 'apt-add-repository ppa:ubuntu-audio-dev/alsa-daily' as there is no Raspbian build there. This means I could not install oem-audio-hda-daily-dkms, or modprobe snd-hda-intel.

Everything else was fine.

The pi shows up as a airplay target, and the chromecast does report it is receiving audio to cast.

katomic avatar Jul 07 '17 12:07 katomic

@katomic is the error you get related to shairport-sync service? Out of curiosity I pulled last stable release 3.0.2 of shairport-sync and I rebuilt everything from scratch using my own manual and it works for me well. I can hear the sound on my Google Home speaker while streaming from iPhone using AirPlay. Did you configured shairport-sync before making it with all those params from step (3)?

eugenet8k avatar Jul 09 '17 00:07 eugenet8k

It seems installations steps should be a bit different for Python dependencies. You need to use Python 2.x and install these deps:

sudo pip2 install --upgrade pip enum34
sudo pip2 install --upgrade zeroconf==0.19.1

(to avoid this crash https://github.com/ains/aircast/issues/7)

to avoid AirCast crashes. I will update my original manual here https://github.com/ains/aircast/issues/1#issuecomment-270019487

eugenet8k avatar Jun 15 '18 19:06 eugenet8k