mikebrady / shairport-sync

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

No audio output after resuming playback #1580

Closed noelhibbard closed 1 year ago

noelhibbard commented 2 years ago

What happened?

On the past few builds I am no longer able to use the transport controls without breaking audio output. For example, I connect to shairport-sync and then start playback and I hear output. If I then pause and unpause, the timer will keep going but I no longer hear any output. The same thing happens if I switch tracks or seak within a track. If I disconnect and reconnect, playback will work again until I use any of the transport controls.

This is only happening in buffered mode (I'm testing with the Apple Podcast app). Realtime apps like Spotify don't exhibit this behavior.

I am running the PA backend and looked at the commit log to see when audio_pa.c was last changed and then compiled the parent of that commit (b178e0e0a5dc631e267920cd84e909b3f14a4285) and the problem goes away.

Relevant log output

         0.011876601 "shairport.c:2196" Startup in AirPlay 2 mode, with features 0x405fca00,0x1c340 on device "02:42:0a:12:0b:05".
         0.003502753 "shairport.c:2235" Version String: "4.1-4-g99e76fdf-dirty-AirPlay2-alac-OpenSSL-Avahi-ALSA-pa-dummy-stdout-pipe-soxr-convolution-metadata-mqtt-dbus-mpris-sysconfdir:/etc"
         0.000021617 "shairport.c:2254" Command Line: "/usr/local/bin/shairport-sync".
         0.000033172 "shairport.c:2261" libsodium initialised.
         0.000141198 "shairport.c:2286" libgcrypt initialised.
         0.000006908 "shairport.c:2290" Log Verbosity is 1.
         0.008977414 "shairport.c:2338" disable_resend_requests is off.
         0.000016864 "shairport.c:2339" diagnostic_drop_packet_fraction is 0.000000. A value of 0.0 means no packets will be dropped deliberately.
         0.000014826 "shairport.c:2343" statistics_requester status is 0.
         0.000004943 "shairport.c:2348" rtsp listening port is 7000.
         0.000004578 "shairport.c:2349" udp base port is 6001.
         0.000004313 "shairport.c:2350" udp port range is 10.
         0.000004205 "shairport.c:2351" player name is "Kitchen".
         0.000004176 "shairport.c:2352" backend is "pa".
         0.000004305 "shairport.c:2353" run_this_before_play_begins action is "(null)".
         0.000006102 "shairport.c:2354" run_this_after_play_ends action is "(null)".
         0.000005780 "shairport.c:2355" wait-cmd status is 0.
         0.000004166 "shairport.c:2356" run_this_before_play_begins may return output is 0.
         0.000005854 "shairport.c:2357" run_this_if_an_unfixable_error_is_detected action is "(null)".
         0.000005891 "shairport.c:2359" run_this_before_entering_active_state action is  "(null)".
         0.000005802 "shairport.c:2361" run_this_after_exiting_active_state action is  "(null)".
         0.000005793 "shairport.c:2363" active_state_timeout is  10.000000 seconds.
         0.000006003 "shairport.c:2364" mdns backend "(null)".
         0.000004103 "shairport.c:2366" interpolation setting is "soxr".
         0.000004162 "shairport.c:2370" interpolation soxr_delay_threshold is 30000000.
         0.000005829 "shairport.c:2371" resync time is 0.050000 seconds.
         0.000004395 "shairport.c:2372" allow a session to be interrupted: 0.
         0.000004088 "shairport.c:2373" busy timeout time is 0.
         0.000004039 "shairport.c:2374" drift tolerance is 0.001995 seconds.
         0.000004480 "shairport.c:2375" password is "(null)".
         0.000004024 "shairport.c:2376" ignore_volume_control is 0.
         0.000004111 "shairport.c:2380" volume_max_db is not set
         0.000003876 "shairport.c:2381" volume range in dB (zero means use the range specified by the mixer): 0.
         0.000005987 "shairport.c:2383" volume_range_combined_hardware_priority (1 means hardware mixer attenuation is used first) is 0.
         0.000006167 "shairport.c:2387" playback_mode is 0 (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_right).
         0.000006019 "shairport.c:2389" disable_synchronization is 0.
         0.000004041 "shairport.c:2390" use_mmap_if_available is 1.
         0.000003997 "shairport.c:2391" output_format automatic selection is enabled.
         0.000005932 "shairport.c:2395" output_rate automatic selection is enabled.
         0.000005750 "shairport.c:2399" audio backend desired buffer length is 0.350000 seconds.
         0.000005983 "shairport.c:2401" audio_backend_buffer_interpolation_threshold_in_seconds is 0.020000 seconds.
         0.000006198 "shairport.c:2403" audio backend latency offset is 0.000000 seconds.
         0.000005905 "shairport.c:2405" audio backend silence lead-in time is "auto".
         0.000005597 "shairport.c:2409" zeroconf regtype is "_raop._tcp".
         0.000004139 "shairport.c:2410" decoders_supported field is 3.
         0.000004081 "shairport.c:2411" use_apple_decoder is 0.
         0.000003933 "shairport.c:2412" alsa_use_hardware_mute is 0.
         0.000003933 "shairport.c:2416" no special mdns service interface was requested.
         0.000026780 "shairport.c:2419" configuration file name "/etc/shairport-sync.conf" resolves to "/etc/shairport-sync.conf".
         0.000007754 "shairport.c:2426" metadata enabled is 1.
         0.000004158 "shairport.c:2427" metadata pipename is "/tmp/shairport-sync-metadata".
         0.000005854 "shairport.c:2428" metadata socket address is "(null)" port 0.
         0.000005920 "shairport.c:2430" metadata socket packet size is "500".
         0.000004158 "shairport.c:2431" get-coverart is 1.
         0.000003924 "shairport.c:2434" mqtt is enabled.
         0.000003919 "shairport.c:2435" mqtt hostname is localhost, port is 1883.
         0.000005953 "shairport.c:2436" mqtt topic is shairport-sync/Kitchen.
         0.000004119 "shairport.c:2437" mqtt will publish raw metadata.
         0.000004086 "shairport.c:2438" mqtt will publish parsed metadata.
         0.000007807 "shairport.c:2439" mqtt will publish cover Art.
         0.000004273 "shairport.c:2440" mqtt remote control is enabled.
         0.000004171 "shairport.c:2444" convolution is 0.
         0.000003938 "shairport.c:2445" convolution IR file is "(null)"
         0.000004065 "shairport.c:2446" convolution max length 8192
         0.000003967 "shairport.c:2447" convolution gain is 0.000000
         0.000004047 "shairport.c:2449" loudness is 0.
         0.000003882 "shairport.c:2450" loudness reference level is -20.000000
         0.000074681 "rtsp.c:4123" metadata pipe name is "/tmp/shairport-sync-metadata".
         0.000568483 "mqtt.c:230" Initialising MQTT
         0.003346615 "dbus-service.c:552" >> setting loudness threshold to -20.000000.
         0.000031043 "dbus-service.c:565" >> setting drift tolerance to 0.001995 seconds.
         0.000019737 "dbus-service.c:938" >> ALACDecoder set to "hammerton"
         0.000011879 "dbus-service.c:950" >> Active set to "false"
         0.000009760 "dbus-service.c:955" >> disable standby mode set to "off"
         0.000009418 "dbus-service.c:979" >> interpolation set to "soxr"
         0.000010969 "dbus-service.c:460" >> deactivating disable standby
         0.000008183 "dbus-service.c:542" >> deactivating loudness
         0.000007939 "dbus-service.c:476" >> deactivating convolution
         0.000020192 "dbus-service.c:445" >> log verbosity set to 1.
         0.000008966 "dbus-service.c:430" >> stop logging statistics
         0.000008098 "dbus-service.c:390" >> stop including elapsed time in logs
         0.000009122 "dbus-service.c:400" >> start including delta time in logs
         0.000008351 "dbus-service.c:413" >> start including file and line in logs
         0.000020140 "dbus-service.c:1087" Shairport Sync native D-Bus service started at "org.gnome.ShairportSync" on the system bus.
         0.000207387 "mpris-service.c:342" MPRIS service started at "org.mpris.MediaPlayer2.ShairportSync" on the system bus.
         0.027757865 "shairport.c:2534" NQPTP is online.
     52142.244289114 "rtsp.c:2877" Connection 1: AP2 PTP connection from 10.18.2.117:64454 ("Noel's iPhone") to self at 10.18.11.5:7000.
         0.030333790 "rtsp.c:4318" Connection 1: Current volume (-24.000000) requested
         2.454929142 "rtsp.c:3284" Connection 1. AP2 Buffered Audio Stream.
        10.074086914 "player.c:1198" Gone past starting time for 3993934182 by 5247170 nanoseconds.
         0.000192683 "player.c:2631" Delay error -5 when checking running latency.
         0.000036674 "player.c:2631" Delay error -5 when checking running latency.
         0.000019356 "player.c:2631" Delay error -5 when checking running latency.
         0.000018326 "player.c:2631" Delay error -5 when checking running latency.
         0.000017703 "player.c:2631" Delay error -5 when checking running latency.
-- these lines repeat until I finally disconnect
         2.926345969 "rtsp.c:1346" Connection 1: Closed by client: from 10.18.2.117:64454 to self at 10.18.11.5:7000.

Configuration Information.

// Sample Configuration File for Shairport Sync
// Commented out settings are generally the defaults, except where noted.
// Some sections are operative only if Shairport Sync has been built with the right configuration flags.
// See the individual sections for details.

// General Settings
general =
{
    name = "Kitchen"; // This means "Hostname" -- see below. This is the name the service will advertise to iTunes.
//      The default is "Hostname" -- i.e. the machine's hostname with the first letter capitalised (ASCII only.)
//      You can use the following substitutions:
//              %h for the hostname,
//              %H for the Hostname (i.e. with first letter capitalised (ASCII only)),
//              %v for the version number, e.g. 3.0 and
//              %V for the full version string, e.g. 3.3-OpenSSL-Avahi-ALSA-soxr-metadata-sysconfdir:/etc
//      Overall length can not exceed 50 characters. Example: "Shairport Sync %v on %H".
//  password = "secret"; // leave this commented out if you don't want to require a password
    interpolation = "soxr"; // aka "stuffing". Default is "auto". Alternatives are "basic" or "soxr". Choose "soxr" only if you have a reasonably fast processor and Shairport Sync has been built with "soxr" support.
    output_backend = "pa"; // Run "shairport-sync -h" to get a list of all output_backends, e.g. "alsa", "pipe", "stdout". The default is the first one.
//  mdns_backend = "avahi"; // Run "shairport-sync -h" to get a list of all mdns_backends. The default is the first one.
//  interface = "name"; // Use this advanced setting to specify the interface on which Shairport Sync should provide its service. Leave it commented out to get the default, which is to select the interface(s) automatically.
//  port = 5000; // Listen for service requests on this port
//  udp_port_base = 6001; // start allocating UDP ports from this port number when needed
//  udp_port_range = 10; // look for free ports in this number of places, starting at the UDP port base. Allow at least 10, though only three are needed in a steady state.
//  regtype = "_raop._tcp"; // Use this advanced setting to set the service type and transport to be advertised by Zeroconf/Bonjour. Default is "_raop._tcp".

//  drift_tolerance_in_seconds = 0.002; // allow a timing error of this number of seconds of drift away from exact synchronisation before attempting to correct it
//  resync_threshold_in_seconds = 0.050; // a synchronisation error greater than this number of seconds will cause resynchronisation; 0 disables it

//  playback_mode = "stereo"; // This can be "stereo", "mono", "reverse stereo", "both left" or "both right". Default is "stereo".
    alac_decoder = "hammerton"; // This can be "hammerton" or "apple". This advanced setting allows you to choose
//      the original Shairport decoder by David Hammerton or the Apple Lossless Audio Codec (ALAC) decoder written by Apple.
//      If you build Shairport Sync with the flag --with-apple-alac, the Apple ALAC decoder will be chosen by default.

    ignore_volume_control = "no"; // set this to "yes" if you want the volume to be at 100% no matter what the source's volume control is set to.
//  volume_range_db = 60 ; // use this advanced setting to set the range, in dB, you want between the maximum volume and the minimum volume. Range is 30 to 150 dB. Leave it commented out to use mixer's native range.
//  volume_max_db = 0.0 ; // use this advanced setting, which must have a decimal point in it, to set the maximum volume, in dB, you wish to use.
//      The setting is for the hardware mixer, if chosen, or the software mixer otherwise. The value must be in the mixer's range (0.0 to -96.2 for the software mixer).
//      Leave it commented out to use mixer's maximum volume.
//  volume_control_profile = "standard" ; // use this advanced setting to specify how the airplay volume is transferred to the mixer volume.
//      "standard" makes the volume change more quickly at lower volumes and slower at higher volumes.
//      "flat" makes the volume change at the same rate at all volumes.
//  volume_control_combined_hardware_priority = "no"; // when extending the volume range by combining the built-in software attenuator with the hardware mixer attenuator, set this to "yes" to reduce volume by using the hardware mixer first, then the built-in software attenuator.
//  run_this_when_volume_is_set = "/opt/shairport-sync/alsa-volset.sh USBSound2 Speaker "; //   Run the specified application whenever the volume control is set or changed.
//      The desired AirPlay volume is appended to the end of the command line – leave a space if you want it treated as an extra argument.
//      AirPlay volume goes from 0 to -30 and -144 means "mute".

//  audio_backend_latency_offset_in_seconds = 0.0; // This is added to the latency requested by the player to delay or advance the output by a fixed amount.
//      Use it, for example, to compensate for a fixed delay in the audio back end.
//      E.g. if the output device, e.g. a soundbar, takes 100 ms to process audio, set this to -0.1 to deliver the audio
//      to the output device 100 ms early, allowing it time to process the audio and output it perfectly in sync.
//  audio_backend_buffer_desired_length_in_seconds = 0.2; // If set too small, buffer underflow occurs on low-powered machines.
//      Too long and the response time to volume changes becomes annoying.
//      Default is 0.2 seconds in the alsa backend, 0.35 seconds in the pa backend and 1.0 seconds otherwise.
//  audio_backend_buffer_interpolation_threshold_in_seconds = 0.075; // Advanced feature. If the buffer size drops below this, stop using time-consuming interpolation like soxr to avoid dropouts due to underrun.
//  audio_backend_silent_lead_in_time = "auto"; // This optional advanced setting, either "auto" or a positive number, sets the length of the period of silence that precedes the start of the audio.
//      The default is "auto" -- the silent lead-in starts as soon as the player starts sending packets.
//      Values greater than the latency are ignored. Values that are too low will affect initial synchronisation.

//  dbus_service_bus = "system"; // The Shairport Sync dbus interface, if selected at compilation, will appear
//      as "org.gnome.ShairportSync" on the whichever bus you specify here: "system" (default) or "session".
//  mpris_service_bus = "system"; // The Shairport Sync mpris interface, if selected at compilation, will appear
//      as "org.gnome.ShairportSync" on the whichever bus you specify here: "system" (default) or "session".

//  resend_control_first_check_time = 0.10; // Use this optional advanced setting to set the wait time in seconds before deciding a packet is missing.
//  resend_control_check_interval_time = 0.25; //  Use this optional advanced setting to set the time in seconds between requests for a missing packet.
//  resend_control_last_check_time = 0.10; // Use this optional advanced setting to set the latest time, in seconds, by which the last check should be done before the estimated time of a missing packet's transfer to the output buffer.
//  missing_port_dacp_scan_interval_seconds = 2.0; // Use this optional advanced setting to set the time interval between scans for a DACP port number if no port number has been provided by the player for remote control commands
};

// Advanced parameters for controlling how Shairport Sync stays active and how it runs a session
sessioncontrol =
{
//  "active" state starts when play begins and ends when the active_state_timeout has elapsed after play ends, unless another play session starts before the timeout has fully elapsed.
//  run_this_before_entering_active_state = "/full/path/to/application and args"; // make sure the application has executable permission. If it's a script, include the shebang (#!/bin/...) on the first line
//  run_this_after_exiting_active_state = "/full/path/to/application and args"; // make sure the application has executable permission. If it's a script, include the shebang (#!/bin/...) on the first line
//  active_state_timeout = 10.0; // wait for this number of seconds after play ends before leaving the active state, unless another play session begins.

//  run_this_before_play_begins = "/full/path/to/application and args"; // make sure the application has executable permission. If it's a script, include the shebang (#!/bin/...) on the first line
//  run_this_after_play_ends = "/full/path/to/application and args"; // make sure the application has executable permission. If it's a script, include the shebang (#!/bin/...) on the first line

//  run_this_if_an_unfixable_error_is_detected = "/full/path/to/application and args"; // if a problem occurs that can't be cleared by Shairport Sync itself, hook a program on here to deal with it. An error code-string is passed as the last argument.
//    Many of these "unfixable" problems are caused by malfunctioning output devices, and sometimes it is necessary to restart the whole device to clear the problem.
//    You could hook on a program to do this automatically, but beware -- the device may then power off and restart without warning!
//  wait_for_completion = "no"; // set to "yes" to get Shairport Sync to wait until the "run_this..." applications have terminated before continuing

//  allow_session_interruption = "no"; // set to "yes" to allow another device to interrupt Shairport Sync while it's playing from an existing audio source
//  session_timeout = 120; // wait for this number of seconds after a source disappears before terminating the session and becoming available again.
};

// Back End Settings

// These are parameters for the "alsa" audio back end.
// For this section to be operative, Shairport Sync must be built with the following configuration flag:
// --with-alsa
alsa =
{
//  output_device = "default"; // the name of the alsa output device. Use "shairport-sync -h" to discover the names of ALSA hardware devices. Use "alsamixer" or "aplay" to find out the names of devices, mixers, etc.
//  mixer_control_name = "PCM"; // the name of the mixer to use to adjust output volume. If not specified, volume in adjusted in software.
//  mixer_device = "default"; // the mixer_device default is whatever the output_device is. Normally you wouldn't have to use this.

//  output_rate = "auto"; // can be "auto", 44100, 88200, 176400 or 352800, but the device must have the capability.
//  output_format = "auto"; // can be "auto", "U8", "S8", "S16", "S16_LE", "S16_BE", "S24", "S24_LE", "S24_BE", "S24_3LE", "S24_3BE", "S32", "S32_LE" or "S32_BE" but the device must have the capability. Except where stated using (*LE or *BE), endianness matches that of the processor.

//  disable_synchronization = "no"; // Set to "yes" to disable synchronization. Default is "no" This is really meant for troubleshootingG.

//  period_size = <number>; // Use this optional advanced setting to set the alsa period size near to this value
//  buffer_size = <number>; // Use this optional advanced setting to set the alsa buffer size near to this value
//  use_mmap_if_available = "yes"; // Use this optional advanced setting to control whether MMAP-based output is used to communicate  with the DAC. Default is "yes"
//  use_hardware_mute_if_available = "no"; // Use this optional advanced setting to control whether the hardware in the DAC is used for muting. Default is "no", for compatibility with other audio players.
//  maximum_stall_time = 0.200; // Use this optional advanced setting to control how long to wait for data to be consumed by the output device before considering it an error. It should never approach 200 ms.
//  use_precision_timing = "auto"; // Use this optional advanced setting to control how Shairport Sync gathers timing information. When set to "auto", if the output device is a real hardware device, precision timing will be used. Choose "no" for more compatible standard timing, choose "yes" to force the use of precision timing, which may cause problems.

//  disable_standby_mode = "never"; // This setting prevents the DAC from entering the standby mode. Some DACs make small "popping" noises when they go in and out of standby mode. Settings can be: "always", "auto" or "never". Default is "never", but only for backwards compatibility. The "auto" setting prevents entry to standby mode while Shairport Sync is in the "active" mode. You can use "yes" instead of "always" and "no" instead of "never".
//  disable_standby_mode_silence_threshold = 0.040; // Use this optional advanced setting to control how little audio should remain in the output buffer before the disable_standby code should start sending silence to the output device.
//  disable_standby_mode_silence_scan_interval = 0.004; // Use this optional advanced setting to control how often the amount of audio remaining in the output buffer should be checked.
};

// Parameters for the "sndio" audio back end. All are optional.
// For this section to be operative, Shairport Sync must be built with the following configuration flag:
// --with-sndio
sndio =
{
//  device = "snd/0"; // optional setting to set the name of the output device. Default is the sndio system default.
//  rate = 44100; // optional setting  which can be 44100, 88200, 176400 or 352800, but the device must have the capability. Default is 44100.
//  format = "S16"; // optional setting  which can be "U8", "S8", "S16", "S24", "S24_3LE", "S24_3BE" or "S32", but the device must have the capability. Except where stated using (*LE or *BE), endianness matches that of the processor.
//  round = <number>; // advanced optional setting to set the period size near to this value
//  bufsz = <number>; // advanced optional setting to set the buffer size near to this value
};

// Parameters for the "pa" PulseAudio  backend.
// For this section to be operative, Shairport Sync must be built with the following configuration flag:
// --with-pa
pa =
{
//  server = "host"; // Set this to override the default pulseaudio server that should be used.
    sink = "Kitchen"; // Set this to override the default pulseaudio sink that should be used. (Untested)
//  application_name = "Shairport Sync"; //Set this to the name that should appear in the Sounds "Applications" tab when Shairport Sync is active.
};

// Parameters for the "jack" JACK Audio Connection Kit backend.
// For this section to be operative, Shairport Sync must be built with the following configuration flag:
// --with-jack
jack =
{
//  client_name = "shairport-sync"; // Set this to the name of the client that should appear in "Connections" when Shairport Sync is active.
//  autoconnect_pattern = ""; // Set this to a POSIX regular expression pattern that describes the ports you would like to connect to
//                                   automatically. Examples:
//                                   "system:playback_[12]"
//                                   "some_app_[0-9]*:in-[LR]"
//                                   "jack_mixer:in_2[78]"
//                                   Beware: if you make a syntax error, libjack might crash. In that case, fix it and start over.
//                                   For a good overview, look here: https://www.ibm.com/support/knowledgecenter/SS8NLW_11.0.1/com.ibm.swg.im.infosphere.dataexpl.engine.doc/c_posix-regex-examples.html
//  soxr_resample_quality = "none"; // Enable resampling by setting this to "very high", "high", "medium", "low" or "quick"
//  bufsz = <number>; // advanced optional setting to set the buffer size to this value
};

// Parameters for the "pipe" audio back end, a back end that directs raw CD-style audio output to a pipe. No interpolation is done.
// For this section to be operative, Shairport Sync must have been built with the following configuration flag:
// --with-pipe
pipe =
{
//  name = "/tmp/shairport-sync-audio"; // this is the default
};

// There are no configuration file parameters for the "stdout" audio back end. No interpolation is done.
// To include support for the "stdout" backend, Shairport Sync must be built with the following configuration flag:
// --with-stdout

// There are no configuration file parameters for the "ao" audio back end. No interpolation is done.
// To include support for the "ao" backend, Shairport Sync must be built with the following configuration flag:
// --with-ao

// For this section to be operative, Shairport Sync must be built with the following configuration flag:
// --with-convolution
dsp =
{

//////////////////////////////////////////
// This convolution filter can be used to apply almost any correction to the audio signal, like frequency and phase correction.
// For example you could measure (with a good microphone and a sweep-sine) the frequency response of your speakers + room,
// and apply a correction to get a flat response curve.
//////////////////////////////////////////
//
//  convolution = "no";                   // Set this to "yes" to activate the convolution filter.
//  convolution_ir_file = "impulse.wav";  // Impulse Response file to be convolved to the audio stream
//  convolution_gain = -4.0;              // Static gain applied to prevent clipping during the convolution process
//  convolution_max_length = 44100;       // Truncate the input file to this length in order to save CPU.

//////////////////////////////////////////
// This loudness filter is used to compensate for human ear non linearity.
// When the volume decreases, our ears loose more sentisitivity in the low range frequencies than in the mid range ones.
// This filter aims at compensating for this loss, applying a variable gain to low frequencies depending on the volume.
// More info can be found here: https://en.wikipedia.org/wiki/Equal-loudness_contour
// For this filter to work properly, you should disable (or set to a fix value) all other volume control and only let shairport-sync control your volume.
// The setting "loudness_reference_volume_db" should be set at the volume reported by shairport-sync when listening to music at a normal listening volume.
//////////////////////////////////////////
//
//  loudness = "no";                      // Set this to "yes" to activate the loudness filter
//  loudness_reference_volume_db = -20.0; // Above this level the filter will have no effect anymore. Below this level it will gradually boost the low frequencies.

};

// How to deal with metadata, including artwork
// For this section to be operative, Shairport Sync must be built with at one (or more) of the following configuration flags:
// --with-metadata, --with-dbus-interface, --with-mpris-interface or --with-mqtt-client.
// In those cases, "enabled" and "include_cover_art" will both be "yes" by default
metadata =
{
//  enabled = "yes"; // set this to yes to get Shairport Sync to solicit metadata from the source and to pass it on via a pipe
//  include_cover_art = "yes"; // set to "yes" to get Shairport Sync to solicit cover art from the source and pass it via the pipe. You must also set "enabled" to "yes".
//  cover_art_cache_directory = "/tmp/shairport-sync/.cache/coverart"; // artwork will be  stored in this directory if the dbus or MPRIS interfaces are enabled or if the MQTT client is in use. Set it to "" to prevent caching, which may be useful on some systems
//  pipe_name = "/tmp/shairport-sync-metadata";
//  pipe_timeout = 5000; // wait for this number of milliseconds for a blocked pipe to unblock before giving up
//  socket_address = "226.0.0.1"; // if set to a host name or IP address, UDP packets containing metadata will be sent to this address. May be a multicast address. "socket-port" must be non-zero and "enabled" must be set to yes"
//  socket_port = 5555; // if socket_address is set, the port to send UDP packets to
//  socket_msglength = 65000; // the maximum packet size for any UDP metadata. This will be clipped to be between 500 or 65000. The default is 500.
};

// How to enable the MQTT-metadata/remote-service
// For this section to be operative, Shairport Sync must be built with the following configuration flag:
// --with-mqtt-client
mqtt =
{
    enabled = "yes"; // set this to yes to enable the mqtt-metadata-service
    hostname = "localhost"; // Hostname of the MQTT Broker
    port = 1883; // Port on the MQTT Broker to connect to
    topic = "shairport-sync/Kitchen"; //MQTT topic where this instance of shairport-sync should publish. If not set, the general.name value is used.
    publish_raw = "yes"; //whether to publish all available metadata under the codes given in the 'metadata' docs.
    publish_parsed = "yes"; //whether to publish a small (but useful) subset of metadata under human-understandable topics
    publish_cover = "yes"; //whether to publish the cover over mqtt in binary form. This may lead to a bit of load on the broker
    enable_remote = "yes"; //whether to remote control via MQTT. RC is available under `topic`/remote.
};

// Diagnostic settings. These are for diagnostic and debugging only. Normally you should leave them commented out
diagnostics =
{
//  disable_resend_requests = "no"; // set this to yes to stop Shairport Sync from requesting the retransmission of missing packets. Default is "no".
    log_output_to = "/var/logs/shairport-sync/kitchen.log"; // set this to "syslog" (default), "stderr" or "stdout" or a file or pipe path to specify were all logs, statistics and diagnostic messages are written to. If there's anything wrong with the file spec, output will be to "stderr".
//  statistics = "no"; // set to "yes" to print statistics in the log
    log_verbosity = 1; // "0" means no debug verbosity, "3" is most verbose.
//  log_show_file_and_line = "yes"; // set this to yes if you want the file and line number of the message source in the log file
//  log_show_time_since_startup = "no"; // set this to yes if you want the time since startup in the debug message -- seconds down to nanoseconds
//  log_show_time_since_last_message = "yes"; // set this to yes if you want the time since the last debug message in the debug message -- seconds down to nanoseconds
//  drop_this_fraction_of_audio_packets = 0.0; // use this to simulate a noisy network where this fraction of UDP packets are lost in transmission. E.g. a value of 0.001 would mean an average of 0.1% of packets are lost, which is actually quite a high figure.
//  retain_cover_art = "no"; // artwork is deleted when its corresponding track has been played. Set this to "yes" to retain all artwork permanently. Warning -- your directory might fill up.
};

How did you install Shairport Sync?

Built from source

Check previous issues

mikebrady commented 2 years ago

Thanks for the report, Noel. I’ll take a look, see what I can find.

mikebrady commented 2 years ago

Hello again, Noel. I can reproduce this, thanks.

mikebrady commented 2 years ago

Hi Noel. I just pushed a fix to the development branch. If you'd be kind enough to test it out, that would be great. It was due to a change in the logic for dealing with buffered audio streams, and I didn't check it against the pa backend. Apologies.

mikebrady commented 1 year ago

I just replaced a faulty push, so it might be worth ensuring you have the absolutely latest one!

noelhibbard commented 1 year ago

@mikebrady, sorry for the delay. I can confirm, the issue is fixed on the development branch. Thanks for spending the time on this.

github-actions[bot] commented 1 year ago

This issue has been inactive for 45 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment.