Skip to content

Instantly share code, notes, and snippets.

@GeeLeonidas
Last active February 6, 2024 08:19
Show Gist options
  • Save GeeLeonidas/48c839e1c7d839c294277715af9e79f1 to your computer and use it in GitHub Desktop.
Save GeeLeonidas/48c839e1c7d839c294277715af9e79f1 to your computer and use it in GitHub Desktop.
Globally disables Auto Gain Control on PipeWire-based systems
#!/bin/bash
# Backups the previous configuration (optional if you take system snapshots regularly)
BACKUP_PATH="/usr/share/alsa-card-profile/mixer/paths_backup"
[ ! -d $BACKUP_PATH ] && sudo cp -vR /usr/share/alsa-card-profile/mixer/paths $BACKUP_PATH
# The actual Perl script that disables AGC
sudo perl -pi -0 -e 's/(\[[A-Za-z ]*Mic Boost\][A-Za-z._=\s-]+volume *= *)merge/\1zero/g;' /usr/share/alsa-card-profile/mixer/paths/*
# Shows the changes made to the system (optional)
diff -r -C 5 $BACKUP_PATH /usr/share/alsa-card-profile/mixer/paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment