From 18b7a5c0f1f7558b5b8d24030a27f3f6839f0ab8 Mon Sep 17 00:00:00 2001 From: vincent Date: Wed, 30 Sep 2020 15:45:43 +0200 Subject: [PATCH] volume_set now with min volume value to 16 --- .../board/funkey/rootfs-overlay/usr/local/sbin/volume_set | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_set b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_set index 8780192..0581858 100755 --- a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_set +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_set @@ -16,15 +16,17 @@ fi # Scale new volume value between 0 and 63 volume_percent=${1} -volume_scaled=$(echo "a = ${1} * 63 / 100 + 0.5; scale = 0; a / 1" | bc -l) +vol_mini=16; +volume_scaled=$(echo "a = $volume_percent * (63 - $vol_mini) / 100 + $vol_mini + 0.5; scale = 0; a / 1" | bc -l) +echo $volume_scaled # Get current value current_volume=$(volume_get) # Turn on/off audio amplifier if necessary -if [ ${current_volume} -eq 0 -a ${volume_scaled} -ne 0 ]; then +if [ ${current_volume} -eq 0 -a ${volume_percent} -ne 0 ]; then start_audio_amp 1 -elif [ ${current_volume} -ne 0 -a ${volume_scaled} -eq 0 ]; then +elif [ ${current_volume} -ne 0 -a ${volume_percent} -eq 0 ]; then start_audio_amp 0 fi