Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay error -524 when checking running latency, HDMI O/P works when connected to speaker thorugh TV but not when directly connected to soundbar #1836

Open
1 of 2 tasks
aditya-gitte opened this issue Mar 29, 2024 · 3 comments

Comments

@aditya-gitte
Copy link

What happened?

I am trying to get hdmi output to a samsung soundbar. I have followed all the steps and set up shairport sync using the instructions. The soundbar is connected to a TV thorugh an ARC connection, when I connect the rasberry pi 3b to the TV and play audio it works flawlessly, but when I connect my RPI directly to the sound bar using HDMI Cable, the sound doesn't work

These are the logs that I get when I connect through TV using shairport-sync -v

adipi@raspberrypi:/etc $ shairport-sync -v
         0.002605573 "shairport.c:2252" Startup in AirPlay 2 mode, with features 0x405c4a00,0x1c340 on device "b8:27:eb:e6:4d:75".
         0.000175156 "shairport.c:2291" Version String: "4.3.2-2-g165431a8-AirPlay2-smi10-OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc"
         0.000037136 "shairport.c:2310" Command Line: "shairport-sync -v".
         0.000539427 "shairport.c:2346" Log Verbosity is 1.
         0.000074583 "audio_alsa.c:1021" alsa: alsa_maximum_stall_time of 0.200000 sec.
         0.000077969 "audio_alsa.c:1310" alsa: disable_standby_mode is "never".
         0.000033177 "audio_alsa.c:1314" alsa: disable_standby_mode_silence_threshold is 0.040000 seconds.
         0.000033021 "audio_alsa.c:1316" alsa: disable_standby_mode_silence_scan_interval is 0.004000 seconds.
         0.000059531 "audio_alsa.c:1356" alsa: output device name is "hdmi:CARD=vc4hdmi,DEV=0".
         0.000321979 "shairport.c:2394" disable_resend_requests is off.
         0.000042709 "shairport.c:2395" diagnostic_drop_packet_fraction is 0.000000. A value of 0.0 means no packets will be dropped deliberately.
         0.000035989 "shairport.c:2399" statistics_requester status is 0.
         0.000031511 "shairport.c:2404" rtsp listening port is 7000.
         0.000030989 "shairport.c:2405" udp base port is 6001.
         0.000030625 "shairport.c:2406" udp port range is 10.
         0.000030417 "shairport.c:2407" player name is "Kitchen".
         0.000033333 "shairport.c:2408" backend is "alsa".
         0.000030834 "shairport.c:2409" run_this_before_play_begins action is "(null)".
         0.000030833 "shairport.c:2410" run_this_after_play_ends action is "(null)".
         0.000066458 "shairport.c:2411" wait-cmd status is 0.
         0.000032344 "shairport.c:2412" run_this_before_play_begins may return output is 0.
         0.000031979 "shairport.c:2413" run_this_if_an_unfixable_error_is_detected action is "(null)".
         0.000031719 "shairport.c:2415" run_this_before_entering_active_state action is  "(null)".
         0.000031771 "shairport.c:2417" run_this_after_exiting_active_state action is  "(null)".
         0.000031250 "shairport.c:2419" active_state_timeout is  10.000000 seconds.
         0.000034844 "shairport.c:2420" mdns backend "(null)".
         0.000030520 "shairport.c:2422" interpolation setting is "basic".
         0.000031302 "shairport.c:2426" interpolation soxr_delay_threshold is 30000000.
         0.000030990 "shairport.c:2427" resync time is 0.050000 seconds.
         0.000031771 "shairport.c:2428" resync recovery time is 0.100000 seconds.
         0.000032396 "shairport.c:2429" allow a session to be interrupted: 0.
         0.000030625 "shairport.c:2430" busy timeout time is 0.
         0.000030156 "shairport.c:2431" drift tolerance is 0.002000 seconds.
         0.000032031 "shairport.c:2432" password is "(null)".
         0.000035834 "shairport.c:2433" default airplay volume is: -24.000000.
         0.000033697 "shairport.c:2434" high threshold airplay volume is: -16.000000.
         0.000033021 "shairport.c:2436" check for higher-than-threshold volume for new play session is disabled.
         0.000031094 "shairport.c:2442" ignore_volume_control is 0.
         0.000031042 "shairport.c:2446" volume_max_db is not set
         0.000030208 "shairport.c:2447" volume range in dB (zero means use the range specified by the mixer): 0.
         0.000032031 "shairport.c:2449" volume_range_combined_hardware_priority (1 means hardware mixer attenuation is used first) is 0.
         0.000031979 "shairport.c:2453" playback_mode is 0 (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_right).
         0.000031875 "shairport.c:2455" disable_synchronization is 0.
         0.000030313 "shairport.c:2456" use_mmap_if_available is 1.
         0.000030521 "shairport.c:2457" output_format automatic selection is enabled.
         0.000031198 "shairport.c:2461" output_rate automatic selection is enabled.
         0.000030781 "shairport.c:2465" audio backend desired buffer length is 0.200000 seconds.
         0.000032083 "shairport.c:2467" audio_backend_buffer_interpolation_threshold_in_seconds is 0.120000 seconds.
         0.000032969 "shairport.c:2469" audio backend latency offset is 0.000000 seconds.
         0.000032240 "shairport.c:2471" audio backend silence lead-in time is "auto".
         0.000036718 "shairport.c:2475" zeroconf regtype is "_raop._tcp".
         0.000031094 "shairport.c:2476" decoders_supported field is 1.
         0.000030365 "shairport.c:2477" use_apple_decoder is 0.
         0.000030416 "shairport.c:2478" alsa_use_hardware_mute is 0.
         0.000030573 "shairport.c:2482" no special mdns service interface was requested.
         0.000066354 "shairport.c:2485" configuration file name "/etc/shairport-sync.conf" resolves to "/etc/shairport-sync.conf".
         0.000035625 "shairport.c:2515" loudness is 0.
         0.000031146 "shairport.c:2516" loudness reference level is -20.000000
         0.000918125 "shairport.c:2643" NQPTP is online.
        15.202085203 "rtsp.c:2902" Connection 1: AP2 PTP connection from 2405:201:1007:30c8:6090:f4a0:908e:3341:49865 ("Aditya’s iPad") to self at 2405:201:1007:30c8:3b2b:e417:c4a3:8491:7000.
         4.868435206 "rtsp.c:3258" Connection 1: SETUP AP2 no Active-Remote information  the SETUP Record.
         0.000100729 "rtsp.c:3277" Connection 1: SETUP AP2 doesn't include DACP-ID string information.

When I connect to the sound bar directly I get this error message 0.748381614 "player.c:1253" Gone past starting time for 3071207565 by 9224461 nanoseconds. 0.043610104 "player.c:2711" Delay error -524 when checking running latency.. Here is the entire log

^Cadipi@raspberrypi:/etc $ shairport-sync -v
         0.002526667 "shairport.c:2252" Startup in AirPlay 2 mode, with features 0x405c4a00,0x1c340 on device "b8:27:eb:e6:4d:75".
         0.000171302 "shairport.c:2291" Version String: "4.3.2-2-g165431a8-AirPlay2-smi10-OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc"
         0.000038489 "shairport.c:2310" Command Line: "shairport-sync -v".
         0.000585886 "shairport.c:2346" Log Verbosity is 1.
         0.000057031 "audio_alsa.c:1021" alsa: alsa_maximum_stall_time of 0.200000 sec.
         0.000074583 "audio_alsa.c:1310" alsa: disable_standby_mode is "never".
         0.000032500 "audio_alsa.c:1314" alsa: disable_standby_mode_silence_threshold is 0.040000 seconds.
         0.000033281 "audio_alsa.c:1316" alsa: disable_standby_mode_silence_scan_interval is 0.004000 seconds.
         0.000042865 "audio_alsa.c:1356" alsa: output device name is "hdmi:CARD=vc4hdmi,DEV=0".
         0.000317292 "shairport.c:2394" disable_resend_requests is off.
         0.000037916 "shairport.c:2395" diagnostic_drop_packet_fraction is 0.000000. A value of 0.0 means no packets will be dropped deliberately.
         0.000036042 "shairport.c:2399" statistics_requester status is 0.
         0.000031823 "shairport.c:2404" rtsp listening port is 7000.
         0.000030937 "shairport.c:2405" udp base port is 6001.
         0.000030886 "shairport.c:2406" udp port range is 10.
         0.000030625 "shairport.c:2407" player name is "Kitchen".
         0.000030521 "shairport.c:2408" backend is "alsa".
         0.000030625 "shairport.c:2409" run_this_before_play_begins action is "(null)".
         0.000036718 "shairport.c:2410" run_this_after_play_ends action is "(null)".
         0.000031563 "shairport.c:2411" wait-cmd status is 0.
         0.000030677 "shairport.c:2412" run_this_before_play_begins may return output is 0.
         0.000031354 "shairport.c:2413" run_this_if_an_unfixable_error_is_detected action is "(null)".
         0.000066823 "shairport.c:2415" run_this_before_entering_active_state action is  "(null)".
         0.000032813 "shairport.c:2417" run_this_after_exiting_active_state action is  "(null)".
         0.000031302 "shairport.c:2419" active_state_timeout is  10.000000 seconds.
         0.000035937 "shairport.c:2420" mdns backend "(null)".
         0.000030834 "shairport.c:2422" interpolation setting is "basic".
         0.000030677 "shairport.c:2426" interpolation soxr_delay_threshold is 30000000.
         0.000030937 "shairport.c:2427" resync time is 0.050000 seconds.
         0.000031927 "shairport.c:2428" resync recovery time is 0.100000 seconds.
         0.000032292 "shairport.c:2429" allow a session to be interrupted: 0.
         0.000030781 "shairport.c:2430" busy timeout time is 0.
         0.000036042 "shairport.c:2431" drift tolerance is 0.002000 seconds.
         0.000032760 "shairport.c:2432" password is "(null)".
         0.000030729 "shairport.c:2433" default airplay volume is: -24.000000.
         0.000033073 "shairport.c:2434" high threshold airplay volume is: -16.000000.
         0.000033125 "shairport.c:2436" check for higher-than-threshold volume for new play session is disabled.
         0.000031250 "shairport.c:2442" ignore_volume_control is 0.
         0.000031094 "shairport.c:2446" volume_max_db is not set
         0.000030208 "shairport.c:2447" volume range in dB (zero means use the range specified by the mixer): 0.
         0.000031927 "shairport.c:2449" volume_range_combined_hardware_priority (1 means hardware mixer attenuation is used first) is 0.
         0.000031771 "shairport.c:2453" playback_mode is 0 (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_right).
         0.000032032 "shairport.c:2455" disable_synchronization is 0.
         0.000030520 "shairport.c:2456" use_mmap_if_available is 1.
         0.000030782 "shairport.c:2457" output_format automatic selection is enabled.
         0.000031354 "shairport.c:2461" output_rate automatic selection is enabled.
         0.000030729 "shairport.c:2465" audio backend desired buffer length is 0.200000 seconds.
         0.000032500 "shairport.c:2467" audio_backend_buffer_interpolation_threshold_in_seconds is 0.120000 seconds.
         0.000038073 "shairport.c:2469" audio backend latency offset is 0.000000 seconds.
         0.000033229 "shairport.c:2471" audio backend silence lead-in time is "auto".
         0.000031198 "shairport.c:2475" zeroconf regtype is "_raop._tcp".
         0.000030885 "shairport.c:2476" decoders_supported field is 1.
         0.000030782 "shairport.c:2477" use_apple_decoder is 0.
         0.000030625 "shairport.c:2478" alsa_use_hardware_mute is 0.
         0.000030468 "shairport.c:2482" no special mdns service interface was requested.
         0.000063542 "shairport.c:2485" configuration file name "/etc/shairport-sync.conf" resolves to "/etc/shairport-sync.conf".
         0.000035729 "shairport.c:2515" loudness is 0.
         0.000031198 "shairport.c:2516" loudness reference level is -20.000000
         0.001397969 "shairport.c:2643" NQPTP is online.
        18.369713847 "rtsp.c:2902" Connection 1: AP2 PTP connection from 2405:201:1007:30c8:6090:f4a0:908e:3341:49860 ("Aditya’s iPad") to self at 2405:201:1007:30c8:3b2b:e417:c4a3:8491:7000.
         3.647073540 "rtsp.c:3258" Connection 1: SETUP AP2 no Active-Remote information  the SETUP Record.
         0.000085834 "rtsp.c:3277" Connection 1: SETUP AP2 doesn't include DACP-ID string information.
         0.748381614 "player.c:1253" Gone past starting time for 3071207565 by 9224461 nanoseconds.
         0.043610104 "player.c:2711" Delay error -524 when checking running latency.
         0.004939011 "player.c:2711" Delay error -524 when checking running latency.
         0.004832708 "player.c:2711" Delay error -524 when checking running latency.

