mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.17k stars 569 forks source link

[Problem]: Ipad 16.6.1 works, but macOS Sonoma have no sound. #1741

Closed janiversen closed 11 months ago

janiversen commented 11 months ago

What happened?

My iPad (iPadOS 16.6.1) streams nicely to the RPI and to the speakers.

My MacMini (MacOS Sonoma 14.0) can see the airport and allows me to stream, but there are NO sound.

All tests are done with the Spotify app.

I checked the alsamixer while streaming from either device and could not see a difference:

Captura de pantalla 2023-10-02 a las 22 27 05

Relevant log output

----- IPAD log (WORKS) -------
0.000808038 "shairport.c:2252" Startup in AirPlay 2 mode, with features 0x405c4a00,0x1c340 on device "e4:5f:01:11:29:9c".
         0.000093425 "shairport.c:2291" Version String: "4.3.1-24-g7e0e3af6-AirPlay2-smi10-OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc"
         0.000011741 "shairport.c:2310" Command Line: "shairport-sync -v --configfile airport.conf".
         0.000292759 "shairport.c:2346" Log Verbosity is 1.
         0.000034149 "audio_alsa.c:1021" alsa: alsa_maximum_stall_time of 0.200000 sec.
         0.000034944 "audio_alsa.c:1310" alsa: disable_standby_mode is "never".
         0.000007000 "audio_alsa.c:1314" alsa: disable_standby_mode_silence_threshold is 0.040000 seconds.
         0.000006833 "audio_alsa.c:1316" alsa: disable_standby_mode_silence_scan_interval is 0.004000 seconds.
         0.000020037 "audio_alsa.c:1356" alsa: output device name is "hw:IQaudIODAC".
         0.000192982 "shairport.c:2394" disable_resend_requests is off.
         0.000017296 "shairport.c:2395" diagnostic_drop_packet_fraction is 0.000000. A value of 0.0 means no packets will be dropped deliberately.
         0.000007611 "shairport.c:2399" statistics_requester status is 0.
         0.000006778 "shairport.c:2404" rtsp listening port is 7000.
         0.000006407 "shairport.c:2405" udp base port is 6001.
         0.000006093 "shairport.c:2406" udp port range is 10.
         0.000006482 "shairport.c:2407" player name is "Pisomusica".
         0.000006018 "shairport.c:2408" backend is "alsa".
         0.000006315 "shairport.c:2409" run_this_before_play_begins action is "(null)".
         0.000006148 "shairport.c:2410" run_this_after_play_ends action is "(null)".
         0.000006241 "shairport.c:2411" wait-cmd status is 0.
         0.000006481 "shairport.c:2412" run_this_before_play_begins may return output is 0.
         0.000007982 "shairport.c:2413" run_this_if_an_unfixable_error_is_detected action is "(null)".
         0.000006444 "shairport.c:2415" run_this_before_entering_active_state action is  "(null)".
         0.000006111 "shairport.c:2417" run_this_after_exiting_active_state action is  "(null)".
         0.000006111 "shairport.c:2419" active_state_timeout is  10.000000 seconds.
         0.000026334 "shairport.c:2420" mdns backend "avahi".
         0.000006703 "shairport.c:2422" interpolation setting is "auto".
         0.000006334 "shairport.c:2426" interpolation soxr_delay_threshold is 30000000.
         0.000006074 "shairport.c:2427" resync time is 0.050000 seconds.
         0.000006444 "shairport.c:2428" resync recovery time is 0.100000 seconds.
         0.000006611 "shairport.c:2429" allow a session to be interrupted: 1.
         0.000005852 "shairport.c:2430" busy timeout time is 120.
         0.000005945 "shairport.c:2431" drift tolerance is 0.002000 seconds.
         0.000006407 "shairport.c:2432" password is "(null)".
         0.000005852 "shairport.c:2433" default airplay volume is: -10.000000.
         0.000006852 "shairport.c:2434" high threshold airplay volume is: -16.000000.
         0.000007111 "shairport.c:2436" check for higher-than-threshold volume for new play session is disabled.
         0.000005981 "shairport.c:2442" ignore_volume_control is 0.
         0.000006223 "shairport.c:2446" volume_max_db is not set
         0.000005907 "shairport.c:2447" volume range in dB (zero means use the range specified by the mixer): 0.
         0.000006574 "shairport.c:2449" volume_range_combined_hardware_priority (1 means hardware mixer attenuation is used first) is 0.
         0.000006519 "shairport.c:2453" playback_mode is 0 (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_right).
         0.000006481 "shairport.c:2455" disable_synchronization is 0.
         0.000006000 "shairport.c:2456" use_mmap_if_available is 1.
         0.000005852 "shairport.c:2457" output_format automatic selection is enabled.
         0.000006056 "shairport.c:2461" output_rate automatic selection is enabled.
         0.000006203 "shairport.c:2465" audio backend desired buffer length is 0.200000 seconds.
         0.000006722 "shairport.c:2467" audio_backend_buffer_interpolation_threshold_in_seconds is 0.120000 seconds.
         0.000006686 "shairport.c:2469" audio backend latency offset is 0.000000 seconds.
         0.000006666 "shairport.c:2471" audio backend silence lead-in time is "auto".
         0.000005982 "shairport.c:2475" zeroconf regtype is "_raop._tcp".
         0.000006166 "shairport.c:2476" decoders_supported field is 1.
         0.000005926 "shairport.c:2477" use_apple_decoder is 0.
         0.000005889 "shairport.c:2478" alsa_use_hardware_mute is 0.
         0.000005945 "shairport.c:2482" no special mdns service interface was requested.
         0.000039055 "shairport.c:2485" configuration file name "airport.conf" resolves to "/home/jan/config/airport.conf".
         0.000011945 "shairport.c:2515" loudness is 0.
         0.000006703 "shairport.c:2516" loudness reference level is -20.000000
         0.000393686 "shairport.c:2643" NQPTP is online.
         1.500654721 "shairport.c:255" "soxr" interpolation has been chosen.
         3.994718312 "rtsp.c:2866" Connection 2: AP2 PTP connection from fd2d:31ce:1aa3:0:c21:8d48:41b8:f56e:55952 ("Jan iPad") to self at fd2d:31ce:1aa3:0:c2e1:5fc5:91ac:8d01:7000.
         5.074715553 "rtsp.c:3249" Connection 2. AP2 Realtime Audio Stream.
         0.006018778 "audio_alsa.c:322" *warning: failed to find mixer control "PCM",0.
         0.047547296 "rtp.c:1741" AP2 Realtime Clock receiver initialised.

----- MacMini (NO SOUND) ----
jan@pisomusica:~/config $ shairport-sync -v --configfile airport.conf 2>&1 | tee macmini.log
         0.001261204 "shairport.c:2252" Startup in AirPlay 2 mode, with features 0x405c4a00,0x1c340 on device "e4:5f:01:11:29:9c".
         0.000131037 "shairport.c:2291" Version String: "4.3.1-24-g7e0e3af6-AirPlay2-smi10-OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc"
         0.000019463 "shairport.c:2310" Command Line: "shairport-sync -v --configfile airport.conf".
         0.000919204 "shairport.c:2346" Log Verbosity is 1.
         0.000060500 "audio_alsa.c:1021" alsa: alsa_maximum_stall_time of 0.200000 sec.
         0.000450444 "audio_alsa.c:1310" alsa: disable_standby_mode is "never".
         0.000027778 "audio_alsa.c:1314" alsa: disable_standby_mode_silence_threshold is 0.040000 seconds.
         0.000018093 "audio_alsa.c:1316" alsa: disable_standby_mode_silence_scan_interval is 0.004000 seconds.
         0.000497888 "audio_alsa.c:1356" alsa: output device name is "hw:IQaudIODAC".
         0.000442630 "shairport.c:2394" disable_resend_requests is off.
         0.000030963 "shairport.c:2395" diagnostic_drop_packet_fraction is 0.000000. A value of 0.0 means no packets will be dropped deliberately.
         0.000017167 "shairport.c:2399" statistics_requester status is 0.
         0.000200389 "shairport.c:2404" rtsp listening port is 7000.
         0.000285074 "shairport.c:2405" udp base port is 6001.
         0.000025611 "shairport.c:2406" udp port range is 10.
         0.000012555 "shairport.c:2407" player name is "Pisomusica".
         0.000235982 "shairport.c:2408" backend is "alsa".
         0.000025778 "shairport.c:2409" run_this_before_play_begins action is "(null)".
         0.000017018 "shairport.c:2410" run_this_after_play_ends action is "(null)".
         0.000235722 "shairport.c:2411" wait-cmd status is 0.
         0.000270445 "shairport.c:2412" run_this_before_play_begins may return output is 0.
         0.000025426 "shairport.c:2413" run_this_if_an_unfixable_error_is_detected action is "(null)".
         0.000017518 "shairport.c:2415" run_this_before_entering_active_state action is  "(null)".
         0.000240000 "shairport.c:2417" run_this_after_exiting_active_state action is  "(null)".
         0.000234111 "shairport.c:2419" active_state_timeout is  10.000000 seconds.
         0.000027797 "shairport.c:2420" mdns backend "avahi".
         0.000017444 "shairport.c:2422" interpolation setting is "auto".
         0.000231500 "shairport.c:2426" interpolation soxr_delay_threshold is 30000000.
         0.000018630 "shairport.c:2427" resync time is 0.050000 seconds.
         0.000268611 "shairport.c:2428" resync recovery time is 0.100000 seconds.
         0.000018074 "shairport.c:2429" allow a session to be interrupted: 1.
         0.000262833 "shairport.c:2430" busy timeout time is 120.
         0.000018871 "shairport.c:2431" drift tolerance is 0.002000 seconds.
         0.000239555 "shairport.c:2432" password is "(null)".
         0.000016834 "shairport.c:2433" default airplay volume is: -10.000000.
         0.000237611 "shairport.c:2434" high threshold airplay volume is: -16.000000.
         0.000018740 "shairport.c:2436" check for higher-than-threshold volume for new play session is disabled.
         0.000234482 "shairport.c:2442" ignore_volume_control is 0.
         0.000017815 "shairport.c:2446" volume_max_db is not set
         0.000230500 "shairport.c:2447" volume range in dB (zero means use the range specified by the mixer): 0.
         0.000238407 "shairport.c:2449" volume_range_combined_hardware_priority (1 means hardware mixer attenuation is used first) is 0.
         0.000024593 "shairport.c:2453" playback_mode is 0 (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_right).
         0.000012500 "shairport.c:2455" disable_synchronization is 0.
         0.000233611 "shairport.c:2456" use_mmap_if_available is 1.
         0.000022741 "shairport.c:2457" output_format automatic selection is enabled.
         0.000012222 "shairport.c:2461" output_rate automatic selection is enabled.
         0.000226889 "shairport.c:2465" audio backend desired buffer length is 0.200000 seconds.
         0.000024963 "shairport.c:2467" audio_backend_buffer_interpolation_threshold_in_seconds is 0.120000 seconds.
         0.000017259 "shairport.c:2469" audio backend latency offset is 0.000000 seconds.
         0.000261055 "shairport.c:2471" audio backend silence lead-in time is "auto".
         0.000018204 "shairport.c:2475" zeroconf regtype is "_raop._tcp".
         0.000242167 "shairport.c:2476" decoders_supported field is 1.
         0.000017722 "shairport.c:2477" use_apple_decoder is 0.
         0.000231704 "shairport.c:2478" alsa_use_hardware_mute is 0.
         0.000018055 "shairport.c:2482" no special mdns service interface was requested.
         0.000414426 "shairport.c:2485" configuration file name "airport.conf" resolves to "/home/jan/config/airport.conf".
         0.000029852 "shairport.c:2515" loudness is 0.
         0.000014667 "shairport.c:2516" loudness reference level is -20.000000
         0.001130055 "shairport.c:2643" NQPTP is online.
         1.501989870 "shairport.c:255" "soxr" interpolation has been chosen.
         4.945211552 "rtsp.c:2866" Connection 1: AP2 PTP connection from fd2d:31ce:1aa3:0:1881:a8e9:8486:df83:53921 ("MacMini") to self at fd2d:31ce:1aa3:0:c2e1:5fc5:91ac:8d01:7000.
        10.545161161 "rtsp.c:3249" Connection 1. AP2 Realtime Audio Stream.
         0.006015333 "audio_alsa.c:322" *warning: failed to find mixer control "PCM",0.
         0.041289648 "rtp.c:1741" AP2 Realtime Clock receiver initialised.

System Information.

RPI 4 with IQAudioAMP. Software is RaspbianOS Lite 64 bit and shairport-sync (compiled from latest master, tested also with development).

iPad with iPadOS 16.6.1 (WORKS) MacMini with MacOS Sonoma 14.0

Test software: Spotify app (for iPad and macOS).

Configuration Information.

>> Display Config Start.

From "uname -a":
 Linux pisomusica 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 4 Model B Rev 1.4

Shairport Sync Version String:
 4.3.1-24-g7e0e3af6-AirPlay2-smi10-OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc

Command Line:
 shairport-sync --configfile airport.conf --displayConfig

Configuration File:
 /home/jan/config/airport.conf

Configuration File Settings:
 general : 
 {
   name = "%H";
   output_backend = "alsa";
   mdns_backend = "avahi";
   playback_mode = "stereo";
   alac_decoder = "hammerton";
   ignore_volume_control = "no";
   default_airplay_volume = -10.0;
 };
 sessioncontrol : 
 {
   active_state_timeout = 10.0;
   allow_session_interruption = "yes";
   session_timeout = 120;
 };
 alsa : 
 {
   output_device = "hw:IQaudIODAC";
   mixer_control_name = "PCM";
 };
 diagnostics : 
 {
   log_output_to = "stderr";
   log_verbosity = 0;
 };

>> Display Config End.

PulseAudio or PipeWire installed?

How did you install Shairport Sync?

Built from source

Check previous issues

janiversen commented 11 months ago

Forgot, I use the standard build:

$ git clone https://github.com/mikebrady/shairport-sync.git
$ cd shairport-sync
$ autoreconf -fi
$ ./configure --sysconfdir=/etc --with-alsa \
    --with-soxr --with-avahi --with-ssl=openssl --with-systemd --with-airplay-2
$ make
# make install

The logs are from "master", I did the same test with branch "development" and it was the same.

janiversen commented 11 months ago

I tried to run with -vv when streaming from my MacMini, the log are here:

vv.log

mikebrady commented 11 months ago

Thanks for the report. Could you enable statistics (--statistics) and set a log level of just 1 (-v) and post the results for the Mac mini please?

janiversen commented 11 months ago

Of course: stat.log

The config contains: ´´´ mixer_control_name = "PCM"; ´´´ Because I saw you recommended that in another issue and wrote that it is build into the RPI...it seems it cannot be found ? (I have no controls on the RPI, so maybe its not needed ?).

janiversen commented 11 months ago

I did a compare of the iPad log vs MacMini log:

         6.730336570 "rtsp.c:2866" Connection 1: AP2 PTP connection from fd2d:31ce:1aa3:0:1881:a8e9:8486:df83:55931 ("MacMini") to self at fd2d:31ce:1aa3:0:c2e1:5fc5:91ac:8d01:7000.
         0.100581371 "rtsp.c:3249" Connection 1. AP2 Realtime Audio Stream.
         0.005204907 "audio_alsa.c:322" *warning: failed to find mixer control "PCM",0.
         1.001659703 "rtp.c:1741" AP2 Realtime Clock receiver initialised.
         1.087311444 "player.c:1810" Connection 1: Playback stopped. Total playing time 09:22:44.
        10.108704735 "rtsp.c:3249" Connection 1. AP2 Realtime Audio Stream.
        10.346877179 "player.c:1810" Connection 1: Playback stopped. Total playing time 09:23:05.

        12.965203233 "rtsp.c:2866" Connection 1: AP2 PTP connection from fd2d:31ce:1aa3:0:c21:8d48:41b8:f56e:56048 ("Jan iPad") to self at fd2d:31ce:1aa3:0:c2e1:5fc5:91ac:8d01:7000.
        22.525412116 "rtsp.c:3249" Connection 1. AP2 Realtime Audio Stream.
         0.006490093 "audio_alsa.c:322" *warning: failed to find mixer control "PCM",0.
         0.048228851 "rtp.c:1741" AP2 Realtime Clock receiver initialised.
         1.939880666 "player.c:2832" Connection 1: Playback started at frame 2876630831 -- AirPlay 2 Realtime.
         5.065834164 "player.c:1810" Connection 1: Playback stopped. Total playing time 00:00:05.

The iPad calls:

         1.939880666 "player.c:2832" Connection 1: Playback started at frame 2876630831 -- AirPlay 2 Realtime.

but MacMini does not.

mikebrady commented 11 months ago

Thanks for the update.

  1. “PCM” was the name of the mixer on old versions of the Raspberry Pi. The name of the mixer on your device looks like “Digital”, so it’s worth trying.
  2. It seems as if audio is not arriving from the Mac mini. This could be due to a firewall or a VPN or, occasionally, a faulty router. There are some suggestions in the TROUBLESHOOTING guide.

Please keep us apprised of how you get on…

janiversen commented 11 months ago

Found the culprit, but I do not understand it ?

iPad, shairport and macMini are on the same subnet (192.168.20.x), and as the log show Mac mini connects correctly to the shairport.

The difference is that the macMini is cabled, where iPad and shairport are Wifi (also 192.168.20.x)

When I put the MacMini on the Wifi and disconnect the cable it works !

This might be good good advice to put in the documentation....however does any of you know why it does not work when the Mac mini is cabled ?

janiversen commented 11 months ago

The problem was that MDNS (224.0.0.0) is not bridged between wifi and lan on openwrt.

Thanks for the help.

mikebrady commented 11 months ago

Excellent -- thanks for letting us know the problem!