From d3c067d009b7d005d724a9315cf3518cd1fb55bb Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Wed, 29 Sep 2021 09:26:46 +0100 Subject: [PATCH] Honour the volume_range_db with a hardware attenuator, duh. --- player.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/player.c b/player.c index ac332a43..6408a006 100644 --- a/player.c +++ b/player.c @@ -2912,6 +2912,8 @@ void player_volume_without_notification(double airplay_volume, rtsp_conn_info *c warn("The range requested is too large to accommodate -- ignored."); else sw_min_db = (sw_max_db - desired_sw_range); + } else { + hw_min_db = hw_max_db - desired_range_db; } } } else { @@ -3086,20 +3088,6 @@ void player_volume_without_notification(double airplay_volume, rtsp_conn_info *c "is disabled.", volume_mode, airplay_volume, software_attenuation, hardware_attenuation); } - /* - } - - #ifdef CONFIG_METADATA - else { - // here, send the 'pvol' metadata message when the airplay volume information - // is being used by shairport sync to control the output volume - char dv[128]; - memset(dv, 0, 128); - snprintf(dv, 127, "%.2f,%.2f,%.2f,%.2f", airplay_volume, 0.0, 0.0, 0.0); - send_ssnc_metadata('pvol', dv, strlen(dv), 1); - } - #endif - */ // here, store the volume for possible use in the future config.airplay_volume = airplay_volume; debug_mutex_unlock(&conn->volume_control_mutex, 3);