I did try setting the disable_synchronization flag under alsa setting in shairport-sync.conf to yes, this only stopped the error from showing up in the logs but the sound still did not come.

I have made only 2 changes to the config file, 1 is name and the other is HDMI output

// General Settings
general =
{
        name = "Kitchen"; // This means "Hostname" -- see below. This is the name the service will advertise to iTunes.
}
alsa = 
{
        output_device = "hdmi:CARD=vc4hdmi,DEV=0";
}

Relevant log output

No response

System Information.

Rasberry pi 3B

Configuration Information.

adipi@raspberrypi:/etc $ shairport-sync --displayConfig
>> Display Config Start.

From "uname -a":
 Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

From /etc/os-release:
 Debian GNU/Linux 11 (bullseye)

From /sys/firmware/devicetree/base/model:
 Raspberry Pi 3 Model B Rev 1.2

Shairport Sync Version String:
 4.3.2-2-g165431a8-AirPlay2-smi10-OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc

Command Line:
 shairport-sync --displayConfig

Configuration File:
 /etc/shairport-sync.conf

Configuration File Settings:
 general : 
 {
   name = "Kitchen";
 };
 alsa : 
 {
   output_device = "hdmi:CARD=vc4hdmi,DEV=0";
 };
 pw : 
 {
 };

