mikebrady / shairport-sync

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

Reconnection issue #1198

Closed freespirit83xyz closed 3 years ago

freespirit83xyz commented 3 years ago

Hi all, I've an old project with OpenWRT (15.05.1) on Mediatek Linkit Smart 7688 that I'm porting on newer release of OpenWRT (19.07.7). Linkit has only one sound card attached (USB DAC). On old Shairport-sync (v. 2.1.15) when the USB is unplugged and plugged again the DAC is recognized again and playback resumes itself. On newer Shairport-sync-openssl remains in an error state and never quit. As you can see logs below, the older Shairports has Error -- ALSA delay(): bad state: -19. Error preparing after delay error: No such device. Error -- ALSA device in incorrect state (-19) for play. for a while than it enters in a new state until USB DAC is plugged again Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5291. Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -4937. Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5301.

The newer Shairport stucks in error: Error -- ALSA delay(): bad state: 8. Error preparing after delay error: "No such device". Error -- ALSA device in incorrect state (8) for play.

Is there some parameters to set in order to have the same behavior?

Here log of Shairport-sync 2.1.15 with verbosity 3

startup avahi: avahi_register. avahi: register_service. new RTSP connection. Play connection from "AirPlay/545.22.21". Connection from IPv4: 192.168.1.153:53877 Error -- ALSA delay(): bad state: -19. Error preparing after delay error: No such device. Error getting dac_delay at start of loop. Error -- ALSA delay(): bad state: -19. Error preparing after delay error: No such device. Error -- ALSA device in incorrect state (-19) for play. Error preparing after play error: No such device. Error -- ALSA delay(): bad state: -19. Error preparing after delay error: No such device. Error getting dac_delay at start of loop. Error -- ALSA delay(): bad state: -19. Error preparing after delay error: No such device. Error -- ALSA device in incorrect state (-19) for play. Error preparing after play error: No such device. Error -- ALSA delay(): bad state: -19. Error preparing after delay error: No such device. Error getting dac_delay at start of loop. Error -- ALSA delay(): bad state: -19. Error preparing after delay error: No such device. Error -- ALSA device in incorrect state (-19) for play. Error preparing after play error: No such device. Error -- ALSA delay(): bad state: -19. Error preparing after delay error: No such device. Error getting dac_delay at start of loop. Error -- ALSA delay(): bad state: -19. Error preparing after delay error: No such device. Error -- ALSA device in incorrect state (-19) for play. Error preparing after play error: No such device. Error -- ALSA delay(): bad state: -19. Error preparing after delay error: No such device. Error getting dac_delay at start of loop. Error -- ALSA delay(): bad state: -19. Error preparing after delay error: No such device. Error -- ALSA device in incorrect state (-19) for play. Error preparing after play error: No such device. Error -- ALSA delay(): bad state: -19. Error preparing after delay error: No such device. Error getting dac_delay at start of loop. Error -- ALSA delay(): bad state: -19. Error preparing after delay error: No such device. Error -- ALSA device in incorrect state (-19) for play. Error preparing after play error: No such device. Error -- ALSA delay(): bad state: -19. Error preparing after delay error: No such device. Error getting dac_delay at start of loop. Error -- ALSA delay(): bad state: -19. Error preparing after delay error: No such device. Error -- ALSA device in incorrect state (-19) for play. Error preparing after play error: No such device. Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: 4294964075. Error dropping frames: No such device. Error preparing after flush: No such device. Flush returning unexpected state -- -19. Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5291. Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -4937. Lost sync with source for 4 consecutive packets -- flushing and resyncing. Error: -5301.

And here the log of Shairport-sync-openssl 3.2.2 with verbosity 3

alsa output device name is "default". Version: "3.2.2-OpenSSL-Avahi-ALSA-soxr-metadata-sysconfdir:/etc" statistics_requester status is 0. daemon status is 0. deamon pid file path is "/var/run/shairport-sync/shairport-sync.pid". rtsp listening port is 5006. udp base port is 6001. udp port range is 100. player name is "pdp". backend is "(null)". on-start action is "(null)". on-stop action is "(null)". wait-cmd status is 0. on-start returns output is 0. mdns backend "(null)". stuffing option is "0" (0-basic, 1-soxr). resync time is 0.050000 seconds. allow a session to be interrupted: 0. busy timeout time is 120. drift tolerance is 0.001995 seconds. password is "(null)". ignore_volume_control is 0. volume_max_db is not set playback_mode is 0 (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_right). disable_synchronization is 0. use_mmap_if_available is 1. output_rate is 44100. output_format is 3 (0-unknown, 1-S8, 2-U8, 3-S16, 4-S24, 5-S24_3LE, 6-S24_3BE, 7-S32). audio backend desired buffer length is 0.150000 seconds. audio backend latency offset is 0.000000 seconds. audio backend silence lead-in time is -1.000000 seconds. A value -1.0 means use the default. volume range in dB (zero means use the range specified by the mixer): 0. zeroconf regtype is "_raop._tcp". decoders_supported field is 1. use_apple_decoder is 0. alsa_use_hardware_mute is 0. no special mdns service interface was requested. configuration file name "/etc/shairport-sync.conf" resolves to "/etc/shairport-sync.conf". metadata enabled is 0. metadata pipename is "(null)". metadata socket address is "(null)" port 0. metadata socket packet size is "500". get-coverart is 0. loudness is 0. loudness reference level is -20.000000 disable resend requests is off. diagnostic_drop_packet_fraction is 0.000000. A value of 0.0 means no packets will be dropped deliberately. avahi: service '452AF0EA3B15@pdp' successfully added. Dithering will be enabled because the output volume is being altered in software waiting for a mutex, maximum expected time of 30000 microseconds exceeded "player.c:495". debug_mutex_lock at "player.c:495" expected max wait: 0.030000000, actual wait: 0.049998234 sec. Error -- ALSA delay(): bad state: 8. Error preparing after delay error: "No such device". Error -- ALSA device in incorrect state (8) for play. Error preparing after play error: "No such device". Error -- ALSA delay(): bad state: 8. Error preparing after delay error: "No such device". Error -- ALSA device in incorrect state (8) for play. Error preparing after play error: "No such device". Error -- ALSA delay(): bad state: 8. Error preparing after delay error: "No such device". Error -- ALSA device in incorrect state (8) for play. Error preparing after play error: "No such device". Error -- ALSA delay(): bad state: 8.

mikebrady commented 3 years ago

Thanks for the post. TBH, being able to work after reconnection is a kind of behaviour that has not been programmed for, so it's lucky that it works at all. That said, nothing has been done to explicitly prevent it from working.

A question that occurs is whether it's a feature of OpenWRT 19? There have been many changes to the way devices are handled....

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.