From fe162863b07bdf7bf29c48278ef2581d65a7f3ad Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Sat, 13 Jul 2024 14:38:36 -0700 Subject: [PATCH] fix(deck): Set volume of original output to 100% to fix low volume under DSP --- .../shared/usr/libexec/bazzite-user-setup | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/system_files/desktop/shared/usr/libexec/bazzite-user-setup b/system_files/desktop/shared/usr/libexec/bazzite-user-setup index 370cdb98..88bab824 100755 --- a/system_files/desktop/shared/usr/libexec/bazzite-user-setup +++ b/system_files/desktop/shared/usr/libexec/bazzite-user-setup @@ -18,7 +18,7 @@ BAZZITE_CONFIG_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/bazzite" mkdir -p "$BAZZITE_CONFIG_DIR" # SCRIPT VERSION -USER_SETUP_VER=40 +USER_SETUP_VER=41 USER_SETUP_VER_FILE="$BAZZITE_CONFIG_DIR/version" USER_SETUP_FEDORA_VER_FILE="$BAZZITE_CONFIG_DIR/fedora_version" USER_SETUP_IMAGE_VER_FILE=$BAZZITE_CONFIG_DIR/image_name"" @@ -199,6 +199,25 @@ if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" || $IMAGE_NAME =~ "framegam fi fi +# Audio Fix +# These handhelds use a custom DSP which requires the base speaker volume to be 100% +wp_audio_sinks() { + wpctl status | + awk 'BEGIN { A=0; S=0; } + /^Audio/ { A=1; } + /Sinks/ { S=1; } + /Sources/ { S=0; } + /Sink endpoints/ { S=0; } + /^Video/ { A=0; } + { if (A==1 && S==1 && / [[:digit:]]*\./) + { print; } }' | + sed 's/^.* \([[:digit:]]*\)\. \(.*\) \[.*$/\1\t\2/' +} + +if [[ ":83E1:ROG Ally RC71L:" =~ ":$SYS_ID:" ]]; then + wpctl set-volume $(wp_audio_sinks | grep "17h/19h" | sed 's@^[^0-9]*\([0-9]\+\).*@\1@') 100 || true +fi + # Prevent future executions echo "Writing state file" echo $USER_SETUP_VER > $USER_SETUP_VER_FILE