mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.16k stars 569 forks source link

[Problem]: Docker instance loads configuration file failed #1890

Open useforgithub opened 1 month ago

useforgithub commented 1 month ago

What happened?

I'm running a docker shairport-sync, when I tried to enable MQTT, the log says it's disabled (The diagnostic in configuration file didn't work too, then I add -vv to the running shell).

Relevant log output

s6-rc: info: service s6rc-fdholder: starting
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service s6rc-fdholder successfully started
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service syslogd-prepare: starting
s6-rc: info: service 01-startup: starting
STARTING - Thu Aug  8 05:36:40 UTC 2024
s6-rc: info: service 01-startup successfully started
s6-rc: info: service 04-nqptp: starting
s6-rc: info: service 02-dbus: starting
s6-rc: info: service 04-nqptp successfully started
Starting nqptp
Starting dbus
s6-rc: info: service syslogd-prepare successfully started
s6-rc: info: service syslogd-log: starting
s6-rc: info: service syslogd-log successfully started
s6-rc: info: service syslogd: starting
s6-rc: info: service syslogd successfully started
s6-rc: info: service 02-dbus successfully started
s6-rc: info: service 03-avahi: starting
Starting avahi
Found user 'avahi' (UID 86) and group 'avahi' (GID 86).
Successfully dropped root privileges.
avahi-daemon 0.8 starting up.
WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
Loading service file /etc/avahi/services/sftp-ssh.service.
Loading service file /etc/avahi/services/ssh.service.
Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.1.141.
New relevant interface eth0.IPv4 for mDNS.
Joining mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
New relevant interface lo.IPv4 for mDNS.
Network interface enumeration completed.
Registering new address record for 192.168.1.141 on eth0.IPv4.
Registering new address record for 127.0.0.1 on lo.IPv4.
Server startup complete. Host name is 481bc8508acd.local. Local service cookie is 326385128.
s6-rc: info: service 03-avahi successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Starting shairport-sync
         0.000120316 "shairport.c:579" looking for configuration file at full path "/etc/shairport-sync.conf"
         0.009688430 "shairport.c:1470" default metadata_pipename is "/tmp/shairport-sync-metadata".
         0.000367403 "shairport.c:2278" Startup in AirPlay 2 mode, with features 0x405fca00,0x1c340 on device "02:42:8f:0b:09:0a".
         0.000028954 "shairport.c:2317" Version String: "4.3.4-dirty-AirPlay2-smi10-alac-OpenSSL-Avahi-ALSA-pa-dummy-stdout-pipe-soxr-convolution-metadata-mqtt-dbus-mpris-sysconfdir:/etc"
         0.000009534 "shairport.c:2336" Command Line: "/usr/local/bin/shairport-sync -vv".
         0.000047265 "shairport.c:2343" libsodium initialised.
         0.000070971 "shairport.c:2368" libgcrypt initialised.
         0.000006990 "shairport.c:2372" Log Verbosity is 2.
         0.000007218 "audio_alsa.c:1065" alsa: init() -- alsa_backend_state => abm_disconnected.
         0.000011175 "audio_alsa.c:1082" alsa: alsa_maximum_stall_time of 0.200000 sec.
         0.000012099 "audio_alsa.c:1371" alsa: disable_standby_mode is "never".
         0.000005568 "audio_alsa.c:1375" alsa: disable_standby_mode_silence_threshold is 0.040000 seconds.
         0.000006898 "audio_alsa.c:1377" alsa: disable_standby_mode_silence_scan_interval is 0.004000 seconds.
         0.000006740 "audio_alsa.c:1417" alsa: output device name is "default".
         0.000045593 "shairport.c:2407" The processor is running little-endian.
         0.000007233 "shairport.c:2440" disable_resend_requests is off.
         0.000005454 "shairport.c:2441" diagnostic_drop_packet_fraction is 0.000000. A value of 0.0 means no packets will be dropped deliberately.
         0.000000653 "audio_alsa.c:2110" keep_dac_busy is now "no"
         0.000007299 "shairport.c:2445" statistics_requester status is 0.
         0.000010622 "shairport.c:2450" rtsp listening port is 7000.
         0.000005584 "shairport.c:2451" udp base port is 6001.
         0.000004516 "shairport.c:2452" udp port range is 10.
         0.000004302 "shairport.c:2453" player name is "Airplay-QNAP".
         0.000005383 "shairport.c:2454" backend is "alsa".
         0.000004302 "shairport.c:2455" run_this_before_play_begins action is "(null)".
         0.000005164 "shairport.c:2456" run_this_after_play_ends action is "(null)".
         0.000004897 "shairport.c:2457" wait-cmd status is 0.
         0.000004191 "shairport.c:2458" run_this_before_play_begins may return output is 0.
         0.000005049 "shairport.c:2459" run_this_if_an_unfixable_error_is_detected action is "(null)".
         0.000004952 "shairport.c:2461" run_this_before_entering_active_state action is  "(null)".
         0.000004731 "shairport.c:2463" run_this_after_exiting_active_state action is  "(null)".
         0.000005338 "shairport.c:2465" active_state_timeout is  10.000000 seconds.
         0.000005031 "shairport.c:2466" mdns backend "(null)".
         0.000003917 "shairport.c:2467" userSuppliedLatency is 0.
         0.000003945 "shairport.c:2468" interpolation setting is "auto".
         0.000004065 "shairport.c:2472" interpolation soxr_delay_threshold is 30000000.
         0.000004814 "shairport.c:2473" resync time is 0.050000 seconds.
         0.000004531 "shairport.c:2474" resync recovery time is 0.100000 seconds.
         0.000005147 "shairport.c:2475" allow a session to be interrupted: 0.
         0.000005015 "shairport.c:2476" busy timeout time is 120.
         0.000008418 "shairport.c:2477" drift tolerance is 0.002000 seconds.
         0.000006046 "shairport.c:2478" password is not set.
         0.000004061 "shairport.c:2479" default airplay volume is: -24.000000.
         0.000004711 "shairport.c:2480" high threshold airplay volume is: -16.000000.
         0.000005420 "shairport.c:2482" check for higher-than-threshold volume for new play session is disabled.
         0.000004814 "shairport.c:2488" ignore_volume_control is 0.
         0.000004172 "shairport.c:2492" volume_max_db is not set
         0.000004743 "shairport.c:2493" volume range in dB (zero means use the range specified by the mixer): 0.
         0.000005320 "shairport.c:2495" volume_range_combined_hardware_priority (1 means hardware mixer attenuation is used first) is 0.
         0.000005600 "shairport.c:2499" playback_mode is 0 (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_right).
         0.000006256 "shairport.c:2501" disable_synchronization is 0.
         0.000017843 "shairport.c:2502" use_mmap_if_available is 1.
         0.000004874 "shairport.c:2503" output_format automatic selection is enabled.
         0.000006151 "shairport.c:2507" output_rate automatic selection is enabled.
         0.000006018 "shairport.c:2511" audio backend desired buffer length is 0.200000 seconds.
         0.000007531 "shairport.c:2513" audio_backend_buffer_interpolation_threshold_in_seconds is 0.120000 seconds.
         0.000006524 "shairport.c:2515" audio backend latency offset is 0.000000 seconds.
         0.000006235 "shairport.c:2517" audio backend silence lead-in time is "auto".
         0.000005566 "shairport.c:2521" zeroconf regtype is "_raop._tcp".
         0.000004853 "shairport.c:2522" decoders_supported field is 3.
         0.000004804 "shairport.c:2523" use_apple_decoder is 1.
         0.000004722 "shairport.c:2524" alsa_use_hardware_mute is 0.
         0.000004840 "shairport.c:2528" no special mdns service interface was requested.
         0.000012540 "shairport.c:2531" configuration file name "/etc/shairport-sync.conf" resolves to "/etc/shairport-sync.conf".
         0.000006947 "shairport.c:2538" metadata enabled is 1.
         0.000004862 "shairport.c:2539" metadata pipename is "/tmp/shairport-sync-metadata".
         0.000005774 "shairport.c:2540" metadata socket address is "(null)" port 0.
         0.000005691 "shairport.c:2542" metadata socket packet size is "500".
         0.000005395 "shairport.c:2543" get-coverart is 1.
         0.000005830 "shairport.c:2546" mqtt is disabled.
         0.000004880 "shairport.c:2547" mqtt hostname is (null), port is 1883.
         0.000005426 "shairport.c:2548" mqtt topic is /Airplay-QNAP.
         0.000005424 "shairport.c:2549" mqtt will not publish raw metadata.
         0.000004178 "shairport.c:2550" mqtt will not publish parsed metadata.
         0.000004998 "shairport.c:2551" mqtt will not publish cover Art.
         0.000004944 "shairport.c:2552" mqtt remote control is disabled.
         0.000004130 "shairport.c:2556" convolution is 0.
         0.000003840 "shairport.c:2557" convolution IR file is "(null)"
         0.000004999 "shairport.c:2558" convolution max length 8192
         0.000004654 "shairport.c:2559" convolution gain is 0.000000
         0.000004150 "shairport.c:2561" loudness is 0.
         0.000004630 "shairport.c:2562" loudness reference level is -20.000000
         0.000035465 "rtsp.c:4172" metadata pipe name is "/tmp/shairport-sync-metadata".
         0.000019525 "rtsp.c:373" Creating metadata queue "pipe".
         0.000043940 "rtsp.c:373" Creating metadata queue "multicast".
         0.000029408 "rtsp.c:373" Creating metadata queue "hub".
         0.000028775 "rtsp.c:373" Creating metadata queue "mqtt".
         0.000651970 "ptp-utilities.c:225" Send control message to NQPTP: "/nqptp T"
         0.003120275 "ptp-utilities.c:165" ptp_shm_interface_open with mapped_addr = 0
         0.000978229 "ptp-utilities.c:196" ptp_shm_interface_open -- success!
         0.000224702 "shairport.c:2689" NQPTP is online.
         0.001804837 "mpris-service.c:342" MPRIS service started at "org.mpris.MediaPlayer2.ShairportSync" on the system bus.
         0.003235705 "dbus-service.c:610" >> setting loudness threshold to -20.000000.
         0.000045785 "dbus-service.c:623" >> setting drift tolerance to 0.002000 seconds.
         0.000019100 "dbus-service.c:636" >> setting volume to -24.0000.
         0.000018908 "dbus-service.c:1021" >> ALACDecoder set to "apple"
         0.000046012 "dbus-service.c:1030" >> Active set to "false"
         0.000104756 "dbus-service.c:1035" >> disable standby mode set to "off"
         0.000099772 "dbus-service.c:1056" >> interpolation set to "auto" (soxr support built in)
         0.000092117 "dbus-service.c:518" >> deactivating disable standby
         0.000106370 "dbus-service.c:600" >> deactivating loudness
         0.000075952 "dbus-service.c:534" >> deactivating convolution
         0.000135984 "dbus-service.c:503" >> log verbosity set to 2.
         0.000098360 "dbus-service.c:488" >> stop logging statistics
         0.000083121 "dbus-service.c:448" >> stop including elapsed time in logs
         0.000013617 "dbus-service.c:458" >> start including delta time in logs
         0.000025747 "dbus-service.c:471" >> start including file and line in logs
         0.000084123 "dbus-service.c:1175" Shairport Sync native D-Bus service started at "org.gnome.ShairportSync" on the system bus.
         0.002925161 "activity_monitor.c:163" am_state: am_inactive
         0.006102430 "mdns_avahi.c:220" avahi: service '02428F0B090A@Airplay-QNAP' group is not yet committed.
         0.010769615 "mdns_avahi.c:277" avahi: avahi_entry_group_commit 0
         0.000236406 "mdns_avahi.c:477" avahi_dacp_monitor_start Avahi DACP monitor successfully started
         0.000025691 "mdns_avahi.c:224" avahi: service '02428F0B090A@Airplay-QNAP' group is registering.
Service "481bc8508acd" (/etc/avahi/services/ssh.service) successfully established.
Service "481bc8508acd" (/etc/avahi/services/sftp-ssh.service) successfully established.

System Information.

QNAP NAS

Configuration Information.

/ # shairport-sync --displayConfig
>> Display Config Start.

From "uname -a":
 Linux 481bc8508acd 5.10.60-qnap #1 SMP Thu Jun 20 01:30:54 CST 2024 x86_64 Linux

From /etc/os-release:
 Alpine Linux v3.17

Shairport Sync Version String:
 4.3.4-dirty-AirPlay2-smi10-alac-OpenSSL-Avahi-ALSA-pa-dummy-stdout-pipe-soxr-convolution-metadata-mqtt-dbus-mpris-sysconfdir:/etc

Command Line:
 shairport-sync --displayConfig

Configuration File:
 /etc/shairport-sync.conf

Configuration File Settings:
 general : 
 {
   name = "Airplay-QNAP";
   mqtt : 
   {
     enabled = "yes";
     hostname = "192.168.1.121";
     port = 1883;
     topic = "shairport";
     publish_parsed = "yes";
     publish_cover = "no";
   };
   metadata : 
   {
     enabled = "no";
     include_cover_art = "yes";
     cover_art_cache_directory = "";
     pipe_name = "/tmp/shairport-sync-metadata";
     pipe_timeout = 5000;
   };
 };

>> Display Config End.
>> Goodbye!
/ #

PulseAudio or PipeWire installed?

How did you install Shairport Sync?

Docker

Check previous issues

mikebrady commented 1 month ago

Thanks for the post.

Could you post the docker command(s) you are using to invoke the player, please? Is it possible you are not mapping a configuration file into the Docker image?

useforgithub commented 1 month ago

Thanks for your reply.

Below is the command I'm using:

docker run -d --restart unless-stopped --net bridge --device /dev/snd \
    -v /share/AppData/Shairplay/shairport-sync.conf:/etc/shairport-sync.conf \
    --name shairport-sync\
    mikebrady/shairport-sync -- -d hw:1

The config file could be read using cat /etc/shairport-sync.conf in my airport-sync container, output below:

/ # cat /etc/shairport-sync.conf
general =
{
        name = "Airplay-QNAP";
        mqtt =
        {
                enabled = "yes";
                hostname = "192.168.1.121";
                port = 1883;
                topic = "shairport";
                publish_parsed = "yes";
                publish_cover = "no";
        };
        metadata =
        {
                enabled = "no";
                include_cover_art = "yes";
                cover_art_cache_directory = "";
                pipe_name = "/tmp/shairport-sync-metadata";
                pipe_timeout = 5000;
        };
};
/ #
mikebrady commented 1 month ago

I think I see the problem — you have nested the mqtt and the metadata stanzas inside the general one. They should not be nested.

useforgithub commented 1 month ago

Thanks for the answer, since this is the first time I've used a non-default configuration, I searched through the issue last night and didn't find this mistake. Although I also looked at the configuration sample, I copied the corresponding node to my own configuration file,

I should modify it directly on the configuration sample,

Thanks a lot.