Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Huawei Matebook 14s headphone / speaker problem (CX8070 codec) #3350

Open
cihatertem opened this issue Dec 21, 2021 · 145 comments
Open

[BUG] Huawei Matebook 14s headphone / speaker problem (CX8070 codec) #3350

cihatertem opened this issue Dec 21, 2021 · 145 comments
Labels
codec Codec HW or driver restriction Community end-user or distro-reported issues

Comments

@cihatertem
Copy link

I tried different distros Ubuntu 21.10/Fedora and now Arch linux. I have an issue with speaker, headphone settings.
First of all the laptop has 4 speakers and 4 dijital mics.
Well these are problems:

  1. Gnome volume slider does not effect on volume. Each clicks give same beep until below %5 and volume goes down.
  2. If I plug a headphone, no sound at headphone and sound still comes from speakers. And after unplugged the headphone, speakers go mutted!
  3. To unmut the speakers I have to go alsamixer and select sound card 'sof-hda-dsp' (codec Chip: Conexant CX8070 ) and then I have to unmut headphone
  4. I can set speaker's volume from alsamixer's headphone slider. Speaker slider has no effect, Master slider only effect depends on headphone slider point.

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
    • Kernel: linux 5.15.10-arch1
    • SOF: 1.9.3
  2. Name of the topology file
    • Topology: {FILE} no idead. (lead me for the file please)
  3. Name of the platform(s) on which the bug is observed.
    • Platform: Arclinux

I tried several model=NAME options but there is no result.
Here they are, installed alsa packages with sof-bin: alsa-card-profiles, alsa-firmware, alsa-lib, alsa-plugins, alsa-topology-conf, alsa-ucm-conf, alsa-utils, pulseaudio-alsa, zita-alsa-pcmi, sof-firmware, sof-tools

If you need more log, outputs, please lead me :)

