mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.28k stars 574 forks source link

Exits with seemingly unrelated error when configuration file not found #1040

Closed leakypixel closed 3 years ago

leakypixel commented 4 years ago

Running shairport-sync as follows, with a missing configuration file:

/usr/bin/shairport-sync --name=AirPipe --output=stdout --use-stderr --get-coverart --metadata-pipename=/tmp/shairmeta.1.5000 --port=5000

results in the following error:

If you want to get cover art, you must also select the --metadata-pipename option.
Aborted (core dumped)

However, when using the -vvv modifier, I can see that the problem is likely a missing configuration file:

# shairport-sync -vvv --name=AirPipe --output=stdout --use-stderr --get-coverart --metadata-pipename=/tmp/shairmeta.1.5000 --port=5000
         0.000040718 "shairport.c:433" Can't resolve the configuration file "/usr/local/etc/shairport-sync.conf".
         0.000033865 "shairport.c:1135" *fatal error: If you want to get cover art, you must also select the --metadata-pipename option.

After making an empty file at /usr/local/etc/shairport-sync.conf, everything works as intended, so I can assume that the missing configuration file was the cause of the issue.

It seems fine that the program would abort when the configuration file is missing, but the exit message doesn't seem to give the reason the program actually exited.

I originally discovered this behaviour when using with snapcast, and raised then closed the following issue: https://github.com/badaix/snapcast/issues/659

mikebrady commented 4 years ago

Thanks for the report. Let me check it out.

[Update] The behaviour is reproducible on the latest version.

mikebrady commented 4 years ago

Thanks again for the report. The issue has been fixed, I hope, in the development branch. If you wanted to test it, that would be great.

BTW, it should have been the case that --get_coverart was enabled by default if Shairport Sync was built with metadata support, so strictly speaking, the option should not have been needed. This issue is fixed now too.

leakypixel commented 4 years ago

Thanks for all your hard work on the project! :)

I've just tested the development branch, and all seems fine:

# /usr/bin/shairport-sync -v --name=AirPipeTest --output=stdout --use-stderr --get-coverart --metadata-pipename=/tmp/shairmeta.1.5000 --port=5000
         0.000071603 "shairport.c:1710" Started!
         0.000051184 "shairport.c:1737" software version: "3.3.7d14-alac-OpenSSL-Avahi-stdout-pipe-soxr-metadata-sysconfdir:/usr/local/etc"
         0.000011074 "shairport.c:1743" log verbosity is 1.
         0.000050911 "shairport.c:1791" disable resend requests is off.
         0.000008604 "shairport.c:1795" diagnostic_drop_packet_fraction is 0.000000. A value of 0.0 means no packets will be dropped deliberately.
         0.000006574 "shairport.c:1796" statistics_requester status is 0.
         0.000004929 "shairport.c:1801" rtsp listening port is 5000.
         0.000026888 "shairport.c:1802" udp base port is 6001.
         0.000005929 "shairport.c:1803" udp port range is 10.
         0.000004357 "shairport.c:1804" player name is "AirPipeTest".
         0.000004265 "shairport.c:1805" backend is "stdout".
         0.000058818 "shairport.c:1806" run_this_before_play_begins action is "(null)".
         0.000018812 "shairport.c:1807" run_this_after_play_ends action is "(null)".
         0.000044976 "shairport.c:1808" wait-cmd status is 0.
         0.000018925 "shairport.c:1809" run_this_before_play_begins may return output is 0.
         0.000005091 "shairport.c:1810" run_this_if_an_unfixable_error_is_detected action is "(null)".
         0.000003373 "shairport.c:1811" run_this_before_entering_active_state action is  "(null)".
         0.000002992 "shairport.c:1812" run_this_after_exiting_active_state action is  "(null)".
         0.000005600 "shairport.c:1813" active_state_timeout is  10.000000 seconds.
         0.000005150 "shairport.c:1814" mdns backend "(null)".
         0.000004142 "shairport.c:1818" interpolation setting is "auto".
         0.000004291 "shairport.c:1819" interpolation soxr_delay_threshold is 30.
         0.000003700 "shairport.c:1820" resync time is 0.050000 seconds.
         0.000011075 "shairport.c:1821" allow a session to be interrupted: 0.
         0.000010143 "shairport.c:1822" busy timeout time is 120.
         0.000004297 "shairport.c:1823" drift tolerance is 0.001995 seconds.
         0.000004163 "shairport.c:1824" password is "(null)".
         0.000003536 "shairport.c:1825" ignore_volume_control is 0.
         0.000003547 "shairport.c:1829" volume_max_db is not set
         0.000003296 "shairport.c:1831" volume range in dB (zero means use the range specified by the mixer): 0.
         0.000003799 "shairport.c:1835" volume_range_combined_hardware_priority (1 means hardware mixer attenuation is used first) is 0.
         0.000003741 "shairport.c:1837" playback_mode is 0 (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_right).
         0.000003907 "shairport.c:1838" disable_synchronization is 0.
         0.000003422 "shairport.c:1839" use_mmap_if_available is 1.
         0.000003454 "shairport.c:1841" output_format automatic selection is enabled.
         0.000003657 "shairport.c:1845" output_rate automatic selection is enabled.
         0.000003489 "shairport.c:1849" audio backend desired buffer length is 1.000000 seconds.
         0.000003891 "shairport.c:1851" audio_backend_buffer_interpolation_threshold_in_seconds is 0.000000 seconds.
         0.000003848 "shairport.c:1852" audio backend latency offset is 0.000000 seconds.
         0.000003834 "shairport.c:1854" audio backend silence lead-in time is "auto".
         0.000003421 "shairport.c:1858" zeroconf regtype is "_raop._tcp".
         0.000003638 "shairport.c:1859" decoders_supported field is 3.
         0.000012229 "shairport.c:1860" use_apple_decoder is 1.
         0.000010031 "shairport.c:1861" alsa_use_hardware_mute is 0.
         0.000013064 "shairport.c:1865" no special mdns service interface was requested.
         0.000014153 "shairport.c:1872" configuration file name "/usr/local/etc/shairport-sync.conf" can not be resolved.
         0.000004101 "shairport.c:1875" metadata enabled is 1.
         0.000003821 "shairport.c:1876" metadata pipename is "/tmp/shairmeta.1.5000".
         0.000003807 "shairport.c:1878" metadata socket address is "(null)" port 0.
         0.000003769 "shairport.c:1879" metadata socket packet size is "0".
         0.000003689 "shairport.c:1880" get-coverart is 1.
         0.000003669 "shairport.c:1898" loudness is 0.
         0.000003706 "shairport.c:1899" loudness reference level is -20.000000
         0.003703293 "mdns_avahi.c:375" avahi_dacp_monitor_start Avahi DACP monitor successfully started
         1.496429954 "shairport.c:199" "soxr" interpolation has been chosen.

I can also connect and stream to the device no problem.

Thanks again!

github-actions[bot] commented 3 years ago

This issue has been inactive for 60 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment.