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

[Problem]: Many sync errors with PulseAudio #1939

Open
2 tasks done
daniel-shimon opened this issue Dec 2, 2024 · 2 comments
Open
2 tasks done

[Problem]: Many sync errors with PulseAudio #1939

daniel-shimon opened this issue Dec 2, 2024 · 2 comments

Comments

@daniel-shimon
Copy link

daniel-shimon commented Dec 2, 2024

What happened?

Hi, first of all - thanks for developing and maintaining this awesome piece of software!

When using the alsa backend everything works smoothly, but when I use the pa backend I start getting sync errors every few seconds.
I need to use pulseaudio so that I can use a few players simultaneously (I want to also run a spotify connect server on the same machine).
BTW tested this while airplaying from both spotify and apple music so Airplay 1vs2 isn't the issue.

I saw this comment and I guess this is an issue with how PulseAudio reports the clock time?
Thanks for your help!

Relevant log output

0.002741777 "shairport.c:2278" Startup in AirPlay 2 mode, with features 0x405c4a00,0x1c340 on device "d8:3a:dd:c6:2c:d7".
         0.000180352 "shairport.c:2317" Version String: "4.3.4-1-g910264e5-AirPlay2-smi10-OpenSSL-Avahi-ALSA-pa-soxr-sysconfdir:/etc"
         0.000031000 "shairport.c:2336" Command Line: "shairport-sync -o pa -v".
         0.000461889 "shairport.c:2372" Log Verbosity is 1.
         0.010557611 "shairport.c:2440" disable_resend_requests is off.
         0.000256704 "shairport.c:2441" diagnostic_drop_packet_fraction is 0.000000. A value of 0.0 means no packets will be dropped deliberately.
         0.000421667 "shairport.c:2445" statistics_requester status is 0.
         0.000037370 "shairport.c:2450" rtsp listening port is 7000.
         0.000020889 "shairport.c:2451" udp base port is 6001.
         0.000019481 "shairport.c:2452" udp port range is 10.
         0.000018056 "shairport.c:2453" player name is "Monitors".
         0.000017741 "shairport.c:2454" backend is "pa".
         0.000018018 "shairport.c:2455" run_this_before_play_begins action is "(null)".
         0.000018815 "shairport.c:2456" run_this_after_play_ends action is "(null)".
         0.000018741 "shairport.c:2457" wait-cmd status is 0.
         0.000017444 "shairport.c:2458" run_this_before_play_begins may return output is 0.
         0.000018056 "shairport.c:2459" run_this_if_an_unfixable_error_is_detected action is "(null)".
         0.000018648 "shairport.c:2461" run_this_before_entering_active_state action is  "(null)".
         0.000018204 "shairport.c:2463" run_this_after_exiting_active_state action is  "(null)".
         0.000018740 "shairport.c:2465" active_state_timeout is  10.000000 seconds.
         0.000025000 "shairport.c:2466" mdns backend "(null)".
         0.000018630 "shairport.c:2468" interpolation setting is "auto".
         0.000018592 "shairport.c:2472" interpolation soxr_delay_threshold is 30000000.
         0.000018741 "shairport.c:2473" resync time is 0.050000 seconds.
         0.000019704 "shairport.c:2474" resync recovery time is 0.100000 seconds.
         0.000020481 "shairport.c:2475" allow a session to be interrupted: 0.
         0.000018037 "shairport.c:2476" busy timeout time is 120.
         0.000017778 "shairport.c:2477" drift tolerance is 0.002000 seconds.
         0.000019130 "shairport.c:2478" password is not set.
         0.000017148 "shairport.c:2479" default airplay volume is: -24.000000.
         0.000020667 "shairport.c:2480" high threshold airplay volume is: -16.000000.
         0.000021703 "shairport.c:2482" check for higher-than-threshold volume for new play session is disabled.
         0.000019723 "shairport.c:2488" ignore_volume_control is 0.
         0.000018074 "shairport.c:2492" volume_max_db is not set
         0.000017240 "shairport.c:2493" volume range in dB (zero means use the range specified by the mixer): 0.
         0.000018815 "shairport.c:2495" volume_range_combined_hardware_priority (1 means hardware mixer attenuation is used first) is 0.
         0.000021074 "shairport.c:2499" playback_mode is 0 (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_right).
         0.000019611 "shairport.c:2501" disable_synchronization is 0.
         0.000017130 "shairport.c:2502" use_mmap_if_available is 1.
         0.000017167 "shairport.c:2503" output_format automatic selection is enabled.
         0.000017963 "shairport.c:2507" output_rate automatic selection is enabled.
         0.000018796 "shairport.c:2511" audio backend desired buffer length is 0.350000 seconds.
         0.000020056 "shairport.c:2513" audio_backend_buffer_interpolation_threshold_in_seconds is 0.020000 seconds.
         0.000020055 "shairport.c:2515" audio backend latency offset is 0.000000 seconds.
         0.000019685 "shairport.c:2517" audio backend silence lead-in time is "auto".
         0.000017593 "shairport.c:2521" zeroconf regtype is "_raop._tcp".
         0.000018759 "shairport.c:2522" decoders_supported field is 1.
         0.000017722 "shairport.c:2523" use_apple_decoder is 0.
         0.000017186 "shairport.c:2524" alsa_use_hardware_mute is 0.
         0.000017092 "shairport.c:2528" no special mdns service interface was requested.
         0.000050630 "shairport.c:2531" configuration file name "/etc/shairport-sync.conf" resolves to "/etc/shairport-sync.conf".
         0.000023296 "shairport.c:2561" loudness is 0.
         0.000018537 "shairport.c:2562" loudness reference level is -20.000000
         0.001570519 "shairport.c:2689" NQPTP is online.
         1.500097943 "shairport.c:255" "soxr" interpolation has been chosen.
         3.507958628 "rtsp.c:2896" Connection 1: AP2 PTP connection from fdb8:5af5:75f3:5c43:1cf2:3bcc:c40d:c0e1:59754 ("Daniel’s iPhone") to self at fdb8:5af5:75f3:5c43:89d1:9e67:d39e:60de:7000.
         0.349285203 "rtsp.c:3253" Connection 1: SETUP AP2 no Active-Remote information  the SETUP Record.
         0.000087630 "rtsp.c:3272" Connection 1: SETUP AP2 doesn't include DACP-ID string information.
         0.000034815 "rtsp.c:3287" Connection 1. AP2 Realtime Audio Stream.
         0.005839111 "rtp.c:1738" AP2 Realtime Clock receiver initialised.
         2.631426406 "player.c:2903" Large negative (i.e. early) sync error of -2297 frames (-0.052086 seconds), at frame: 1628546958.
         0.419714277 "player.c:2903" Large negative (i.e. early) sync error of -2254 frames (-0.051111 seconds), at frame: 1628566318.
         0.624124240 "player.c:2903" Large negative (i.e. early) sync error of -2304 frames (-0.052245 seconds), at frame: 1628593070.
         0.882847704 "player.c:2903" Large negative (i.e. early) sync error of -2330 frames (-0.052834 seconds), at frame: 1628632142.
         7.244452755 "player.c:2878" Large positive (i.e. late) sync error of 2614 frames (0.059274 seconds), at frame: 1628951758.
         0.244477444 "player.c:2903" Large negative (i.e. early) sync error of -10633 frames (-0.241111 seconds), at frame: 1628962670.
         0.656574277 "player.c:2903" Large negative (i.e. early) sync error of -2694 frames (-0.061088 seconds), at frame: 1628991886.
         0.662146555 "player.c:2903" Large negative (i.e. early) sync error of -2773 frames (-0.062880 seconds), at frame: 1629020398.
         0.603020056 "player.c:2903" Large negative (i.e. early) sync error of -2282 frames (-0.051746 seconds), at frame: 1629047502.
         0.619773407 "player.c:2903" Large negative (i.e. early) sync error of -2340 frames (-0.053061 seconds), at frame: 1629074254.

