Skip to content

Instantly share code, notes, and snippets.

@philipperoubert
Last active September 24, 2024 07:23
Show Gist options
  • Save philipperoubert/a4dd97bd94c78a588147c044000a87da to your computer and use it in GitHub Desktop.
Save philipperoubert/a4dd97bd94c78a588147c044000a87da to your computer and use it in GitHub Desktop.
Huawei Matebook 14S Audio Fix
value=`cat selected_audio_output.txt`
if [ -z "$value" ]
then
value=0
fi
if [ $value -eq 0 ]
then
sudo hda-verb /dev/snd/hwC0D0 0x16 0x701 0x0001 // move output to speaker dac
sudo hda-verb /dev/snd/hwC0D0 0x17 0x70C 0x0002 // enable speaker
sudo hda-verb /dev/snd/hwC0D0 0x1 0x715 0x2 // disable headphones
value=1
else
sudo hda-verb /dev/snd/hwC0D0 0x16 0x701 0x0000 // move output to headphones dac
sudo hda-verb /dev/snd/hwC0D0 0x17 0x70C 0x0000 // disable speaker
sudo hda-verb /dev/snd/hwC0D0 0x1 0x717 0x2 // pin output mode
sudo hda-verb /dev/snd/hwC0D0 0x1 0x716 0x2 // pin enable
sudo hda-verb /dev/snd/hwC0D0 0x1 0x715 0x0 // clear pin value
value=0
fi
echo $value > selected_audio_output.txt
@Smoren
Copy link

Smoren commented Aug 7, 2023

Thank for this code! I've created a daemon for listening headphones connected/disconnected and switching audio output: https://github.com/Smoren/huawei-ubuntu-sound-fix

@eniskastrati
Copy link

Hey everyone,
I just got a matebook 14 with AMD Ryzen 7 and 16gb RAM and on linux distros (already tested Mint, Ubuntu 23 and 22) is not working.
Only with bluetoth headset is working, beside that no speeker is working even if I plug in headphones in the jack they are not recognized and don't work and no sound at all.
Even the microphone input is also not even detected.
Any clue what the issue there might be and how I can fix it, cause I just don't want to change to windows after beeing for more than 4 year a linux user.
In windows works everything perfectly!
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment