linux
linux copied to clipboard
No sound card detected on custom EHL board with ALC5660I codec on I2S0
The sound is working under Windows 10, but no sound card detected under Linux (kernel 5.11.11 Fedora 33) The ACPI of this board has been changed to use codec ID 10EC5660 instead of the original value INTC1027 (that works under Windows but is not supported under Linux). See attached dsdt.dsl file generated under Linux. dsdt.dsl.gz
At the end of boot I get snd_soc_rt5660 automatically loaded (thanks to ACPI match by snd_soc_acpi_intel_match). But snd_soc_ehl_rt5660 is not. It can be loaded manually but this does not create any available sound card
[root@localhost update]# cat /sys/bus/acpi/devices/10EC5660\:00/status
15
[root@localhost update]# grep CONFIG_SND_SOC_INTEL_EHL_RT5660_MACH /usr/src/kernels/5.11.11-200.fc33.x86_64/.config
CONFIG_SND_SOC_INTEL_EHL_RT5660_MACH=m
[root@localhost update]# uname -r
5.11.11-200.fc33.x86_64
[root@localhost update]#
[root@localhost ~]# lsmod | grep 5660
snd_soc_rt5660 69632 0
snd_soc_rl6231 20480 1 snd_soc_rt5660
snd_soc_core 331776 5 soundwire_intel,snd_sof,snd_soc_rt5660,snd_sof_intel_hda_common,snd_soc_hdac_hda
snd_pcm 135168 12 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,soundwire_intel,snd_sof,snd_soc_rt5660,snd_sof_intel_hda_common,snd_sof_intel_ipc,snd_compress,snd_soc_core,snd_hda_core,snd_pcm_dmaengine
[root@localhost ~]# modprobe snd_soc_ehl_rt5660
[root@localhost ~]# lsmod | grep 5660
snd_soc_ehl_rt5660 24576 0
snd_soc_rt5660 69632 0
snd_soc_rl6231 20480 1 snd_soc_rt5660
snd_soc_core 331776 6 soundwire_intel,snd_sof,snd_soc_rt5660,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_soc_ehl_rt5660
snd_hda_codec 172032 4 snd_hda_codec_hdmi,snd_hda_intel,snd_soc_hdac_hda,snd_soc_ehl_rt5660
snd_hda_core 110592 8 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_soc_ehl_rt5660,snd_sof_intel_hda
snd_pcm 135168 12 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,soundwire_intel,snd_sof,snd_soc_rt5660,snd_sof_intel_hda_common,snd_sof_intel_ipc,snd_compress,snd_soc_core,snd_hda_core,snd_pcm_dmaengine
[root@localhost ~]#
[guest@localhost ~]$ systemctl --user start pulseaudio
[guest@localhost ~]$ arecord -l
arecord: device_list:274: no soundcards found...
[guest@localhost ~]$
Any other verification I can do through /sys or other things for debug ?
@gbuloz can you add this file sof-dyndbg.conf.txt as /etc/modprobe.d/sof-dyndbg.conf and attach the dmesg log (edit: need to reboot)
Can you also provide the results of "ls /sys/bus/pci/devices/0000:00:1f.3/", just to check if you have an elh_rt5660 device added by the SOF driver.
Thanks!
@gbuloz The ACPI table seems OK now. Besides dmesg, please also attach the lspci -vvvv
@plbossart : I've added the .conf file and power-cycled
[root@localhost ~]# ls -l /etc/modprobe.d/sof-dyndbg.conf
-rw-r--r--. 1 root root 2485 11 juin 10:25 /etc/modprobe.d/sof-dyndbg.conf
shutdown+power-cycle dmesg.log (edit : I see no debug message in dmesg output, however I have CONFIG_DYNAMIC_DEBUG=y and /sys/kernel/debug/dynamic_debug/control shows many =p so I should get some debug message)
[root@localhost ~]# ls /sys/bus/pci/devices/0000:00:1f.3/
ari_enabled driver link power_state subsystem
broken_parity_status driver_override local_cpulist remove subsystem_device
class enable local_cpus rescan subsystem_vendor
config firmware_node modalias resource supplier:pci:0000:00:02.0
consistent_dma_mask_bits hdaudioC0D2 msi_bus resource0 uevent
d3cold_allowed index msi_irqs resource4 vendor
device irq numa_node revision
dma_mask_bits label power sound
@libinyang : Here is the output of lspci -vvvv lspcivvvv.log Note : I got the following error :
[root@localhost ~]# lspci -vvvv > lspcivvvv.log
pcilib: sysfs_read_vpd: read failed: Input/output error
@gbuloz the results show that there is no machine device created, so no machine driver probed.
Without dynamic debug it's going to be hard to figure things out. Not sure if this is a configuration issue, maybe try using our setup in https://github.com/thesofproject/kconfig and run https://github.com/thesofproject/kconfig/blob/master/kconfig-sof-default.sh to generate a .config. This may or may not work on your platform due to other dependencies. This config is just a minimal one for our own tests and a reference to see what options we enable.
@plbossart : I've been able to get some debug and got "sof-audio-pci 0000:00:1f.3: error: cl_copy_fw: timeout HDA_DSP_SRAM_REG_ROM_STATUS read" See dmesg : dmesg_3.log
I still don't know why dynamic debug did not wotk for snd/sof modules but was working for other drivers. I'm wondering if the modules where running enough to produce at least some debug messages. To be sure I've rebuilt all modules under sound/ (318 modules) with dev_dbg changed to dev_info and pr_debug to pr_info and installed them under updates/, then ran depmod -a and ran dracut -f (because 3 snd modules where in initramfs; now I have many). This gave me an error while still under initramfs about intel/sof/sof-ehl.ri missing, so I added this file to initramfs. And this leads to the full dmesg above.
@gbuloz this error typically indicates that the firmware you used was not signed with the key that is known to the CSME (ME) engine. Can you please clarify which SOF firmware you used?
I am also not sure if the results make sense, the errors you see are logged with dev_err, so they would be seen by default. dynamic debug is only useful when we have dev_dbg() in the code.
Weird.
@plbrossart : I use only the standard packages from Fedora repos. Currently alsa-sof-firmware-1.6.1-4.fc33.noarch providing the firmware like this :
[root@localhost ~]# ls -l /usr/lib/firmware/intel/sof/sof-ehl.ri /usr/lib/firmware/intel/sof/intel-signed/sof-ehl.ri
-rw-r--r--. 1 root root 360448 4 mars 09:28 /usr/lib/firmware/intel/sof/intel-signed/sof-ehl.ri
lrwxrwxrwx. 1 root root 23 12 mars 20:28 /usr/lib/firmware/intel/sof/sof-ehl.ri -> intel-signed/sof-ehl.ri
And I also don't understand why I did not get these dev_err message before I rebuild all modules under sound/ and install them under updates. I've built them with the same .config than the Fedora distribution, but out-of-tree. I still also don't understand why the dynamic debug didi not work for snd/sof modules using your sof-dyndbg.conf but worked for other modules for which I added entries in the same sof-dyndbg.conf. I've even added this file to initramfs for testing but this did not help.
@gbuloz could you try /usr/lib/firmware/intel/sof/sof-ehl.ri -> community/sof-ehl.ri
I don't know if this was released but that would be the alternate key that's typically used.
@plbrossart : unfortunately I have no community subdir, but only a public-signed/ and there's no file for EHL in it : sof-apl.ri sof-cnl.ri sof-icl.ri sof-jsl.ri sof-tgl-h.ri sof-tgl.ri
Edit : I've tried with https://github.com/thesofproject/sof-bin/blob/main/v1.8.x/sof-v1.8-rc2/intel-signed/sof-ehl.ri but same result. Edit : I need to blacklist pinctrl_elkhartlake on my platform to prevent a kernel oops (https://bugzilla.redhat.com/show_bug.cgi?id=1948468) leading to a very long boot time. This problem is still present with kernel 5.12.9. But it seems the SOF firmware download does not behave the same way with or without pinctrl_elkhartlake blacklisted. I don't know if it's related or just a side effect. See dmesg_5129_3pinctl.log (not blacklisted) and dmesg_5129_3nopinctl.log (blacklisted) dmesg_5129_3pinctl.log dmesg_5129_3nopinctl.log
@libinyang : your debug firmware works much better than the prod one dmesg_prod.log dmesg_debug.log With the debug one I now get :
[root@localhost ~]# lsmod | grep 5660
snd_soc_ehl_rt5660 24576 0
snd_hda_codec 172032 4 snd_hda_codec_hdmi,snd_hda_intel,snd_soc_hdac_hda,snd_soc_ehl_rt5660
snd_soc_rt5660 69632 0
snd_hda_core 110592 8 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_soc_ehl_rt5660,snd_sof_intel_hda
snd_soc_rl6231 20480 1 snd_soc_rt5660
snd_soc_core 331776 7 soundwire_intel,snd_sof,snd_soc_rt5660,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_soc_dmic,snd_soc_ehl_rt5660
snd_pcm 135168 11 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,soundwire_intel,snd_sof,snd_soc_rt5660,snd_sof_intel_hda_common,snd_compress,snd_soc_core,snd_hda_core,snd_pcm_dmaengine
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# ls /sys/bus/pci/devices/0000:00:1f.3/
ari_enabled d3cold_allowed driver_override index local_cpus power resource0 subsystem_vendor
broken_parity_status device ehdaudio0D2 irq modalias power_state resource4 supplier:pci:0000:00:02.0
class dma_mask_bits ehl_rt5660 label msi_bus remove revision uevent
config dmic-codec enable link msi_irqs rescan subsystem vendor
consistent_dma_mask_bits driver firmware_node local_cpulist numa_node resource subsystem_device
I have currently no access to desktop to check if I have new input/output channels, but only have access to text console. Which command do recommand to check ? I've tried with "systemctl --user start pulseaudio" then "arecord -l" but I get "arecord: device_list:274: no soundcards found.."
Please also note my platform is equipped with a CPU sample and that I've been heard from my HW team that the production processors will require some software updates. Could this explain the signature problem with the SOF firmware ?
@gbuloz yes, when you receive production devices the firmware is required to use production keys for authentication. It looks like you are in a gray area here.
I can see that the device '/sys/bus/pci/devices/0000:00:1f.3/ehl_rt5660' is created, which is good and expected. Somehow the card is not created though.
if you can't figure out how to enable dynamic debug, you can try a manual probe:
add 'blacklist snd_soc_ehl_rt5660' in /etc/modprobe.d/alsa-base.conf boot as usual echo 8 > /proc/sys/kernel/printk dmesg -C modprobe snd_soc_ehl_rt5660
I've rebuilt all sound modules with pr_debug changed to pr_info and dev_dbg to dev_info and now I get this at boot time "ehl_rt5660 ehl_rt5660: ASoC: codec component i2c-10EC5660:00 not found for link SSP0-Codec" See full dmesg : dmesg_debug_dbg.log
@gbuloz can you check if the device exists
cat /sys/bus/acpi/devices/i2c-10EC5660:*/status
No it does not exist. Even nothing with : ls /sys/bus/acpi/devices/i*
try
cat /sys/bus/acpi/devices/*10EC5660:*/status
[root@localhost ~]# cat /sys/bus/acpi/devices/*10EC5660:*/status
15
ls -l /sys/bus/acpi/devices/10EC5660: then?
[root@localhost ~]# ls -l /sys/bus/acpi/devices/10EC5660:*
lrwxrwxrwx. 1 root root 0 15 juin 18:04 /sys/bus/acpi/devices/10EC5660:00 -> ../../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:56/10EC5660:00
[root@localhost ~]# ls -l /sys/bus/acpi/devices/10EC5660:00/
total 0
-r--r--r--. 1 root root 4096 15 juin 18:05 hid
-r--r--r--. 1 root root 4096 15 juin 18:05 modalias
-r--r--r--. 1 root root 4096 15 juin 18:05 path
lrwxrwxrwx. 1 root root 0 15 juin 18:05 physical_node -> ../../../../../pci0000:00/0000:00:15.3/i2c_designware.1/i2c-1/i2c-10EC5660:00
drwxr-xr-x. 2 root root 0 15 juin 18:05 power
-r--r--r--. 1 root root 4096 15 juin 18:04 status
lrwxrwxrwx. 1 root root 0 15 juin 18:04 subsystem -> ../../../../../../bus/acpi
-rw-r--r--. 1 root root 4096 15 juin 18:04 uevent
-r--r--r--. 1 root root 4096 15 juin 18:05 uid
ok, let's try to see if the components were registered:
cat /sys/kernel/debug/asoc/components
cat /sys/kernel/debug/asoc/dais
[root@localhost ~]# cat /sys/kernel/debug/asoc/components
0000:00:1f.3
ehdaudio0D2
dmic-codec
snd-soc-dummy
snd-soc-dummy
[root@localhost ~]# cat /sys/kernel/debug/asoc/dais
SSP0 Pin
SSP1 Pin
SSP2 Pin
SSP3 Pin
SSP4 Pin
SSP5 Pin
DMIC01 Pin
DMIC16k Pin
iDisp1 Pin
iDisp2 Pin
iDisp3 Pin
iDisp4 Pin
Analog CPU DAI
Digital CPU DAI
Alt Analog CPU DAI
Analog Codec DAI
Digital Codec DAI
Alt Analog Codec DAI
intel-hdmi-hifi1
intel-hdmi-hifi2
intel-hdmi-hifi3
intel-hdmi-hifi4
dmic-hifi
snd-soc-dummy-dai
ok, so something happens in the probe of the snd_soc_rt5660 driver, the required components were not registered with ASoC.
you'll have to instrument rt5660_i2c_probe() to see what happens.
I've added several dev_info() into this function (including at first line where I also have a printk) but I get not output as if the probe was not run. No message at boot time, nor with rmmod+insmod once booted.
@gbuloz it's clearly a problem that's not due to SOF then...
Either the ACPI subsystem is unable to probe this device, or there is a conflict, or the BIOS is wrong.
You may also need to use i2cdetect to make sure that there's really an I2c device that matches the address listed in the BIOS.
@gbuloz Based on the information:
physical_node -> ../../../../../pci0000:00/0000:00:15.3/i2c_designware.1/i2c-1/i2c-10EC5660:00
The codec is located on i2c-1.
However on my CRB, the codec is located on i2c-5, addr: 0x1c
Could you run:
sudo i2cdetect -y -r 5
to check whether i2c-5 has device, and if i2c-5 0x1c shows a device, please run
sudo i2cdump -y 5 0x1c w
and attach the output
Yes, it is really on i2c-1 and its device ID is correct (0x6338). I've also tried to instantiate the I2C device with /sys/bus/i2c/devices/i2c-1/new_device but I got a device busy error but i2cdetect does not report UU at device address. But maybe this is normal for this device. See probes and dump : i2c.log
Are you sure the DSDT is correct? I see this:
Scope (_SB.PC00.I2C2)
{
Device (HDAC)
{
Name (_HID, "INT00000") // _HID: Hardware ID
Name (_CID, "INT00000") // _CID: Compatible ID
Name (_DDN, "Intel(R) Smart Sound Technology Audio Codec") // _DDN: DOS Device Name
Name (_UID, One) // _UID: Unique ID
Name (CADR, Zero)
Name (CDIS, Zero)
Name (_SUB, "10EC0001") // _SUB: Subsystem ID
Method (_INI, 0, NotSerialized) // _INI: Initialize
{
If ((I2SC == One))
{
_HID = "INT34C2"
_CID = "INT34C2"
CADR = 0x1C
Return (Zero)
}
If ((I2SC == 0x02))
{
_HID = "10EC5660"
_CID = "10EC5660"
CADR = 0x1C
Return (Zero)
}
}
Scope (_SB.PC00.I2C2) <<< is this the right controller?
Yes, I also suspected the DSDT. However I was confident thanks to the multiple declarations of 10EC5660 for the following contexts : (I2SB == Zero) + Scope (_SB.PC00.I2C0) (I2SB == One) + Scope (_SB.PC00.I2C1) (I2SB == 0x02) + Scope (_SB.PC00.I2C2) (I2SB == 0x03) + Scope (_SB.PC00.I2C3) (I2SB == 0x04) + Scope (_SB.PC00.I2C4) (I2SB == 0x05) + Scope (_SB.PC00.I2C5) I also though this was to deal with a possible change in i2c-x bus number across Linux boots. But I must admit I'm lost and don't know what to change.
@gbuloz Yes, I also suspect that the hw topology changed but the ACPI didn't change correctly correspondingly.
Could you apply the below patch and see whether the acpi export the correct device id?
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 5a97e4a02fa2..cd111b285b5a 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -123,8 +123,10 @@ static int i2c_device_match(struct device *dev, struct device_driver *drv)
return 1;
/* Then ACPI style match */
- if (acpi_driver_match_device(dev, drv))
+ if (acpi_driver_match_device(dev, drv)) {
+ dev_info(dev, "i2c client %#x matched\n", client->addr);
return 1;
+ }
driver = to_i2c_driver(drv);
@@ -960,6 +962,7 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf
}
}
+ dev_info(&client->dev, "in %s %d, addr: %#x, name: %s, adapter %s (%d)\n", __func__, __LINE__, client->addr, client->name, client->adapter->name, client->adapter->nr);
status = device_register(&client->dev);
if (status)
goto out_remove_swnode;
diff --git a/sound/soc/codecs/rt5660.c b/sound/soc/codecs/rt5660.c
index 33ff9156358b..687754cc5a07 100644
--- a/sound/soc/codecs/rt5660.c
+++ b/sound/soc/codecs/rt5660.c
@@ -1274,6 +1274,7 @@ static int rt5660_i2c_probe(struct i2c_client *i2c,
int ret;
unsigned int val;
+ dev_err(&i2c->dev, "in %s %d\n", __func__, __LINE__);
rt5660 = devm_kzalloc(&i2c->dev, sizeof(struct rt5660_priv),
GFP_KERNEL);
@libinyang : see the dmesg with debug from i2c-core-base.c, but still no debug coming from rt5660.c. dmesg_i2cdbg.log I see the i2c_new_client_device is called for 10EC5660:00 while still running from initramfs in which I have no snd* driver. I also see many "i2c client 0x1c matched".
[root@localhost ~]# dmesg | egrep 'matched|addr:|sysroot.mount'
[ 5.101190] i2c i2c-10EC5660:00: in i2c_new_client_device 925, addr: 0x1c, name: 10EC5660:00, adapter Synopsys DesignWare I2C adapter (1)
[ 13.323593] systemd[1]: sysroot.mount: Succeeded.
[ 14.217060] i2c 14-0050: in i2c_new_client_device 925, addr: 0x50, name: ee1004, adapter SMBus I801 adapter at efa0 (14)
[ 14.314799] i2c i2c-10EC5660:00: i2c client 0x1c matched
[ 14.454974] i2c i2c-10EC5660:00: i2c client 0x1c matched
[ 14.462075] i2c 14-0036: in i2c_new_client_device 925, addr: 0x36, name: dummy, adapter SMBus I801 adapter at efa0 (14)
[ 14.492171] i2c i2c-10EC5660:00: i2c client 0x1c matched
[ 14.498250] i2c 14-0037: in i2c_new_client_device 925, addr: 0x37, name: dummy, adapter SMBus I801 adapter at efa0 (14)
[ 14.509598] i2c i2c-10EC5660:00: i2c client 0x1c matched
[ 14.522557] i2c i2c-10EC5660:00: i2c client 0x1c matched
[ 14.548691] i2c i2c-10EC5660:00: i2c client 0x1c matched
[ 14.611604] i2c i2c-10EC5660:00: i2c client 0x1c matched
[ 14.673506] i2c i2c-10EC5660:00: i2c client 0x1c matched
[ 14.745276] i2c i2c-10EC5660:00: i2c client 0x1c matched
[ 15.011683] i2c i2c-10EC5660:00: i2c client 0x1c matched
@gbuloz The i2c client is registered correctly and it matched its driver. But the rt5660 probe() is not called. This is so weird. I'm almost have no idea. Let's dump the what happens in dd. Could you apply the below patch:
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index ecd7cf848daf..8b52933660fe 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -379,7 +379,7 @@ static void driver_bound(struct device *dev)
return;
}
- pr_debug("driver: '%s': %s: bound to device '%s'\n", dev->driver->name,
+ pr_err("driver: '%s': %s: bound to device '%s'\n", dev->driver->name,
__func__, dev_name(dev));
klist_add_tail(&dev->p->knode_driver, &dev->driver->p->klist_devices);
@@ -749,7 +749,7 @@ static int driver_probe_device(struct device_driver *drv, struct device *dev)
return -ENODEV;
dev->can_match = true;
- pr_debug("bus: '%s': %s: matched device %s with driver %s\n",
+ pr_err("bus: '%s': %s: matched device %s with driver %s\n",
drv->bus->name, __func__, dev_name(dev), drv->name);
pm_runtime_get_suppliers(dev);
@@ -864,6 +864,9 @@ static int __device_attach_driver(struct device_driver *drv, void *_data)
if (async_allowed)
data->have_async = true;
+ pr_err("driver: '%s': %s: bound to device '%s'\n", drv->name,
+ __func__, dev_name(dev));
+
if (data->check_async && async_allowed != data->want_async)
return 0;
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index cd111b285b5a..302ae44adef1 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -466,6 +466,7 @@ static int i2c_device_probe(struct device *dev)
struct i2c_driver *driver;
int status;
+ dev_info(dev, "in %s %d, i2c client %s (%#x) enter probe\n", __func__, __LINE__, client->name, client->addr);
if (!client)
return 0;
@@ -553,6 +554,7 @@ static int i2c_device_probe(struct device *dev)
* When there are no more users of probe(),
* rename probe_new to probe.
*/
+ dev_info(dev, "in %s %d, i2c client %s (%#x) start probe\n", __func__, __LINE__, client->name, client->addr);
if (driver->probe_new)
status = driver->probe_new(client);
else if (driver->probe)