System Information.

Raspberry Pi 4 Model B+, connected to the built-in audio jack.

Configuration Information.

>> Display Config Start.

From "uname -a":
 Linux monitors-rpi 6.6.51+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64 GNU/Linux

From /etc/os-release:
 Debian GNU/Linux 12 (bookworm)

From /sys/firmware/devicetree/base/model:
 Raspberry Pi 4 Model B Rev 1.5

Shairport Sync Version String:
 4.3.4-1-g910264e5-AirPlay2-smi10-OpenSSL-Avahi-ALSA-pa-soxr-sysconfdir:/etc

Command Line:
 shairport-sync --displayConfig

Configuration File:
 /etc/shairport-sync.conf

Configuration File Settings:
 general : 
 {
   name = "Monitors";
   output_backend = "pa";
 };
 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

Thanks for the report and for the kind words, and BTW there was a new release yesterday, though I don't expect it has much bearing on this issue.

I don't have much to offer on this, except perhaps to consider using the PipeWire backend; I understand that the full version of Raspberry Pi OS with a GUI uses PipeWire and has a PulseAudio-to-PipeWire adapter.

@mikebrady
Copy link
Owner

Regarding Issue #1768, what would be relevant is the AirPlay source: if it's Apple software or hardware, (or if it's OwnTone), then the timing it provides will generally be very stable. Your source appears to be an iPhone, so that should be okay.

Other third-party AirPlay "solutions", especially those based on Android, tend to have inaccurate timing.

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

2 participants