thesofproject / linux

Linux kernel source tree
Other
89 stars 128 forks source link

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

Open cihatertem opened 2 years ago

cihatertem commented 2 years ago

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).

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]
Valeria commented 1 year ago

Having the same issue on a recently bought 14s from the Huawei store. Truly a shame as otherwise both the laptop and linux run wonderfully.

TadeoDGAguilar commented 1 year ago

Hello everyone, I was trying all Linux's flavors but this problem persist, only in Ubuntu 22.04 the output show "fictitious output", also I was reading that problem will be repair with the Linux Kernel 5.19.0 but I'm not sure.

By the way, I have a Matebook 13 (2021)

What do you think?

lnicola commented 1 year ago

@TadeoDGAguilar probably not, it's broken on Fedora 37 and the linked kernel bug is still open. But you're on a different laptop so who knows?

TadeoDGAguilar commented 1 year ago

@lnicola Hi! A few minutes ago I tried Ubuntu 22.10 in a LIVE-USB, and this time the output changed, now show the device's name (I think that is good) but I don't have sound...

By the way, can you see this https://github.com/intbyte-100/matebook-d15-linux-soundfix ??

cihatertem commented 1 year ago

@lnicola Hi! A few minutes ago I tried Ubuntu 22.10 in a LIVE-USB, and this time the output changed, now show the device's name (I think that is good) but I don't have sound...

By the way, can you see this https://github.com/intbyte-100/matebook-d15-linux-soundfix ??

Has anyone tried this fixes with 5.19 kernel? I am on Ubuntu 22.04 with 5.15. If it works, I hope to see the fix with first hwe kernel :).

lnicola commented 1 year ago

To the best of my understanding, I'll try to make a quick summary (focusing on the Matebook 14s), sorry for being slightly out of topic:

webgtx commented 1 year ago

We found solution on 5.19 kernel

intbyte-100 commented 1 year ago

@lnicola Hi! A few minutes ago I tried Ubuntu 22.10 in a LIVE-USB, and this time the output changed, now show the device's name (I think that is good) but I don't have sound... By the way, can you see this https://github.com/intbyte-100/matebook-d15-linux-soundfix ??

Has anyone tried this fixes with 5.19 kernel? I am on Ubuntu 22.04 with 5.15. If it works, I hope to see the fix with first hwe kernel :).

I have tested this fix on two laptops and it works. But now there is one bug in this fix that will be fixed soon.

Valeria commented 1 year ago

We found solution on 5.19 kernel

Could you elaborate a bit on this?

philipperoubert commented 1 year ago

We found solution on 5.19 kernel

Tried on Ubuntu without success.

Upgraded Ubuntu to 22.10 which has Kernel 5.19 - that didn't change anything on my side.

I also tried both https://github.com/webgtx/matebook-d15-linux-soundfix and https://github.com/intbyte-100/matebook-d15-linux-soundfix - but that gave me error:

main.c:4:10: fatal error: spa/param/audio/format-utils.h: No such file or directory 4 | #include <spa/param/audio/format-utils.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Pipewire seems to be the default audio server as of 22.10. However, it seems it's not installing the source files in usr/include like what the soundfix code expects. Hence, it cannot import the header files and it does not install anything.

I tried to manually move the source files from Pipewire to usr/include, but that didn't solve the issue, it seems there are arch specific codes that do not work well with debian.

So to conclude - it seems to be working on Arch-based systems, but not yet on Debian-based?

lnicola commented 1 year ago

@philipperoubert you'll need libpipewire-0.3-dev or something similar for that. Arch doesn't split -devel packages.

But how did we end up talking about the D15 here?

tkefeli commented 1 year ago

Hi everybody. I want to inform you about similar situation that i am trying to cope with, especially related with matebook laptops. According to the forums i read, i think the 5.19 kernel has a tool or solution to identify sound card and related chips correctly. I'll try to explain more detail but a little bit long way:

I purchased a laptop a few days ago, Huawei Matebook 14, i5, 16GB, 512GB, W11, TigerLake. I installed the LinuxMint 21 Cinnamon desktop named "Vanessa". The sound was very impressive on Win side but there was no sound for Linux side. The system saw the audio card, no error reported in "dmesg" output. The sound volume slider icon that sits the right bottom corner is exist and working but no sound on speakers and no sound on headphones. And then i read this topic and saw "the solution was found on 5.19 kernel" and download the last ubuntu distro, burned to usb flash and reboot. Nothing was changed. The sound was absent, neither speaker nor headphone.

But there was some differences between the lsmod outputs of Mint and Ubuntu systems. For example Linux mint was using "snd_sof_pci_intel_tgl", "snd_sof_intel_hda_common", "snd_sof_intel_hda" and similar named modules. From the other way, ubuntu was using "snd_soc_sof_es8336 ", "snd_soc_intel_hda_dsp_common" modues.

When i look at the alsamixer on ubuntu side, there was too many control on the screen, some of them was "MM" state, some of them was "00" and some of them was "100". I enabled the the "MM" stated controls and tried to get to incresa to 100. Some of them was ok some of them was not, only enabled. Finally when i tried again to play something with aplay (Front_Center.wav) the sound came to me from speakers.

Later, i switched to win side and check the properties of sound card from system settings. The audio card has "es8336" codename.

Linux mint uses the sof-firmware 1.9.x (i think) and Ubuntu uses 2.x.x . I think, my opinion, ubuntu with newer kernel identified the sound card correctly and used the proper module but mint not. And i had to make all audio channels enabled and up from alsamixer.

I know this was a long post, and you may consider that this is not relevant the main issue discussed here, i only want to share my opinions to give an idea.

Thanks.

lnicola commented 1 year ago

@tkefeli on my D14s Fedora loads the tgl driver, but it works if I unmute the controls. Can you do the same thing in Mint? I didn't try a Ubuntu live image yet.

And does your laptop have four speakers? Do you get sound on all of them?

tkefeli commented 1 year ago

@lnicola, no, i haven't test it on mint at the moment. I will test it and if the speakers run, i will be very happy. At the moment, i am not sure, this sound problem can only be solved by switching the 5.19 kernel, or may be other method existed like make the current kernel use correct module. Because i don't know any idea for compiling kernel and want to use mint.

From the other way, I don't know my laptop has four or two speaker and how many mic inputs. Because the seller gives very limited information about the laptop i purchased, anybody can find the information they gave from anywhere. I researched the Huawei global site and found too many laptop model with the same name. in the weekend i will try to check the hardware more detailed. I have a little son, four years old, and i can't do anything with laptop unless he goes to bed.

Thanks.

NikitaMarakushev commented 1 year ago

So, i tried kubuntu 22.10, system detected sound card, but also no sound, kernel version is 5.19.0-23-generic sound1 sound2, also on kernel version 6.0.5 the same issue, but when i connect headphone appears small sound ripple

tkefeli commented 1 year ago

I am tkinking about, the 5.19 kernel must be installed in order to get sound for this kind of ES8336 chipsets. I say that this idea based on the information I read from https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html#es8336-support. I tried too many things in order to run audio device under 5.15 kernel Linux Mint, it all failed. So, i switched the Ubuntu 22.10, kernel 5.19, at the first shot, audio has been seen by the operating system but there was no sound. When i tweaked the sound system with alsamixer finally I heard the good quality sound. The trick was like this: Play a continuous song etc from youtube or anything else, while it isplaying, open the alsamixer from command prompt and try to enable all controls you can in turn and try to make their values maximum. if sound card detected properly you will see the name of sound device left-top corner of the window. image For me, the sound came suddenly when i boosted first two control even they are related with headphone control. These two control was muted at the beginning.

phanky5 commented 1 year ago

