From 81a02221c14250500c6144211079cebf4e10e1ab Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sat, 2 Sep 2017 17:17:11 +0100 Subject: [PATCH] Change default of using alsa mute switch to "no" for compatability with other audio players. --- audio_alsa.c | 2 +- scripts/shairport-sync.conf | 2 +- shairport.c | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/audio_alsa.c b/audio_alsa.c index f880d1f7..3288b85d 100644 --- a/audio_alsa.c +++ b/audio_alsa.c @@ -162,7 +162,7 @@ static int init(int argc, char **argv) { // set up default values first set_period_size_request = 0; set_buffer_size_request = 0; - config.alsa_use_playback_switch_for_mute = 1; + config.alsa_use_playback_switch_for_mute = 0; // don't use it by default config.audio_backend_latency_offset = 0; config.audio_backend_buffer_desired_length = 0.15; diff --git a/scripts/shairport-sync.conf b/scripts/shairport-sync.conf index 1d664365..7b87191d 100644 --- a/scripts/shairport-sync.conf +++ b/scripts/shairport-sync.conf @@ -110,7 +110,7 @@ alsa = // period_size = ; // Use this optional advanced setting to set the alsa period size near to this value // buffer_size = ; // 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" -// mute_using_playback_switch = "yes"; // Use this optional advanced setting to control whether the snd_mixer_selem_set_playback_switch_all call can be used for muting. Default is yes. +// mute_using_playback_switch = "no"; // Use this optional advanced setting to control whether the snd_mixer_selem_set_playback_switch_all call can be used for muting. Default is "no", for compatibility with other audio players. }; // Parameters for the "sndio" audio back end. All are optional. diff --git a/shairport.c b/shairport.c index 9ea6de90..83dd3fc1 100644 --- a/shairport.c +++ b/shairport.c @@ -994,6 +994,9 @@ int main(int argc, char **argv) { endianness = SS_BIG_ENDIAN; else die("Can not recognise the endianness of the processor."); + + // set non-zero / non-NULL default values here + // but note that audio back ends also have a chance to set defaults strcpy(configuration_file_path, SYSCONFDIR); // strcat(configuration_file_path, "/shairport-sync"); // thinking about adding a special