Smoren / huawei-ubuntu-sound-fix

Fix for sound card behavior on Huawei Matebook s14 / s16 on Ubuntu 22.04 / Fedora / Arch
140 stars 24 forks source link
archlinux fedora huawei linux matebook soundcard ubuntu

Huawei Matebook 14s / 16s soundcard fix for Ubuntu / Fedora / Arch

Problem

The headphone and speaker channels are mixed up in the sound card driver for Linux distributions.

When headphones are connected, the system considers that sound should be output from the speakers. When the headphones are off, the system tries to output sound through them.

Problem details (found here)

Looks like there is some weird hardware design, because from my prospective, the interesting widgets are:

And:

Solution

A daemon has been implemented that monitors the connection/disconnection of headphones and accesses the sound card device in order to switch playback to the right place.

Install

bash install.sh

Daemon control commands

systemctl status huawei-soundcard-headphones-monitor
systemctl restart huawei-soundcard-headphones-monitor
systemctl start huawei-soundcard-headphones-monitor
systemctl stop huawei-soundcard-headphones-monitor

Environment

This fix definitely works under Ubuntu 22.04 and Fedora 39 for laptop model Huawei MateBook 14s.

$ inxi -F
System:
  Host: smorenbook Kernel: 5.15.0-78-generic x86_64 bits: 64
    Desktop: GNOME 42.9 Distro: Ubuntu 22.04.3 LTS (Jammy Jellyfish)
Machine:
  Type: Laptop System: HUAWEI product: HKF-WXX v: M1010
    serial: <superuser required>
  Mobo: HUAWEI model: HKF-WXX-PCB v: M1010 serial: <superuser required>
    UEFI: HUAWEI v: 1.06 date: 07/22/2022

Say thanks

If you want to thank me for this solution, you can subscribe to my Github profile and also give stars to my open source projects, e.g.: