From 744bd8ee62ca136570a954c9e511ad5c2a98cfd0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 6 Apr 2021 15:20:46 +0200 Subject: [PATCH] v7.1 + DietPi-Set_hardware | soundcard: Fix amixer controls loop when generic USB DAC is selected, which did split at spaces within the control name. Use the unique numid (first field) as identifier. Outstanding test: Set "100%" for controls which do not take percentage values or are actually no volumes, like "Playback switch". --- dietpi/func/dietpi-set_hardware | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 6641c66423..61384fd581 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1839,10 +1839,11 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 [[ $INPUT_DEVICE_VALUE == *'1.1' ]] && G_EXEC sed -i 's/aotg\.aotg1_speed=0/aotg.aotg1_speed=1/' $FP_UENV # Unmute all (re: @sudeep) - for x in $(amixer -c "$SOUNDCARD_TARGET_CARD" controls | grep layback) + while read -r line do - G_EXEC amixer -c "$SOUNDCARD_TARGET_CARD" cset "$x" 100% - done + G_EXEC amixer -c "$SOUNDCARD_TARGET_CARD" cset "$line" 100% + + done < <(amixer -c "$SOUNDCARD_TARGET_CARD" controls | mawk -F, '/layback/{print $1}') # Odroid C2: https://github.com/MichaIng/DietPi/issues/2101 elif (( $G_HW_MODEL == 12 )); then