aplay -l 
**** List of PLAYBACK Hardware Devices ****
card 0: sofhdadsp [sof-hda-dsp], device 0: HDA Analog (*) []
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 1: HDA Digital (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 3: HDMI1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 4: HDMI2 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 5: HDMI3 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
pacmd list-sinks
4 sink(s) available.
    index: 0
	name: <alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_5__sink>
	driver: <module-alsa-card.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: SUSPENDED
	suspend cause: IDLE
	priority: 9037
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 0.00 ms
	max request: 0 KiB
	max rewind: 0 KiB
	monitor source: 0
	sample spec: s24-32le 2ch 48000Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	configured latency: 0.00 ms; range is 0.50 .. 170.67 ms
	card: 0 <alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic>
	module: 6
	properties:
		alsa.resolution_bits = "32"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = ""
		alsa.id = "HDMI3 (*)"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "5"
		alsa.card = "0"
		alsa.card_name = "sof-hda-dsp"
		alsa.long_card_name = "HUAWEI-HKD_WXX-M1010-HKD_WXX_PCB"
		alsa.driver_name = "snd_soc_skl_hda_dsp"
		device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "a0c8"
		device.product.name = "Tiger Lake-LP Smart Sound Technology Audio Controller"
		device.string = "_ucm0001.hw:sofhdadsp,5"
		device.buffering.buffer_size = "65536"
		device.buffering.fragment_size = "16384"
		device.access_mode = "mmap+timer"
		device.profile.name = "HiFi: hw:sofhdadsp,5: sink"
		device.profile.description = "HDMI / DisplayPort 3 Output"
		alsa.mixer_device = "_ucm0001.hw:sofhdadsp"
		device.description = "Tiger Lake-LP Smart Sound Technology Audio Controller HDMI / DisplayPort 3 Output"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		[Out] HDMI3: HDMI / DisplayPort 3 Output (priority 700, latency offset 0 usec, available: no)
			properties:
				
	active port: <[Out] HDMI3>
    index: 1
	name: <alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_4__sink>
	driver: <module-alsa-card.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: SUSPENDED
	suspend cause: IDLE
	priority: 9036
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 0.00 ms
	max request: 0 KiB
	max rewind: 0 KiB
	monitor source: 1
	sample spec: s24-32le 2ch 48000Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	configured latency: 0.00 ms; range is 0.50 .. 170.67 ms
	card: 0 <alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic>
	module: 6
	properties:
		alsa.resolution_bits = "32"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = ""
		alsa.id = "HDMI2 (*)"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "4"
		alsa.card = "0"
		alsa.card_name = "sof-hda-dsp"
		alsa.long_card_name = "HUAWEI-HKD_WXX-M1010-HKD_WXX_PCB"
		alsa.driver_name = "snd_soc_skl_hda_dsp"
		device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "a0c8"
		device.product.name = "Tiger Lake-LP Smart Sound Technology Audio Controller"
		device.string = "_ucm0001.hw:sofhdadsp,4"
		device.buffering.buffer_size = "65536"
		device.buffering.fragment_size = "16384"
		device.access_mode = "mmap+timer"
		device.profile.name = "HiFi: hw:sofhdadsp,4: sink"
		device.profile.description = "HDMI / DisplayPort 2 Output"
		alsa.mixer_device = "_ucm0001.hw:sofhdadsp"
		device.description = "Tiger Lake-LP Smart Sound Technology Audio Controller HDMI / DisplayPort 2 Output"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		[Out] HDMI2: HDMI / DisplayPort 2 Output (priority 600, latency offset 0 usec, available: no)
			properties:
				
	active port: <[Out] HDMI2>
    index: 2
	name: <alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_3__sink>
	driver: <module-alsa-card.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: SUSPENDED
	suspend cause: IDLE
	priority: 9035
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 0.00 ms
	max request: 0 KiB
	max rewind: 0 KiB
	monitor source: 2
	sample spec: s24-32le 2ch 48000Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	configured latency: 0.00 ms; range is 0.50 .. 170.67 ms
	card: 0 <alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic>
	module: 6
	properties:
		alsa.resolution_bits = "32"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = ""
		alsa.id = "HDMI1 (*)"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "3"
		alsa.card = "0"
		alsa.card_name = "sof-hda-dsp"
		alsa.long_card_name = "HUAWEI-HKD_WXX-M1010-HKD_WXX_PCB"
		alsa.driver_name = "snd_soc_skl_hda_dsp"
		device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "a0c8"
		device.product.name = "Tiger Lake-LP Smart Sound Technology Audio Controller"
		device.string = "_ucm0001.hw:sofhdadsp,3"
		device.buffering.buffer_size = "65536"
		device.buffering.fragment_size = "16384"
		device.access_mode = "mmap+timer"
		device.profile.name = "HiFi: hw:sofhdadsp,3: sink"
		device.profile.description = "HDMI / DisplayPort 1 Output"
		alsa.mixer_device = "_ucm0001.hw:sofhdadsp"
		device.description = "Tiger Lake-LP Smart Sound Technology Audio Controller HDMI / DisplayPort 1 Output"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		[Out] HDMI1: HDMI / DisplayPort 1 Output (priority 500, latency offset 0 usec, available: no)
			properties:
				
	active port: <[Out] HDMI1>
  * index: 3
	name: <alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink>
	driver: <module-alsa-card.c>
	flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: IDLE
	suspend cause: (none)
	priority: 9032
	volume: front-left: 31032 /  47% / -19.48 dB,   front-right: 31032 /  47% / -19.48 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 40.32 ms
	max request: 15 KiB
	max rewind: 15 KiB
	monitor source: 3
	sample spec: s24-32le 2ch 48000Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 2
	configured latency: 40.00 ms; range is 0.50 .. 170.67 ms
	card: 0 <alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic>
	module: 6
	properties:
		alsa.resolution_bits = "32"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = ""
		alsa.id = "HDA Analog (*)"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "sof-hda-dsp"
		alsa.long_card_name = "HUAWEI-HKD_WXX-M1010-HKD_WXX_PCB"
		alsa.driver_name = "snd_soc_skl_hda_dsp"
		device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "a0c8"
		device.product.name = "Tiger Lake-LP Smart Sound Technology Audio Controller"
		device.string = "_ucm0001.hw:sofhdadsp"
		device.buffering.buffer_size = "65536"
		device.buffering.fragment_size = "16384"
		device.access_mode = "mmap+timer"
		device.profile.name = "HiFi: hw:sofhdadsp: sink"
		device.profile.description = "Speaker + Headphones"
		alsa.mixer_device = "_ucm0001.hw:sofhdadsp"
		device.description = "Tiger Lake-LP Smart Sound Technology Audio Controller Speaker + Headphones"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		[Out] Speaker: Speaker (priority 100, latency offset 0 usec, available: unknown)
			properties:
				
		[Out] Headphones: Headphones (priority 200, latency offset 0 usec, available: no)
			properties:
				
	active port: <[Out] Speaker>
sudo lshw -c multimedia
  *-usb:1                   
       description: Video
       product: USB Camera
       vendor: 3730304231385631354A4A
       physical id: 6
       bus info: usb@3:6
       version: 0.0e
       serial: 200901010001
       capabilities: usb-2.01
       configuration: driver=uvcvideo maxpower=500mA speed=480Mbit/s
  *-multimedia
       description: Multimedia audio controller
       product: Tiger Lake-LP Smart Sound Technology Audio Controller
       vendor: Intel Corporation
       physical id: 1f.3
       bus info: pci@0000:00:1f.3
       version: 20
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi bus_master cap_list
       configuration: driver=sof-audio-pci-intel-tgl latency=32
       resources: iomemory:600-5ff iomemory:600-5ff irq:168 memory:601d170000-601d173fff memory:601d000000-601d0fffff
arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: sofhdadsp [sof-hda-dsp], device 0: HDA Analog (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 1: HDA Digital (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 6: DMIC (*) []
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 7: DMIC16kHz (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
amixer 
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 31032 [47%] [on]
  Front Right: Playback 31032 [47%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right - Rear Left - Rear Right
  Limits: Capture 0 - 65536
  Front Left: Capture 65536 [100%] [off]
  Front Right: Capture 65536 [100%] [off]
  Rear Left: Capture 65536 [100%] [off]
  Rear Right: Capture 65536 [100%] [off]
@lgirdwood
Copy link
Member

@Fincan can you provide the output of dmesg. Transfering issue to kernel.

@lgirdwood lgirdwood transferred this issue from thesofproject/sof Dec 22, 2021
@cihatertem
Copy link
Author

@Fincan can you provide the output of dmesg. Transfering issue to kernel.
dmesg.txt
Hello,
I attached dmesg as file.

@cihatertem
Copy link
Author

Archlinux updated sof-firmware and tools from 1.9.3 to to 2.0. But the problem goes on.

@JornUzon
Copy link

JornUzon commented Jan 6, 2022

I also this problem,CX8070,matebook14s, anything i can do?I want solve it

@JornUzon
Copy link

JornUzon commented Jan 6, 2022

kernel:5.10.60 ,and after alsactl init , speaker can work.and I use
hda-verb.txt
headphone can work ,but so sorry use this script,headerphone and speaker work at the same time

@spacer2010
Copy link

@Fincan I have the same problem, you get any solution?

@cihatertem
Copy link
Author

cihatertem commented Jan 7, 2022

@spacer2010 No, still waiting the fix. It seems it will be kernel/driver fix or something. I suppose we will wait some more.

@plbossart
Copy link
Member

@Fincan for the speakers and headphones, please see https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html, this looks like a codec issue that you should be able to try by disabling the SOF driver

@cihatertem
Copy link
Author

@plbossart I have already tried "options snd-intel-dspcfg dsp_driver=1" and it made no differences.

@plbossart
Copy link
Member

@Fincan then it's not an SOF issue but a codec driver issue. Something's missing, e.g. a quirk at the codec level.

@cihatertem
Copy link
Author

cihatertem commented Jan 10, 2022

@plbossart yes you can be right, I have checked linux kernel doc and there are only 4 Conexant codecs; 5045, 5047, 5051 and 5066. mine is CX8070 :/.
https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html#conexant-5045

@plbossart
Copy link
Member

if you happen to have a Windows setup, you can try to find the 'right' configuration for the codec, it's painful to snoop and reverse engineer low-level commands but it's the only way I am aware of to bring Linux to parity with Windows. see e.g. #3356 (comment)

@plbossart plbossart added codec Codec HW or driver restriction Community end-user or distro-reported issues labels Jan 10, 2022
@cihatertem
Copy link
Author

@plbossart there is only Archlinux in my system and reverse-engineering is over my computer skill :).

@cihatertem
Copy link
Author

cihatertem commented Jan 12, 2022

Today Archlinux updated kernel 5.15 >> 5.16 but the issue goes on.

@artsiomivanets
Copy link

artsiomivanets commented Mar 19, 2022

have same issue on my Honor Magicbook 14 view (Manjaro distro), since it has same audio card CX8070.
Headphones and speakers play simultaneously when headphones are plugged in
Has anyone found a solution?
Kernel: 5.16
SOF: 2.0

@cihatertem
Copy link
Author

have same issue on my Honor Magicbook 14 view (Manjaro distro), since it has same audio card CX8070. Headphones and speakers play simultaneously when headphones are plugged in Has anyone found a solution? Kernel: 5.16 SOF: 2.0

There is no solution yet. I use BT headphone.

@artsiomivanets
Copy link

There is no solution yet. I use BT headphone.

I see.
Thank you!

@spacer2010
Copy link

spacer2010 commented Mar 20, 2022 via email

@cihatertem
Copy link
Author

Archlinux linux-5.17.3 and lastest sof-bin 2.1.1 there is still no sound from headphone.
By the way switch from pulse to pipewire and there are some error log about conexant after pipewire switch:
"""
17:06:06 pipewire: mod.adapter: usage: node.name=
17:06:06 pipewire: mod.adapter: usage: node.name=
17:06:06 pipewire: spa.alsa: 'hw:0,1': capture open failed: Invalid argument
17:06:06 pipewire: mod.adapter: usage: node.name=
17:06:06 pipewire: spa.alsa: 'hw:0,1': playback open failed: Invalid argument
17:06:06 kernel: HDA Digital: dpcm_fe_dai_startup() failed (-22)
17:06:06 kernel: HDA Digital: dpcm_fe_dai_startup() failed (-22)
17:06:06 kernel: HDA Digital: ASoC: dpcm_be_dai_startup() failed at Digital Playback and Capture (-22)
17:06:06 kernel: Digital Playback and Capture: __soc_pcm_open() failed (-22)
17:06:06 kernel: snd_hda_codec_conexant ehdaudio0D0: ASoC: error at snd_soc_dai_startup on Digital Codec DAI: -22
17:06:06 kernel: snd_hda_codec_conexant ehdaudio0D0: ASoC: error at snd_soc_dai_startup on Digital Codec DAI: -22
17:06:06 kernel: snd_hda_codec_conexant ehdaudio0D0: didn't find PCM for DAI Digital Codec DAI
17:06:06 kernel: HDA Digital: dpcm_fe_dai_startup() failed (-22)
17:06:06 kernel: HDA Digital: dpcm_fe_dai_startup() failed (-22)
17:06:06 kernel: HDA Digital: ASoC: dpcm_be_dai_startup() failed at Digital Playback and Capture (-22)
17:06:06 kernel: Digital Playback and Capture: __soc_pcm_open() failed (-22)
17:06:06 kernel: snd_hda_codec_conexant ehdaudio0D0: ASoC: error at snd_soc_dai_startup on Digital Codec DAI: -22
17:06:06 kernel: snd_hda_codec_conexant ehdaudio0D0: ASoC: error at snd_soc_dai_startup on Digital Codec DAI: -22
17:06:06 kernel: snd_hda_codec_conexant ehdaudio0D0: didn't find PCM for DAI Digital Codec DAI
"""

@plbossart
Copy link
Member

@cihatertem can you add this file
sof-dyndbg.conf.txt as /etc/modprobe.d/sof-dyndbg.conf, reboot and attach the dmesg log.

we've seen this error with the digital path that no one actually uses, we should remove this option to make those them go away. Thanks.

@cihatertem
Copy link
Author

@cihatertem can you add this file sof-dyndbg.conf.txt as /etc/modprobe.d/sof-dyndbg.conf, reboot and attach the dmesg log.

we've seen this error with the digital path that no one actually uses, we should remove this option to make those them go away. Thanks.

Here it is.
dmesg.txt

@plbossart
Copy link
Member

I removed this digital path in thesofproject/sof#5691

Can you back-up /lib/firmware/intel/sof-tplg/, unzip this file
sof-hda-generic-idisp-4ch.tplg.gz
and copy it to the directory, reboot and recheck the results.

Thanks!

@cihatertem
Copy link
Author

cihatertem commented Apr 16, 2022

I did it but still same.
The new dmesg.
log.txt

@rzwinge
Copy link

rzwinge commented Apr 17, 2022

Hello, i have the same problem. I don't know if this can help. I tried the last weeks multiple distros and i tried 5.10-5.17, but always the same behaviour. Last week i tried Chrome OS Flex, which is running with kernel 5.10 and it is fully working. I'm not sure if it is working, because Google modified the kernel. I used "top" to see running processes. They are not using pulseaudio/pipewire. Then i installed Chrome OS over dual bot with brunch framework and so i had access to shell. i compared alsamixer and i saw no difference in the detected inputs/outputs. So i think Chrome OS is directly interacting with alsa.

Modified kernel by Google? Perhaps a working codec for this chipset? Is it a problem of pipewire/pulseaudio? Or special alsa config?

@rzwinge
Copy link

rzwinge commented Apr 17, 2022

And another thing. I have here Manjaro, Linux Kernel 5.17, KDE Plasma. Running pipewire with pulseaudio in combination.
If i switch the port of the soundcard to Headphones (Not connected) and setting the app, which is running sound to Audio Controller Speakers+Headphones then the sound and speakers are working correctly.

Screenshot_20220417_090630

Sry for screenshot with german lang.

Edit: Everytime the app is closed and you open a new app, you must reset the port, then it is working again.

@cihatertem
Copy link
Author

And another thing. I have here Manjaro, Linux Kernel 5.17, KDE Plasma. Running pipewire with pulseaudio in combination. If i switch the port of the soundcard to Headphones (Not connected) and setting the app, which is running sound to Audio Controller Speakers+Headphones then the sound and speakers are working correctly.

Screenshot_20220417_090630

Sry for screenshot with german lang.

Edit: Everytime the app is closed and you open a new app, you must reset the port, then it is working again.

There is no selection in gnome sound control and pavu like KDE sound section. BTW chrome OS's situation is interesting. 3-4 months ago I use a firmware for intel wireless chipset from chrome os firmware package and the firmware was added linux firmware package 1 month ago. I hope same merge is happen soon for the our sound hardware :).

@rzwinge
Copy link

rzwinge commented Apr 17, 2022

@cihatertem Last week i installed Fedora 35 and added the package pavu control. There i had the same possibility to switch the outputs and i simulated the same behaviuor to make the speaker working.

@phanky5
Copy link

phanky5 commented Jul 9, 2023

@Israellh2001 sound quality is probably a problem with your kernel version. I had tested some older Debian and Ubuntu releases before. Some had sound but low volume and quality as you describe. I am running kernel 6.3.11-200.fc38.x86_64. I don't have any issues with volume or quality.

I don't get any error when running alsactl restore.

@spacer2010
Copy link

spacer2010 commented Jul 9, 2023 via email

@Smoren
Copy link

Smoren commented Aug 8, 2023

Hi, everyone!

Disclaimer: I saw the HDA spec for the first time in my life just a few evenings ago so there is a chance that I might understand something incorrectly, but I still hope that my experience might be helpful.

After spending a few evenings with QEMU, HDA spec, CX20671 Datasheet (it is another SoC, but it's better than nothing) and hda-verb I was able to find the commands which can fix both cases (a speaker and headphones) on Ubuntu 22.04 (5.15.0-52-generic).

To enable a speaker and disable headphones:

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

To disable a speaker and enable headphones:

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

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

  • 0x01 - Audio Function Group
  • 0x10 - Headphones DAC (really both devices connected here)
  • 0x11 - Speaker DAC
  • 0x16 - Headphones Jack
  • 0x17 - Internal Speaker

And:

  • widgets 0x16 and 0x17 simply should be connected to different DACs 0x10 and 0x11, but Internal Speaker 0x17 ignores the connection select command and use the value from Headphones Jack 0x16.
  • Headphone Jack 0x16 is controlled with some weird stuff so it should be enabled with GPIO commands for Audio Group 0x01.
  • Internal Speaker 0x17 is coupled with Headphone Jack 0x16 so it should be explicitly disabled with EAPD/BTL Enable command.

I hope, somebody can put this knowledge in order and make a patch to kernel 😊

Thanks for this solution! I implemented a daemon that monitors headphones connection/disconnection and switchs output mode using your idea.

@foofly
Copy link

foofly commented Aug 8, 2023

@Smoren thank you! This solved my issue completely!

Kubuntu 23.04 x86_64
6.2.0-26-generic
Matebook 14

@tikhcloud
Copy link

Hi, everyone!

Disclaimer: I saw the HDA spec for the first time in my life just a few evenings ago so there is a chance that I might understand something incorrectly, but I still hope that my experience might be helpful.

After spending a few evenings with QEMU, HDA spec, CX20671 Datasheet (it is another SoC, but it's better than nothing) and hda-verb I was able to find the commands which can fix both cases (a speaker and headphones) on Ubuntu 22.04 (5.15.0-52-generic).

To enable a speaker and disable headphones:

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

To disable a speaker and enable headphones:

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

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

* 0x01 - Audio Function Group

* 0x10 - Headphones DAC (really both devices connected here)

* 0x11 - Speaker DAC

* 0x16 - Headphones Jack

* 0x17 - Internal Speaker

And:

* widgets 0x16 and 0x17 simply should be connected to different DACs 0x10 and 0x11, but Internal Speaker 0x17 ignores the connection select command and use the value from Headphones Jack 0x16.

* Headphone Jack 0x16 is controlled with some weird stuff so it should be enabled with GPIO commands for Audio Group 0x01.

* Internal Speaker 0x17 is coupled with Headphone Jack 0x16 so it should be explicitly disabled with EAPD/BTL Enable command.

I hope, somebody can put this knowledge in order and make a patch to kernel 😊

Solution doesn't work :(
Ubuntu 22.04.2 LTS x86_64,
6.2.0-26-generic,
Matebook 14s 2023 HKFG-XX

Headphones plugged or unplugged doesn't matter, nothing changes. As usual, sound comes from speakers when headphones plugged in :

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

Both speakers and headphones working at the same time:

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

Also, only 2 speakers out of 4 works..

@thule1291
Copy link

thule1291 commented Aug 10, 2023

Guys, so if you are just trying to get your speakers to work, as I was, here's a simple solution: image

I just cut a headphone jack and plugged in the end. Not an ideal solution, but if you don't want to wear headphones, it's good enough. Plus it's portable :)

THIS is the best Solution so far!
I thought it was a joke at first but no, absolutely perfect!
(Huawei MateBook X Pro 2021, 13.90", Intel Core i7-1165G7, 16 GB, 1000 GB, CH)

@merelm-academy
Copy link

Hi guys, I have a matebook 14 2020 with speakers and microphones array not working. I don't want to give you too much hope but I read on forums that in the future version 6.7 of the linux kernel there could be a generic fix to the audio problem of Huawei matebooks. I'm not sure that could be a definitive solution to our problem with these pc but could be a starting point.
codepayne/linux-sound-huawei#15
May the force be with you...

@cihatertem
Copy link
Author

Hi guys, I have a matebook 14 2020 with speakers and microphones array not working. I don't want to give you too much hope but I read on forums that in the future version 6.7 of the linux kernel there could be a generic fix to the audio problem of Huawei matebooks. I'm not sure that could be a definitive solution to our problem with these pc but could be a starting point. codepayne/linux-sound-huawei#15 May the force be with you...

Nice improved for Huawei laptops with "AMD CPUs that connect using the ACP3x module to a ES8336 CODEC.". But 14s uses intel and the codec is CX8070. :/

@merelm-academy
Copy link

My pc and other AMD's laptop use "snd_hda_intel" driver that are the same for intel CPUs. Is it possible that they are working on your issue that is similar to mine?

@cihatertem
Copy link
Author

My pc and other AMD's laptop use "snd_hda_intel" driver that are the same for intel CPUs. Is it possible that they are working on your issue that is similar to mine?

I am not sure but codes are different. And a user commented above and mark the this topic issue as codec problem. Nevermind, we'll see soon :)

@eniskastrati
Copy link

Currently having the issue with my new matebook14 amd ryzen 7 5400U 16GB RAM.
Anyone a solution that I can try?

@cihatertem
Copy link
Author

2 years and no official progress :), we could make happy birthday party for the bug!

@Cypukat85
Copy link

2 years and no official progress :), we could make happy birthday party for the bug!

This is a client-only problem because the vendor does not add Linux support as a specification. Next time I will choose a more suitable model and manufacturer.

@maniadevice
Copy link

Does anyone know what's the best way to contact them about this issue? If not, I can look around and type up an email for them, and then paste the template here. So everyone here can send one out to them.

@vpkopylov
Copy link

I have the same issue with my Huawei MateBook 16s, although the chip name is different: Conexant SN6140. A simple workaround that works for me is executing (from a startup script) amixer -c 0 sset Headphone on 100 (this command unmutes Headphone ). It doesn't solve the problem with not working headphones plugged in jack (doesn't matter if you use bluetooth headphones), but at least speaker works.

@developersu
Copy link

Same on Honor MagicView 14 (HGE-W76). Same issues with same Conexant cx8070

@maniadevice
Copy link

FWIW, just sent out an email here https://consumer.huawei.com/uk/support/contact-us/email-us/ and posted the link to this github issue. I don't know if they are going to care about one person. But maybe more of us can put some pressure?

@NikitaMarakushev
Copy link

I had the same problem with huawei matebook d14, until i tried current lastest fedora 39 with kernel 6.5
I consider, that using some of rolling-release distros, such as fedora, manjaro, void e. t. c can probably fix that problem

@vpkopylov
Copy link

vpkopylov commented Jan 8, 2024

I had the same problem with huawei matebook d14, until i tried current lastest fedora 39 with kernel 6.5 I consider, that using some of rolling-release distros, such as fedora, manjaro, void e. t. c can probably fix that problem

I am on Arch Linux and the system is up to date. Still have this problem with Matebook 16s (if a workaround is not applied)

@foofly
Copy link

foofly commented Jan 12, 2024

I've posted this before, but I've had success with this:
https://github.com/Smoren/huawei-ubuntu-sound-fix

Tested on Kbuntu, Solus and Endevour OS (all running plasma as that's my preference)

@spacer2010
Copy link

spacer2010 commented Jan 12, 2024 via email

@eniskastrati
Copy link

eniskastrati commented Jan 12, 2024

I just dual booted Debian 12.4 Bookworm and again getting the dummy output.!
Have you also done any other changes on your site @spacer2010 ?

@spacer2010
Copy link

spacer2010 commented Jan 13, 2024 via email

@spacer2010
Copy link

spacer2010 commented Jan 13, 2024 via email

@vpkopylov
Copy link

I can confirm that this workaround https://github.com/Smoren/huawei-ubuntu-sound-fix also works on Arch Linux and Matebook 16s out of box! Thanks @foofly
Even though README claims support only for Ubuntu and Fedora, the installation script contains pacman commands as well.
And this is the best workaround so far, because both the speakers and the headphones work properly, and auto switching between them also works.

@catmeowjiao
Copy link

I have a matebook 14s and I'm trying to use the headset's microphone but it doesn't work, how do I fix it?

@foofly
Copy link

foofly commented Jan 20, 2024

@catmeowjiao depending on your distro, the link I posted above may be your best bet.

@catmeowjiao
Copy link

FWIW, just sent out an email here https://consumer.huawei.com/uk/support/contact-us/email-us/ and posted the link to this github issue. I don't know if they are going to care about one person. But maybe more of us can put some pressure?

They should only respond to problems with Deepin, a Linux distribution in China.

@Fisherworks
Copy link

I can confirm that this workaround https://github.com/Smoren/huawei-ubuntu-sound-fix also works on Arch Linux and Matebook 16s out of box! Thanks @foofly Even though README claims support only for Ubuntu and Fedora, the installation script contains pacman commands as well. And this is the best workaround so far, because both the speakers and the headphones work properly, and auto switching between them also works.

Confirm this working too, on Matebook 14 with kernel 6.9.3 on Arch Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codec Codec HW or driver restriction Community end-user or distro-reported issues
Projects
None yet
Development

No branches or pull requests