-
Notifications
You must be signed in to change notification settings - Fork 134
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 D15 headphone and speaker not work #3831
Comments
You are not using the SOF driver! snd_intel_dspcfg: dsp_driver=1 dyndbg= p please remove this option, and read the wiki: |
@plbossart I load the SOF driver and there is no sound card. |
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. 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 |
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 |
@plbossart I add some dev_info:
[ 52.247139] sof-essx8336 sof-essx8336: quirk mask 0x20 http://alsa-project.org/db/?f=5adfb126cedacfecb5bc021097816853ebeb769b |
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. |
@plbossart dynamic debug enabled for gpiolib and add priv->gpio_speakers = NULL; [ 9.281388] sof-essx8336 sof-essx8336: quirk mask 0x20 |
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. |
@plbossart What dumps do you need to do the analysis? acpidump? I would like to provide you with all the information you need. Thanks. |
@tvelazquez make sure snd-soc-es8316 is probed and provide the information shown in /sys/kernel/debug/asoc/components |
@plbossart added some printk at es8316_probe() and es8316_i2c_probe() but dmesg doesn't show it. /sys/kernel/debug/asoc/components: |
@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. |
I don't see anything blantantly wrong in the DSDT @tvelazquez but it's also on the rather convoluted side. I don't see why e.g. there are two addresses for this codec I think only the second one is valid, that's what I see for other devices. I am afraid you'll have to look into other ways to debug why the driver is not probed, or ask @yangxiaohua2009 |
@tvelazquez You can verify it by install i2c-tools and dump the i2c by |
@andy-shev would you happen to know if there's a way to ignore one of the two addresses in ACPI? see above the DSDT contains two addresses for the same codec, this looks wrong? |
@plbossart Thanks for your analysis and support! @yangxiaohua2009 I have never changed the ACPI and I have to study how to do it. No size specified (using byte-data access) |
Why do you think it's a single codec there? We already have an example of two or more codecs in the same device node in ACPI (see serial-multi-instantiate.c for the details). I.o.w. without schematic and datasheet to the codec itself it's hard to say if it's wrong table or driver or something else (might be a multi-functional device, e.g. camera sensor + motion coil + ... but for the audio case). |
@andy-shev we've never seen a form-factor device with e.g. two headset codecs and jacks. This sort of low-cost devices only rely on one codec, that's a safe assumption. Put differently, all the existing devices with this ES8336 rely on a single codec so there's no precedent with two. |
What about multifunction device then? Is it possible to find a schematic of the board? |
@plbossart lt's a longer story behind the two I2C address. We recommand less than two reflow soldering, but the OEM reflow soldering four times. The high temperature causes detachment between bonding wire and the lead frame, making CE pin (I2C address pin) float, so the I2C address becomes float. It may be either 0x10 or 0x11. When they found the problem, tens of thousands has been made so it's impossible to modify the hardware. They then came up with the idea that they can set up two I2C addresses in the ACPI so that the driver can get two I2C addresses. Since at least one of them can work, the CODEC can now work well. The problem was solved later with new chips, and the problematic chips recalled. As a conclusion, the two I2C addresses is just a way to solve I2C failure and only for the specific model, no need to pay special attention for it. |
Thanks for the explanations @yangxiaohua2009. "the codec works well" might be a true statement for the Windows drivers, it's not true for LInux, as measured by es8316_probe() and es8316_i2c_probe() not being invoked (see results from @tvelazquez above), likely due to an earlier error handling in the ACPI or I2C subsystems. |
@jwrdegoede, read above, very interesting case! It also might affect serial-multi-instantiate.c. |
Ugh, this is just so ugly (the 1 codec which will have 1 of 2 possible addresses thing). So the only way I can come up with to solve this would be to
Note doing things this way will break ACPI HID based driver <-> device matching. So this will require the codec driver to get an old fashioned i2c_client_id added to it for the binding to still work. An even uglier alternative would be would be to modify That even uglier approach is probably easier, so it might be a good way to at least get things to work for @tvelazquez . Although if @plbossart has at least 1 similar device, then implementing the addition to ignore_serial_bus_ids + special driver should not be that much work and it should be testable on a device with just 1 i2cresource in the ACPI table. A 3th option would be to just use a DSDT overlay and drop the first I2Cresource. But that is not really a generic fix for other users impacted by the same issue. |
@jwrdegoede, thanks for your ideas! From hw perspective my understanding is that the floating pin can take any state at any time (especially taking into account temperature differences as cold start), the robust solution is to try two addresses for each transaction, and it sounds to me like a dirty hack in I2C core would be needed. But the more I think about this the more I tend to tell users that this hardware is broken for any sane software. |
I tend to agree with @andy-shev, what are the odds that the address used on startup remains functional during a typical 'day use' scenario. In addition I don't have ANY device to test, so can't really help. |
@andy-shev you are right about the floating pin being able to take any value, but this is likely a dual-purpose bootstrap + other-purpose pin. So at power-on-reset it gets read once (the bootstrap) to determine the i2c address and that then gets latched and after that the pin switches to its other purpose which is unused in this design. So the address can be different every boot, but it is stable after boot. I believe that if each transfer would potentially need a different address that things then would not even work under Windows. @plbossart ah I assumed you had at least one alderlake device with an es83x6 in there. Yeah without hardware developing a fix is going to be very hard. |
Still no luck unfortunately, can't get any sound input/output to work. |
@yangxiaohua2009 I compiled https://github.com/thesofproject/linux/tree/es8336-v6.0 and removed the second I2C address, but same results. [ 0.008024] ACPI: DSDT ACPI table found in initrd [kernel/firmware/acpi/dsdt.aml][0x3b562] It seems that now i2cdump works:
|
Why is this issue closed? |
@tvelazquez Is the codec driver loaded properly? can you see snd_soc_es8316 using |
@yangxiaohua2009 the codec driver is loaded. http://alsa-project.org/db/?f=e8575fee7c036dfff3bb12f6880b6a32037c62f7 |
@yangxiaohua2009 @plbossart What additional tests could I do? |
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? |
@yangxiaohua2009 here you have the DSDT Added a printk at es8316_i2c_probe() but dmesg doesn't show it. |
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. Can you see the device |
@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:
|
@tvelazquez Can you change the _CRS part and see what happens? Basically I changed the _CRS and _INI part according to working dsl here If this still not work I have no idea why es8316_i2c_probe failed to be called.
|
@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?
|
You're looking at an 'old' kernel code @tvelazquez, state 7 is for the trace, you have to keep BIT(0) of the sof_debug parameter set. /* Flag definitions used in sof_core_debug (sof_debug module parameter) */
#define SOF_DBG_ENABLE_TRACE BIT(0) |
btw the quirk detection only works if you are able to probe a codec driver... |
I'm assuming there are no updates for this? I wasn't able to get anything to be detected at all. |
@plbossart A few months ago I bought a Huawei Matebook D15 and the sound only works through HDMI.
I have followed this guide https://github.com/thesofproject/linux/wiki/ES8336-support
And I have compiled this branch https://github.com/thesofproject/linux/tree/es8336-v5.19
http://alsa-project.org/db/?f=77cd3bc0e0fa1b6a398e76f454fc11f017b10b4c
The text was updated successfully, but these errors were encountered: