Wiki GeRgOsNet Notes d’administration système, réseau et domotique

Vous consultez une ancienne version, enregistrée le 18 juin 2019 par GreG. Voir la version actuelle.

AirPlay Linux Raspberry

Migration depuis l’ancien wiki MediaWiki

Distribution : Raspbian “wheezy” nu Hardware : Raspberry PI version B

Diffusion de musique via le protocole Apple Airplay .

  • Passage en root :
pi@raspberrypi:~$ sudo su
root@raspberrypi:/home/pi# cd
root@raspberrypi:~#
  • Mise à jour de la distribution
root@raspberrypi:~# apt-get update
root@raspberrypi:~# apt-get upgrade
  • Activer la sortie Jack
root@raspberrypi:~# amixer cset numid=3 1
  • Installer shairport
root@raspberrypi:~# aptitude install git libao-dev libssl-dev libcrypt-openssl-rsa-perl libio-socket-inet6-perl libwww-perl avahi-utils
  • On télécharge ensuite les sources de shairport pour les compiler :
root@raspberrypi:~# git clone https://github.com/albertz/shairport.git shairport
root@raspberrypi:~# cd shairport
root@raspberrypi:~/shairport# make
  • Ajout de la librairie NET-SDP :
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
  • On peut enfin lancer shairport en premier plan :
cd ..
root@raspberrypi:~/shairport# ./shairport.pl -a AirPi

Il est maintenant possible d’utiliser son iDevice pour essayer AirPlay, sans avoir oublié de brancher un casque ou une paire d’enceinte sur la sortie jack.

  • Pour lancer automatiquement shairport, il suffit d’installer shairport et de copier le script de démarrage :
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
  • Avant de démarrer le service, on doit ajouter le nom d’AP dans les paramètres de démarrage. Editez le fichier avec nano shairport et changer la ligne avec la variable DAEMON_ARGS :
DAEMON_ARGS="-w $PIDFILE -a AirPi"

Remplacez AirPi par ce que vous voulez, sauvegardez, quittez et démarrez le service pour profiter pleinement de AirPlay audio avec shairport en arrière plan :

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