diff --git a/install/config/hardware/fix-asus-rog-mic.sh b/install/config/hardware/fix-asus-rog-mic.sh new file mode 100644 index 00000000..b7391a2c --- /dev/null +++ b/install/config/hardware/fix-asus-rog-mic.sh @@ -0,0 +1,17 @@ +# Fix internal mic gain on ASUS ROG laptops with Realtek ALC285. +# The mic boost is way too high by default, causing clipping. +# Sets levels and stores ALSA state so it persists across reboots. + +if [[ "$(cat /sys/class/dmi/id/sys_vendor 2>/dev/null)" == "ASUSTeK COMPUTER INC." ]] && + grep -q "ROG" /sys/class/dmi/id/product_family 2>/dev/null; then + + for card in /proc/asound/card*/codec*; do + if grep -q "ALC285" "$card" 2>/dev/null; then + cardnum=$(echo "$card" | grep -oP 'card\K\d+') + amixer -c "$cardnum" set 'Internal Mic Boost' 0 >/dev/null 2>&1 || true + amixer -c "$cardnum" set 'Capture' 70% >/dev/null 2>&1 || true + sudo alsactl store "$cardnum" 2>/dev/null || true + break + fi + done +fi diff --git a/migrations/1768916735.sh b/migrations/1768916735.sh new file mode 100644 index 00000000..2cbeea44 --- /dev/null +++ b/migrations/1768916735.sh @@ -0,0 +1,3 @@ +echo "Fix microphone gain on Asus ROG laptops with ALC285 Realtek" + +$OMARCHY_PATH/install/config/hardware/fix-asus-rog-mic.sh