Skip to content

Instantly share code, notes, and snippets.

@whc2001
Created June 18, 2020 20:32
Show Gist options
  • Select an option

  • Save whc2001/feaef5314c1ed0983ffb0bd2c5f09dc0 to your computer and use it in GitHub Desktop.

Select an option

Save whc2001/feaef5314c1ed0983ffb0bd2c5f09dc0 to your computer and use it in GitHub Desktop.
设置OpenWrt默认声卡和音量,丢到rc.local即可
# ====Sound card configuration====
DEFAULT_CARD=1
VOLUME=100
# Config default card
if ! grep -q "defaults.pcm.card" /etc/asound.conf; then
echo "defaults.pcm.card ${DEFAULT_CARD}" >> /etc/asound.conf
echo "defaults.ctl.card ${DEFAULT_CARD}" >> /etc/asound.conf
fi
# Set output volume
amixer -c ${DEFAULT_CARD} set Master playback ${VOLUME}% unmute
amixer -c ${DEFAULT_CARD} set Headphone playback ${VOLUME}% unmute
# ====End of sound card configuration====
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment