You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Huawei MateBook D15 headphone and speaker not work #3831
priv->gpio_speakers = gpiod_get_optional(codec_dev, "speakers-enable", GPIOD_OUT_LOW);
if (IS_ERR(priv->gpio_speakers)) {
ret = dev_err_probe(dev, PTR_ERR(priv->gpio_speakers),
"could not get speakers-enable GPIO\n");
dev_info(dev, "could not get speakers-enable GPIO\n");
goto err_put_codec;
}
[ 52.247139] sof-essx8336 sof-essx8336: quirk mask 0x20
[ 52.247141] sof-essx8336 sof-essx8336: quirk SSP0
[ 52.247142] sof-essx8336 sof-essx8336: quirk DMIC enabled
[ 52.247168] sof-essx8336 sof-essx8336: could not get speakers-enable GPIO
That's not good news @tvelazquez, the problem is likely a BIOS issue or something. That's super hard to debug remotely. You are getting an error for an optional gpio, not sure what happens.
@tvelazquez can you share the DSDT and also verify that this codec driver is part of the build? Wondering if there is some sort of I2C configuration issue.
You can see the codec driver in lsmod, but the es8316_i2c_probe fuction is not called, making the probe of sound card failed. can you add print message to make sure the es8316_i2c_probe failed to be called? If so, it's because the dsdt is wrong. Can you show your overriding dsdt table?
The dsdt looks good but es8316_i2c_probe is not called. Usually when the HID 'ESSX8336' in dsdt matches the ID in es8316.c, es8316_i2c_probe is called.
I also see a device named ESSX8336 in your alsainfo.
Can you see the device /sys/bus/i2c/devices/i2c-ESSX8336\:00 ?
Can you blacklist and then manuelly probe the module snd_soc_es8316 and snd_soc_sof_es8336 using modprobe and see what happens?
Activity
plbossart commentedon Aug 24, 2022
You are not using the SOF driver!
snd_intel_dspcfg: dsp_driver=1 dyndbg= p
please remove this option, and read the wiki:
https://github.com/thesofproject/linux/wiki/ES8336-support
tvelazquez commentedon Aug 24, 2022
@plbossart I load the SOF driver and there is no sound card.
http://alsa-project.org/db/?f=7b41c67fbe773bd8a70ecdb3946a3b264bc2a7d7
plbossart commentedon Aug 24, 2022
The last line of the dmesg log shows you have started probing the machine driver
[ 21.210242] sof-essx8336 sof-essx8336: quirk mask 0x20
If you don't see a card created it means that that probe failed somewhere.
Not sure what happens, you have dynamic debug enabled but nothing is shown.
You will have to trace manually where the issue happens, likely by adding some dev_info statements in sound/soc/intel/boards/sof_es8336.c
plbossart commentedon Aug 24, 2022
you may also want to try and enable dynamic debug for the ASoC core, this will be very verbose but let you know why the card registration failed
options snd-soc-core dyndbg=+pmf
tvelazquez commentedon Aug 24, 2022
@plbossart I add some dev_info:
[ 52.247139] sof-essx8336 sof-essx8336: quirk mask 0x20
[ 52.247141] sof-essx8336 sof-essx8336: quirk SSP0
[ 52.247142] sof-essx8336 sof-essx8336: quirk DMIC enabled
[ 52.247168] sof-essx8336 sof-essx8336: could not get speakers-enable GPIO
http://alsa-project.org/db/?f=5adfb126cedacfecb5bc021097816853ebeb769b
plbossart commentedon Aug 25, 2022
That's not good news @tvelazquez, the problem is likely a BIOS issue or something. That's super hard to debug remotely. You are getting an error for an optional gpio, not sure what happens.
Try to add dynamic debug in https://elixir.bootlin.com/linux/latest/source/drivers/gpio/gpiolib.c and see what the results are.
You could also bypass this and just set priv->gpio_speakers = NULL and see what happens.
tvelazquez commentedon Aug 25, 2022
@plbossart dynamic debug enabled for gpiolib and add priv->gpio_speakers = NULL;
[ 9.281388] sof-essx8336 sof-essx8336: quirk mask 0x20
[ 9.281390] sof-essx8336 sof-essx8336: quirk SSP0
[ 9.281391] sof-essx8336 sof-essx8336: quirk DMIC enabled
[ 9.281413] gpiolib:gpiod_get_index: i2c i2c-ESSX8336:00: GPIO lookup for consumer speakers-enable
[ 9.281414] gpiolib:gpiod_get_index: i2c i2c-ESSX8336:00: using ACPI for GPIO lookup
[ 9.281428] gpiolib:gpiod_get_index: i2c i2c-ESSX8336:00: No GPIO consumer speakers-enable found
[ 9.281428] gpiolib:gpiod_get_index: i2c i2c-ESSX8336:00: GPIO lookup for consumer headphone-enable
[ 9.281429] gpiolib:gpiod_get_index: i2c i2c-ESSX8336:00: using ACPI for GPIO lookup
[ 9.281430] gpiolib:gpiod_get_index: i2c i2c-ESSX8336:00: using lookup tables for GPIO lookup
[ 9.281431] gpiolib:gpiod_get_index: i2c i2c-ESSX8336:00: No GPIO consumer headphone-enable found
[ 9.281433] snd_soc_core:soc_check_tplg_fes: sof-essx8336 sof-essx8336: info: override BE DAI link SSP0-Codec
[ 9.281433] snd_soc_core:soc_check_tplg_fes: sof-essx8336 sof-essx8336: info: override BE DAI link dmic01
[ 9.281434] snd_soc_core:soc_check_tplg_fes: sof-essx8336 sof-essx8336: info: override BE DAI link dmic16k
[ 9.281435] snd_soc_core:soc_check_tplg_fes: sof-essx8336 sof-essx8336: info: override BE DAI link iDisp1
[ 9.281435] snd_soc_core:soc_check_tplg_fes: sof-essx8336 sof-essx8336: info: override BE DAI link iDisp2
[ 9.281436] snd_soc_core:soc_check_tplg_fes: sof-essx8336 sof-essx8336: info: override BE DAI link iDisp3
[ 9.281437] snd_soc_core:snd_soc_add_pcm_runtime: sof-essx8336 sof-essx8336: ASoC: binding SSP0-Codec
[ 9.281438] snd_soc_core:soc_dai_link_sanity_check: sof-essx8336 sof-essx8336: ASoC: codec component i2c-ESSX8336:00 not found for link SSP0-Codec
[ 9.281440] sof-essx8336 sof-essx8336: snd_soc_register_card failed: -517
plbossart commentedon Aug 25, 2022
that's a completely different issue to the initial gpio issue. This hints at a configuration issue where maybe the codec is not probed.
I don't have any bandwidth to help in the next two weeks, sorry.
tvelazquez commentedon Aug 27, 2022
@plbossart What dumps do you need to do the analysis? acpidump? I would like to provide you with all the information you need. Thanks.
plbossart commentedon Sep 12, 2022
@tvelazquez make sure snd-soc-es8316 is probed and provide the information shown in /sys/kernel/debug/asoc/components
tvelazquez commentedon Sep 12, 2022
@plbossart added some printk at es8316_probe() and es8316_i2c_probe() but dmesg doesn't show it.
/sys/kernel/debug/asoc/components:
0000:00:1f.3
ehdaudio0D2
dmic-codec
snd-soc-dummy
snd-soc-dummy
plbossart commentedon Sep 12, 2022
@tvelazquez can you share the DSDT and also verify that this codec driver is part of the build? Wondering if there is some sort of I2C configuration issue.
tvelazquez commentedon Sep 12, 2022
@plbossart here you have the DSDT
https://github.com/tvelazquez/thesofproject/raw/main/dsdt.dat
https://github.com/tvelazquez/thesofproject/raw/main/dsdt.dsl
16 remaining items
koffiato commentedon Dec 21, 2022
Why is this issue closed?
yangxiaohua2009 commentedon Dec 22, 2022
@tvelazquez Is the codec driver loaded properly? can you see snd_soc_es8316 using
lsmod | grep snd?tvelazquez commentedon Dec 22, 2022
@yangxiaohua2009 the codec driver is loaded.
http://alsa-project.org/db/?f=e8575fee7c036dfff3bb12f6880b6a32037c62f7
tvelazquez commentedon Jan 1, 2023
@yangxiaohua2009 @plbossart What additional tests could I do?
yangxiaohua2009 commentedon Jan 5, 2023
You can see the codec driver in lsmod, but the es8316_i2c_probe fuction is not called, making the probe of sound card failed. can you add print message to make sure the es8316_i2c_probe failed to be called? If so, it's because the dsdt is wrong. Can you show your overriding dsdt table?
tvelazquez commentedon Jan 27, 2023
@yangxiaohua2009 here you have the DSDT
https://github.com/tvelazquez/thesofproject/blob/main/dsdt_override.dat
https://github.com/tvelazquez/thesofproject/blob/main/dsdt_override.dsl
Added a printk at es8316_i2c_probe() but dmesg doesn't show it.
yangxiaohua2009 commentedon Jan 27, 2023
The dsdt looks good but es8316_i2c_probe is not called. Usually when the HID 'ESSX8336' in dsdt matches the ID in es8316.c, es8316_i2c_probe is called.
I also see a device named ESSX8336 in your alsainfo.
Can you see the device
/sys/bus/i2c/devices/i2c-ESSX8336\:00?Can you blacklist and then manuelly probe the module snd_soc_es8316 and snd_soc_sof_es8336 using
modprobeand see what happens?tvelazquez commentedon Jan 27, 2023
@yangxiaohua2009 the device exist:
snd_soc_es8316 and snd_soc_sof_es8336 blacklisted and then manually loaded, but the same result, the es8316_i2c_probe() is not called:
yangxiaohua2009 commentedon Jan 28, 2023
@tvelazquez Can you change the _CRS part and see what happens? Basically I changed the _CRS and _INI part according to working dsl here
cnl_dsdt.zip
If this still not work I have no idea why es8316_i2c_probe failed to be called.
tvelazquez commentedon Jan 31, 2023
@yangxiaohua2009 same result with _CRS & _INI changed. The es8316_i2c_probe failed to be called. This is a nightmare.
@mchehab @plbossart good job with Improve quirks detection for es8336 #4112 I tried mchehab:sound-es8336 with dynamic debug enabled and this is the
dmesg
@plbossart Is fw_state 7 a SOF_FW_CRASHED?
How do I activate the firmware trace?
plbossart commentedon Feb 1, 2023
You're looking at an 'old' kernel code @tvelazquez, state 7 is
@SOF_FW_BOOT_COMPLETE: firmware is booted up and functional
for the trace, you have to keep BIT(0) of the sof_debug parameter set.
plbossart commentedon Feb 1, 2023
btw the quirk detection only works if you are able to probe a codec driver...
koffiato commentedon Oct 7, 2023
I'm assuming there are no updates for this? I wasn't able to get anything to be detected at all.