改造树莓派、香橙派摇身一变无线WIFI音响在线播放,无需安装XBMC这个庞然大物也能实现DLNA和AirPlay双协议的WIFI音响,DLNA 实现于Gmrender-resurrect项目、AirPlay实现于Shairport项目
拿出你放在角落里积灰的树莓派,扫扫灰尘,必要的时候再抚摸安慰一下?!哈哈哈
DLNA 协议项目:gmrender-resurrect AirPlay 协议项目:shairport
sudo apt-get install git
参考文档:https://github.com/hzeller/gmrender-resurrect/blob/master/INSTALL.md
gstreamer1.0-alsa
可选为 gstreamer1.0-pulseaudio
这个要根据自己的环境而定,参考官方帮助文档 gmrender-resurrect 如果你不知道这是什么就无视这一段话。
sudo apt-get install libupnp-dev libgstreamer1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa autoconf
1、定位到home文件夹并克隆程序源码
cd ../home/
git clone <https://github.com/hzeller/gmrender-resurrect.git>
2、转到刚刚克隆的gmrender-resurrect文件夹并安装
cd gmrender-resurrect
./autogen.sh
./configure
sudo make
sudo make install
3、输入下面的命令运行服务并用电脑或者安卓一类支持DLNA播放的设备播放一首歌试试吧
gmediarender -f "Raspberry-DLNA" 2
1、拷贝相关配置文件
cp scripts/init.d/gmediarenderer /etc/init.d/
2、建立用户组
useradd -g audio gmediarender
3、修改配置文件 /etc/init.d/gmediarenderer
DAEMON_USER="gmediarender:audio" #用户组
UPNP_DEVICE_NAME="Raspberry-DLNA" #服务名称
4、设置开机自启
update-rc.d gmediarenderer defaults
参考文档:https://github.com/abrasive/shairport/wiki
apt-get install libssl-dev libavahi-client-dev libasound2-dev libao-dev libpulse-dev
1、定位到 home
文件夹克隆程序源码并安装
cd ../home/
git clone <https://github.com/abrasive/shairport.git>
cd shairport
sudo make
sudo make install
2、启动服务用苹果家族设备测试一下能否正常播放
./shairport -a Raspberry-AirPlay
1、拷贝相关配置文件
cp scripts/debian/default/shairport /etc/default/
cp scripts/debian/init.d/shairport /etc/init.d/
cp scripts/debian/logrotate.d/shairport /etc/logrotate.d/
2、建立用户组
useradd -g audio shairport
3、修改配置文件 /etc/init.d/shairport
USER=shairport #用户
GROUP=audio #用户组
AP_NAME=Raspberry-AirPlay #服务名称
4、设置开机自启
update-rc.d shairport defaults
http://raspberrypihq.com/how-to-turn-your-raspberry-pi-into-a-airplay-receiver-to-stream-music-from-your-iphone/https://blog.wanghw.cn/archives/raspberry-wifisoundtrack.htmlhttps://github.com/hzeller/gmrender-resurrect/blob/master/INSTALL.mdhttps://github.com/abrasive/shairport/wiki