}
debug(1, "alsa: output device name is \"%s\".", alsa_out_dev);
-
- do_alsa_device_init_if_needed();
-
- alsa_mix_handle = NULL;
+
+ alsa_mix_handle = NULL; // indicates alsa handle isn't open
// so, now, if the option to keep the DAC running has been selected, start a thread to monitor the
// length of the queue
if (alsa_backend_state != abm_playing) {
debug(2, "alsa: play() -- alsa_backend_state => abm_playing");
alsa_backend_state = abm_playing;
+ do_mute(0);
}
ret = do_play(buf, samples);
}
*/
int mute(int mute_state_requested) {
+ debug(1,"alsa: mute(%d)",mute_state_requested);
int response = 0;
if (config.alsa_use_hardware_mute == 1)
response = 1; // return true if actually using the mute facility
}
void do_mute(int mute_state_requested) {
- debug(3, "Setting mute to %d.", mute_state_requested);
+ debug(1, "alsa: do_mute(%d).", mute_state_requested);
int oldState;
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldState); // make this un-cancellable
void *alsa_buffer_monitor_thread_code(__attribute__((unused)) void *arg) {
while (1) {
- int sleep_time_ms = (int)(config.audio_backend_silence_scan_interval * 1000);
- pthread_cleanup_debug_mutex_lock(&alsa_mutex, 20000, 1);
- // check possible state transitions here
if ((config.keep_dac_busy != 0) && (alsa_device_initialised == 0)) {
debug(1,"alsa: alsa_buffer_monitor_thread_code() calling do_alsa_device_init_if_needed.");
do_alsa_device_init_if_needed();
}
+ int sleep_time_ms = (int)(config.audio_backend_silence_scan_interval * 1000);
+ pthread_cleanup_debug_mutex_lock(&alsa_mutex, 20000, 1);
+ // check possible state transitions here
if ((alsa_backend_state == abm_disconnected) && (config.keep_dac_busy != 0)) {
// open the dac and move to abm_connected mode
if (do_open() == 0)
}
- if (((volume_mode == vol_hw_only) || (volume_mode == vol_both)) && (config.output->volume))
+ if (((volume_mode == vol_hw_only) || (volume_mode == vol_both)) && (config.output->volume)) {
config.output->volume(hardware_attenuation); // otherwise set the output to the lowest value
// debug(1,"Hardware attenuation set to %f for airplay volume of
// %f.",hardware_attenuation,airplay_volume);
+ conn->fix_volume = 0x10000;
+ }
if ((volume_mode == vol_sw_only) || (volume_mode == vol_both)) {
double temp_fix_volume = 65536.0 * pow(10, software_attenuation / 2000);