docker run -d --restart unless-stopped --net host --device /dev/snd \
mikebrady/shairport-sync -a DenSystem -- -d hw:0 -c PCM
shairport-sync配置
使用sps-alsa-explore的建议配置即可
踩坑记录
grep output_device查看配置选项为hw:后接字符串
root@rpi0:~# grep output_device ./shairport-sync/audio_alsa.c -C 2
// this is very crude -- if the device is a hardware device, then it's assumed the delay is
// precise
const char *output_device_name = snd_pcm_name(alsa_handle);
int is_a_real_hardware_device = 0;
if (output_device_name != NULL)
is_a_real_hardware_device = (strstr(output_device_name, "hw:") == output_device_name);
// The criteria as to whether precision delay is available
--
warn("The output device \"%s\" is busy and can't be used by Shairport Sync at present.",
alsa_out_dev);
debug(2, "the alsa output_device \"%s\" is busy.", alsa_out_dev);
} else if (ret == -ENOENT) {
die("the alsa output_device \"%s\" can not be found.", alsa_out_dev);
} else {
char errorstring[1024];
--
/* Get the Output Device Name. */
if (config_lookup_string(config.cfg, "alsa.output_device", &str)) {
alsa_out_dev = (char *)str;
}