Bug 201251 - Enable the digital microphone (DMIC) of Intel audio controller [8086:9dc8]
Summary: Enable the digital microphone (DMIC) of Intel audio controller [8086:9dc8]
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: Intel Linux
: P1 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-27 05:58 UTC by jian-hong
Modified: 2019-11-14 15:27 UTC (History)
25 users (show)

See Also:
Kernel Version: 4.19
Tree: Mainline
Regression: No


Attachments
alsa info (34.49 KB, text/plain)
2018-09-27 06:04 UTC, jian-hong
Details
Intenal MIC on Windows (67.88 KB, image/jpeg)
2018-09-27 06:11 UTC, jian-hong
Details
Internal speaker uses Realtek driver on Windows (52.05 KB, image/jpeg)
2018-09-27 06:12 UTC, jian-hong
Details
Other MICs use Realtek driver on Windows (66.67 KB, image/jpeg)
2018-09-27 06:14 UTC, jian-hong
Details
dmesg with snd_hda_intel (64.92 KB, text/plain)
2018-09-27 06:28 UTC, jian-hong
Details
dmesg without snd_hda_intel (65.51 KB, text/plain)
2018-09-27 06:41 UTC, jian-hong
Details
Intel SST driver's Device instance path on Windows (56.94 KB, image/jpeg)
2018-09-27 06:54 UTC, jian-hong
Details
acpidump (1.70 MB, text/plain)
2018-09-27 07:43 UTC, jian-hong
Details
dmesg with Skylake driver w/ latest ASoC code (62.19 KB, text/plain)
2018-10-26 22:54 UTC, Pierre Bossart
Details
topology file (22.59 KB, application/octet-stream)
2018-10-26 23:02 UTC, Pierre Bossart
Details
Acer Z24-890 acpidump output (1.62 MB, text/plain)
2018-11-23 05:55 UTC, Chris Chiu
Details
Acer Z24-890 lspci output (6.64 KB, text/plain)
2018-11-23 05:56 UTC, Chris Chiu
Details
Acer Z24-890 dmesg of for-next branch (57.56 KB, text/plain)
2018-11-23 05:58 UTC, Chris Chiu
Details
dmesg with sound/soc DEBUG enabled (58.44 KB, text/plain)
2018-11-27 13:59 UTC, Chris Chiu
Details
DSDT table of Z24-890 (2.02 MB, text/x-csrc)
2018-11-27 14:00 UTC, Chris Chiu
Details
Acer Z24-890 dmesg w/ initcall_debug (166.21 KB, text/plain)
2018-11-28 14:22 UTC, Chris Chiu
Details
Acer Z24-890 dmesg for intel-sst hdaudio (60.14 KB, text/plain)
2018-11-29 07:14 UTC, Chris Chiu
Details
Acer Z24-890 dsp_fw_cnl.bin (570.17 KB, application/macbinary)
2018-11-30 06:48 UTC, Chris Chiu
Details
Acer Z24-890 dmesg for cnl_v1858 dw (60.51 KB, text/plain)
2018-12-04 14:05 UTC, Chris Chiu
Details
Acer Z24-890 dmesg for windows fw (63.73 KB, text/plain)
2018-12-04 14:06 UTC, Chris Chiu
Details
dmesg of Acer Crux (55.02 KB, text/plain)
2019-01-23 08:44 UTC, jian-hong
Details
alsa-info with Mark Brown's for-next kernel (HDA quirk) (39.02 KB, text/plain)
2019-01-24 05:10 UTC, jian-hong
Details
alsa-info with Mark Brown's for-next kernel with snd_soc_skl for Comment 52 (5.09 KB, text/plain)
2019-01-24 05:31 UTC, jian-hong
Details
dmesg with Mark Brown's for-next kernel with snd_soc_skl for Comment 53 (52.79 KB, text/plain)
2019-01-24 05:33 UTC, jian-hong
Details
alsa-info with Mark Brown's for-next kernel with snd_soc_skl and v1858.bin (30.47 KB, text/plain)
2019-01-25 05:10 UTC, jian-hong
Details
dmesg with Mark Brown's for-next kernel with snd_soc_skl and v1858.bin for Comment 56 (55.14 KB, text/plain)
2019-01-25 05:13 UTC, jian-hong
Details
dmesg with Mark Brown's for-next kernel with snd_soc_skl and v1858.bin - no backend DAIs (55.14 KB, text/plain)
2019-01-28 09:56 UTC, jian-hong
Details
dmesg of (61.05 KB, text/plain)
2019-07-26 08:11 UTC, jian-hong
Details
topology file for HDaudio platforms with 2 DMICs (41.85 KB, application/octet-stream)
2019-07-26 16:11 UTC, Pierre Bossart
Details
topology file for HDaudio platforms with 4 DMICs (41.99 KB, application/octet-stream)
2019-07-26 16:12 UTC, Pierre Bossart
Details
config to test SOF w/ DMIC support (138.38 KB, text/plain)
2019-07-26 20:00 UTC, Pierre Bossart
Details
dmesg SOF 5.3-rc1 z24-890 (64.01 KB, text/plain)
2019-07-29 06:45 UTC, jian-hong
Details
alsa-info SOF 5.3-rc1 z24-890 of comment #76 (34.64 KB, text/plain)
2019-07-29 06:47 UTC, jian-hong
Details
Screenshot of Audacity for internal DMIC on z24-890 (66.68 KB, image/png)
2019-07-30 06:16 UTC, jian-hong
Details
dmesg recording from SOF 5.3-rc1 z24-890 (63.53 KB, text/plain)
2019-07-30 06:42 UTC, jian-hong
Details
alsa-info spectre x360 (36.36 KB, text/plain)
2019-08-14 00:41 UTC, Tristan Mahe
Details
patch to compile for-next branch as of commit da84c03c03cfadffe00f72f83ea9f556b903f565 (1.02 KB, patch)
2019-08-14 03:54 UTC, Tristan Mahe
Details | Diff
alsa-info for working speakers / still no dmic working though (34.84 KB, text/plain)
2019-08-14 04:17 UTC, Tristan Mahe
Details
dmesg with sof ddebug activated (98.16 KB, text/plain)
2019-08-14 17:19 UTC, Tristan Mahe
Details
latest HDaudio topology files (7.58 KB, application/gzip)
2019-08-14 17:32 UTC, Pierre Bossart
Details
dmesg while speaker-test -c 4 (14.97 KB, application/gzip)
2019-08-14 19:02 UTC, Tristan Mahe
Details
dmesg without all the traces (99.22 KB, text/plain)
2019-08-14 21:18 UTC, Tristan Mahe
Details
kernel config 5.4.0-rc7 Arch not working (236.71 KB, text/plain)
2019-11-14 14:04 UTC, Robert
Details

Description jian-hong 2018-09-27 05:58:02 UTC
We have an Acer SWIFT laptop equipped with Intel Whiskey Lake CPU and Intel audio controller [8086:9dc8].

00:1f.3 Multimedia audio controller [0401]: Intel Corporation Device [8086:9dc8] (rev 30)
	Subsystem: Acer Incorporated [ALI] Device [1025:129c]
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 32, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 133
	Region 0: Memory at a1110000 (64-bit, non-prefetchable) [size=16K]
	Region 4: Memory at a1000000 (64-bit, non-prefetchable) [size=1M]
	Capabilities: [50] Power Management version 3
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0-,D1-,D2-,D3hot+,D3cold+)
		Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [80] Vendor Specific Information: Len=14 <?>
	Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
		Address: 00000000fee10004  Data: 4023
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel, snd_soc_skl

We get information from installed Windows that the internal MIC is a Microphone Array - Front Panel Digital Jack using the Intel Smart Sound Technology (Intel SST) driver.  So, we tried to reconfigure the Pin Node ID 0x12's default value as
Comment 1 jian-hong 2018-09-27 06:04:03 UTC
Created attachment 278783 [details]
alsa info

So, we tried to reconfigure the Pin Node ID 0x12's default value as 0x90a60120 (also tried NID 0x13) of ALC256.  But the internal microphone still cannot be used.  It only records white noise.
Comment 2 jian-hong 2018-09-27 06:11:32 UTC
Created attachment 278785 [details]
Intenal MIC on Windows

Microphone Array - Front Panel Digital Jack uses Intel Smart Sound Technology (Intel SST) driver.
Comment 3 jian-hong 2018-09-27 06:12:44 UTC
Created attachment 278787 [details]
Internal speaker uses Realtek driver on Windows
Comment 4 jian-hong 2018-09-27 06:14:42 UTC
Created attachment 278789 [details]
Other MICs use Realtek driver on Windows

All of the audio things use Realtek driver, except internal microphone on Windows.
Comment 5 jian-hong 2018-09-27 06:28:08 UTC
Created attachment 278791 [details]
dmesg with snd_hda_intel

I also notice the PCI ID [8086:9dc8] is listed in sound/soc/intel/skylake/skl.c which is related to Intel SST on Linux.

Therefore, I add some debug messages to trace the code path intel sound skylake which is based on 4.19-rc5

diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index 1d17be0f78a0..aac57b69459b 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -503,6 +503,7 @@ static int skl_machine_device_register(struct skl *skl)
        struct platform_device *pdev;
        int ret;
 
+       dev_warn(bus->dev, "%s\n", __func__);
        pdev = platform_device_alloc(mach->drv_name, -1);
        if (pdev == NULL) {
                dev_err(bus->dev, "platform device alloc failed\n");
@@ -536,6 +537,7 @@ static int skl_dmic_device_register(struct skl *skl)
        struct platform_device *pdev;
        int ret;
 
+       dev_warn(bus->dev, "%s\n", __func__);
        /* SKL has one dmic port, so allocate dmic device for this */
        pdev = platform_device_alloc("dmic-codec", -1);
        if (!pdev) {
@@ -639,6 +641,7 @@ static int probe_codec(struct hdac_bus *bus, int addr)
        struct skl *skl = bus_to_skl(bus);
        struct hdac_device *hdev;
 
+       dev_warn(bus->dev, "%s\n", __func__);
        mutex_lock(&bus->cmd_mutex);
        snd_hdac_bus_send_cmd(bus, cmd);
        snd_hdac_bus_get_response(bus, addr, &res);
@@ -659,6 +662,7 @@ static void skl_codec_create(struct hdac_bus *bus)
 {
        int c, max_slots;
 
+       dev_warn(bus->dev, "%s\n", __func__);
        max_slots = HDA_MAX_CODECS;
 
        /* First try to probe all given codec slots */
@@ -718,6 +722,7 @@ static void skl_probe_work(struct work_struct *work)
        struct hdac_ext_link *hlink = NULL;
        int err;
 
+       dev_warn(bus->dev, "%s\n", __func__);
        if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) {
                err = skl_i915_init(bus);
                if (err < 0)
@@ -804,6 +809,7 @@ static int skl_create(struct pci_dev *pci,
        }
 
        bus = skl_to_bus(skl);
+       dev_warn(bus->dev, "%s\n", __func__);
        snd_hdac_ext_bus_init(bus, &pci->dev, &bus_core_ops, io_ops, NULL);
        bus->use_posbuf = 1;
        skl->pci = pci;
@@ -823,6 +829,7 @@ static int skl_first_init(struct hdac_bus *bus)
        unsigned short gcap;
        int cp_streams, pb_streams, start_idx;
 
+       dev_warn(bus->dev, "%s\n", __func__);
        err = pci_request_regions(pci, "Skylake HD audio");
        if (err < 0)
                return err;
@@ -888,6 +895,7 @@ static int skl_probe(struct pci_dev *pci,
        struct hdac_bus *bus = NULL;
        int err;
 
+       pr_warn("snd_soc_skl: %s\n", __func__);
        /* we use ext core ops, so provide NULL for ops here */
        err = skl_create(pci, NULL, &skl);
        if (err < 0)
@@ -898,7 +906,7 @@ static int skl_probe(struct pci_dev *pci,
        err = skl_first_init(bus);
        if (err < 0)
                goto out_free;
-
+       dev_warn(bus->dev, "%s\n", __func__);
        skl->pci_id = pci->device;
 
        device_disable_async_suspend(bus->dev);

However, there is no related message shown in dmesg.  The snd_soc_skl is loaded, but skl_probe() is not called.
Comment 6 jian-hong 2018-09-27 06:41:25 UTC
Created attachment 278793 [details]
dmesg without snd_hda_intel

According to comment 5, I add "modprobe.blacklist=snd_hda_intel" to boot command to disable snd_hda_intel module.

skl_probe() function is called now, but it cannot find a driver.

[    8.612356] snd_soc_skl: skl_probe
[    8.612371] snd_soc_skl 0000:00:1f.3: enabling device (0000 -> 0002)
[    8.612550] (NULL device *): skl_create
[    8.612552] snd_soc_skl 0000:00:1f.3: skl_first_init
[    8.621218] snd_soc_skl 0000:00:1f.3: skl_probe
[    8.622230] snd_soc_skl 0000:00:1f.3: No matching machine driver found
Comment 7 jian-hong 2018-09-27 06:54:29 UTC
Created attachment 278795 [details]
Intel SST driver's Device instance path on Windows

According to comment 4, we also notice the Device instance path on Windows is: 
INTELAUDIO\CTLR_DEV_9DC8&LINKTYPE_02&DEVTYPE_01&VEN_8086&DEV_AE20&SUBSYS_1025129C&REV_10EC\5&394DE642&0&0100
Comment 8 jian-hong 2018-09-27 07:43:23 UTC
Created attachment 278799 [details]
acpidump

After disassemble the ACPI dump, the subsystem PCI ID [1025:129C], also listed in comment 7, is in NHLT part.  However, it is only Raw Table Data now.

/*
 * Intel ACPI Component Architecture
 * AML/ASL+ Disassembler version 20160831-64
 * Copyright (c) 2000 - 2016 Intel Corporation
 * 
 * Disassembly of nhlt.dat, Wed Sep 26 16:31:06 2018
 *
 * ACPI Data Table [NHLT]
 *
 * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue
 */

[000h 0000   4]                    Signature : "NHLT"    
[004h 0004   4]                 Table Length : 0000185C
[008h 0008   1]                     Revision : 00
[009h 0009   1]                     Checksum : 46
[00Ah 0010   6]                       Oem ID : "ACRSYS"
[010h 0016   8]                 Oem Table ID : "ACRPRDCT"
[018h 0024   4]                 Oem Revision : 00000002
[01Ch 0028   4]              Asl Compiler ID : "    "
[020h 0032   4]        Asl Compiler Revision : 01000013


**** Unknown ACPI table signature [NHLT]


Raw Table Data: Length 6236 (0x185C)

  0000: 4E 48 4C 54 5C 18 00 00 00 46 41 43 52 53 59 53  // NHLT\....FACRSYS
  0010: 41 43 52 50 52 44 43 54 02 00 00 00 20 20 20 20  // ACRPRDCT....    
  0020: 13 00 00 01 01 2F 18 00 00 02 00 86 80 20 AE EC  // ...../....... ..
  0030: 10 9C 12 25 10 01 01 00 5C 00 00 00 00 01 0F 04  // ...%....\.......
  0040: 01 04 00 00 DE FF 64 00 04 28 00 00 00 00 C4 FF  // ......d..(......
  0050: 3C 00 C4 FF 3C 00 01 04 00 00 1A 00 64 00 04 28  // <...<.......d..(
...
Comment 9 Daniel Drake 2018-10-02 08:04:29 UTC
https://www.pcworld.com/article/3300798/intel/intels-whiskey-lake-notebook-chip-launches-emphasizing-connectivity.html

> Intel also added a new quad-core audio DSP, designed to be used in
> conjunction 
> with far-field mics on laptops. Though Windows 10 has included the Cortana
> digital assistant since its inception, Amazon and Microsoft have finalized
> their partnership to put Alexa on to Windows PCs, as well. 

We believe that's why this config has appeared in this product, the first one we've seen that has the mic device not as part of HDA.

But it sounds like it won't be the only product that appears in this way. In addition to figuring out how to make the existing SST driver detect and work with this mic array, it seems like we will need to find a way to allow both HDA and SST drivers to bind to the same PCI device.
Comment 10 Pierre Bossart 2018-10-22 17:54:48 UTC
Thanks for the information.
The only way to enable DMIC support with HDA is to enable the DSP support. If you use the legacy HDaudio driver you will not be able to access the DSP.

So far, the only users of the DMIC were also using I2S, so there was a clear distinction between the HDaudio world and the DMIC/I2S world. With new products based on HDAudio + DMIC this is no longer the case.

However things are not that bad. Intel worked on enabling HDAudio + DSP and the patches were merged by Mark Brown so should be queued for 4.20 or 5.0. We have not however tested the DMIC path. 

Would you mind providing the references of the ACER device, I'll try to get one purchased to solve this.
Comment 11 Daniel Drake 2018-10-23 00:54:41 UTC
It's Acer Swift SF314-55. Let me know if you have trouble getting hold of it.
Comment 12 Pierre Bossart 2018-10-23 02:48:25 UTC
Humm, yes it looks difficult to find, AnandTech tells me this model will be for sale in November. Even on the Acer site it's SF314-51..54 that's for sale at the moment, the 55 is not even listed.
Comment 13 Pierre Bossart 2018-10-26 19:28:58 UTC
just to confirm, the probe does happen with skl_hda_probe:

[    8.612356] snd_soc_skl: skl_probe
[    8.612371] snd_soc_skl 0000:00:1f.3: enabling device (0000 -> 0002)
[    8.612550] (NULL device *): skl_create
[    8.612552] snd_soc_skl 0000:00:1f.3: skl_first_init
[    8.621218] snd_soc_skl 0000:00:1f.3: skl_probe
[    8.622230] snd_soc_skl 0000:00:1f.3: No matching machine driver found

but it since you are missing the HDaudio card support w/ the SKL driver the probe stops. I'll give it a try with the updated code
Comment 14 Pierre Bossart 2018-10-26 22:54:47 UTC
Created attachment 279181 [details]
dmesg with Skylake driver w/ latest ASoC code

The log show the probe progresses but stops due to a firmware download issue and there is also an error message during the DMIC NHLT parsing. Both issues will have to involve people smarter than me.
Comment 15 Pierre Bossart 2018-10-26 23:01:07 UTC
My latest code is at https://github.com/plbossart/sound/tree/debug/skl

a dedicated topology file is required (will attach)

kernel config for SST: https://github.com/thesofproject/kconfig/blob/master/sst-defconfig
Comment 16 Pierre Bossart 2018-10-26 23:02:54 UTC
Created attachment 279183 [details]
topology file

needs to be copied as /lib/firmware/dfw_sst.bin
Comment 17 Pierre Bossart 2018-11-02 18:39:30 UTC
I am able to play audio on the speakers by 
a) using Mark Brown's for-next branch
b) using the topology file described in Comment 16
c) install and boot, then set amixer -Dhw:0 cset numid=1 on

What needs to be fixed is the firmware file, apparently the one in /lib/firmware/intel/dsp_fw_cnl_v1191.bin will not boot while the one extracted from the Windows driver does (need to copy it to the lib/firmware/intel directory and update the dsp_fw_cnl.bin link), likely due to the wrong key being used.

This does not solve the DMIC issue just yet but at least it shows the HDaudio work done over the Summer works fine on this platform.

I'll share more info when I progress further. In the mean time can the EndlessM folks try and reproduce my setup? Thanks!
Comment 18 Daniel Drake 2018-11-05 05:12:09 UTC
Thanks for the update! Are you saying you are now playing audio through the speakers using the SST driver?

That's a little surprising as (I think) we had speaker output working fine through HDA audio.

You have our only sample of this unit, but I will see if we can get hold of another.
Comment 19 Pierre Bossart 2018-11-05 15:40:20 UTC
To play on the speaker, you can either use the hardware in legacy mode (as you tested with the snd_hda driver, or you can use the enhancement mode with the DSP enabled (with the Skylake/SST driver). When you use the DMIC you have to rely on the DSP.
So basically we are now at feature parity with the HDaudio legacy stuff (speaker playback works for both cases) and only need to add DMIC support.
Comment 20 Chris Chiu 2018-11-23 05:55:25 UTC
Created attachment 279619 [details]
Acer Z24-890 acpidump output
Comment 21 Chris Chiu 2018-11-23 05:56:30 UTC
Created attachment 279621 [details]
Acer Z24-890 lspci output
Comment 22 Chris Chiu 2018-11-23 05:58:00 UTC
Created attachment 279623 [details]
Acer Z24-890 dmesg of for-next branch
Comment 23 Chris Chiu 2018-11-23 06:14:33 UTC
We got another Acer machine (AIO Z24-890) which has the same issue as Swift SF314-55. The internal microphone also connects to the SST instead of the built-in Realtek audio codec. Please ref attachment 279619 [details] for NHLT definition. The difference is that the PCI id of the device (attachment 279621 [details])  is 8086:a348 which can not been found in skl.c and skl-message.c. So I made the following modification to allow it to be probed at boot.

--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -247,6 +247,14 @@ static const struct skl_dsp_ops dsp_ops[] = {
                .init_fw = cnl_sst_init_fw,
                .cleanup = cnl_sst_dsp_cleanup
        },
+       {
+               .id = 0xa348,
+               .num_cores = 4,
+               .loader_ops = bxt_get_loader_ops,
+               .init = cnl_sst_dsp_init,
+               .init_fw = cnl_sst_init_fw,
+               .cleanup = cnl_sst_dsp_cleanup
+       },
 };
 
 const struct skl_dsp_ops *skl_get_dsp_ops(int pci_id)
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -1121,6 +1121,8 @@ static const struct pci_device_id skl_ids[] = {
        /* CNL */
        { PCI_DEVICE(0x8086, 0x9dc8),
                .driver_data = (unsigned long)&snd_soc_acpi_intel_cnl_machines},
+       { PCI_DEVICE(0x8086, 0xa348),
+               .driver_data = (unsigned long)&snd_soc_acpi_intel_cnl_machines},
        { 0, }
 };
 MODULE_DEVICE_TABLE(pci, skl_ids);

I follow your instructions, 
a). build kernel from Mark Brown's for-next branch (https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/)
b) using the topology file described in Comment 16 and copy to /lib/firmware/dfw_sst.bin
c) install and reboot
The dmesg in attachment 279623 [details] shows the result. Seems it has trouble on the dsp. I don't know whether if it's due to the modification I made in skl-messages.c. Can you suggest what I should do next? Thanks
Comment 24 Pierre Bossart 2018-11-24 03:35:10 UTC
Ah, that looks like a CFL machine, see http://mailman.alsa-project.org/pipermail/alsa-devel/2018-November/142017.html, your changes look legit

[   22.996968] snd_soc_skl 0000:00:1f.3: undefined DMIC array_type 0xf

This means "vendor defined", not sure what to do with it

[   22.997164] snd_soc_skl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   23.205954] skl_hda_dsp_generic skl_hda_dsp_generic: Unsupported HDAudio/iDisp configuration found
[   23.205958] skl_hda_dsp_generic: probe of skl_hda_dsp_generic failed with error -22

Ah not good. can you try to get more details, this is unusual.
Comment 25 Chris Chiu 2018-11-26 13:28:33 UTC
The message "Unsupported HDAudio/iDisp configuration found" is due to the fail of snd_hda_fill_card_info(). This function mainly checks the codec count and codec mask, and the codec mask seems to be unexpected. I then add the following code to print the codec mask.
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -538,6 +538,7 @@ static int skl_machine_device_register(struct skl *skl)

        mach->mach_params.platform = dev_name(bus->dev);
        mach->mach_params.codec_mask = bus->codec_mask;
+pr_warn("%s: platform %s codec_mask 0x%x\n", __func__, dev_name(bus->dev), bus->codec_mask);

        ret = platform_device_add_data(pdev, (const void *)mach, sizeof(*mach));
        if (ret) {

The dmesg shows 
[   23.706679] snd_soc_skl 0000:00:1f.3: enabling device (0000 -> 0002)
[   23.715998] snd_soc_skl 0000:00:1f.3: undefined DMIC array_type 0xf
[   23.716065] snd_soc_skl 0000:00:1f.3: dsp registration status=0
[   23.716161] snd_soc_skl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   23.804479] skl_machine_device_register: platform 0000:00:1f.3 codec_mask 0x1

But snd_hda_fill_card_info() expect the (codec_mask & IDISP_CODEC_MASK) to be true. IDISP_CODEC_MASK is defined 0x4 though I don't know what it means. The codec_mask should directly comes from the snd_hdac_chip_readw(bus, STATESTS) in snd_hdac_bus_reset_link(). Anything could go wrong here?
Comment 26 Pierre Bossart 2018-11-26 15:29:04 UTC
you need to enable more logs w/ dynamic debug and share them. I'd need all the info from sound/soc/intel/skylake, sound/soc/codecs and sound/soc/intel/boards.

Just add this in all the Makefile for the directories I listed:
ccflags-y += -DDEBUG
Comment 27 Chris Chiu 2018-11-27 13:59:39 UTC
Created attachment 279667 [details]
dmesg with sound/soc DEBUG enabled
Comment 28 Chris Chiu 2018-11-27 14:00:27 UTC
Created attachment 279669 [details]
DSDT table of Z24-890
Comment 29 Chris Chiu 2018-11-27 14:12:28 UTC
attachment 279667 [details] is the dmesg log per your suggestion. And per this log, the problem is "snd_soc_skl 0000:00:1f.3: No matching I2S machine driver found". It indicats that the INT34C2 we expect for snd_soc_apci_intel_cnl_machines not exists.

Then I dump the dsdt in attachment 279669 [details]. 

Device (HDAC)
{
    Name (_HID, "INT0000")  // _HID: Hardware ID
    Name (_CID, "INT0000")  // _CID: Compatible ID
    Name (_DDN, "Intel(R) Smart Sound Technology Audio Codec")  // _DDN: DOS Device Name
    Name (_UID, One)  // _UID: Unique ID
    Name (CDIS, Zero)
    Method (_INI, 0, NotSerialized)  // _INI: Initialize
    {
        If (I2SC == One)
        {
            _HID = "INT34C2"
            _CID = "INT34C2"
            Return (Zero)
        }
    }
}

And I only find INT0000 instead of INT34C2 in /sys/bus/acpi/devices. I can't see where I2SC been initialized/assigned. Should I just modify the DSDT and load the customized DSDT for the kernel or any better idea?
Comment 30 Chris Chiu 2018-11-27 15:10:50 UTC
There're HDAC definitions under each _SB.PCI0.I2Cx. I override them with INT34C2 and there's now INT34C2 entry under /sys/bus/acpi/devices. However, the dmesg still shows the same "snd_soc_skl 0000:00:1f.3: No matching I2S machine driver found". No idea so far, please advise if any. Thanks.
Comment 31 Pierre Bossart 2018-11-27 18:47:29 UTC
No, please don't define *any* ACPI IDs, that will interfere with the HDaudio selection.

The problem you have is that the hdac_hdmi does not seem to work, the iDISP codec is not detected and hence everything falls apart since HDMI is expected to work in the skl_generic machine driver.

it's very surprising that there is no message, can you please compile sound/soc/codecs with the DEBUG stuff I listed?
Comment 32 Chris Chiu 2018-11-28 14:22:14 UTC
Created attachment 279709 [details]
Acer Z24-890 dmesg w/ initcall_debug
Comment 33 Chris Chiu 2018-11-28 14:28:56 UTC
I did add ccflags-y += DEBUG in the Makefile of sound/soc/codecs. There's no message. I look into the hdac_hdmi.c, the hdac_hdmi_dev_probe not even invoked but the hdmi id(8086:280b) does exist. attachment 279709 [details] dumps the dmesg with kernel parameter initcall_debug. Nothing seems really helpful. Or which part of code you want me to look into?
Comment 34 Pierre Bossart 2018-11-28 18:00:48 UTC
Not sure what goes on. I am tempted to err on the side of a configuration issue.
all my tests are based on make defconfig + the -defconfigs found on https://github.com/thesofproject/kconfig

scripts/kconfig/merge_config.sh .config <PATH>/kconfig/base-defconfig <PATH>/kconfig/sst-defconfig <PATH>/kconfig/hdaudio-codecs-defconfig
Comment 35 Chris Chiu 2018-11-29 07:14:10 UTC
Created attachment 279733 [details]
Acer Z24-890 dmesg for intel-sst hdaudio
Comment 36 Chris Chiu 2018-11-29 07:16:52 UTC
My bad, it's the configuration issue. I've reconfigure the kernel and run it again. dmesg attachment 279733 [details] here. It's about the "transfer firmware fail" so no sound card/pcm available for amixer. Could you help on that?
Comment 37 Chris Chiu 2018-11-29 07:30:28 UTC
(In reply to Chris Chiu from comment #36)
> My bad, it's the configuration issue. I've reconfigure the kernel and run it
> again. dmesg attachment 279733 [details] here. It's about the "transfer
> firmware fail" so no sound card/pcm available for amixer. Could you help on
> that?

Forgot to mention, I've already used the topology file described in Comment 16 and follow steps in Comment 17. So maybe it's not the firmware for this?
Comment 38 Pierre Bossart 2018-11-29 17:09:30 UTC
Just to be clear, you used the topology file provided in Comment 16 and the firmware extracted from the Windows driver, not the default in /lib/firmware/intel/dfw_cnl.bin which is know to have an incompatibility with recent BIOS?

If the firmware from Windows fails that's a new dimension...
Comment 39 Chris Chiu 2018-11-30 06:48:59 UTC
Created attachment 279749 [details]
Acer Z24-890 dsp_fw_cnl.bin
Comment 40 Chris Chiu 2018-11-30 06:59:57 UTC
Sorry, we lost the audio driver file for the Acer Swift laptop so we request the driver again for this Z24-890. Replace the fw bin as you mentioned in Comment 17. Not I can successfully "set amixer -Dhw:0 cset numid=1 on". And could you suggest what's next? Thanks
Comment 41 Pierre Bossart 2018-12-03 19:48:32 UTC
> Sorry, we lost the audio driver file for the Acer Swift laptop so we request
> the driver again for this Z24-890. Replace the fw bin as you mentioned in
> Comment 17. Not I can successfully "set amixer -Dhw:0 cset numid=1 on". And
> could you suggest what's next? Thanks

Can you please check things with the latest firmware that was just 
released by Intel this morning:

http://mailman.alsa-project.org/pipermail/alsa-devel/2018-December/142476.html

https://github.com/crojewsk/linux-firmware.git for-upstream

The next step would be to define a topology file for dmics. Most likely 
it'll require some help from other folks at Intel.
Comment 42 Chris Chiu 2018-12-04 14:05:56 UTC
Created attachment 279839 [details]
Acer Z24-890 dmesg for cnl_v1858 dw
Comment 43 Chris Chiu 2018-12-04 14:06:52 UTC
Created attachment 279841 [details]
Acer Z24-890 dmesg for windows fw
Comment 44 Chris Chiu 2018-12-04 14:11:50 UTC
Unfortunately, I tried the upstream firmware but it fails at
[   17.305886] snd_soc_skl 0000:00:1f.3: DSP core(s) enabled? 1: core_mask 0x1
[   20.379198] snd_soc_skl 0000:00:1f.3: transfer firmware failed: -62
[   20.379213] snd_soc_skl 0000:00:1f.3: DSP core(s) enabled? 0: core_mask 0x1
[   20.379243] snd_soc_skl 0000:00:1f.3: load base fw failed: -62
[   20.379266] snd_soc_skl 0000:00:1f.3: Failed to boot first fw: -62
[   20.379270] snd_soc_skl 0000:00:1f.3: ASoC: failed to probe component -62
[   20.379327] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: failed to instantiate card -62


I logged by dmesg for different firmwares on the same kernel and topology file. Hope they can do some help. Let me know if there's any update need me to help verify. Thanks.
Comment 45 Pierre Bossart 2018-12-31 10:48:28 UTC
(In reply to Chris Chiu from comment #44)
> Unfortunately, I tried the upstream firmware but it fails at
> [   17.305886] snd_soc_skl 0000:00:1f.3: DSP core(s) enabled? 1: core_mask
> 0x1
> [   20.379198] snd_soc_skl 0000:00:1f.3: transfer firmware failed: -62
> [   20.379213] snd_soc_skl 0000:00:1f.3: DSP core(s) enabled? 0: core_mask
> 0x1
> [   20.379243] snd_soc_skl 0000:00:1f.3: load base fw failed: -62
> [   20.379266] snd_soc_skl 0000:00:1f.3: Failed to boot first fw: -62
> [   20.379270] snd_soc_skl 0000:00:1f.3: ASoC: failed to probe component -62
> [   20.379327] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: failed to
> instantiate card -62
> 
> 
> I logged by dmesg for different firmwares on the same kernel and topology
> file. Hope they can do some help. Let me know if there's any update need me
> to help verify. Thanks.

Can you please retry with the latest firmware? I am not sure which version you took and I don't see a reason why this fails. Thanks!
Comment 46 Chris Chiu 2019-01-04 06:33:53 UTC
The firmware I tried is /lib/firmware/intel/dsp_fw_cnl_v1858.bin. Is there any newer version?
Comment 47 Chris Chiu 2019-01-04 12:45:42 UTC
(In reply to Chris Chiu from comment #46)
> The firmware I tried is /lib/firmware/intel/dsp_fw_cnl_v1858.bin. Is there
> any newer version?

I tried the latest Mark Brown's for-next branch, which also includes the recently upstream commits from you and 8086:a348 already supported, but still no luck. I verified the fw file is still dsp_fw_cnl_v1858.bin. The error message is the same as attachment 279839 [details].
Comment 48 Pierre Bossart 2019-01-04 17:51:58 UTC
> The firmware I tried is /lib/firmware/intel/dsp_fw_cnl_v1858.bin. Is there
> any
> newer version?
No, that's the latest. It works fine for me on WHL. What I don't get is 
what the Windows firmware is. Is this the same your Endless colleagues 
used for the previous program on WHL, or  is this a CFL-specific one? 
There is a mismatch somewhere. Could you also try with the previous 
version dsp_fw_cnl_v1191.bin?
Comment 49 Chris Chiu 2019-01-07 12:53:41 UTC
The dsp_fw_cnl_v1191.bin also fails just like dsp_fw_cnl_v1858.bin. The error messages are the same. So the only working firmware is attachment 279749 [details]. We can try to find out the Windows firmware which used to work on WHL (Acer Swift SF314-55) because I'm not really sure the driver is the same. Maybe binary diff between these 2 woudld do some helpful.
Comment 50 jian-hong 2019-01-23 08:44:21 UTC
Created attachment 280693 [details]
dmesg of Acer Crux

I get another Acer Crux laptop which also uses DMIC as the internal MIC and the PCI ID is 8086:9dc8.

00:1f.3 Multimedia audio controller [0401]: Intel Corporation Device [8086:9dc8] (rev 30)
	Subsystem: Acer Incorporated [ALI] Device [1025:1330]
	Flags: bus master, fast devsel, latency 32, IRQ 16
	Memory at a121c000 (64-bit, non-prefetchable) [size=16K]
	Memory at a1000000 (64-bit, non-prefetchable) [size=1M]
	Capabilities: <access denied>
	Kernel driver in use: snd_soc_skl
	Kernel modules: snd_hda_intel, snd_soc_skl

I follow steps in Comment 17 and blacklist snd_hda_intel module.  System loads the firmware but the audio does not work.

[    8.182241] snd_soc_skl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    8.191390] snd_soc_skl 0000:00:1f.3: undefined DMIC array_type 0xf
[    8.191997] snd_soc_skl 0000:00:1f.3: Linked as a consumer to 0000:00:02.0
[    8.192009] snd_soc_skl 0000:00:1f.3: bound 0000:00:02.0 (ops 0xffffffffaf89be20)
[    8.273977] HDMI HDA Codec ehdaudio0D2: Max dais supported: 3
[    8.303663] snd_soc_skl 0000:00:1f.3: Direct firmware load for 9dc8-ACRSYS-ACRPRDCT-2-tplg.bin failed with error -2
[    8.303667] snd_soc_skl 0000:00:1f.3: tplg fw 9dc8-ACRSYS-ACRPRDCT-2-tplg.bin load failed with -2, falling back to dfw_sst.bin
[    8.318544] snd_soc_skl 0000:00:1f.3: ASoC: Parent card not yet available, widget card binding deferred
[    8.452454] HDMI HDA Codec ehdaudio0D2: hdac_hdmi_present_sense: disconnect for pin:port 5:0
[    8.452827] HDMI HDA Codec ehdaudio0D2: hdac_hdmi_present_sense: disconnect for pin:port 6:0
[    8.453144] HDMI HDA Codec ehdaudio0D2: hdac_hdmi_present_sense: disconnect for pin:port 7:0
[    8.495726] snd_hda_codec_realtek ehdaudio0D0: autoconfig for ALC255: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker
[    8.495735] snd_hda_codec_realtek ehdaudio0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    8.495739] snd_hda_codec_realtek ehdaudio0D0:    hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[    8.495742] snd_hda_codec_realtek ehdaudio0D0:    mono: mono_out=0x0
[    8.495745] snd_hda_codec_realtek ehdaudio0D0:    inputs:
[    8.495748] snd_hda_codec_realtek ehdaudio0D0:      Headphone Mic=0x1a
[    8.495752] snd_hda_codec_realtek ehdaudio0D0:      Headset Mic=0x19
[    8.553107] skl_hda_dsp_generic skl_hda_dsp_generic: intel-hdmi-hifi1 <-> iDisp1 Pin mapping ok
[    8.553120] skl_hda_dsp_generic skl_hda_dsp_generic: intel-hdmi-hifi2 <-> iDisp2 Pin mapping ok
[    8.553128] skl_hda_dsp_generic skl_hda_dsp_generic: intel-hdmi-hifi3 <-> iDisp3 Pin mapping ok
[    8.553137] skl_hda_dsp_generic skl_hda_dsp_generic: Analog Codec DAI <-> Analog CPU DAI mapping ok
[    8.553146] skl_hda_dsp_generic skl_hda_dsp_generic: Digital Codec DAI <-> Digital CPU DAI mapping ok
[    8.553210] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <-> cnl-audio-dai mapping ok
[    8.553233] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <-> hdmi1 mapping ok
[    8.553255] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <-> hdmi2 mapping ok
[    8.553276] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <-> hdmi3 mapping ok
[    8.553357] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: no source widget found for codec1_out
[    8.553359] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to add route codec1_out -> direct -> Digital CPU Playback
[    8.553364] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: no source widget found for codec2_out
[    8.553366] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to add route codec2_out -> direct -> Alt Analog CPU Playback
[    8.553374] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: no sink widget found for codec1_in
[    8.553375] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to add route Digital CPU Capture -> direct -> codec1_in
[    8.553381] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: no sink widget found for codec2_in
[    8.553383] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to add route Alt Analog CPU Capture -> direct -> codec2_in
[    8.555467] input: skl_hda_card Headphone Mic as /devices/platform/skl_hda_dsp_generic/sound/card0/input8
[    8.555540] input: skl_hda_card Headset Mic as /devices/platform/skl_hda_dsp_generic/sound/card0/input9
[    8.555607] input: skl_hda_card HDMI/DP, pcm=6 Jack as /devices/platform/skl_hda_dsp_generic/sound/card0/input10
[    8.555670] input: skl_hda_card HDMI/DP, pcm=7 Jack as /devices/platform/skl_hda_dsp_generic/sound/card0/input11
[    8.555740] input: skl_hda_card HDMI/DP, pcm=8 Jack as /devices/platform/skl_hda_dsp_generic/sound/card0/input12
Comment 51 Pierre Bossart 2019-01-23 15:26:38 UTC
On 1/23/19 2:44 AM, bugzilla-daemon@bugzilla.kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=201251
>
> --- Comment #50 from jian-hong@endlessm.com ---
> Created attachment 280693 [details]
>    --> https://bugzilla.kernel.org/attachment.cgi?id=280693&action=edit
> dmesg of Acer Crux
>
> I get another Acer Crux laptop which also uses DMIC as the internal MIC and
> the
> PCI ID is 8086:9dc8.
>
> 00:1f.3 Multimedia audio controller [0401]: Intel Corporation Device
> [8086:9dc8] (rev 30)
>          Subsystem: Acer Incorporated [ALI] Device [1025:1330]
>          Flags: bus master, fast devsel, latency 32, IRQ 16
>          Memory at a121c000 (64-bit, non-prefetchable) [size=16K]
>          Memory at a1000000 (64-bit, non-prefetchable) [size=1M]
>          Capabilities: <access denied>
>          Kernel driver in use: snd_soc_skl
>          Kernel modules: snd_hda_intel, snd_soc_skl
>
> I follow steps in Comment 17 and blacklist snd_hda_intel module.  System
> loads
> the firmware but the audio does not work.
>
> [    8.182241] snd_soc_skl 0000:00:1f.3: DSP detected with PCI
> class/subclass/prog-if info 0x040100
> [    8.191390] snd_soc_skl 0000:00:1f.3: undefined DMIC array_type 0xf
> [    8.191997] snd_soc_skl 0000:00:1f.3: Linked as a consumer to 0000:00:02.0
> [    8.192009] snd_soc_skl 0000:00:1f.3: bound 0000:00:02.0 (ops
> 0xffffffffaf89be20)
> [    8.273977] HDMI HDA Codec ehdaudio0D2: Max dais supported: 3
> [    8.303663] snd_soc_skl 0000:00:1f.3: Direct firmware load for
> 9dc8-ACRSYS-ACRPRDCT-2-tplg.bin failed with error -2
> [    8.303667] snd_soc_skl 0000:00:1f.3: tplg fw
> 9dc8-ACRSYS-ACRPRDCT-2-tplg.bin load failed with -2, falling back to
> dfw_sst.bin
> [    8.318544] snd_soc_skl 0000:00:1f.3: ASoC: Parent card not yet available,
> widget card binding deferred
> [    8.452454] HDMI HDA Codec ehdaudio0D2: hdac_hdmi_present_sense:
> disconnect
> for pin:port 5:0
> [    8.452827] HDMI HDA Codec ehdaudio0D2: hdac_hdmi_present_sense:
> disconnect
> for pin:port 6:0
> [    8.453144] HDMI HDA Codec ehdaudio0D2: hdac_hdmi_present_sense:
> disconnect
> for pin:port 7:0
> [    8.495726] snd_hda_codec_realtek ehdaudio0D0: autoconfig for ALC255:
> line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker
> [    8.495735] snd_hda_codec_realtek ehdaudio0D0:    speaker_outs=0
> (0x0/0x0/0x0/0x0/0x0)
> [    8.495739] snd_hda_codec_realtek ehdaudio0D0:    hp_outs=1
> (0x21/0x0/0x0/0x0/0x0)
> [    8.495742] snd_hda_codec_realtek ehdaudio0D0:    mono: mono_out=0x0
> [    8.495745] snd_hda_codec_realtek ehdaudio0D0:    inputs:
> [    8.495748] snd_hda_codec_realtek ehdaudio0D0:      Headphone Mic=0x1a
> [    8.495752] snd_hda_codec_realtek ehdaudio0D0:      Headset Mic=0x19
> [    8.553107] skl_hda_dsp_generic skl_hda_dsp_generic: intel-hdmi-hifi1 <->
> iDisp1 Pin mapping ok
> [    8.553120] skl_hda_dsp_generic skl_hda_dsp_generic: intel-hdmi-hifi2 <->
> iDisp2 Pin mapping ok
> [    8.553128] skl_hda_dsp_generic skl_hda_dsp_generic: intel-hdmi-hifi3 <->
> iDisp3 Pin mapping ok
> [    8.553137] skl_hda_dsp_generic skl_hda_dsp_generic: Analog Codec DAI <->
> Analog CPU DAI mapping ok
> [    8.553146] skl_hda_dsp_generic skl_hda_dsp_generic: Digital Codec DAI <->
> Digital CPU DAI mapping ok
> [    8.553210] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <->
> cnl-audio-dai mapping ok
> [    8.553233] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <->
> hdmi1 mapping ok
> [    8.553255] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <->
> hdmi2 mapping ok
> [    8.553276] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <->
> hdmi3 mapping ok
> [    8.553357] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: no source
> widget
> found for codec1_out
> [    8.553359] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to add
> route codec1_out -> direct -> Digital CPU Playback
> [    8.553364] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: no source
> widget
> found for codec2_out
> [    8.553366] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to add
> route codec2_out -> direct -> Alt Analog CPU Playback
> [    8.553374] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: no sink widget
> found for codec1_in
> [    8.553375] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to add
> route Digital CPU Capture -> direct -> codec1_in
> [    8.553381] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: no sink widget
> found for codec2_in
> [    8.553383] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Failed to add
> route Alt Analog CPU Capture -> direct -> codec2_in
> [    8.555467] input: skl_hda_card Headphone Mic as
> /devices/platform/skl_hda_dsp_generic/sound/card0/input8
> [    8.555540] input: skl_hda_card Headset Mic as
> /devices/platform/skl_hda_dsp_generic/sound/card0/input9
> [    8.555607] input: skl_hda_card HDMI/DP, pcm=6 Jack as
> /devices/platform/skl_hda_dsp_generic/sound/card0/input10
> [    8.555670] input: skl_hda_card HDMI/DP, pcm=7 Jack as
> /devices/platform/skl_hda_dsp_generic/sound/card0/input11
> [    8.555740] input: skl_hda_card HDMI/DP, pcm=8 Jack as
> /devices/platform/skl_hda_dsp_generic/sound/card0/input12

The warnings above are just noise, did you try to see if the card is 
created?

Also what does "audio does not work" mean? card not created, capture not 
happening, etc? it helps if you attach the full dmesg and alsa-info.sh


>
Comment 52 jian-hong 2019-01-24 05:10:10 UTC
Created attachment 280703 [details]
alsa-info with Mark Brown's for-next kernel (HDA quirk)

I have tried Mark Brown's for-next branch on Acer Crux (TravelMate X514-51T) laptop.  And quirked the audio pin nodes as the alsa-info as this attachment.  The internal speaker, headphone and headset MIC work correctly.  But the internal MIC cannot record any sound.  Then, I checked Windows on Acer Crux and found the internal MIC is a DMIC which uses Intel SST as the driver.

So, I copy the topology file in Comment 16 to /lib/firmware/dfw_sst.bin
Then, cold reboot again.  I made system boot with blacklist snd_hda_intel commad for using snd_soc_skl.  The alsa-info and dmesg will be uploaded.
Comment 53 jian-hong 2019-01-24 05:31:14 UTC
Created attachment 280705 [details]
alsa-info with Mark Brown's for-next kernel with snd_soc_skl for Comment 52

I blacklist the snd_hda_intel for using snd_soc_skl.
According to this alsa-info, sound card is not found!?  Should snd_hda_intel not be in blacklist?

!!Soundcards recognised by ALSA
!!-----------------------------

--- no soundcards ---

Any config or parameter can make snd_hda_intel and snd_soc_skl work together?  Thanks
Comment 54 jian-hong 2019-01-24 05:33:16 UTC
Created attachment 280707 [details]
dmesg with Mark Brown's for-next kernel with snd_soc_skl for Comment 53
Comment 55 Pierre Bossart 2019-01-24 15:11:06 UTC
On 1/23/19 11:33 PM, bugzilla-daemon@bugzilla.kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=201251
>
> --- Comment #54 from jian-hong@endlessm.com ---
> Created attachment 280707 [details]
>    --> https://bugzilla.kernel.org/attachment.cgi?id=280707&action=edit
> dmesg with Mark Brown's for-next kernel with snd_soc_skl for Comment 53

You need to update your firmware, the errors below are a telltale sign 
of authentication issues that are solved.

Make sure you use dsp_fw_cnl.bin -> dsp_fw_cnl_v1858.bin

[   11.895374] snd_soc_skl 0000:00:1f.3: transfer firmware failed: -62
[   11.895429] snd_soc_skl 0000:00:1f.3: load base fw failed: -62
[   11.895455] snd_soc_skl 0000:00:1f.3: Failed to boot first fw: -62
[   11.895458] snd_soc_skl 0000:00:1f.3: ASoC: failed to probe component -62
Comment 56 jian-hong 2019-01-25 05:10:29 UTC
Created attachment 280757 [details]
alsa-info with Mark Brown's for-next kernel with snd_soc_skl and v1858.bin

I changed the symbolic link of dsp_fw_cnl.bin to dsp_fw_cnl_v1858.bin

ls -l /lib/firmware/intel/dsp_fw_cnl*
lrwxrwxrwx 1 root root     20 Jan 25 10:36 /lib/firmware/intel/dsp_fw_cnl.bin -> dsp_fw_cnl_v1858.bin
-rw-r--r-- 3 root root 583852 Jan 24 11:09 /lib/firmware/intel/dsp_fw_cnl_v1191.bin
-rw-r--r-- 1 root root 583852 Jan 23 14:19 /lib/firmware/intel/dsp_fw_cnl_v1858.bin

Also "amixer -Dhw:0 cset numid=1 on"

However, "pactl list cards" shows nothing.

The new alsa-info is as this attachment.  The new dmesg will be uploaded.
Comment 57 jian-hong 2019-01-25 05:13:48 UTC
Created attachment 280759 [details]
dmesg with Mark Brown's for-next kernel with snd_soc_skl and v1858.bin for Comment 56
Comment 58 Pierre Bossart 2019-01-25 14:17:35 UTC
The card creation happened now, so the move to the new firmware was successful

0 [sklhdacard     ]: skl_hda_card - skl_hda_card
                      WL-TravelMateX514_51T-V1.02-Crux_WL

You probably miss a UCM profile for PulseAudio to work, but that's a different issue. For now you should be able to play on the speakers and HDMI.
Comment 59 jian-hong 2019-01-28 09:56:45 UTC
Created attachment 280823 [details]
dmesg with Mark Brown's for-next kernel with snd_soc_skl and v1858.bin - no backend DAIs

(In reply to Pierre Bossart from comment #58)
> The card creation happened now, so the move to the new firmware was
> successful
> 
> 0 [sklhdacard     ]: skl_hda_card - skl_hda_card
>                       WL-TravelMateX514_51T-V1.02-Crux_WL

Thanks for your help!

> You probably miss a UCM profile for PulseAudio to work, but that's a
> different issue. For now you should be able to play on the speakers and HDMI.

However, I got no sound output when I play with the command: 

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sklhdacard [skl_hda_card], device 5: CNL Audio (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sklhdacard [skl_hda_card], device 6: CNL HDMI1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sklhdacard [skl_hda_card], device 7: CNL HDMI2 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sklhdacard [skl_hda_card], device 8: CNL HDMI3 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0


aplay -D plughw:0,5 ~/Downloads/Yamaha-V50-Rock-Beat-120bpm.wav -v
Playing WAVE '/home/dev/Downloads/Yamaha-V50-Rock-Beat-120bpm.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: set_params:1363: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: (85333 85334)
PERIOD_SIZE: [3763 3763]
PERIOD_BYTES: (15052 15056)
PERIODS: (3 4)
BUFFER_TIME: (341315 341316)
BUFFER_SIZE: 15052
BUFFER_BYTES: 60208
TICK_TIME: 0

And I notice there is the error message:

[   54.099485]  CNL Audio: ASoC: no backend DAIs enabled for CNL Audio
Comment 60 Pierre Bossart 2019-01-28 18:47:25 UTC
You need to set 'amixer -Dhw:0 cset numid=1'
Comment 61 Pierre Bossart 2019-01-28 18:47:59 UTC
I meant 'amixer -Dhw:0 cset numid=1 on'
Comment 62 jian-hong 2019-01-29 03:30:35 UTC
(In reply to Pierre Bossart from comment #61)
> I meant 'amixer -Dhw:0 cset numid=1 on'

I can play and get sound output from internal speaker and headphone with snd_soc_skl now.  Thanks for your guide.
Comment 63 Robert 2019-07-22 13:03:41 UTC
May I ask what's the state of this bug?
It's listed as: Status: NEW and Kernel Version: 4.19 

I'm currently on kernel 5.2.1 with very similar audio hardware. However, my internal mic is not recognized. 

arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: Generic Analog [Generic Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

The snd_soc_skl module is loaded. Internal speakers and external headset with mic is working.

The firmware seems to be up to date: /usr/lib/firmware/intel/dsp_fw_cnl.bin -> dsp_fw_cnl_v1858.bin

My system is an HP Elitebook 1040 G5 with Arch Linux.
Comment 64 Pierre Bossart 2019-07-22 15:24:58 UTC
the(In reply to Robert from comment #63)
> May I ask what's the state of this bug?
> It's listed as: Status: NEW and Kernel Version: 4.19 
> 
> I'm currently on kernel 5.2.1 with very similar audio hardware. However, my
> internal mic is not recognized. 
> 
> arecord -l
> **** List of CAPTURE Hardware Devices ****
> card 0: PCH [HDA Intel PCH], device 0: Generic Analog [Generic Analog]
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> 
> The snd_soc_skl module is loaded. Internal speakers and external headset
> with mic is working.
> 
> The firmware seems to be up to date: /usr/lib/firmware/intel/dsp_fw_cnl.bin
> -> dsp_fw_cnl_v1858.bin
> 
> My system is an HP Elitebook 1040 G5 with Arch Linux.

the solution will be to use the SOF driver, which does support HDaudio+dmic configurations. there's a bit of a delay to make the signed firmware sof-cnl.ri available (mostly due to vacation season).
Comment 65 Pierre Bossart 2019-07-23 15:16:07 UTC
> the solution will be to use the SOF driver, which does support HDaudio+dmic
> configurations. there's a bit of a delay to make the signed firmware
> sof-cnl.ri available (mostly due to vacation season).

Signed binaries for SOF are now available here;
https://github.com/thesofproject/sof/releases
Comment 66 Stefan Rinke 2019-07-23 18:41:01 UTC
May I ask a stupid question: how can I install these signed binaries on my acerswift 3 ubuntu 19.04 kernel 5.0.20?

Thx Steve
Comment 67 Pierre Bossart 2019-07-23 18:53:07 UTC
you will need to install kernel v5.2 and copy this file to /lib/firmware/intel/sof
You will also need a topology file to copy into /lib/firmware/intel/sof-tplg.
Comment 68 jian-hong 2019-07-26 08:11:58 UTC
Created attachment 283981 [details]
dmesg of

I have tried 5.2 kernel with the SOF files from https://github.com/thesofproject/sof/releases on Acer Z24-890

Howerver, the audio does not work with the errors:

[   24.252621] snd_soc_skl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[   24.252631] snd_soc_skl 0000:00:1f.3: enabling device (0000 -> 0002)
[   24.434174] snd_soc_skl 0000:00:1f.3: undefined DMIC array_type 0xf
[   24.434648] snd_soc_skl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   24.615591] skl_hda_dsp_generic skl_hda_dsp_generic: Unsupported HDAudio/iDisp configuration found
[   24.615594] skl_hda_dsp_generic: probe of skl_hda_dsp_generic failed with error -22

The SOF binaries are installed in /lib/firmware/intel/sof/

/lib/firmware/intel/sof/sof-apl-gcc.ri
/lib/firmware/intel/sof/sof-apl-signed-intel.ri
/lib/firmware/intel/sof/sof-apl-unsigned.ri
/lib/firmware/intel/sof/sof-bdw-gcc.ri
/lib/firmware/intel/sof/sof-byt-gcc.ri
/lib/firmware/intel/sof/sof-cht-gcc.ri
/lib/firmware/intel/sof/sof-cnl-gcc.ri
/lib/firmware/intel/sof/sof-cnl-signed-intel.ri
/lib/firmware/intel/sof/sof-cnl-unsigned.ri
/lib/firmware/intel/sof/sof-hsw-gcc.ri
/lib/firmware/intel/sof/sof-icl-gcc.ri
/lib/firmware/intel/sof/sof-icl-signed-intel.ri
/lib/firmware/intel/sof/sof-icl-unsigned.ri
/lib/firmware/intel/sof/sof-imx8-gcc.ri
/lib/firmware/intel/sof/sof-kbl-gcc.ri
/lib/firmware/intel/sof/sof-skl-gcc.ri
/lib/firmware/intel/sof/sof-sue-gcc.ri

I think I also need the topology file to be installed into /lib/firmware/intel/sof-tplg

Where can I have the topology file or how to produce it?
Thank you
Comment 69 Pierre Bossart 2019-07-26 16:06:18 UTC
(In reply to jian-hong from comment #68)
> Created attachment 283981 [details]
> dmesg of
> 
> I have tried 5.2 kernel with the SOF files from
> https://github.com/thesofproject/sof/releases on Acer Z24-890
> 
> Howerver, the audio does not work with the errors:
> 
> [   24.252621] snd_soc_skl 0000:00:1f.3: DSP detected with PCI
> class/subclass/prog-if info 0x040100
> [   24.252631] snd_soc_skl 0000:00:1f.3: enabling device (0000 -> 0002)
> [   24.434174] snd_soc_skl 0000:00:1f.3: undefined DMIC array_type 0xf
> [   24.434648] snd_soc_skl 0000:00:1f.3: bound 0000:00:02.0 (ops
> i915_audio_component_bind_ops [i915])
> [   24.615591] skl_hda_dsp_generic skl_hda_dsp_generic: Unsupported
> HDAudio/iDisp configuration found
> [   24.615594] skl_hda_dsp_generic: probe of skl_hda_dsp_generic failed with
> error -22

You need to blacklist snd-soc-skl, you are probing the wrong driver here.

> 
> The SOF binaries are installed in /lib/firmware/intel/sof/
> 
> /lib/firmware/intel/sof/sof-apl-gcc.ri
> /lib/firmware/intel/sof/sof-apl-signed-intel.ri
> /lib/firmware/intel/sof/sof-apl-unsigned.ri
> /lib/firmware/intel/sof/sof-bdw-gcc.ri
> /lib/firmware/intel/sof/sof-byt-gcc.ri
> /lib/firmware/intel/sof/sof-cht-gcc.ri
> /lib/firmware/intel/sof/sof-cnl-gcc.ri
> /lib/firmware/intel/sof/sof-cnl-signed-intel.ri
> /lib/firmware/intel/sof/sof-cnl-unsigned.ri
> /lib/firmware/intel/sof/sof-hsw-gcc.ri
> /lib/firmware/intel/sof/sof-icl-gcc.ri
> /lib/firmware/intel/sof/sof-icl-signed-intel.ri
> /lib/firmware/intel/sof/sof-icl-unsigned.ri
> /lib/firmware/intel/sof/sof-imx8-gcc.ri
> /lib/firmware/intel/sof/sof-kbl-gcc.ri
> /lib/firmware/intel/sof/sof-skl-gcc.ri
> /lib/firmware/intel/sof/sof-sue-gcc.ri

Gah, this will not work. You need to symlink sof-cnl.ri to sof-cnl-sign-intel.ri

> 
> I think I also need the topology file to be installed into
> /lib/firmware/intel/sof-tplg
> 
> Where can I have the topology file or how to produce it?
> Thank you

I will add examples as attachments.
Comment 70 Pierre Bossart 2019-07-26 16:11:17 UTC
Created attachment 283987 [details]
topology file for HDaudio platforms with 2 DMICs

copy to /lib/firmware/intel/sof-tplg/sof-hda-generic.tplg
Comment 71 Pierre Bossart 2019-07-26 16:12:01 UTC
Created attachment 283989 [details]
topology file for HDaudio platforms with 4 DMICs
Comment 72 Pierre Bossart 2019-07-26 16:13:20 UTC
you can also clone the sof project, and in a terminal type
scripts/build_tools.sh
all the topology files will be in tools/build_tools/topology/*.tplg
Comment 73 Pierre Bossart 2019-07-26 19:57:49 UTC
I just gave it a try and I can see the mic input:

scp sof-cnl-signed-intel.ri root@192.168.1.185:/lib/firmware/intel/sof/
ssh root@192.168.1.185 'cd /lib/firmware/intel/sof; ln -s sof-cnl-signed-intel.ri sof-cnl.ri'
scp sof-hda-generic-4ch.tplg root@192.168.1.185:/lib/firmware/intel/sof-tplg/
ssh root@192.168.1.185 'cd /lib/firmware/intel/sof-tplg; ln -s sof-hda-generic-4ch.tplg sof-hda-generic.tplg'

use Mark Brown's tree with all SOF patches and config that I'll attach shortly.

There is however an issue with the sound level, I'll need to look into this, it worked a couple of weeks ago.
Comment 74 Pierre Bossart 2019-07-26 20:00:22 UTC
Created attachment 283995 [details]
config to test SOF w/ DMIC support

minimal config only, e.g. pad doesn't work, etc. This is for audio tests only with basic network and display support.
Comment 75 Pierre Bossart 2019-07-26 20:16:35 UTC
sound level issue tracked at https://github.com/thesofproject/sof/issues/1675
Comment 76 jian-hong 2019-07-29 06:45:49 UTC
Created attachment 284011 [details]
dmesg SOF 5.3-rc1 z24-890

I have followed the steps mentioned in comment #73

Used for-next branch of Mark Brown's tree and the config attachment 283995 [details].  Also blacklisted snd_hda_intel and snd_soc_skl modules.

The firmware
/lib/firmware/intel/sof/sof-cnl.ri -> sof-cnl-signed-intel.ri

The topology
/lib/firmware/intel/sof-tplg/sof-hda-generic.tplg -> sof-hda-generic-4ch.tplg

The SOF is loaded and speakers work.  Howerver, the internal DMIC does not work.

Got the audio related messages in dmesg:

[   20.335493] sof-audio-pci 0000:00:1f.3: Topology: ABI 3:9:0 Kernel ABI 3:9:0
[   20.335506] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp3 Tx not handled
[   20.336901] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name codec0_in not handled
[   20.336907] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp2 Tx not handled
[   20.337923] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name codec1_in not handled
[   20.337929] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp1 Tx not handled
[   20.338844] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name codec0_out not handled
[   20.338849] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name Analog CPU Playback not handled
[   20.339774] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name codec1_out not handled
[   20.339778] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name Digital CPU Playback not handled
[   20.339782] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name codec2_in not handled
[   20.339786] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name Alt Analog CPU Playback not handled
[   20.339790] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name codec2_out not handled
[   20.339794] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name Analog CPU Capture not handled
[   20.340921] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp1_out not handled
[   20.340922] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name Digital CPU Capture not handled
[   20.341628] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp2_out not handled
[   20.341629] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name Alt Analog CPU Capture not handled
[   20.342353] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp3_out not handled
[   20.348221] sof-audio-pci 0000:00:1f.3: ASoC: Parent card not yet available, widget card binding deferred
...
[   29.292642] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[   29.374209] sof-audio-pci 0000:00:1f.3: firmware boot complete
[   30.124883] debugfs: File 'Analog Playback and Capture' in directory 'HDA Analog' already present!
[   30.128036] debugfs: File 'Analog Playback and Capture' in directory 'HDA Analog' already present!
[   30.180118] debugfs: File 'Analog Playback and Capture' in directory 'HDA Analog' already present!
[   30.184197] debugfs: File 'Analog Playback and Capture' in directory 'HDA Analog' already present!
[   30.325943] debugfs: File 'Analog Playback and Capture' in directory 'HDA Analog' already present!

The alsa-info follows this comment.
Comment 77 jian-hong 2019-07-29 06:47:05 UTC
Created attachment 284013 [details]
alsa-info SOF 5.3-rc1 z24-890 of comment #76
Comment 78 Pierre Bossart 2019-07-29 13:46:36 UTC
ok, we'll have to look at the debugfs, but that's not preventing anything from working. we ignore all errors on debugfs calls.

Please provide more information when you say the 'internal DMIC does not work'. You should be able to capture and see non-zero data recorded, however there is a known issue with the volume that we are looking into.

What exactly does not work? The card creation, data transfers or volume level?
Comment 79 jian-hong 2019-07-30 06:16:17 UTC
Created attachment 284041 [details]
Screenshot of Audacity for internal DMIC on z24-890

(In reply to Pierre Bossart from comment #78)

> What exactly does not work? The card creation, data transfers or volume
> level?

I can see the card's DMIC

arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: sofsklhdacard [sof-skl_hda_card], device 0: HDA Analog (*) []
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: sofsklhdacard [sof-skl_hda_card], device 1: HDA Digital (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofsklhdacard [sof-skl_hda_card], device 6: DMIC32 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofsklhdacard [sof-skl_hda_card], device 7: DMIC16 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

However, the recording volume level is always zero in Audacity.  Is this the bug mentioned in https://github.com/thesofproject/sof/issues/1675 ?
Comment 80 jian-hong 2019-07-30 06:42:04 UTC
Created attachment 284043 [details]
dmesg recording from SOF 5.3-rc1 z24-890

Following comment #79

I also notice whenever I try to record from DMIC, system shows this error in dmesg:

[  187.246188] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[  187.331288] sof-audio-pci 0000:00:1f.3: firmware boot complete
Comment 81 Pierre Bossart 2019-07-30 13:19:00 UTC
> I also notice whenever I try to record from DMIC, system shows this error in
> dmesg:
> 
> [  187.246188] sof-audio-pci 0000:00:1f.3: error: no reply expected,
> received 0x0
> [  187.331288] sof-audio-pci 0000:00:1f.3: firmware boot complete

yes, it's an annoying log we need to remove but it's not a problem. please ignore this.
Comment 82 Pierre Bossart 2019-07-30 13:20:08 UTC
(In reply to jian-hong from comment #79)
> Created attachment 284041 [details]
> Screenshot of Audacity for internal DMIC on z24-890
> 
> (In reply to Pierre Bossart from comment #78)
> 
> > What exactly does not work? The card creation, data transfers or volume
> > level?
> 
> I can see the card's DMIC
> 
> arecord -l
> **** List of CAPTURE Hardware Devices ****
> card 0: sofsklhdacard [sof-skl_hda_card], device 0: HDA Analog (*) []
>   Subdevices: 0/1
>   Subdevice #0: subdevice #0
> card 0: sofsklhdacard [sof-skl_hda_card], device 1: HDA Digital (*) []
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> card 0: sofsklhdacard [sof-skl_hda_card], device 6: DMIC32 (*) []
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> card 0: sofsklhdacard [sof-skl_hda_card], device 7: DMIC16 (*) []
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> 
> However, the recording volume level is always zero in Audacity.  Is this the
> bug mentioned in https://github.com/thesofproject/sof/issues/1675 ?

I guess. Try zooming in Audacity and you show see the same issue of very very low level.
Comment 83 Pierre Bossart 2019-08-09 17:51:50 UTC
Turns out the low volume is a result of ALSA mixers not being set properly. Adding +20dB on all capture paths gives me a decent volume on DMIC.

There is one catch is that is you use the 4ch topology they you have to record with 4 channels. Somehow it's permitted to record in stereo but that's an invalid configuration we need to fix in the topology.
Comment 84 Tristan Mahe 2019-08-14 00:40:18 UTC
Hi, 

The HP spectre x360 from 2019 also has the same Intel SST mic array with the realtek alc285.

I tried using the latest sof files as explained above, blacklisting old modules.
and seems like card is detected.

I do not get any sound output though and errors are throwing in the logs.

alsa-info and dmesg are following.
Comment 85 Tristan Mahe 2019-08-14 00:41:03 UTC
Created attachment 284373 [details]
alsa-info spectre x360

alsa info and the errors in dmesg when trying to play something.
Comment 86 Tristan Mahe 2019-08-14 03:54:44 UTC
Created attachment 284375 [details]
patch to compile for-next branch as of commit da84c03c03cfadffe00f72f83ea9f556b903f565

trying to compile for-next branch to test further, I had to patch two places as attached.

Forgive me if I made an error, I am not familiar with that code.
Comment 87 Tristan Mahe 2019-08-14 04:17:35 UTC
Created attachment 284377 [details]
alsa-info for working speakers / still no dmic working though

reporting that speakers work using the for-next branch on the 2019 hp spectre x360.

I just have a doubt on the back speakers, ( using speaker-test -c4 seems to produce an output on each speaker, but the two 'back' have very low volume ). It is an improvement over the legacy driver since there was only two speakers working. Volume is also louder than legacy driver ( snd-hda-intel ).

Dmic still no luck for now though, I will do further tests. if you have any pointers from the attached alsa-info, happy to test !
Comment 88 Pierre Bossart 2019-08-14 14:16:26 UTC
(In reply to Tristan Mahe from comment #87)
> Created attachment 284377 [details]
> alsa-info for working speakers / still no dmic working though
> 
> reporting that speakers work using the for-next branch on the 2019 hp
> spectre x360.
> 
> I just have a doubt on the back speakers, ( using speaker-test -c4 seems to
> produce an output on each speaker, but the two 'back' have very low volume
> ). It is an improvement over the legacy driver since there was only two
> speakers working. Volume is also louder than legacy driver ( snd-hda-intel ).
> 
> Dmic still no luck for now though, I will do further tests. if you have any
> pointers from the attached alsa-info, happy to test !

There is a known debugfs error in there, discard it, we are trying to figure out where it comes from (likely not from SOF).
The dmesg is cut so can't interpret it and figure out your setup.
please provide the full log with dynamic debug for the SOF parts
Also please list which firmware and topology files you are using, I don't know how you play on 4 speakers since we typically enable stereo only.
Comment 89 Tristan Mahe 2019-08-14 17:19:02 UTC
Created attachment 284393 [details]
dmesg with sof ddebug activated

Please find attached the dmesg with dynamic debug on boot for sof module. Tell me if you want other logs or different ddebug options. There does not seem to be more messages than before though.

I use the topology for 2 DMICs as provided on comment 70.

The firmware is sof-cnl-signed-intel.ri v1.3 directly from GitHub release ( and renamed as specified above ).

Upon further testing, I  think the issue was a wrong symlink on my part with the 4 dmic topology instead of the two, since now I get some very low volume recording with arecord on the DMIC16 card ( expected as the patch +20dB is not in the firmware I am using at the moment, and adding +20dB in Audacity makes the file audible ). I can't record yet using Audacity but it is probably user error or misconfig of pulseaudio, as arecord works.

I guess the only wonder now left is why the 4 speakers since it is the first time speaker-test -c 4 has an output for me on the back speakers ( although very faint ).
Comment 90 Pierre Bossart 2019-08-14 17:31:04 UTC
Tristan, do you mind testing with the latest SOF kernel https://github.com/thesofproject/linux/commits/topic/sof-dev and the topologies I'll add in attachment? That should provide you with a better sound level and no DC issues

You don't need to change anything in the firmware itself, it does not contain any gain values.
Comment 91 Pierre Bossart 2019-08-14 17:32:31 UTC
Created attachment 284395 [details]
latest HDaudio topology files

copy these files in /lib/firmware/intel/sof-tplg
(no symlinks required with the latest SOF kernel)
Comment 92 Tristan Mahe 2019-08-14 19:02:27 UTC
Created attachment 284409 [details]
dmesg while speaker-test -c 4

Thank you Pierre, just finished compiling the latest SOF kernel and testing.

Please find attached a dmesg while playing sound with speaker-test -c 4 and one while recording with arecord. I could not be fast enough to catch boot logs though, there is a lot of debug messages.

Tell me if you need to restrict a bit the dynamic debug with other options than all logs for sof module.

Still playing on the 4 speakers as the previous test, with the same low volume for the back speakers.

I can confirm the recording volume is also way better as you were expecting.

Gonna try now to get the mic exposed to pulseaudio to be able to use it in other GUIs apps.

Do not hesitate if you need other tests !
Comment 93 Tristan Mahe 2019-08-14 19:52:04 UTC
just reporting that the mic is not autodetected by udev but specifying it in /etc/pulse/default.pa ( load-module module-alsa-source device=hw:0,7 ) works perfectly.

Amazing !

Gonna now try to figure out what is happening with the 4 speakers...
Comment 94 Pierre Bossart 2019-08-14 20:59:23 UTC
looks like you have too many traces now...Anyways looks like you are in good shape.

We didn't use 'conventional' names for the DMIC capture so it's likely that PulseAudio don't know what to do. Same on the playback side, the stream names come from the DSP topology and are likely not aligned with the usual conventions.

I was thinking a UCM file is likely required for this, so that you get the correct devices and don't have to do any guess work. We haven't started the work on this yet but it's on the radar.

for the 4 speakers, it could be a bug on the topology side. I don't this we support this but will check.
Comment 95 Tristan Mahe 2019-08-14 21:18:36 UTC
Created attachment 284417 [details]
dmesg without all the traces

Yes, too many traces :)

I have recompiled removing the -DDEBUG in the Makefile in sound/soc/sof and got up with this one, it is a bit truncated from the beginning since it's been running a bit more, but it was the same as previous dmesg...

Few errors show up.

let me know if you need me to test anything !
Comment 96 Nils Hondong 2019-10-11 09:58:07 UTC
I even have the same Problem with a HP envy x360 dr0220ng. 

Audio Hardware is the same:

00:1f.3 Multimedia audio controller: Intel Corporation Device 9dc8 (rev 30)
	Subsystem: Hewlett-Packard Company Device 85e7

Sound is working with kernel 4.15 and 5.3, but it does not recognize the microphone.
Comment 97 Thomas 2019-11-03 06:13:41 UTC
I followed Pierre's comment #73 with blacklisting snd_hda_intel and snd_soc_skl and copying firmware and topology files from the SOF project.

Still something goes wrong:

[   84.441301] sof-audio-pci 0000:00:1f.3: No ASoC machine driver found - using nocodec

All SOF-related messages from dmesg attached below (how do I insert attachments?)

This is on a Thinkpad X1 Yoga, 4th gen, Intel Whiskey Lake CPU and Intel audio 8086:9dc8, running Kernel 5.3.0-19.

00:1f.3 Audio device [0403]: Intel Corporation Cannon Point-LP High Definition Audio Controller [8086:9dc8] (rev 11) (prog-if 80)

                       -------------

[   84.433656] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine driver found
[   84.433658] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040380
[   84.434109] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[   84.441301] sof-audio-pci 0000:00:1f.3: No ASoC machine driver found - using nocodec
[   84.444139] sof-audio-pci 0000:00:1f.3: unexpected ipc interrupt raised!
[   84.444141] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[   84.529692] sof-audio-pci 0000:00:1f.3: Firmware info: version 1:1:0-5dd9a
[   84.529693] sof-audio-pci 0000:00:1f.3: Firmware: ABI 3:7:0 Kernel ABI 3:8:0
[   84.529904] sof-audio-pci 0000:00:1f.3: firmware boot complete
[   84.530777] sof-nocodec sof-nocodec: info: override FE DAI link NoCodec-0
[   84.530778] sof-nocodec sof-nocodec: info: override FE DAI link NoCodec-1
[   84.530779] sof-nocodec sof-nocodec: info: override FE DAI link NoCodec-2
[   84.530780] sof-nocodec sof-nocodec: info: override FE DAI link NoCodec-3
[   84.530781] sof-nocodec sof-nocodec: info: override FE DAI link NoCodec-4
[   84.530781] sof-nocodec sof-nocodec: info: override FE DAI link NoCodec-5
[   84.530782] sof-nocodec sof-nocodec: info: override FE DAI link NoCodec-6
[   84.530783] sof-nocodec sof-nocodec: info: override FE DAI link NoCodec-7
[   84.530999] sof-audio-pci 0000:00:1f.3: Direct firmware load for intel/sof-tplg/sof-cnl-nocodec.tplg failed with error -2
[   84.531001] sof-audio-pci 0000:00:1f.3: error: tplg request firmware intel/sof-tplg/sof-cnl-nocodec.tplg failed err: -2
[   84.531003] sof-audio-pci 0000:00:1f.3: error: failed to load DSP topology -2
[   84.531005] sof-audio-pci 0000:00:1f.3: ASoC: failed to probe component -2
[   84.531364] sof-nocodec sof-nocodec: ASoC: failed to instantiate card -2
[   84.531378] sof-nocodec: probe of sof-nocodec failed with error -2
[   84.572888] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[   84.656175] sof-audio-pci 0000:00:1f.3: firmware boot complete

[   91.953802] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[   92.058349] sof-audio-pci 0000:00:1f.3: firmware boot complete
Comment 98 Jaroslav Kysela 2019-11-03 08:07:56 UTC
You have to compile the kernel driver without CONFIG_SND_SOC_SOF_NOCODEC_SUPPORT:

  # CONFIG_SND_SOC_SOF_NOCODEC_SUPPORT is not set
Comment 99 Thomas 2019-11-03 19:28:51 UTC
(In reply to Jaroslav Kysela from comment #98)
> You have to compile the kernel driver without
> CONFIG_SND_SOC_SOF_NOCODEC_SUPPORT:
> 
>   # CONFIG_SND_SOC_SOF_NOCODEC_SUPPORT is not set

This worked, thank you so much!
Comment 100 Pierre Bossart 2019-11-04 15:32:31 UTC
yes, it's a known problem, I sent a couple of corrections upstream to clarify what distros should enable, hopefully things should "just work" now.
Comment 101 David Ward 2019-11-13 15:10:06 UTC
(In reply to Pierre Bossart from comment #64)
> the solution will be to use the SOF driver, which does support HDaudio+dmic
> configurations. there's a bit of a delay to make the signed firmware
> sof-cnl.ri available (mostly due to vacation season).

Question: can this not be made to work using the SST driver as well (like it works under Windows, as I understand)? It appeared that this was heading that way before SOF was introduced as an alternative driver/firmware option. Is there a reason this is no longer considered viable:

(In reply to Pierre Bossart from comment #19)
> To play on the speaker, you can either use the hardware in legacy mode (as
> you tested with the snd_hda driver, or you can use the enhancement mode with
> the DSP enabled (with the Skylake/SST driver). When you use the DMIC you
> have to rely on the DSP.
> So basically we are now at feature parity with the HDaudio legacy stuff
> (speaker playback works for both cases) and only need to add DMIC support.

Having this work in both drivers wouldn't be a bad thing...

This bug seems to be what is pushing distributions to enable the SOF driver, without understanding the implications of it (additional firmware files need to be packaged or sound no longer works out-of-the-box; interaction occurs when the SST driver is also enabled (see bug 204237); etc.)
Comment 102 Pierre Bossart 2019-11-13 16:50:15 UTC
> Question: can this not be made to work using the SST driver as well (like it
> works under Windows, as I understand)? It appeared that this was heading
> that way before SOF was introduced as an alternative driver/firmware option.
> Is there a reason this is no longer considered viable:

The end-goal is really to have ONE driver that deals with all Intel platforms. This transition took more time than expected, it's unfortunate indeed.

There is no plan to provide further updates to the SST/Skylake driver.
HDaudio codecs, DMIC and SoundWire needs the SOF driver.
Comment 103 Robert 2019-11-14 14:03:18 UTC
Could you point me to the documentation for distros on what to enable?

I have now the following kernel config, derived from the previous config + kconfig-sof-default.sh from https://github.com/thesofproject/kconfig

/lib/firmware/intel/sof/sof-cnl-signed-intel.ri (sha1 28ad2a9afedfc0cf62b05ba8192dfa948ce5597e) + other files

/lib/firmware/intel/sof-tplg/sof-hda-generic.tplg (sha1 6fe2c4d64a9aca7ad259c396a85747ec11a1bd74) + other files

Kernel from https://github.com/thesofproject/linux#topic/sof-dev
and modprobe.blacklist=snd_hda_intel modprobe.blacklist=snd_soc_skl in Kernel command line.


The device is a HP EliteBook x360 1040 G5 with i7-8550U



% aplay -l
aplay: device_list:272: no soundcards found...

% arecord -l
arecord: device_list:272: no soundcards found...

And dmesg doesn't contain anything with "sof-" or "audio".
Comment 104 Robert 2019-11-14 14:04:31 UTC
Created attachment 285909 [details]
kernel config 5.4.0-rc7 Arch not working
Comment 105 David Ward 2019-11-14 15:04:56 UTC
(In reply to Robert from comment #103)
> Could you point me to the documentation for distros on what to enable?

SOF has been intentionally disabled in Arch Linux for now:

https://git.archlinux.org/svntogit/packages.git/commit/trunk/PKGBUILD?h=packages/linux&id=5eea0711df9dee2f91da7fd12aa07d8e8fd136d6
Comment 106 Pierre Bossart 2019-11-14 15:27:07 UTC
(In reply to Robert from comment #103)
> Could you point me to the documentation for distros on what to enable?
> 
> I have now the following kernel config, derived from the previous config +
> kconfig-sof-default.sh from https://github.com/thesofproject/kconfig

Can you start from make defconfig?
I have no idea what the 'previous config' might be.

Also you don't want any of the SOF developer options. We should probably move this out of the default or create a distro-safe kconfig

> 
> /lib/firmware/intel/sof/sof-cnl-signed-intel.ri (sha1
> 28ad2a9afedfc0cf62b05ba8192dfa948ce5597e) + other files
> 
> /lib/firmware/intel/sof-tplg/sof-hda-generic.tplg (sha1
> 6fe2c4d64a9aca7ad259c396a85747ec11a1bd74) + other files

There is a known issue if you take the latest HDAudio topology and use it with the signed firmware.

> Kernel from https://github.com/thesofproject/linux#topic/sof-dev
> and modprobe.blacklist=snd_hda_intel modprobe.blacklist=snd_soc_skl in
> Kernel command line.
> 
> 
> The device is a HP EliteBook x360 1040 G5 with i7-8550U
> 
> 
> 
> % aplay -l
> aplay: device_list:272: no soundcards found...
> 
> % arecord -l
> arecord: device_list:272: no soundcards found...
> 
> And dmesg doesn't contain anything with "sof-" or "audio".

wondering if you can share the pci ID for that device. I hope it's not KBL...

cd /sys/bus/pci/devices/0000\:00\:1f.3/
more device
more class

Note You need to log in before you can comment on or make changes to this bug.