Skip to content

tarik-sen/huawei-sound-fix

Repository files navigation

Huawei MateBook 14s / 16s sound fix for Linux

Problem

On Huawei MateBook 14s/16s, the Linux sound card driver has the headphone and speaker outputs swapped. When headphones are plugged in, audio plays through the speakers, and vice versa.

This is a hardware quirk: the internal speaker (widget 0x17) ignores DAC connection select commands and mirrors the headphone jack (widget 0x16). Switching outputs requires sending HDA verb commands directly to the sound card.

Solution

A systemd user service runs in the background and applies the correct HDA verb commands at startup and whenever WirePlumber resumes (e.g. after suspend). A WirePlumber Lua hook triggers the re-apply on audio node state changes.

Requirements

  • Debian/Ubuntu-based distro
  • WirePlumber (PipeWire session manager)

Install

Step 1 — Install dependencies and configure the system (requires sudo):

sudo apt-get install -y alsa-tools alsa-utils
sudo usermod -aG audio "$USER"
sudo setcap cap_sys_rawio+ep "$(which hda-verb)"
  • alsa-tools provides hda-verb, used to send commands directly to the sound card
  • usermod adds your user to the audio group for access to /dev/snd/ devices
  • setcap grants hda-verb raw I/O access so it can run without root

Re-login after this step for the audio group membership to take effect.

Step 2 — Install the service:

bash install.sh

Uninstall

bash uninstall.sh

Service control

systemctl --user status huawei-sound-fix
systemctl --user restart huawei-sound-fix
systemctl --user stop huawei-sound-fix

About

Huawei Matebook 14s/16s sound fix or debian/ubuntu

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors