使用shairport-sync搭建airplay音频服务器

Arch下直接:

$ sudo pacmna -S shairport-sync
$ sudo systemctl enable shairport-sync

如果直接启动,会发现没有声音。因为默认的配置文件里,有这样一行:

alsa =
{
	output_device = "default"; // the name of the alsa output device. Use "alsamixer" or "aplay" to find out the names of devices, mixers, etc.
	mixer_control_name = "default"; // the name of the mixer to use to adjust output volume. If not specified, volume in adjusted in software.
	mixer_device = "default"; // the mixer_device default is whatever the output_device is. Normally you wouldn't have to use this.
    ...
}

修改成 hw:0。具体是什么要用 aplay -l 查看,不过一般都是这个值。

alsa =
{
	output_device = "hw:0"; // the name of the alsa output device. Use "alsamixer" or "aplay" to find out the names of devices, mixers, etc.
	mixer_control_name = "PCM"; // the name of the mixer to use to adjust output volume. If not specified, volume in adjusted in software.
	mixer_device = "hw:0"; // the mixer_device default is whatever the output_device is. Normally you wouldn't have to use this.

然后启动服务,打开iOS设备,就可以在手机上点歌,笔记本上放歌了 :)


不过我重启之后,使用 hw:0 又不行了,改回 default 又可以了,奇怪。


更多文章
  • 再读vim help:vim小技巧
  • 设计模式(2)- 深入浅出设计模式 阅读笔记
  • 设计模式(1)- 深入浅出设计模式 阅读笔记
  • Cython! Python和C两个世界的交叉点
  • socketserver 源码阅读与分析
  • functools 源码阅读与分析
  • contextlib代码阅读
  • Collections 源码阅读与分析
  • Redis通信协议阅读
  • 2016年就要结束了,2017年就要开始啦!
  • unittest 源代码阅读
  • APUEv3 - 重读笔记
  • Mock源码阅读与分析
  • Thinking in Python
  • 我的代码进CPython标准库啦