树莓派配置Airplay服务

shairport

获取更新

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

安装Shairport

$ cd ~
$ git clone https://github.com/abrasive/shairport.git
$ cd shairport
$ ./configure
$ make
$ sudo make install

获取Shairport脚本

$ sudo cp scripts/debian/init.d/shairport /etc/init.d/
$ sudo cp scripts/debian/default/shairport /etc/default/

编辑/etc/default/shairport/etc/init.d/shairport

# User and group under which shairport should be run
# user should have permission to output sound
# Check the audio output documentation for details.
USER=pi # 用户
GROUP=nogroup
...
# Set the AirPlay advertised name.
# Defaults to computer's hostname
AP_NAME=AirPlay
...
# Force the mDNS backend
# By default, shairport will try all backends until one works.
# Check 'shairport -h' for details
MDNS=avahi

测试Shairport

$ shairport -a 'Shairport Test'
Starting Shairport 1.1.1-22-gd679d19
Listening for connections.
$ sudo update-rc.d shairport defaults # 自启动配置
$ sudo service shairport start # 开启服务

参考:https://www.jianshu.com/p/03d28aeba009
http://www.raspberry-pi-geek.com/Archive/2015/09/Using-the-Raspberry-Pi-as-an-AirPlay-server

你可能感兴趣的:(树莓派配置Airplay服务)