>> Display Config End.
>> Goodbye!

PulseAudio or PipeWire installed?

  • Check if your system uses a Sound Server.

How did you install Shairport Sync?

Built from source

Check previous issues

  • Confirm
@mikebrady
Copy link
Owner

mikebrady commented Apr 1, 2024

Thanks for the post. (It's very useful to know that Shairport Sync itself is working when connected to the TV.)

There is an app called sps-alsa-explore which you can use to discover Shairport-Sync-compatible output devices.

I guess you are testing with the soundbar connected and switched on?

It is possible, I guess, that the soundbar is incompatible with Shairport Sync. For example, it might only accept 48,000 frames per second (fps), not the 44,100 fps needed by Shairport, and the TV transcodes from 44,100 to 48,000.

@aditya-gitte
Copy link
Author

Thanks for the reply. The soundbar was on and connected when I was testing. I did check the compatibility using sps-alsa-explore and my soundbar doesn't show up in the list. So ig there is not much that can be done in this case. I have placed an order for a DAC, and I'll start using my RPI using the USB DAC. Thanks a lot for the good work!

@fritz-fritz
Copy link

@aditya-gitte I'm sure you received your DAC by now, but if you use alsa as your backend you could set your bit depth and rate to match what your soundbar supports.

If you have pulseaudio or pipewire-pulse you could run pactl list sinks to see what audio.allowed-rates it supports.

or even easier with alsa, simply play any audio file:

$ aplay --dump-hw-params /path/to/audio/file

or if that doesn't work the following has a TON of information but will be buried in there

alsa-info --stdout

Once you have the information, set it in your config file under the alsa backend settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants