mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.04k stars 567 forks source link

unable to start the service #1047

Closed kamikaze463 closed 3 years ago

kamikaze463 commented 3 years ago

Hey there!

I was not able to start the shairport-sync service. Hence cloned a fresh copy of Raspabian and tried to install using git clone method. I/m still not able to get the service up and running. I'm currently into below version 3.3.7rc1-OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc

when I check for the status it shows it started but I'm not able to see the service from any of the iOS or Mac

● shairport-sync.service - Shairport Sync - AirPlay Audio Receiver
   Loaded: loaded (/lib/systemd/system/shairport-sync.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2020-07-27 15:41:48 IST; 12min ago
 Main PID: 4021 (shairport-sync)
    Tasks: 4 (limit: 2068)
   CGroup: /system.slice/shairport-sync.service
           └─4021 /usr/local/bin/shairport-sync

Jul 27 15:41:48 raspberrypi systemd[1]: Started Shairport Sync - AirPlay Audio Receiver.

when I run shairport-sync -vu

I get an error saying "Is another instance of Shairport Sync running on this device":

0.002697983 "shairport.c:1703" Started!
         0.000260366 "shairport.c:1730" software version: "3.3.7rc1-OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc"
         0.000050469 "shairport.c:1736" log verbosity is 1.
         0.000049844 "audio_alsa.c:1015" alsa: alsa_maximum_stall_time of 0.200000 sec.
         0.000174844 "audio_alsa.c:1302" alsa: disable_standby_mode is "never".
         0.000039376 "audio_alsa.c:1304" alsa: disable_standby_mode_silence_threshold is 0.040000 seconds.
         0.000047760 "audio_alsa.c:1306" alsa: disable_standby_mode_silence_scan_interval is 0.004000 seconds.
         0.000062344 "audio_alsa.c:1345" alsa: output device name is "default".
         0.000352502 "shairport.c:1784" disable resend requests is off.
         0.000053125 "shairport.c:1788" diagnostic_drop_packet_fraction is 0.000000. A value of 0.0 means no packets will be dropped deliberately.
         0.000048594 "shairport.c:1789" statistics_requester status is 0.
         0.000035782 "shairport.c:1794" rtsp listening port is 5000.
         0.000034010 "shairport.c:1795" udp base port is 6001.
         0.000033751 "shairport.c:1796" udp port range is 10.
         0.000039948 "shairport.c:1797" player name is "Shareport".
         0.000043437 "shairport.c:1798" backend is "alsa".
         0.000038074 "shairport.c:1799" run_this_before_play_begins action is "(null)".
         0.000040416 "shairport.c:1800" run_this_after_play_ends action is "(null)".
         0.000039740 "shairport.c:1801" wait-cmd status is 0.
         0.000037396 "shairport.c:1802" run_this_before_play_begins may return output is 0.
         0.000040000 "shairport.c:1803" run_this_if_an_unfixable_error_is_detected action is "(null)".
         0.000040730 "shairport.c:1804" run_this_before_entering_active_state action is  "(null)".
         0.000039219 "shairport.c:1805" run_this_after_exiting_active_state action is  "(null)".
         0.000039427 "shairport.c:1806" active_state_timeout is  10.000000 seconds.
         0.000048021 "shairport.c:1807" mdns backend "(null)".
         0.000039063 "shairport.c:1811" interpolation setting is "auto".
         0.000040469 "shairport.c:1812" interpolation soxr_delay_threshold is 30.
         0.000039167 "shairport.c:1813" resync time is 0.050000 seconds.
         0.000041198 "shairport.c:1814" allow a session to be interrupted: 1.
         0.000040156 "shairport.c:1815" busy timeout time is 120.
         0.000039844 "shairport.c:1816" drift tolerance is 0.001995 seconds.
         0.000040573 "shairport.c:1817" password is "(null)".
         0.000043803 "shairport.c:1818" ignore_volume_control is 0.
         0.000034948 "shairport.c:1822" volume_max_db is not set
         0.000036562 "shairport.c:1824" volume range in dB (zero means use the range specified by the mixer): 60.
         0.000043178 "shairport.c:1828" volume_range_combined_hardware_priority (1 means hardware mixer attenuation is used first) is 0.
         0.000041719 "shairport.c:1830" playback_mode is 0 (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_right).
         0.000041042 "shairport.c:1831" disable_synchronization is 0.
         0.000039010 "shairport.c:1832" use_mmap_if_available is 1.
         0.000037917 "shairport.c:1834" output_format automatic selection is enabled.
         0.000038386 "shairport.c:1838" output_rate automatic selection is enabled.
         0.000038958 "shairport.c:1842" audio backend desired buffer length is 0.200000 seconds.
         0.000044375 "shairport.c:1844" audio_backend_buffer_interpolation_threshold_in_seconds is 0.120000 seconds.
         0.000042969 "shairport.c:1845" audio backend latency offset is 0.000000 seconds.
         0.000042292 "shairport.c:1847" audio backend silence lead-in time is "auto".
         0.000037813 "shairport.c:1851" zeroconf regtype is "_raop._tcp".
         0.000039323 "shairport.c:1852" decoders_supported field is 1.
         0.000038282 "shairport.c:1853" use_apple_decoder is 0.
         0.000038646 "shairport.c:1854" alsa_use_hardware_mute is 0.
         0.000038073 "shairport.c:1858" no special mdns service interface was requested.
         0.000087031 "shairport.c:1862" configuration file name "/etc/shairport-sync.conf" resolves to "/etc/shairport-sync.conf".
         0.000047136 "shairport.c:1891" loudness is 0.
         0.000038802 "shairport.c:1892" loudness reference level is -20.000000
         0.001683447 "rtsp.c:2854" unable to listen on IPv4 port 5000. The error is: "Address already in use".
         0.000183751 "rtsp.c:2854" unable to listen on IPv6 port 5000. The error is: "Address already in use".
         0.000070365 "rtsp.c:2986" *fatal error: could not establish a service on port 5000 -- program terminating. Is another instance of Shairport Sync running on this device?
         0.000066354 "shairport.c:1414" emergency exit

I tried running gdb and below is the output

Reading symbols from ./shairport-sync...done.
(gdb) run
Starting program: /usr/local/bin/shairport-sync -v
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0x76538390 (LWP 4656)]
[New Thread 0x75d37390 (LWP 4657)]
[New Thread 0x753ff390 (LWP 4658)]
[Thread 0x75d37390 (LWP 4657) exited]
[Thread 0x76538390 (LWP 4656) exited]
[Thread 0x76ff3330 (LWP 4653) exited]
[Inferior 1 (process 4653) exited with code 01

I've already followed "Remove Old Versions of Shairport Sync and its Startup Scripts" 2 times excluding clean installation. But I'm still not able to get the service up.

Can you help me out?

mikebrady commented 3 years ago

From the log, it looks like the service is actually already running. Let me suggest that you look through the TROUBLESHOOTING.md page for some hints.

kamikaze463 commented 3 years ago

I've checked and verified all the steps mentioned in TROUBLESHOOTING.md page and I still can't get the devices to see the service.

mikebrady commented 3 years ago

Maybe try some of the older issues, e.g. #741?

minix1234 commented 3 years ago

can you confirm that avahi-daemon is alive and well? any time i've had issues with ios devices it was/is usually due to avahi problems.

I've been deploying in docker lately and the daemon will come up using the Top command. I haven't used raspabian so I can not really speak to it. Generally speaking though just executing ""avahi-daemon" will tell you if it fails or not. you might be missing libraries.

image

Should also double check the DBus is working properly. below is a docker image where the dbus wasnt running (and i was missing libnss-mdns). not sure if executing dbus-daemon --system might work on raspabian, but i'm sure you can google up some references.

image

kamikaze463 commented 3 years ago

Maybe try some of the older issues, e.g. #741?

I followed as is and I can now see the service being broadcasted in iTunes/OSX. and it is playing perfectly as it should. However, I still don't see service seen in either of my iPhones or in my iPad. (silly but wanted to mention; I've connected to the same network as MacBook)

kamikaze463 commented 3 years ago

@minix1234 here is the output that I get

pi@raspberrypi:~ $ dbus-daemon --system
dbus-daemon[1775]: Failed to start message bus: Failed to bind socket "/var/run/dbus/system_bus_socket": Address already in use
pi@raspberrypi:~ $ avahi-deamon
-bash: avahi-deamon: command not found
pi@raspberrypi:~ $ avahi-daemon
This program is intended to be run as root.
pi@raspberrypi:~ $ sudo avahi-daemon
Daemon already running on PID 379
kamikaze463 commented 3 years ago

Ok. I'm going to re-image one more time and follow the steps as is mentioned. I'll update you guys on it.

mikebrady commented 3 years ago

Thanks for the updates.

... I can now see the service being broadcasted in iTunes/OSX. and it is playing perfectly as it should. However, I still don't see service seen in either of my iPhones or in my iPad. (silly but wanted to mention; I've connected to the same network as MacBook)

This result means that Shairport Sync is working but not reaching your iOS devices. If that is so, then consider that there might be something odd with your network -- a firewall somewhere, perhaps, or a bad router. Are your iOS devices on VPNs, for example?

mikebrady commented 3 years ago

There are two utilities -- avahi-browse (part of the avahi-utils package) for the Shairport Sync (SPS) end and Discovery by TildeSoft at the iOS/Mac end that you can use to see if the service advertisements are (a) being issued at the SPS end and (b) being seen at the iOS/MacOS end.

minix1234 commented 3 years ago

Thanks

from your comments it looks like they are both running. Try Mikes comments regarding avahi-browse. a common command is "avahi-browse -t --all"

you should see a list of register services that the avahi-daemon has cached. ones with _raop._tcp should corrispond to your shairport-sync instances. below you can see two visible on my test network.

image

if you want greater details on those registries than use

avahi-browse -rt --all

image

kamikaze463 commented 3 years ago

Damn! It was WindScribe. I had installed it on my router and it was somehow blocking the traffic from iOS device. I'm not sure why it wasn't from mac or windows laptop.

kamikaze463 commented 3 years ago

Yup! it was WindScibe. when I re-enable it, It stops broadcasting the device. I'm not sure whats the issue. But for now. Im going to remove the free-vpn option.

mikebrady commented 3 years ago

I might update the troubleshooting guide to mention VPNs...

kamikaze463 commented 3 years ago

I'm loving this!

Thanks Mike!!