I am tkinking about, the 5.19 kernel must be installed in order to get sound for this kind of ES8336 chipsets. I say that this idea based on the information I read from https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html#es8336-support. I tried too many things in order to run audio device under 5.15 kernel Linux Mint, it all failed. So, i switched the Ubuntu 22.10, kernel 5.19, at the first shot, audio has been seen by the operating system but there was no sound. When i tweaked the sound system with alsamixer finally I heard the good quality sound. The trick was like this: Play a continuous song etc from youtube or anything else, while it isplaying, open the alsamixer from command prompt and try to enable all controls you can in turn and try to make their values maximum. if sound card detected properly you will see the name of sound device left-top corner of the window. image For me, the sound came suddenly when i boosted first two control even they are related with headphone control. These two control was muted at the beginning.

Changing the soundcard to sof-hda-dsp in alsamixer, unmuting the headphone with the "m" key and then turning up the volume worked for me on Fedora 36 Kernel 5.19.16-200.fc36.x86_64. The volume control does only work partially, and I only have sound from two of the four speakers on my Matebook 14s. This is a good start! Thanks for sharing @tkefeli

spacer2010 commented 1 year ago

Debían testing is now on kernel 6.0 and I don't get any sound, only have sound if I put earphones then I get sound from speaker. 10 month persist this problem it's a shame for Linux.

Wolfgang Endres

On Tue, Nov 1, 2022, 20:05 tkefeli @.***> wrote:

I am tkinking about, the 5.19 kernel must be installed in order to get sound for this kind of ES8336 chipsets. I say that this idea based on the information I read from https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html#es8336-support. I tried too many things in order to run audio device under 5.15 kernel Linux Mint, it all failed. So, i switched the Ubuntu 22.10, kernel 5.19, at the first shot, audio has been seen by the operating system but there was no sound. When i tweaked the sound system with alsamixer finally I heard the good quality sound. The trick was like this: Play a continuous song etc from youtube or anything else, while it isplaying, open the alsamixer from command prompt and try to enable all controls you can in turn and try to make their values maximum. if sound card detected properly you will see the name of sound device left-top corner of the window. [image: image] https://user-images.githubusercontent.com/95205510/199315758-3943471a-313e-4180-b25d-995cc46d6dde.png For me, the sound came suddenly when i boosted first two control even they are related with headphone control. These two control was muted at the beginning.

— Reply to this email directly, view it on GitHub https://github.com/thesofproject/linux/issues/3350#issuecomment-1298980390, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHICGOGPVKP6VAHOPTSUOCLWGFSWBANCNFSM5KTOKH7Q . You are receiving this because you were mentioned.Message ID: @.***>

foofly commented 1 year ago

I've seen some other people saying that their audio issues with the new kernal was solved on wayland with installing WirePlumber. Has anyone attempted that?

lnicola commented 1 year ago

@spacer2010 can you try to use alsamixer to unmute and increase the volume on your headphones?

spacer2010 commented 1 year ago

I have installed wire plumber but no changes, no sound.

Wolfgang Endres

On Wed, Nov 2, 2022, 11:04 Bill Kav @.***> wrote:

I've seen some other people saying that their audio issues with the new kernal was solved on wayland with installing WirePlumber. Has anyone attempted that?

— Reply to this email directly, view it on GitHub https://github.com/thesofproject/linux/issues/3350#issuecomment-1299975176, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHICGOA233BZAQQ7AVX3TLDWGI4EBANCNFSM5KTOKH7Q . You are receiving this because you were mentioned.Message ID: @.***>

cihatertem commented 1 year ago

Guys, topic goes to wrong way. You all miss the main issue that headphone / speakers are mismapped. And there is only sound from speakers while headphones connected or not connected! and you cannot get sound from headphones with any other changes.

After headphones connect/disconnect, you have to make un-[MM] headphones to get sound from speakers.

From start of the issue till now, we could use alsamixer to sound on/off headphone [MM] or un-[MM] to get sound from speakers.

If you cannot get sound from speakers while headphones un[MM] at alsamixer, you should install sof-firmware or other missing packages.

lnicola commented 1 year ago

Guys, topic goes to wrong way.

Agreed.

After headphones connect/disconnect, you have to make un-[MM] headphones to get sound from speakers.

Hmm, for me (on Fedora 37) it works without connecting and disconnecting anything. It's just that the volume control is wrong.

spacer2010 commented 1 year ago

On debían testing, only get sound from speaker with earphone plugged in.

Wolfgang Endres

On Wed, Nov 2, 2022, 13:05 Laurențiu Nicola @.***> wrote:

Guys, topic goes to wrong way.

Agreed.

After headphones connect/disconnect, you have to make un-[MM] headphones to get sound from speakers.

Hmm, for me (on Fedora 37) it works without connecting and disconnecting anything. It's just that the volume control is wrong.

— Reply to this email directly, view it on GitHub https://github.com/thesofproject/linux/issues/3350#issuecomment-1300231704, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHICGOHDHK2M5T2NS7ZDE4DWGJKHBANCNFSM5KTOKH7Q . You are receiving this because you were mentioned.Message ID: @.***>

cihatertem commented 1 year ago

Hmm, for me (on Fedora 37) it works without connecting and disconnecting anything. It's just that the volume control is wrong.

Well I totaly forget this problem. Yes, I am at ubuntu 22.04 with gnome and volume doesnt change from gnome volume slider. I have to set speaker's volume from alsamixer with headphone section.

lnicola commented 1 year ago

I have to set speaker's volume from alsamixer with headphone section.

As I mentioned before, I have a hacky fix for this. I can publish it if anyone is interested (feel free to :+1: if you want to avoid sending an email to everyone).

lnicola commented 1 year ago

@cihatertem see https://github.com/lnicola/mirror-volume. It's not exactly "ready", don't tell anyone I wrote it 🫣.

anticodeninja commented 1 year ago

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:

And:

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

xalexalex commented 1 year ago

@anticodeninja Remarkable! This is the first time I've heard sound through my headphones in linux on this laptop. Congrats for the great job and I too hope someone will integrate this ASAP. Meanwhile your commands can be put into scripts and they work very well. I have added them to the ArchWiki for the benefit of our Matebook 14s fellows who are longing to use the audio jack.

p.s. (partly related) have you gotten the microphones to work? I'm still having issues with them.

philipperoubert commented 1 year ago

@anticodeninja You're amazing. Thanks a lot for this solution, it's almost been a year since we had this issue. Tested it and it works on my Ubuntu.

I made a script that toggles the sound output between speakers and headphones and I bound it to a keyboard shortcut. That way every time I press F10, it changes to the other output.

It's a bit of a hacky solution but it works. I tried to find a way to read the value of the hwdep device but couldn't find an easy way, so that shell script simply saves a 1 or 0 value in a text file and toggles based on the value of that file.

https://gist.github.com/philipperoubert/a4dd97bd94c78a588147c044000a87da

Fl0r14nJ commented 1 year ago

Hello same issue here with matebook 14s alsa and pulseaudio

GeorgeKarles commented 1 year ago

@anticodeninja same issue with huawei d14 in ubuntu 22.10 but when i try to run any of the commands above i get open: No such file or directory what do i do?

casabero commented 1 year ago

@anticodeninja same issue with huawei d14 in ubuntu 22.10 but when i try to run any of the commands above i get open: No such file or directory what do i

Same here!

cihatertem commented 1 year ago

@jdgari @GeorgeKarles you have to install alsa-tools.

spacer2010 commented 1 year ago

Alsa tools dosen't solve the problem

Bruce

On Tue, 22 Nov 2022, 06:08 Cihat Ertem, @.***> wrote:

@jdgari https://github.com/jdgari @GeorgeKarles https://github.com/GeorgeKarles you have to install alsa-tools.

— Reply to this email directly, view it on GitHub https://github.com/thesofproject/linux/issues/3350#issuecomment-1323077464, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHICGOFLTIOKXEQOYOIVKSLWJRINZANCNFSM5KTOKH7Q . You are receiving this because you were mentioned.Message ID: @.***>

GeorgeKarles commented 1 year ago

