Skip to content

Instantly share code, notes, and snippets.

@fleger
Created May 24, 2011 17:52
Show Gist options
  • Save fleger/989245 to your computer and use it in GitHub Desktop.
Save fleger/989245 to your computer and use it in GitHub Desktop.
Fix the sound card of the Asus X77J to output 5.1 sound with ALSA
rclocal.10-fixX77JHDA() {
# Fix the sound card configuration to output 5.1 with ALSA.
local snddev=/dev/snd/hwC0D0
[[ -e "$snddev" ]] &&
# Source: 0x0 - Front
# 0x1 - LFE / Center
# 0x2 - Rear
# 1st jack (0x19) will be rear channels (green)
# Set source
hda-verb "$snddev" 0x19 SET_CONNECT_SEL 0x2 2> /dev/null &&
# Set to output mode
hda-verb "$snddev" 0x19 SET_PIN_WIDGET_CONTROL 0x44 2> /dev/null &&
# Unmute
hda-verb "$snddev" 0x19 0x3a0 0x0 2> /dev/null &&
hda-verb "$snddev" 0x19 0x390 0x0 2> /dev/null &&
# 2nd jack (0x1B) will be front channels (black)
# This one is already properly configured.
# 3rd jack (0x21) will be center / LFE channels (pink)
# Set source
hda-verb "$snddev" 0x21 SET_CONNECT_SEL 0x1 2> /dev/null &&
# Set to output mode
hda-verb "$snddev" 0x21 SET_PIN_WIDGET_CONTROL 0x40 2> /dev/null &&
# Unmute
hda-verb "$snddev" 0x21 0x3a0 0x0 2> /dev/null &&
hda-verb "$snddev" 0x21 0x390 0x0 2> /dev/null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment