mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.19k stars 570 forks source link

[Problem]: volume not adjusting with AirPlay #1814

Closed AStoker closed 6 months ago

AStoker commented 7 months ago

What happened?

I'm using the Adafruit speaker bonnet and have configured it according to their docs (https://learn.adafruit.com/adafruit-speaker-bonnet-for-raspberry-pi). Everything works correctly, EXCEPT the volume control. When I run alsamixer to look at the volume, and then change the volume from airplay, the volume mixer in alsamixer does not change, but remains static. I need to have the alsamixer volume to 100 in order for any substantial volume to be heard. I've rebooted, double checked configs, all that jazz, but so far no joy. Any chance you happened to know if something in particular fixed this?

This is my asound.conf file

pcm.speakerbonnet {
   type hw card 0
}

pcm.dmixer {
   type dmix
   ipc_key 1024
   ipc_perm 0666
   slave {
     pcm "speakerbonnet"
     period_time 0
     period_size 1024
     buffer_size 8192
     rate 44100
     channels 2
   }
}

ctl.dmixer {
    type hw card 0
}

pcm.softvol {
    type softvol
    slave.pcm "dmixer"
    control.name "PCM"
    control.card 0
}

ctl.softvol {
    type hw card 0
}

pcm.!default {
    type             plug
    slave.pcm       "softvol"
}

related #1034

Relevant log output

No response

System Information.

Raspberry Pi Zero 2W Adafruit Sound Bonnet (https://www.adafruit.com/product/3346)

Configuration Information.

>> Display Config Start.

From "uname -a":
 Linux airplaypi 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 Zero 2 W Rev 1.0

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

Command Line:
 shairport-sync --displayConfig

Configuration File:
 /etc/shairport-sync.conf

Configuration File Settings:
 general : 
 {
   name = "AirPlay Pi";
 };
 pw : 
 {
 };

>> Display Config End.
>> Goodbye!

PulseAudio or PipeWire installed?

How did you install Shairport Sync?

Built from source

Check previous issues

mikebrady commented 6 months ago

Thanks for the post. It's hard to know what the cause of this problem is, but let me suggest you investigate the capabilities of the audio devices that are there that might be suitable for Shairport Sync.

There is a tool for this called sps-alsa-explore.

If there is a device that can be used, then I'd suggest you bypass all that asound stuff and send audio to the output device directly. If it has a usable volume control mixer, you can use it.

First step, though, is to see what's out there.

AStoker commented 6 months ago

This is the output of that command.


 ./sps-alsa-explore 
> Device Full Name:    "hw:sndrpihifiberry"
  Short Name:          "hw:0"
  This device is already in use and can not be checked.
  To check it, take it out of use and try again.
mikebrady commented 6 months ago

Thanks. What could be using it? Is PulseAudio or PipeWire installed on the system?

AStoker commented 6 months ago

Neither of those are installed. I pretty much followed these instructions exactly: https://learn.adafruit.com/boomy-pi-airplay/software. If I recall, there was a helper that actually played a quiet "no sound" when no audio is playing, which helped eliminate popping sounds when audio started and stopped playing. I wonder if that's causing that issue. Let me see if I can disable that real quick and run the command again

AStoker commented 6 months ago

Here we go


Device Full Name:    "hw:sndrpihifiberry"
  Short Name:          "hw:0"
  This device seems suitable for use with Shairport Sync.
  The following rate and format would be chosen by Shairport Sync in "auto" mode:
     Rate              Format
     44100             S32_LE
AStoker commented 6 months ago

I'll confess, I'm still a linux peon when it comes to alsa and hardware (part of this project has been an excuse to learn some more). I'm hearing you say that I could potentially skip the whole asound configuration and tell shairport to directly use the output_device that matches my device name ("hw:sndrpihifiberry")?

mikebrady commented 6 months ago

I'm hearing you say that I could potentially skip the whole asound configuration and tell shairport to directly use the output_device that matches my device name ("hw:sndrpihifiberry")?

Exactly. That device doesn’t have a mixer, but that’s okay — Shairport Sync will use its own built-in volume control. But leave that helper disabled, at least for the time being, until Shairport Sync is working properly.

AStoker commented 6 months ago

Alright, got rid of the asound config and disabled the helper, and made the output device the speaker bonnet (hifiberry). Sound works, but now theres a popping whenever the speaker starts or stops (that's what the helper was supposed to help with). Also, the volume control from AirPlay still doesn't change the volume of the pi (looking at alsamixer the volume doesn't change). Also, I tried re-enabling the helper, and that resulted in no audio playing at all (likely because it's "busy" with the helper).

mikebrady commented 6 months ago

Good work.

  1. Regarding the popping, Shairport Sync has a built-in feature for this. In the alsa stanza of the configuration file, set the disable_standby_mode setting to "auto" (remember to uncomment the line) and restart. With this setting, Shairport Sync will prevent the DAC from going into standby mode (and thus from popping) between tracks (for intervals of up to 10 seconds by default) while music is being played by Shairport Sync.

  2. Regarding the volume control. First, perhaps you could post the output the result of:

    $ shairport-sync --display-config

    in case I'm missing something. More generally, the output device "hw:1" may not have a volume control at all (I use similar devices and they don't have built-in mixers -- see the screenshot below). So, is it possible that alsamixer is showing you the mixer from another output device, such as "hw:0"?

    Here is a screenshot:

    image
AStoker commented 6 months ago

Regarding the config, this is what I have:


shairport-sync --displayConfig
>> Display Config Start.

From "uname -a":
 Linux airplaypi 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 Zero 2 W Rev 1.0

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

Command Line:
 shairport-sync --displayConfig

Configuration File:
 /etc/shairport-sync.conf

Configuration File Settings:
 general : 
 {
   name = "AirPlay Pi";
 };
 alsa : 
 {
   output_device = "hw:sndrpihifiberry";
   disable_standby_mode = "always";
 };
 pw : 
 {
 };

>> Display Config End.
>> Goodbye!
pi@airplaypi:~ $ 

I changed the standby mode to always, as the popping was a bit frustratingly loud when starting or stopping (when using auto). However, it seems that when using "always" I don't get any audio at all. Not sure if that should be a separate issue?

And perhaps I don't understand fully enough, but maybe I'm starting to grasp it. I don't have a hw:1 device, just a hw:0, which is the little speaker bonnet/hifiberry dac. So, if that dac doesn't have a volume control, then the alsamixer wouldn't have anything to really do at that point, correct?

GitHub is being difficult with image uploads right now, but in short my alsamixer output window looks like yours except I have a volume control, and perhaps most importantly, the "item" says PCM. Perhaps this is due to my original asound config making a volume control where in my case I didn't actually need one. Does that make sense?

AStoker commented 6 months ago
HEIF Image
AStoker commented 6 months ago

Here are the stats when I try to use always by the way.


pi@airplaypi:~ $ shairport-sync -v --statistics
         0.002847396 "shairport.c:2252" Startup in AirPlay 2 mode, with features 0x405fca00,0x1c340 on device "d8:3a:dd:eb:17:89".
         0.000257187 "shairport.c:2291" Version String: "4.3.2-2-g165431a8-AirPlay2-smi10-alac-OpenSSL-Avahi-ALSA-soxr-metadata-sysconfdir:/etc"
         0.000048802 "shairport.c:2310" Command Line: "shairport-sync -v --statistics".
         0.000649531 "shairport.c:2346" Log Verbosity is 1.
         0.000113073 "audio_alsa.c:1021" alsa: alsa_maximum_stall_time of 0.200000 sec.
         0.000102240 "audio_alsa.c:1310" alsa: disable_standby_mode is "always".
         0.000038698 "audio_alsa.c:1314" alsa: disable_standby_mode_silence_threshold is 0.040000 seconds.
         0.000040156 "audio_alsa.c:1316" alsa: disable_standby_mode_silence_scan_interval is 0.004000 seconds.
         0.000049063 "audio_alsa.c:1356" alsa: output device name is "hw:sndrpihifiberry".
         0.000460000 "shairport.c:2394" disable_resend_requests is off.
         0.000081458 "shairport.c:2395" diagnostic_drop_packet_fraction is 0.000000. A value of 0.0 means no packets will be dropped deliberately.
         0.000056302 "shairport.c:2399" statistics_requester status is 1.
         0.000039010 "shairport.c:2404" rtsp listening port is 7000.
         0.000033855 "shairport.c:2405" udp base port is 6001.
         0.000037291 "shairport.c:2406" udp port range is 10.
         0.000039740 "shairport.c:2407" player name is "AirPlay Pi".
         0.000033750 "shairport.c:2408" backend is "alsa".
         0.000033489 "shairport.c:2409" run_this_before_play_begins action is "(null)".
         0.000033542 "shairport.c:2410" run_this_after_play_ends action is "(null)".
         0.000033073 "shairport.c:2411" wait-cmd status is 0.
         0.000047813 "shairport.c:2412" run_this_before_play_begins may return output is 0.
         0.000037864 "shairport.c:2413" run_this_if_an_unfixable_error_is_detected action is "(null)".
         0.000034479 "shairport.c:2415" run_this_before_entering_active_state action is  "(null)".
         0.000034167 "shairport.c:2417" run_this_after_exiting_active_state action is  "(null)".
         0.000033698 "shairport.c:2419" active_state_timeout is  10.000000 seconds.
         0.000043802 "shairport.c:2420" mdns backend "(null)".
         0.000036927 "shairport.c:2422" interpolation setting is "auto".
         0.000037292 "shairport.c:2426" interpolation soxr_delay_threshold is 30000000.
         0.000036927 "shairport.c:2427" resync time is 0.050000 seconds.
         0.000038333 "shairport.c:2428" resync recovery time is 0.100000 seconds.
         0.000038802 "shairport.c:2429" allow a session to be interrupted: 0.
         0.000036667 "shairport.c:2430" busy timeout time is 0.
         0.000036302 "shairport.c:2431" drift tolerance is 0.002000 seconds.
         0.000038385 "shairport.c:2432" password is "(null)".
         0.000036146 "shairport.c:2433" default airplay volume is: -24.000000.
         0.000039531 "shairport.c:2434" high threshold airplay volume is: -16.000000.
         0.000039271 "shairport.c:2436" check for higher-than-threshold volume for new play session is disabled.
         0.000037604 "shairport.c:2442" ignore_volume_control is 0.
         0.000036667 "shairport.c:2446" volume_max_db is not set
         0.000036250 "shairport.c:2447" volume range in dB (zero means use the range specified by the mixer): 0.
         0.000038229 "shairport.c:2449" volume_range_combined_hardware_priority (1 means hardware mixer attenuation is used first) is 0.
         0.000038334 "shairport.c:2453" playback_mode is 0 (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_right).
         0.000037760 "shairport.c:2455" disable_synchronization is 0.
         0.000036510 "shairport.c:2456" use_mmap_if_available is 1.
         0.000036563 "shairport.c:2457" output_format automatic selection is enabled.
         0.000036875 "shairport.c:2461" output_rate automatic selection is enabled.
         0.000036927 "shairport.c:2465" audio backend desired buffer length is 0.200000 seconds.
         0.000038594 "shairport.c:2467" audio_backend_buffer_interpolation_threshold_in_seconds is 0.120000 seconds.
         0.000038958 "shairport.c:2469" audio backend latency offset is 0.000000 seconds.
         0.000038594 "shairport.c:2471" audio backend silence lead-in time is "auto".
         0.000036614 "shairport.c:2475" zeroconf regtype is "_raop._tcp".
         0.000036459 "shairport.c:2476" decoders_supported field is 3.
         0.000036458 "shairport.c:2477" use_apple_decoder is 1.
         0.000036094 "shairport.c:2478" alsa_use_hardware_mute is 0.
         0.000036667 "shairport.c:2482" no special mdns service interface was requested.
         0.000066614 "shairport.c:2485" configuration file name "/etc/shairport-sync.conf" resolves to "/etc/shairport-sync.conf".
         0.000043646 "shairport.c:2492" metadata enabled is 1.
         0.000037500 "shairport.c:2493" metadata pipename is "/tmp/shairport-sync-metadata".
         0.000037187 "shairport.c:2494" metadata socket address is "(null)" port 0.
         0.000037396 "shairport.c:2496" metadata socket packet size is "500".
         0.000036563 "shairport.c:2497" get-coverart is 1.
         0.000036302 "shairport.c:2515" loudness is 0.
         0.000036094 "shairport.c:2516" loudness reference level is -20.000000
         0.000591406 "rtsp.c:4193" metadata pipe name is "/tmp/shairport-sync-metadata".
         0.001646979 "shairport.c:2643" NQPTP is online.
         1.499310989 "shairport.c:255" "soxr" interpolation has been chosen.
        22.507256658 "rtsp.c:2902" Connection 1: AP2 PTP connection from 192.168.0.102:55038 ("Andrew’s iPhone") to self at 192.168.3.227:7000.
        23.276620616 "rtsp.c:3258" Connection 1: SETUP AP2 no Active-Remote information  the SETUP Record.
         0.000145729 "rtsp.c:3277" Connection 1: SETUP AP2 doesn't include DACP-ID string information.
         0.793327240 "player.c:2835" Connection 1: Playback started at frame 459505873 -- AirPlay 2 Buffered.
         7.935023226 "player.c:2654" Sync Error ms | Net Sync PPM | All Sync PPM | Min DAC Queue | Min Buffers | Min Buffer Size | Output FPS (r) | Output FPS (c)
         0.000272500 "player.c:2654"         -0.27            0.0            0.0            7384            46              161k              N/A              N/A
         8.001116038 "player.c:2654"         -0.33            0.0            0.0            7392            46             2501k         44099.94         44100.23
mikebrady commented 6 months ago

Thanks for the updates.

First, the mixer issue looks as if your output device's volume control/mixer -- "PCM" -- is not a decibel-denominated control. Here is a screenshot of a Raspberry Pi 2's built-in DAC, which does have a decibel-denominated mixer:

image

You can see that the fourth line down on the left give the attenuation ("gain" here) in decibels (dB). This is absent from yours, and indicates that your device's mixer doesn't have a dB-denominated mixer. Unfortunately, that means that Shairport Sync can't use it. (Human hearing is approximately logarithmic in sensitivity -- an increase of 10 dB is roughly perceived as twice as loud. Most mixers/attenuators have a logarithmic scale.)

Second, just to get a bit more clarity on the problem: if you set the disable_standby to "always" and run Shairport Sync from the command line, as shown above, am I correct in understanding that one hears a pop as Shairport Sync starts and no more pops thereafter, and that you can hear music? But then when you start Shairport Sync automatically at boot time, you get no sound? Does any other program use the sound system at startup?

A debugging idea is to set the log_verbosity to 1 in the configuration file and reboot. When Shairport Sync is started automatically after booting, diagnostic messages from it (such as you logged above) will appear in the system log which you can read using something like $ sudo journalctl | grep shair. There might be some relevant message there, e.g. that the speaker is not available.

AStoker commented 6 months ago

Thanks for clarifying, that makes sense.

And to clarify the other volume issue, if I set disable_standby_mode to always, then it doesn't matter how shairport starts (automatically or manually), there isn't any audio that comes out. And just to add some more details, there isn't any popping sound at all when playing or stopping. If I set the value to auto, then I get a popping when I start to play music, or when the music stops playing for about 10ish seconds (can't remember exactly how long). The loud popping is a bit of a downer.

Here's what I get in the logs when the standby mode is set to 'always'. Nothing seems to stand out about not finding a speaker. At least nothing to me.

Mar 07 09:01:24 airplaypi sudo[2145]:       pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/nano /etc/shairport-sync.conf
Mar 07 09:03:30 airplaypi systemd[1]: shairport-sync.service: Succeeded.
Mar 07 09:03:30 airplaypi systemd[1]: shairport-sync.service: Consumed 8min 14.921s CPU time.
Mar 07 09:03:57 airplaypi sudo[590]:       pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/nano /etc/shairport-sync.conf
Mar 07 09:05:16 airplaypi sudo[594]:       pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/systemctl stop shairport-sync
Mar 07 09:05:17 airplaypi systemd[1]: shairport-sync.service: Succeeded.
Mar 07 09:05:17 airplaypi systemd[1]: shairport-sync.service: Consumed 5.542s CPU time.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.102501823 "shairport.c:2252" Startup in AirPlay 2 mode, with features 0x405fca00,0x1c340 on device "d8:3a:dd:eb:17:89".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000451614 "shairport.c:2291" Version String: "4.3.2-2-g165431a8-AirPlay2-smi10-alac-OpenSSL-Avahi-ALSA-soxr-metadata-sysconfdir:/etc"
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000075938 "shairport.c:2310" Command Line: "/usr/local/bin/shairport-sync --log-to-syslog".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000618125 "shairport.c:2346" Log Verbosity is 1.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000066510 "audio_alsa.c:1021" alsa: alsa_maximum_stall_time of 0.200000 sec.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000097552 "audio_alsa.c:1310" alsa: disable_standby_mode is "always".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000050521 "audio_alsa.c:1314" alsa: disable_standby_mode_silence_threshold is 0.040000 seconds.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000036302 "audio_alsa.c:1316" alsa: disable_standby_mode_silence_scan_interval is 0.004000 seconds.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000063438 "audio_alsa.c:1356" alsa: output device name is "hw:sndrpihifiberry".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000478542 "shairport.c:2394" disable_resend_requests is off.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000076979 "shairport.c:2395" diagnostic_drop_packet_fraction is 0.000000. A value of 0.0 means no packets will be dropped deliberately.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000039010 "shairport.c:2399" statistics_requester status is 0.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000046563 "shairport.c:2404" rtsp listening port is 7000.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000040833 "shairport.c:2405" udp base port is 6001.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000037083 "shairport.c:2406" udp port range is 10.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000034688 "shairport.c:2407" player name is "AirPlay Pi".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033906 "shairport.c:2408" backend is "alsa".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000036667 "shairport.c:2409" run_this_before_play_begins action is "(null)".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000049583 "shairport.c:2410" run_this_after_play_ends action is "(null)".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000040729 "shairport.c:2411" wait-cmd status is 0.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000035156 "shairport.c:2412" run_this_before_play_begins may return output is 0.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033542 "shairport.c:2413" run_this_if_an_unfixable_error_is_detected action is "(null)".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033958 "shairport.c:2415" run_this_before_entering_active_state action is  "(null)".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000035730 "shairport.c:2417" run_this_after_exiting_active_state action is  "(null)".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033906 "shairport.c:2419" active_state_timeout is  10.000000 seconds.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000039635 "shairport.c:2420" mdns backend "(null)".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000034427 "shairport.c:2422" interpolation setting is "auto".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000034688 "shairport.c:2426" interpolation soxr_delay_threshold is 30000000.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000034323 "shairport.c:2427" resync time is 0.050000 seconds.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000034635 "shairport.c:2428" resync recovery time is 0.100000 seconds.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000035209 "shairport.c:2429" allow a session to be interrupted: 0.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033281 "shairport.c:2430" busy timeout time is 0.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000032969 "shairport.c:2431" drift tolerance is 0.002000 seconds.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000036302 "shairport.c:2432" password is "(null)".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000050312 "shairport.c:2433" default airplay volume is: -24.000000.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000045156 "shairport.c:2434" high threshold airplay volume is: -16.000000.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000038073 "shairport.c:2436" check for higher-than-threshold volume for new play session is disabled.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033125 "shairport.c:2442" ignore_volume_control is 0.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033698 "shairport.c:2446" volume_max_db is not set
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033334 "shairport.c:2447" volume range in dB (zero means use the range specified by the mixer): 0.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000034479 "shairport.c:2449" volume_range_combined_hardware_priority (1 means hardware mixer attenuation is used first) is 0.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033802 "shairport.c:2453" playback_mode is 0 (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_right).
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033698 "shairport.c:2455" disable_synchronization is 0.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033125 "shairport.c:2456" use_mmap_if_available is 1.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033437 "shairport.c:2457" output_format automatic selection is enabled.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033073 "shairport.c:2461" output_rate automatic selection is enabled.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033333 "shairport.c:2465" audio backend desired buffer length is 0.200000 seconds.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000034792 "shairport.c:2467" audio_backend_buffer_interpolation_threshold_in_seconds is 0.120000 seconds.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000034636 "shairport.c:2469" audio backend latency offset is 0.000000 seconds.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000034843 "shairport.c:2471" audio backend silence lead-in time is "auto".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000043750 "shairport.c:2475" zeroconf regtype is "_raop._tcp".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000039792 "shairport.c:2476" decoders_supported field is 3.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000034010 "shairport.c:2477" use_apple_decoder is 1.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033594 "shairport.c:2478" alsa_use_hardware_mute is 0.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000034531 "shairport.c:2482" no special mdns service interface was requested.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000064896 "shairport.c:2485" configuration file name "/etc/shairport-sync.conf" resolves to "/etc/shairport-sync.conf".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000039063 "shairport.c:2492" metadata enabled is 1.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000034948 "shairport.c:2493" metadata pipename is "/tmp/shairport-sync-metadata".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000034114 "shairport.c:2494" metadata socket address is "(null)" port 0.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033490 "shairport.c:2496" metadata socket packet size is "500".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033385 "shairport.c:2497" get-coverart is 1.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000033229 "shairport.c:2515" loudness is 0.
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000110209 "shairport.c:2516" loudness reference level is -20.000000
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.000715625 "rtsp.c:4193" metadata pipe name is "/tmp/shairport-sync-metadata".
Mar 07 09:06:53 airplaypi shairport-sync[542]:          0.002765989 "shairport.c:2643" NQPTP is online.
Mar 07 09:06:55 airplaypi shairport-sync[542]:          1.505805468 "shairport.c:255" "soxr" interpolation has been chosen.
Mar 07 09:14:16 airplaypi shairport-sync[542]:        426.338702025 "rtsp.c:2902" Connection 1: AP2 PTP connection from 192.168.0.102:56543 ("Andrew’s iPhone") to self at 192.168.3.227:7000.
Mar 07 09:14:21 airplaypi shairport-sync[542]:          5.183353019 "rtsp.c:3258" Connection 1: SETUP AP2 no Active-Remote information  the SETUP Record.
Mar 07 09:14:21 airplaypi shairport-sync[542]:          0.000152396 "rtsp.c:3277" Connection 1: SETUP AP2 doesn't include DACP-ID string information.
Mar 07 09:14:27 airplaypi shairport-sync[542]:          5.943810310 "rtsp.c:2902" Connection 3: AP2 PTP connection from 192.168.0.102:56547 ("Andrew’s iPhone") to self at 192.168.3.227:7000.
Mar 07 09:14:27 airplaypi shairport-sync[542]:          0.248651094 "rtsp.c:3258" Connection 3: SETUP AP2 no Active-Remote information  the SETUP Record.
Mar 07 09:14:27 airplaypi shairport-sync[542]:          0.000102031 "rtsp.c:3277" Connection 3: SETUP AP2 doesn't include DACP-ID string information.
mikebrady commented 6 months ago

Thanks again. You're right -- there is nothing obvious. The lack of audio on "always" is a puzzle. So, perhaps you could try two more things, please.

  1. Could you set the log_verbosity to 2 -- it's a bit more verbose, but temporarily it should be tolerable, and it might be useful.
  2. Set the "statistics" to "yes" and then restart and play some music for a while -- a minute or two. If the audio is getting through properly, you'll see some statistics information.

Finally, is it possible that the PCM volume is somehow set to zero on boot-up, or could it be muted?

AStoker commented 6 months ago

Let me start by saying.... I'm not crazy 🤪 PCM wasn't muted, checked all that. Had already rebooted like 15 times over the process of debugging this. Just set the verbosity and statistics as you were requesting, and started playing some music to get the logs... Expecting to hear silence, I instead hear the dulcet tones of Willie Nelson. Go figure. No idea why it suddenly started to work. Zilch. Put the verbosity and statistics back to their defaults and rebooted again to make sure it was still working. And again... still working 🤷 Anyway, I appreciate your help with this, I've learned a lot. Thanks for this awesome project, and the thankless (for the most part I'm sure) work you do on it! Closing the issue for now.

mikebrady commented 6 months ago

Super -- it's nice to get a good result.