@jdgari i had them installed when i tried and got that message

lnicola commented 1 year ago

I can confirm @anticodeninja's solution works, up to a sound card reset (resume from sleep or after the card gets suspended on idle, I suppose).

Fl0r14nJ commented 1 year ago

Some plans to fix?

casabero commented 1 year ago

@jdgari @GeorgeKarles you have to install alsa-tools.

yes

casabero commented 1 year ago

@jdgari i had them installed when i tried and got that message

try with hwC0D2 instead hwC0D0

NikitaMarakushev commented 1 year ago

@jdgari , did you try?

casabero commented 1 year ago

@jdgari , did you try?

yeah, but it didnt work

pcouy commented 1 year ago

@lnicola Hi! A few minutes ago I tried Ubuntu 22.10 in a LIVE-USB, and this time the output changed, now show the device's name (I think that is good) but I don't have sound... By the way, can you see this https://github.com/intbyte-100/matebook-d15-linux-soundfix ??

Has anyone tried this fixes with 5.19 kernel? I am on Ubuntu 22.04 with 5.15. If it works, I hope to see the fix with first hwe kernel :).

I just tried this on a matebook D 15 with 5.19 kernel. Audio output works way better than the "headphone workaround". Still no luck with the mic though (but it's fine for me)

spacer2010 commented 1 year ago

I use Debian bookworm on matebook S14, 1 year without sound only hear something using blutooth earphones and use kernel 6.0.0.5. attempt many things all without any result.

Wolfgang Endres

On Sun, 4 Dec 2022, 17:15 Pierre Couy, @.***> wrote:

@lnicola https://github.com/lnicola Hi! A few minutes ago I tried Ubuntu 22.10 in a LIVE-USB, and this time the output changed, now show the device's name (I think that is good) but I don't have sound... By the way, can you see this https://github.com/intbyte-100/matebook-d15-linux-soundfix ??

Has anyone tried this fixes with 5.19 kernel? I am on Ubuntu 22.04 with 5.15. If it works, I hope to see the fix with first hwe kernel :).

I just tried this on a matebook D 15 with 5.19 kernel. Audio output works way better than the "headphone workaround". Still no luck with the mic though (but it's fine for me)

— Reply to this email directly, view it on GitHub https://github.com/thesofproject/linux/issues/3350#issuecomment-1336454737, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHICGOB2H6WSUIQR3G7D6ZTWLS7S5ANCNFSM5KTOKH7Q . You are receiving this because you were mentioned.Message ID: @.***>

lnicola commented 1 year ago

@spacer2010 do you want to give https://github.com/lnicola/mirror-volume a try?

casabero commented 1 year ago

@lnicola Hi! A few minutes ago I tried Ubuntu 22.10 in a LIVE-USB, and this time the output changed, now show the device's name (I think that is good) but I don't have sound... By the way, can you see this https://github.com/intbyte-100/matebook-d15-linux-soundfix ??

Has anyone tried this fixes with 5.19 kernel? I am on Ubuntu 22.04 with 5.15. If it works, I hope to see the fix with first hwe kernel :).

I just tried this on a matebook D 15 with 5.19 kernel. Audio output works way better than the "headphone workaround". Still no luck with the mic though (but it's fine for me)

amd or intel? ubuntu? manjaro?

DmitriiMukhin commented 1 year ago

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 blush

5.15.78-1-MANJARO

Partial works on HONOR HGE-WX6. Headphones plugged or unplugged it doesn't matter:

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

Making internal speakers fully working. Headphones are muted.

Headphones plugged in:

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

Without success - both speakers and headphones working at the same time.

doom-fr commented 1 year ago

a workaround ... -> https://askubuntu.com/questions/1451232/no-sound-on-huawei-14s-with-ubuntu-22-10/1451233#1451233

maniadevice commented 1 year ago

Landed here after a loot of searching for the solution. Do we know if this issue is going to be patched in a kernel update soon?

Fl0r14nJ commented 1 year ago

Its not depending in a kernel update i think you should look at sof