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: RESOLVED CODE_FIX
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: 2023-07-30 14:26 UTC (History)
56 users (show)

See Also:
Kernel Version: 4.19
Subsystem:
Regression: No
Bisected commit-id:


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
nhlt.dsl (30.48 KB, text/x-csrc)
2020-04-15 08:07 UTC, Josep Lladonosa Capell
Details
Attachment of all dynamic_debug/control lines for kernel 5.6.4 in HP Elitebook 830 G6 (370.99 KB, text/plain)
2020-04-16 03:26 UTC, Josep Lladonosa Capell
Details
Attachment of sound related dynamic_debug/control lines for kernel 5.6.5 in HP Elitebook 830 G6 and sof DSP detections (51.46 KB, text/plain)
2020-04-19 06:14 UTC, Josep Lladonosa Capell
Details
ALSA info output for Acer Swift SF314-55G Ubuntu 18.04.4 (87.99 KB, text/plain)
2020-04-19 23:41 UTC, Siddharth Pant
Details
pulseaudio logs for Acer Swift SF314-55G (189.74 KB, text/plain)
2020-04-20 20:52 UTC, Siddharth Pant
Details
dmesg output as per comment 168 (77.88 KB, text/plain)
2020-05-06 09:39 UTC, glenn.mccarthy
Details
Data as per comment #177 (4.06 KB, text/plain)
2020-05-07 06:52 UTC, glenn.mccarthy
Details
dmesg on acer sf314-54g, arch linux (80.87 KB, text/plain)
2020-07-07 02:45 UTC, Nathaniel Evan
Details
Requested outputs for commands in comment#186, for Acer Swift SF314-54G running Arch Linux (3.56 KB, text/plain)
2020-07-07 03:15 UTC, Nathaniel Evan
Details
dmesg outputs. each scenario described in text file (3.55 KB, text/plain)
2020-08-31 07:18 UTC, Nathaniel Evan
Details
dmesg on Acer Swift SF514-52T running Ubuntu 20.10, as per comment #213. (81.57 KB, text/plain)
2020-10-27 01:09 UTC, Parinya Teerakasemsuk
Details
dmesg HP Zbook 17 G6, error: ipc error for 0x50010000 size 108 (115.32 KB, text/plain)
2020-10-30 12:39 UTC, Peter
Details
dmesg HP Zbook 17 G6, error: ipc error for 0x50010000 size 108 (131.83 KB, text/plain)
2020-10-30 13:02 UTC, Peter
Details
HP x360 1040 (82.72 KB, text/plain)
2020-10-30 22:21 UTC, DDD
Details
dmesg output for 1CH DMIC using ALSA generic SKL topology (2.82 KB, text/plain)
2020-11-07 16:45 UTC, benjamin.doron00
Details
NHLT ACPI table for 1CH DMIC (1.22 KB, application/gzip)
2020-11-09 21:46 UTC, benjamin.doron00
Details
Modified NHLT with added DMIC configuration blobs (1.47 KB, application/x-gzip)
2020-11-16 11:31 UTC, Mateusz Gorski
Details
Changes to NHLT parsing to support 1-mic configuration (4.32 KB, patch)
2021-02-02 17:44 UTC, Pierre Bossart
Details | Diff
Lenovo_C930_dmesg (80.78 KB, text/plain)
2021-02-06 13:17 UTC, ais
Details
alsa-info from Acer Swift 3 (5.04 KB, text/plain)
2021-02-08 15:32 UTC, Eli Melucci
Details
dmesg from Acer Swift 3 with debug logging (68.67 KB, text/plain)
2021-02-08 15:32 UTC, Eli Melucci
Details
verbose dmesg from Acer Swift 3 (no patch) (73.88 KB, text/plain)
2021-02-08 16:46 UTC, Eli Melucci
Details
manjaro kconfig from Acer Swift 3 (248.09 KB, text/plain)
2021-02-09 10:20 UTC, Eli Melucci
Details
alsa-info from Swift 3 with HDAUDIO_CODEC compiled (29.46 KB, text/plain)
2021-02-09 13:35 UTC, Eli Melucci
Details
dmesg from Swift 3 with HDAUDIO_CODEC compiled (85.99 KB, text/plain)
2021-02-09 13:35 UTC, Eli Melucci
Details
complete dmesg from Swift 3 with HDAUDIO_CODEC compiled (260.50 KB, text/plain)
2021-02-09 14:12 UTC, Eli Melucci
Details
dmesg when running arecord, swift 3 (129.88 KB, text/plain)
2021-02-09 16:10 UTC, Eli Melucci
Details
arecord output for dmic, swift 3 (503 bytes, text/plain)
2021-02-09 16:11 UTC, Eli Melucci
Details
dmesg for the second run of arecord (134.08 KB, text/plain)
2021-02-10 10:57 UTC, Eli Melucci
Details
second run of arecord on swift 3 (406 bytes, text/plain)
2021-02-10 10:59 UTC, Eli Melucci
Details
arecord logs for swift 3 without pulseaudio noise (2.69 KB, text/plain)
2021-02-23 10:42 UTC, Eli Melucci
Details
dmesg for arecord with more debug info (15.80 KB, text/plain)
2021-02-23 15:38 UTC, Eli Melucci
Details
dmesg for arecord with even more debug info (17.83 KB, text/plain)
2021-02-23 16:26 UTC, Eli Melucci
Details
patch adding more debug logs (7.00 KB, patch)
2021-02-24 11:29 UTC, Amadeusz Sławiński
Details | Diff
boot 5.11 dmesg from Swift 3 with HDAUDIO_CODEC compiled (99.61 KB, application/octet-stream)
2021-03-14 12:00 UTC, Eli Melucci
Details
dmesg for arecord with debug info, 5.11, swift 3 (21.59 KB, application/octet-stream)
2021-03-14 13:34 UTC, Eli Melucci
Details
patch adding more debug logs 2 (18.12 KB, patch)
2021-03-15 09:50 UTC, Amadeusz Sławiński
Details | Diff
Patch application failure (2.97 KB, patch)
2021-03-15 10:46 UTC, Eli Melucci
Details | Diff
patch adding more debug logs 3 (18.40 KB, patch)
2021-03-15 10:59 UTC, Amadeusz Sławiński
Details | Diff
Swift 3, dmesg, moredebug3 patch (22.56 KB, text/plain)
2021-03-15 12:49 UTC, Eli Melucci
Details
patch adding more debug logs 4 (9.89 KB, patch)
2021-03-16 15:53 UTC, Amadeusz Sławiński
Details | Diff
Swift 3, dmesg, moredebug4 patch (27.46 KB, application/octet-stream)
2021-03-17 13:17 UTC, Eli Melucci
Details
patch adding more debug logs 5 (12.54 KB, patch)
2021-03-17 13:56 UTC, Amadeusz Sławiński
Details | Diff
Swift 3, dmesg, moredebug5 patch (22.86 KB, application/octet-stream)
2021-03-17 15:39 UTC, Eli Melucci
Details
attachment-13893-0.html (5.88 KB, text/html)
2021-08-30 02:01 UTC, Ruben
Details
attachment-31016-0.html (1.39 KB, text/html)
2023-07-30 12:37 UTC, dmbohdan
Details
attachment-6363-0.html (282 bytes, text/html)
2023-07-30 13:03 UTC, dmbohdan
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
Comment 107 Robert 2019-11-15 17:59:09 UTC
(In reply to David Ward from comment #105) 
> 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

Thanks, that's interesting. 
I had CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=y and CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL=y which apparently leads to an issue. However, with CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=n there's still no soundcard detected.

(In reply to Pierre Bossart from comment #106)
> (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 started from defconfig (and added necessary config for dm_crypt cryptroot). Still no luck


> 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

A distro-safe kconfig would be highly appreaciated.
 
> There is a known issue if you take the latest HDAudio topology and use it
> with the signed firmware.

Are there firmware and topology files available, which don't have this issue?


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

more /sys/bus/pci/devices/0000:00:1f.3/device
0x9d71

more /sys/bus/pci/devices/0000:00:1f.3/class
0x040100
Comment 108 Jaroslav Kysela 2019-11-15 18:05:45 UTC
> Are there firmware and topology files available, which don't have this issue?

You may try this tar ball with the firmware and topology files:

ftp://ftp.alsa-project.org/pub/misc/sof/sof-firmware-1.3.1.tar.bz2
Comment 109 Pierre Bossart 2019-11-15 18:07:49 UTC
> more /sys/bus/pci/devices/0000:00:1f.3/device
> 0x9d71

That's a KabyLake device.

#if IS_ENABLED(CONFIG_SND_SOC_INTEL_KBL)
	/* KBL */
	{ PCI_DEVICE(0x8086, 0x9D71),
		.driver_data = (unsigned long)&snd_soc_acpi_intel_kbl_machines},
#endif

Unfortunately this device is not supported by SOF at the moment, and 
DMICs are not supported by the SST driver in combination with HDaudio.

At some point SOF will support KabyLake but that's just not there today.
I can only apologize and ask you to be patient.
Comment 110 Robert 2019-11-18 14:28:11 UTC
(In reply to Pierre Bossart from comment #109)
> Unfortunately this device is not supported by SOF at the moment, and 
> DMICs are not supported by the SST driver in combination with HDaudio.
> 
> At some point SOF will support KabyLake but that's just not there today.
> I can only apologize and ask you to be patient.

Thanks, is there another bug to track the progress for KabyLake or will the updates follow here?
Comment 111 Pierre Bossart 2019-11-18 17:04:55 UTC
I would engage people that have issues with DMIC enablement to report their case here.

When SOF became the new direction, we made the assumption that we could start with the firmware boot flow used for ApolloLake and newer platforms. It turned out to be a partly flawed assumption since OEMs shipped products based on Kabylake which uses a different boot process. We really need to fork-lift this boot support but as usual it's a matter of competing priorities and milestones.
Comment 112 Peter F. Patel-Schneider 2019-11-24 13:55:42 UTC
By here do you mean in this bug report or to this bugzilla?


I have a new Lenovo Yoga C940, which has an i7-1065G7 CPU.

The microphone array is not working with snd_hda_intel, nor are three of the five speakers.  I've tried to connect them by using hdajackretask but nothing I'm trying is working so I'm making the assumption that they are connected via the Intel audio controller
00:1f.3 Multimedia audio controller: Intel Corporation Device 34c8 (rev 30)

I'm running Fedora 31 and blacklisting snd_hda_intel doesn't help.  

Is there a possibility that SOF will handle the microphones?  If so, how do I set things up so that SOF has a chance of working?
Comment 113 Jaroslav Kysela 2019-11-24 14:11:49 UTC
(In reply to Peter F. Patel-Schneider from comment #112)
> By here do you mean in this bug report or to this bugzilla?
> 
> 
> I have a new Lenovo Yoga C940, which has an i7-1065G7 CPU.

...

> Is there a possibility that SOF will handle the microphones?  If so, how do
> I set things up so that SOF has a chance of working?

You need most likely the SOF kernel, Fedora bug with a test kernel is here:

https://bugzilla.redhat.com/show_bug.cgi?id=1772498

It's the WiP, not all issues are resolved (problems with the old firmware and topology, some other litle UCM issues). Just read the comments.
Comment 114 Peter F. Patel-Schneider 2019-11-24 18:07:41 UTC
OK, I'm working with that kernel.  I've encountered some problems but I'll work them out at https://bugzilla.redhat.com/show_bug.cgi?id=1772498
Comment 115 arthur 2020-01-01 15:54:37 UTC
Just to add to the list of affected devices:

Machine:   Device: laptop System: LENOVO product: 20HR0068GE v: ThinkPad X1 Carbon 5th serial: <filter>
           Mobo: LENOVO model: 20HR0068GE v: SDK0J40697 WIN serial: <filter>
           UEFI [Legacy]: LENOVO v: N1MET37W (1.22 ) date: 07/04/2017
CPU:       Dual core Intel Core i7-7500U (-MT-MCP-)
           arch: Kaby Lake rev.9 cache: 4096 KB
Audio:     Card Intel Sunrise Point-LP HD Audio
           driver: snd_hda_intel bus-ID: 00:1f.3
           Sound: Advanced Linux Sound Architecture v: k5.0.0-37-generic

# lspci -nn|grep Audio
00:1f.3 Audio device [0403]: Intel Corporation Sunrise Point-LP HD Audio [8086:9d71] (rev 21)
Comment 116 Nathaniel Evan 2020-01-05 05:05:06 UTC
My machine is also affected by this bug. Any updates?

Machine:
  Type: Laptop System: Acer product: Swift SF314-54G v: V1.16 
  serial: <root required> 
  Mobo: KBL model: Strongbow_KL v: V1.16 serial: <root required> 
  UEFI: Insyde v: 1.16 date: 05/30/2019 

CPU:
  Topology: Quad Core model: Intel Core i5-8250U bits: 64 type: MT MCP 
  arch: Kaby Lake rev: A L2 cache: 6144 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 28808 
  Speed: 800 MHz min/max: 400/3400 MHz Core speeds (MHz): 1: 801 2: 800 
  3: 775 4: 800 5: 787 6: 800 7: 800 8: 802 

Audio:
  Device-1: Intel Sunrise Point-LP HD Audio vendor: Acer Incorporated ALI 
  driver: snd_hda_intel v: kernel bus ID: 00:1f.3 
  Sound Server: ALSA v: k5.4.7-arch1-1 

# lspci -nn | grep Audio
00:1f.3 Multimedia audio controller [0401]: Intel Corporation Sunrise Point-LP HD Audio [8086:9d71] (rev 21)
Comment 117 Vasyl 2020-01-24 15:55:56 UTC
acer sf315-52 is affected too

00:1f.3 Multimedia audio controller [0401]: Intel Corporation Sunrise Point-LP HD Audio [8086:9d71] (rev 21)
Comment 118 Vasyl 2020-01-24 23:27:45 UTC
The difference between this and previous message is like 7 hours, but I got it worked. 
But only with external microphone via jack 
Here's what I did:
1) run
>pavucontrol
and pick "analog stereo duplex" in the "configuration" tab.(for some reason only "analog stereo output" was there by default)
2) and close the app (it cannot run together with next app same time) 
2) run
> hdajackretask
from "alsa-tools-gui" package
3) select codec "Realtek ALC256" in the bottom
4) click "show unconnected pins" on menu on right panel 
5)By trying one by one I found that override pin ID 0x19 to the "Microphone" did the trick.

All the time the headset was in the jack.
Also nice to have onboard mic also worked, but seems other configuration or pins there(haven't found).

Can I help in development somehow by providing some info from my PC?
Comment 119 Perry.Yuan 2020-01-25 00:57:15 UTC
Hey there,
Thanks for reaching out. I am on Chinese New Year holiday.
I’m out of the office with no access to email. I’ll be responding to the emails I missed when I return on  2/2 .

[Image]

Happy New Year!
Best Regards!
Comment 120 Kristiyan 2020-02-25 13:38:11 UTC
Hi, is there an update on the issue? A lot of laptops are affected, including the new inspiron 7590 from Dell.
Comment 121 Pierre Bossart 2020-02-25 15:26:17 UTC
(In reply to Kristiyan from comment #120)
> Hi, is there an update on the issue? A lot of laptops are affected,
> including the new inspiron 7590 from Dell.

Just to double-check this is the same issue, can you post the results of the following command on his Inspiron 7590?
lspci -nn | grep Audio
Comment 122 Kristiyan 2020-02-25 18:56:21 UTC
Hi, the output was empty, so I give you only lspci -nn:

00:00.0 Host bridge [0600]: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers [8086:3ec4] (rev 07)
00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 07)
00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:3e9b]
00:04.0 Signal processing controller [1180]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem [8086:1903] (rev 07)
00:08.0 System peripheral [0880]: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model [8086:1911]
00:12.0 Signal processing controller [1180]: Intel Corporation Cannon Lake PCH Thermal Controller [8086:a379] (rev 10)
00:13.0 Serial controller [0700]: Intel Corporation Device [8086:a37c] (rev 10)
00:14.0 USB controller [0c03]: Intel Corporation Cannon Lake PCH USB 3.1 xHCI Host Controller [8086:a36d] (rev 10)
00:14.2 RAM memory [0500]: Intel Corporation Cannon Lake PCH Shared SRAM [8086:a36f] (rev 10)
00:14.3 Network controller [0280]: Intel Corporation Wireless-AC 9560 [Jefferson Peak] [8086:a370] (rev 10)
00:15.0 Serial bus controller [0c80]: Intel Corporation Device [8086:a368] (rev 10)
00:15.1 Serial bus controller [0c80]: Intel Corporation Device [8086:a369] (rev 10)
00:16.0 Communication controller [0780]: Intel Corporation Cannon Lake PCH HECI Controller [8086:a360] (rev 10)
00:17.0 SATA controller [0106]: Intel Corporation Device [8086:a353] (rev 10)
00:1b.0 PCI bridge [0604]: Intel Corporation Device [8086:a340] (rev f0)
00:1d.0 PCI bridge [0604]: Intel Corporation Cannon Lake PCH PCI Express Root Port 9 [8086:a330] (rev f0)
00:1f.0 ISA bridge [0601]: Intel Corporation Device [8086:a30d] (rev 10)
00:1f.3 Multimedia audio controller [0401]: Intel Corporation Cannon Lake PCH cAVS [8086:a348] (rev 10)
00:1f.4 SMBus [0c05]: Intel Corporation Cannon Lake PCH SMBus Controller [8086:a323] (rev 10)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH SPI Controller [8086:a324] (rev 10)
01:00.0 3D controller [0302]: NVIDIA Corporation Device [10de:1f91] (rev a1)
3b:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd Device [144d:a809]
Comment 123 Pierre Bossart 2020-02-25 19:11:38 UTC
00:1f.3 Multimedia audio controller [0401]: Intel Corporation Cannon Lake PCH
cAVS [8086:a348] (rev 10)

That's a supported platform, you should get the DMIC functionality with the SOF driver. The issue is only with platforms using the PCI ID [8086:9d71]
Comment 124 Kristiyan 2020-02-25 21:02:59 UTC
SOF comes shipped with kernel 5.2, I have 5.3.0 and still no support, but thanks!
Comment 125 rb 2020-02-25 21:34:54 UTC
I'm on the same boat here, Lenovo X1 Carbon Gen7 :
$ dmesg | grep audio
[   24.711915] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   24.774599] snd_hda_codec_realtek hdaudioC0D0: autoconfig for ALC285: line_outs=2 (0x14/0x17/0x0/0x0/0x0) type:speaker
[   24.774601] snd_hda_codec_realtek hdaudioC0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[   24.774603] snd_hda_codec_realtek hdaudioC0D0:    hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[   24.774604] snd_hda_codec_realtek hdaudioC0D0:    mono: mono_out=0x0
[   24.774605] snd_hda_codec_realtek hdaudioC0D0:    inputs:
[   24.774607] snd_hda_codec_realtek hdaudioC0D0:      Mic=0x19

Kernel: 5.4.20-200.fc31.x86_64 

On kernel 5.5.5, there's no audio at all.
Comment 126 Jaroslav Kysela 2020-02-25 22:14:50 UTC
Fedora bug: https://bugzilla.redhat.com/show_bug.cgi?id=1772498

Please, don't report the specific distribution issues here.
Comment 127 Ruben 2020-02-26 06:57:22 UTC
Me too, HP EliteBook x360. I've lived with this for months now, booting with the snd_hda_intel.dsp_driver=0 flag, and keeping myself on the latest kernel until now. 

I confirm no audio at all with 5.5.5 :

$ dmesg | grep audio
[   16.286925] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[   16.287674] sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[   16.287695] sof-audio-pci 0000:00:1f.3: enabling device (0000 -> 0002)
[   16.288298] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine driver found
[   16.288322] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[   16.288674] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[   16.289358] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   16.298199] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[   16.298206] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[   16.372919] sof-audio-pci 0000:00:1f.3: Direct firmware load for intel/sof/sof-cnl.ri failed with error -2
[   16.372927] sof-audio-pci 0000:00:1f.3: error: request firmware intel/sof/sof-cnl.ri failed err: -2
[   16.372932] sof-audio-pci 0000:00:1f.3: error: failed to load DSP firmware -2
[   16.372936] sof-audio-pci 0000:00:1f.3: error: sof_probe_work failed err: -2
Comment 128 Pierre Bossart 2020-02-26 15:30:05 UTC
> [   16.372919] sof-audio-pci 0000:00:1f.3: Direct firmware load for
> intel/sof/sof-cnl.ri failed with error -2
> [   16.372927] sof-audio-pci 0000:00:1f.3: error: request firmware
> intel/sof/sof-cnl.ri failed err: -2
> [   16.372932] sof-audio-pci 0000:00:1f.3: error: failed to load DSP
> firmware -2
> [   16.372936] sof-audio-pci 0000:00:1f.3: error: sof_probe_work failed err:
> -2

You're missing the firmware file... Updating your kernel is nice but unless you have the firmware file in /lib/firmware/intel/sof you'll keep getting the same error. You also need a topology file in /lib/firmware/intel/sof-tplg
Comment 129 Nathaniel Evan 2020-03-06 22:28:33 UTC
I saw on this bug page https://bugzilla.redhat.com/show_bug.cgi?id=1772498 that this issue has been fixed with several new packages on Fedora; have these made their way upstream?
Comment 130 rb 2020-03-09 19:20:34 UTC
(In reply to Ruben from comment #127)
> Me too, HP EliteBook x360. I've lived with this for months now, booting with
> the snd_hda_intel.dsp_driver=0 flag, and keeping myself on the latest kernel
> until now. 
> 
> I confirm no audio at all with 5.5.5 :
> 
> $ dmesg | grep audio
> [   16.286925] sof-audio-pci 0000:00:1f.3: DSP detected with PCI
> class/subclass/prog-if info 0x040100
> [   16.287674] sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+
> platform, using SOF driver
> [   16.287695] sof-audio-pci 0000:00:1f.3: enabling device (0000 -> 0002)
> [   16.288298] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine
> driver found
> [   16.288322] sof-audio-pci 0000:00:1f.3: DSP detected with PCI
> class/subclass/prog-if 0x040100
> [   16.288674] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
> [   16.289358] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops
> i915_audio_component_bind_ops [i915])
> [   16.298199] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
> [   16.298206] sof-audio-pci 0000:00:1f.3: using HDA machine driver
> skl_hda_dsp_generic now
> [   16.372919] sof-audio-pci 0000:00:1f.3: Direct firmware load for
> intel/sof/sof-cnl.ri failed with error -2
> [   16.372927] sof-audio-pci 0000:00:1f.3: error: request firmware
> intel/sof/sof-cnl.ri failed err: -2
> [   16.372932] sof-audio-pci 0000:00:1f.3: error: failed to load DSP
> firmware -2
> [   16.372936] sof-audio-pci 0000:00:1f.3: error: sof_probe_work failed err:
> -2

I had this exact issue until I did : dnf install alsa-firmware

running 5.5.7-200

Mic still doesn't work but at least i have audio output.
Comment 131 Ruben 2020-03-10 06:41:54 UTC
(In reply to rb from comment #130)
> (In reply to Ruben from comment #127)
> > Me too, HP EliteBook x360. I've lived with this for months now, booting
> with
> > the snd_hda_intel.dsp_driver=0 flag, and keeping myself on the latest
> kernel
> > until now. 
> > 
> > I confirm no audio at all with 5.5.5 :
> > 
> > $ dmesg | grep audio
> > [   16.286925] sof-audio-pci 0000:00:1f.3: DSP detected with PCI
> > class/subclass/prog-if info 0x040100
> > [   16.287674] sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+
> > platform, using SOF driver
> > [   16.287695] sof-audio-pci 0000:00:1f.3: enabling device (0000 -> 0002)
> > [   16.288298] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC
> machine
> > driver found
> > [   16.288322] sof-audio-pci 0000:00:1f.3: DSP detected with PCI
> > class/subclass/prog-if 0x040100
> > [   16.288674] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
> > [   16.289358] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops
> > i915_audio_component_bind_ops [i915])
> > [   16.298199] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
> > [   16.298206] sof-audio-pci 0000:00:1f.3: using HDA machine driver
> > skl_hda_dsp_generic now
> > [   16.372919] sof-audio-pci 0000:00:1f.3: Direct firmware load for
> > intel/sof/sof-cnl.ri failed with error -2
> > [   16.372927] sof-audio-pci 0000:00:1f.3: error: request firmware
> > intel/sof/sof-cnl.ri failed err: -2
> > [   16.372932] sof-audio-pci 0000:00:1f.3: error: failed to load DSP
> > firmware -2
> > [   16.372936] sof-audio-pci 0000:00:1f.3: error: sof_probe_work failed
> err:
> > -2
> 
> I had this exact issue until I did : dnf install alsa-firmware
> 
> running 5.5.7-200
> 
> Mic still doesn't work but at least i have audio output.

I did that when someone pointed me out that I was missing some firmware, but I still have no audio at all with 5.5.7-200. I can suspend my machine again though.

That is a feature I took for granted, and I will take more seriously from now on :D. I can live without audio (any bluetooth headphones or any USB comm dongle allows me to have flawless video calls). But before 5.5.7, the audio problem had the side effect of preventing my machine from suspending. Then I learned to appreciate suspension as a big feature, not only as a nice-to-have.

Cheers.
Comment 132 Tobias Grosser 2020-03-20 05:34:08 UTC
Hi,

I would like to ask if you guys could guide me through the setup of the sound card of my Thinkpad Yoga X1 Gen 4 on Ubuntu 20.04 with Linux 5.5.0.

After disabling dmic, I managed to get audio output using the hda driver. Now I would like to get both audio output and microphone input.

This is my card:

00:1f.3 Audio device: Intel Corporation Cannon Point-LP High Definition Audio Controller (rev 11) (prog-if 80)
        Subsystem: Lenovo Cannon Point-LP High Definition Audio Controller
        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: 64
        Interrupt: pin A routed to IRQ 154
        Region 0: Memory at ea33c000 (64-bit, non-prefetchable) [size=16K]
        Region 4: Memory at ea000000 (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: 00000000fee00578  Data: 0000
        Kernel driver in use: sof-audio-pci

This is my grub line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash modprobe.blacklist=snd_hda_intel,snd-soc-skl"

And setup the sof firmware directories as follows:

/lib/firmware/intel/sof:
total 272
lrwxrwxrwx 1 root    root        47 Mär 19 22:05 sof-cnl.ri -> /lib/firmware/intel/sof/sof-cnl-signed-intel.ri
-rw-r--r-- 1 grosser grosser 278528 Jul 23  2019 sof-cnl-signed-intel.ri

/lib/firmware/intel/sof-tplg:
total 44
-rw-r--r-- 1 grosser grosser 42995 Mär 19 22:11 sof-hda-generic.tplg

The sof-hda-generic.tplg file is the one from Comment 17

My dmesg is showing:

[   32.948551] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040380
[   32.948777] sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[   32.948986] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine driver found
[   32.948993] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040380
[   32.949150] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[   32.949505] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   32.963344] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[   32.963346] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[   33.038132] sof-audio-pci 0000:00:1f.3: unexpected ipc interrupt raised!
[   33.038134] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[   33.119627] sof-audio-pci 0000:00:1f.3: Firmware info: version 1:1:0-5dd9a
[   33.119629] sof-audio-pci 0000:00:1f.3: Firmware: ABI 3:7:0 Kernel ABI 3:11:0
[   33.119839] sof-audio-pci 0000:00:1f.3: firmware boot complete
[   33.312378] sof-audio-pci 0000:00:1f.3: Direct firmware load for intel/sof-tplg/sof-hda-generic-4ch.tplg failed with error -2
[   33.312381] sof-audio-pci 0000:00:1f.3: error: tplg request firmware intel/sof-tplg/sof-hda-generic-4ch.tplg failed err: -2
[   33.312383] sof-audio-pci 0000:00:1f.3: error: failed to load DSP topology -2
[   33.312385] sof-audio-pci 0000:00:1f.3: ASoC: failed to probe component -2

Unfortunately, I do not get any audio devices at this point. I think I successfully managed to get the right driver, get a signed firmware booted, ut somehow fail to get a tplg loaded. My suspicion is that I just loaded the wrong topology file, but I have no idea which one I would need and where to obtain it.

I tried to build all topology files in the sof repository by running ./scripts/build-tools.sh but run into this error:

ALSA lib dapm.c:547:(tplg_parse_dapm_widget) widget 'ASRC1.0': Unsupported widget type asrc
ALSA lib parser.c:213:(tplg_load_config) failed to parse topology
Unable to load configuration: Invalid argument
make[2]: *** [topology/CMakeFiles/topology_sof-apl-asrc-pcm512x.dir/build.make:61: topology/sof-apl-asrc-pcm512x.tplg] Error 1
make[1]: *** [CMakeFiles/Makefile2:679: topology/CMakeFiles/topology_sof-apl-asrc-pcm512x.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

using the following revision of the repo:

commit c639886ddcae5ad8cc758e36521e7d645301a700 (HEAD -> master, origin/master, origin/HEAD)
Author: Paul Olaru <paul.olaru@nxp.com>
Date:   Wed Mar 18 15:06:09 2020 +0200

I was wondering if anyone here could give me a some directions on how to get this thing working?
Comment 133 Pierre Bossart 2020-03-20 12:24:31 UTC
> [   33.312378] sof-audio-pci 0000:00:1f.3: Direct firmware load for
> intel/sof-tplg/sof-hda-generic-4ch.tplg failed with error -2
> [   33.312381] sof-audio-pci 0000:00:1f.3: error: tplg request firmware
> intel/sof-tplg/sof-hda-generic-4ch.tplg failed err: -2
> [   33.312383] sof-audio-pci 0000:00:1f.3: error: failed to load DSP
> topology -2

You don't have the right topology, or it was renamed to handle 2 and 4 channels.

> ALSA lib dapm.c:547:(tplg_parse_dapm_widget) widget 'ASRC1.0': Unsupported
> widget type asrc
> ALSA lib parser.c:213:(tplg_load_config) failed to parse topology
> Unable to load configuration: Invalid argument
> make[2]: ***
> [topology/CMakeFiles/topology_sof-apl-asrc-pcm512x.dir/build.make:61:
> topology/sof-apl-asrc-pcm512x.tplg] Error 1
> make[1]: *** [CMakeFiles/Makefile2:679:
> topology/CMakeFiles/topology_sof-apl-asrc-pcm512x.dir/all] Error 2
> make: *** [Makefile:130: all] Error 2

Known issue now fixed in alsa-lib.

Just take all the firmware and topology from 
https://github.com/thesofproject/sof-bin/tree/stable-v1.4.2

the go.sh script will install everything. Just save /lib/firmware/intel/sof and /lib/firmware/intel/sof-tplg beforehand should you want to restore your system.

we'll probably change to a Makefile and add more capabilities for the install but that should do for now.
Comment 134 Tobias Grosser 2020-03-20 13:07:43 UTC
Wow, I am impressed. This was super fast. Installing the new firmware worked very smoothly. It now seems to me that the kernel side works as expected. Unfortunately, pavucontrol does not yet show any of these inputs/outputs.

I will try to debug this a little, but if something obvious in my outputs below is visible, I would be glad to get a pointer of where to look.

> dmesg | egrep 'audio|dsp'
[   19.891619] systemd[1]: Mounting Mount unit for pulseaudio, revision 9...
[   20.315820] usbcore: registered new interface driver snd-usb-audio
[   20.341950] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040380
[   20.342133] sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[   20.342305] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine driver found
[   20.342311] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040380
[   20.342439] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[   20.342564] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   20.352766] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[   20.352768] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[   20.400590] sof-audio-pci 0000:00:1f.3: unexpected ipc interrupt raised!
[   20.400592] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[   20.500327] sof-audio-pci 0000:00:1f.3: Firmware info: version 1:4:2-66a5a
[   20.500329] sof-audio-pci 0000:00:1f.3: Firmware: ABI 3:11:0 Kernel ABI 3:11:0
[   20.500575] sof-audio-pci 0000:00:1f.3: firmware boot complete
[   20.675060] skl_hda_dsp_generic skl_hda_dsp_generic: info: override BE DAI link iDisp1
[   20.675062] skl_hda_dsp_generic skl_hda_dsp_generic: info: override BE DAI link iDisp2
[   20.675062] skl_hda_dsp_generic skl_hda_dsp_generic: info: override BE DAI link iDisp3
[   20.675063] skl_hda_dsp_generic skl_hda_dsp_generic: info: override BE DAI link Analog Playback and Capture
[   20.675064] skl_hda_dsp_generic skl_hda_dsp_generic: info: override BE DAI link Digital Playback and Capture
[   20.675064] skl_hda_dsp_generic skl_hda_dsp_generic: info: override BE DAI link dmic01
[   20.675065] skl_hda_dsp_generic skl_hda_dsp_generic: info: override BE DAI link dmic16k
[   20.675532] sof-audio-pci 0000:00:1f.3: Topology: ABI 3:11:0 Kernel ABI 3:11:0
[   20.675536] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp3 Tx not handled
[   20.676867] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name codec0_in not handled
[   20.676869] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp2 Tx not handled
[   20.678190] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name codec1_in not handled
[   20.678202] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp1 Tx not handled
[   20.681039] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name codec0_out not handled
[   20.681040] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name Analog CPU Playback not handled
[   20.682522] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name codec1_out not handled
[   20.682524] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name Digital CPU Playback not handled
[   20.682525] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name codec2_in not handled
[   20.682526] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name Alt Analog CPU Playback not handled
[   20.682527] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name codec2_out not handled
[   20.682527] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name Analog CPU Capture not handled
[   20.683875] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp1_out not handled
[   20.683876] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name Digital CPU Capture not handled
[   20.684594] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp2_out not handled
[   20.684595] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name Alt Analog CPU Capture not handled
[   20.685500] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp3_out not handled
[   20.692557] sof-audio-pci 0000:00:1f.3: ASoC: Parent card not yet available, widget card binding deferred
[   20.716635] snd_hda_codec_realtek ehdaudio0D0: autoconfig for ALC285: line_outs=2 (0x14/0x17/0x0/0x0/0x0) type:speaker
[   20.716636] snd_hda_codec_realtek ehdaudio0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[   20.716637] snd_hda_codec_realtek ehdaudio0D0:    hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[   20.716637] snd_hda_codec_realtek ehdaudio0D0:    mono: mono_out=0x0
[   20.716638] snd_hda_codec_realtek ehdaudio0D0:    inputs:
[   20.716638] snd_hda_codec_realtek ehdaudio0D0:      Mic=0x19
[   20.770500] snd_hda_codec_realtek ehdaudio0D0: ASoC: sink widget AIF1TX overwritten
[   20.770509] snd_hda_codec_realtek ehdaudio0D0: ASoC: source widget AIF1RX overwritten
[   20.770536] skl_hda_dsp_generic skl_hda_dsp_generic: intel-hdmi-hifi1 <-> iDisp1 Pin mapping ok
[   20.770539] skl_hda_dsp_generic skl_hda_dsp_generic: intel-hdmi-hifi2 <-> iDisp2 Pin mapping ok
[   20.770541] skl_hda_dsp_generic skl_hda_dsp_generic: intel-hdmi-hifi3 <-> iDisp3 Pin mapping ok
[   20.770543] skl_hda_dsp_generic skl_hda_dsp_generic: Analog Codec DAI <-> Analog CPU DAI mapping ok
[   20.770545] skl_hda_dsp_generic skl_hda_dsp_generic: Digital Codec DAI <-> Digital CPU DAI mapping ok
[   20.770547] skl_hda_dsp_generic skl_hda_dsp_generic: dmic-hifi <-> DMIC01 Pin mapping ok
[   20.770550] skl_hda_dsp_generic skl_hda_dsp_generic: dmic-hifi <-> DMIC16k Pin mapping ok
[   20.770567] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <-> DMIC48kHz 6 mapping ok
[   20.770582] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <-> DMIC16kHz 7 mapping ok
[   20.770603] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <-> HDA Analog 0 mapping ok
[   20.770630] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <-> HDA Digital 1 mapping ok
[   20.770641] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <-> HDMI1 3 mapping ok
[   20.770652] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <-> HDMI2 4 mapping ok
[   20.770662] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <-> HDMI3 5 mapping ok
[   20.770716] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi3 overwritten
[   20.770719] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi2 overwritten
[   20.770723] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi1 overwritten
[   20.770726] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Codec Output Pin1 overwritten
[   20.770729] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Codec Input Pin1 overwritten
[   20.770733] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Analog Codec Playback overwritten
[   20.770738] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Digital Codec Playback overwritten
[   20.770742] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Alt Analog Codec Playback overwritten
[   20.770748] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Analog Codec Capture overwritten
[   20.770752] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Digital Codec Capture overwritten
[   20.770756] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Alt Analog Codec Capture overwritten
[   20.787069] input: sof-hda-dsp Mic as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input30
[   20.798812] input: sof-hda-dsp Headphone as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input31
[   20.798963] input: sof-hda-dsp HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input32
[   20.799014] input: sof-hda-dsp HDMI/DP,pcm=4 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input33
[   20.799123] input: sof-hda-dsp HDMI/DP,pcm=5 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input34
[  585.450960] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[  585.545209] sof-audio-pci 0000:00:1f.3: firmware boot complete

grosser@grosser-ThinkPad-X1-Yoga-4th:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sofhdadsp [sof-hda-dsp], device 0: HDA Analog (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 1: HDA Digital (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 3: HDMI1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 4: HDMI2 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofhdadsp [sof-hda-dsp], device 5: HDMI3 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: USB [ThinkPad Thunderbolt 3 Dock USB], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
grosser@grosser-ThinkPad-X1-Yoga-4th:~$ aplay -L
default
    Playback/recording through the PulseAudio sound server
null
    Discard all samples (playback) or generate zero samples (capture)
samplerate
    Rate Converter Plugin Using Samplerate Library
speexrate
    Rate Converter Plugin Using Speex Resampler
jack
    JACK Audio Connection Kit
oss
    Open Sound System
pulse
    PulseAudio Sound Server
upmix
    Plugin for channel upmix (4,6,8)
vdownmix
    Plugin for channel downmix (stereo) with a simple spacialization
sysdefault:CARD=sofhdadsp
    sof-hda-dsp, 
    Default Audio Device
dmix:CARD=sofhdadsp,DEV=0
    sof-hda-dsp, 
    Direct sample mixing device
dmix:CARD=sofhdadsp,DEV=1
    sof-hda-dsp, 
    Direct sample mixing device
dmix:CARD=sofhdadsp,DEV=3
    sof-hda-dsp, 
    Direct sample mixing device
dmix:CARD=sofhdadsp,DEV=4
    sof-hda-dsp, 
    Direct sample mixing device
dmix:CARD=sofhdadsp,DEV=5
    sof-hda-dsp, 
    Direct sample mixing device
dsnoop:CARD=sofhdadsp,DEV=0
    sof-hda-dsp, 
    Direct sample snooping device
dsnoop:CARD=sofhdadsp,DEV=1
    sof-hda-dsp, 
    Direct sample snooping device
dsnoop:CARD=sofhdadsp,DEV=3
    sof-hda-dsp, 
    Direct sample snooping device
dsnoop:CARD=sofhdadsp,DEV=4
    sof-hda-dsp, 
    Direct sample snooping device
dsnoop:CARD=sofhdadsp,DEV=5
    sof-hda-dsp, 
    Direct sample snooping device
hw:CARD=sofhdadsp,DEV=0
    sof-hda-dsp, 
    Direct hardware device without any conversions
hw:CARD=sofhdadsp,DEV=1
    sof-hda-dsp, 
    Direct hardware device without any conversions
hw:CARD=sofhdadsp,DEV=3
    sof-hda-dsp, 
    Direct hardware device without any conversions
hw:CARD=sofhdadsp,DEV=4
    sof-hda-dsp, 
    Direct hardware device without any conversions
hw:CARD=sofhdadsp,DEV=5
    sof-hda-dsp, 
    Direct hardware device without any conversions
plughw:CARD=sofhdadsp,DEV=0
    sof-hda-dsp, 
    Hardware device with all software conversions
plughw:CARD=sofhdadsp,DEV=1
    sof-hda-dsp, 
    Hardware device with all software conversions
plughw:CARD=sofhdadsp,DEV=3
    sof-hda-dsp, 
    Hardware device with all software conversions
plughw:CARD=sofhdadsp,DEV=4
    sof-hda-dsp, 
    Hardware device with all software conversions
plughw:CARD=sofhdadsp,DEV=5
    sof-hda-dsp, 
    Hardware device with all software conversions
usbstream:CARD=sofhdadsp
    sof-hda-dsp
    USB Stream Output
sysdefault:CARD=USB
    ThinkPad Thunderbolt 3 Dock USB, USB Audio
    Default Audio Device
front:CARD=USB,DEV=0
    ThinkPad Thunderbolt 3 Dock USB, USB Audio
    Front speakers
surround21:CARD=USB,DEV=0
    ThinkPad Thunderbolt 3 Dock USB, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=USB,DEV=0
    ThinkPad Thunderbolt 3 Dock USB, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=USB,DEV=0
    ThinkPad Thunderbolt 3 Dock USB, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=USB,DEV=0
    ThinkPad Thunderbolt 3 Dock USB, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=USB,DEV=0
    ThinkPad Thunderbolt 3 Dock USB, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=USB,DEV=0
    ThinkPad Thunderbolt 3 Dock USB, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=USB,DEV=0
    ThinkPad Thunderbolt 3 Dock USB, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=USB,DEV=0
    ThinkPad Thunderbolt 3 Dock USB, USB Audio
    Direct sample mixing device
dsnoop:CARD=USB,DEV=0
    ThinkPad Thunderbolt 3 Dock USB, USB Audio
    Direct sample snooping device
hw:CARD=USB,DEV=0
    ThinkPad Thunderbolt 3 Dock USB, USB Audio
    Direct hardware device without any conversions
plughw:CARD=USB,DEV=0
    ThinkPad Thunderbolt 3 Dock USB, USB Audio
    Hardware device with all software conversions
usbstream:CARD=USB
    ThinkPad Thunderbolt 3 Dock USB
    USB Stream Output



pactl list

Sink #1
        State: IDLE
        Name: alsa_output.usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00.analog-stereo
        Description: ThinkPad Thunderbolt 3 Dock USB Audio Analog Stereo
        Driver: module-alsa-card.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 27
        Mute: no
        Volume: front-left: 61604 /  94% / -1.61 dB,   front-right: 61604 /  94% / -1.61 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor Source: alsa_output.usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00.analog-stereo.monitor
        Latency: 42400 usec, configured 40000 usec
        Flags: HARDWARE HW_MUTE_CTRL DECIBEL_VOLUME LATENCY 
        Properties:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "USB Audio"
                alsa.id = "USB Audio"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "1"
                alsa.card_name = "ThinkPad Thunderbolt 3 Dock USB"
                alsa.long_card_name = "Lenovo ThinkPad Thunderbolt 3 Dock USB at usb-0000:0a:00.0-1, full speed"
                alsa.driver_name = "snd_usb_audio"
                device.bus_path = "pci-0000:0a:00.0-usb-0:1:1.0"
                sysfs.path = "/devices/pci0000:00/0000:00:1d.4/0000:05:00.0/0000:06:01.0/0000:08:00.0/0000:09:00.0/0000:0a:00.0/usb3/3-1/3-1:1.0/sound/card1"
                udev.id = "usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00"
                device.bus = "usb"
                device.vendor.id = "17ef"
                device.vendor.name = "Lenovo"
                device.product.id = "306a"
                device.product.name = "ThinkPad Thunderbolt 3 Dock USB Audio"
                device.serial = "Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000"
                device.string = "front:1"
                device.buffering.buffer_size = "352800"
                device.buffering.fragment_size = "176400"
                device.access_mode = "mmap+timer"
                device.profile.name = "analog-stereo"
                device.profile.description = "Analog Stereo"
                device.description = "ThinkPad Thunderbolt 3 Dock USB Audio Analog Stereo"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-usb"
        Ports:
                analog-output: Analog Output (priority: 9900)
        Active Port: analog-output
        Formats:
                pcm

Source #1
        State: RUNNING
        Name: alsa_output.usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00.analog-stereo.monitor
        Description: Monitor of ThinkPad Thunderbolt 3 Dock USB Audio Analog Stereo
        Driver: module-alsa-card.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 27
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor of Sink: alsa_output.usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00.analog-stereo
        Latency: 0 usec, configured 40000 usec
        Flags: DECIBEL_VOLUME LATENCY 
        Properties:
                device.description = "Monitor of ThinkPad Thunderbolt 3 Dock USB Audio Analog Stereo"
                device.class = "monitor"
                alsa.card = "1"
                alsa.card_name = "ThinkPad Thunderbolt 3 Dock USB"
                alsa.long_card_name = "Lenovo ThinkPad Thunderbolt 3 Dock USB at usb-0000:0a:00.0-1, full speed"
                alsa.driver_name = "snd_usb_audio"
                device.bus_path = "pci-0000:0a:00.0-usb-0:1:1.0"
                sysfs.path = "/devices/pci0000:00/0000:00:1d.4/0000:05:00.0/0000:06:01.0/0000:08:00.0/0000:09:00.0/0000:0a:00.0/usb3/3-1/3-1:1.0/sound/card1"
                udev.id = "usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00"
                device.bus = "usb"
                device.vendor.id = "17ef"
                device.vendor.name = "Lenovo"
                device.product.id = "306a"
                device.product.name = "ThinkPad Thunderbolt 3 Dock USB Audio"
                device.serial = "Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000"
                device.string = "1"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-usb"
        Formats:
                pcm

Source #2
        State: RUNNING
        Name: alsa_input.usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00.multichannel-input
        Description: ThinkPad Thunderbolt 3 Dock USB Audio Multichannel
        Driver: module-alsa-card.c
        Sample Specification: s16le 1ch 44100Hz
        Channel Map: mono
        Owner Module: 27
        Mute: no
        Volume: mono: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor of Sink: n/a
        Latency: 0 usec, configured 40000 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY 
        Properties:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "USB Audio"
                alsa.id = "USB Audio"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "1"
                alsa.card_name = "ThinkPad Thunderbolt 3 Dock USB"
                alsa.long_card_name = "Lenovo ThinkPad Thunderbolt 3 Dock USB at usb-0000:0a:00.0-1, full speed"
                alsa.driver_name = "snd_usb_audio"
                device.bus_path = "pci-0000:0a:00.0-usb-0:1:1.0"
                sysfs.path = "/devices/pci0000:00/0000:00:1d.4/0000:05:00.0/0000:06:01.0/0000:08:00.0/0000:09:00.0/0000:0a:00.0/usb3/3-1/3-1:1.0/sound/card1"
                udev.id = "usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00"
                device.bus = "usb"
                device.vendor.id = "17ef"
                device.vendor.name = "Lenovo"
                device.product.id = "306a"
                device.product.name = "ThinkPad Thunderbolt 3 Dock USB Audio"
                device.serial = "Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000"
                device.string = "hw:1"
                device.buffering.buffer_size = "176400"
                device.buffering.fragment_size = "88200"
                device.access_mode = "mmap+timer"
                device.profile.name = "multichannel-input"
                device.profile.description = "Multichannel"
                device.description = "ThinkPad Thunderbolt 3 Dock USB Audio Multichannel"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-usb"
        Ports:
                multichannel-input: Multichannel Input (priority: 0)
        Active Port: multichannel-input
        Formats:
                pcm
Source #2
        State: RUNNING
        Name: alsa_input.usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00.multichannel-input
        Description: ThinkPad Thunderbolt 3 Dock USB Audio Multichannel
        Driver: module-alsa-card.c
        Sample Specification: s16le 1ch 44100Hz
        Channel Map: mono
        Owner Module: 27
        Mute: no
        Volume: mono: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor of Sink: n/a
        Latency: 0 usec, configured 40000 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY 
        Properties:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "USB Audio"
                alsa.id = "USB Audio"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "1"
                alsa.card_name = "ThinkPad Thunderbolt 3 Dock USB"
                alsa.long_card_name = "Lenovo ThinkPad Thunderbolt 3 Dock USB at usb-0000:0a:00.0-1, full speed"
                alsa.driver_name = "snd_usb_audio"
                device.bus_path = "pci-0000:0a:00.0-usb-0:1:1.0"
                sysfs.path = "/devices/pci0000:00/0000:00:1d.4/0000:05:00.0/0000:06:01.0/0000:08:00.0/0000:09:00.0/0000:0a:00.0/usb3/3-1/3-1:1.0/sound/card1"
                udev.id = "usb-Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000-00"
                device.bus = "usb"
                device.vendor.id = "17ef"
                device.vendor.name = "Lenovo"
                device.product.id = "306a"
                device.product.name = "ThinkPad Thunderbolt 3 Dock USB Audio"
                device.serial = "Lenovo_ThinkPad_Thunderbolt_3_Dock_USB_Audio_000000000000"
                device.string = "hw:1"
                device.buffering.buffer_size = "176400"
                device.buffering.fragment_size = "88200"
                device.access_mode = "mmap+timer"
                device.profile.name = "multichannel-input"
                device.profile.description = "Multichannel"
                device.description = "ThinkPad Thunderbolt 3 Dock USB Audio Multichannel"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-usb"
        Ports:
                multichannel-input: Multichannel Input (priority: 0)
        Active Port: multichannel-input
        Formats:
                pcm
Comment 135 Tobias Grosser 2020-03-20 14:30:55 UTC
It seems pulseaudio is failing to initialize my sound card giving the following error:

```
I: [pulseaudio] alsa-util.c: Device hw:sofhdadsp,5 doesn't support 44100 Hz, changed to 48000 Hz.
I: [pulseaudio] alsa-util.c: Device hw:sofhdadsp,4 doesn't support 44100 Hz, changed to 48000 Hz.
I: [pulseaudio] alsa-util.c: Device hw:sofhdadsp,3 doesn't support 44100 Hz, changed to 48000 Hz.
I: [pulseaudio] alsa-util.c: Device hw:sofhdadsp doesn't support 44100 Hz, changed to 48000 Hz.
I: [pulseaudio] alsa-util.c: Device hw:sofhdadsp doesn't support 44100 Hz, changed to 48000 Hz.
I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1
I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or directory
I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM plug:hw:sofhdadsp,6
I: [pulseaudio] alsa-util.c: Error opening PCM device plug:hw:sofhdadsp,6: No such file or directory
E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="0" name="pci-0000_00_1f.3-platform-skl_hda_dsp_generic" card_name="alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
```

I found a related bug report and provided details there: https://github.com/thesofproject/linux/issues/1879#issuecomment-601729153
Comment 136 glenn.mccarthy 2020-04-01 02:16:08 UTC
There are a number of Chromebooks using KabyLake processors with digital mic arrays, for example my Laptop is affected with this issue (HP Elitebook x360 1040), but there is an almost identical Chromebook model (HP Chromebook x360 14) with I presume a working mic on Linux kernel based ChromeOS.

Is there any possibility of extracting the firmware/kernel drivers from ChromeOS to have linux support for the meantime until the fix for this makes it into the kernel?
Comment 137 Josep Lladonosa Capell 2020-04-01 06:54:41 UTC
Linux kernel 5.5.11 reports HP Elitebook 830 G6 with an ALC215 soundcard,
listed by lspci as:
00:1f.3 Multimedia audio controller: Intel Corporation Cannon Point-LP High Definition Audio Controller (rev 11) [8086:9dc8] Subsystem: [103c:854a]

Laptop has internal microphone/s (?) close to screen camera and a 4 pin connector for earphones with microphone in its right side.

Sound works (speakers and earphones) but microphone is reported as unplugged.

The fact is that, with sound booted as laptop-dmic (and several others),
microphone input appears but mixer pavucontrol shows it unplugged and its sound bar input keeps moving with autogenerated noise. In order to see the mic controls, "Analog Stereo Duplex" has to be choosen in pavucontrol.

This laptop has also a mic key with led which is not detected by XFCE.

Note about BIOS:
Previous BIOS versions were not detecting brightness keys but my last upgrade does: DMI: HP HP EliteBook 830 G6/854A, BIOS R70 Ver. 01.04.05 02/18/2020.
I think that this added an ACPI method to the BIOS for brightness:
ACPI: Added _OSI(intel_backlight)
I do not know if this is the way for the mic key to work, ie. adding HP an ACPI method in next BIOS upgrade.

All info collected by /usr/sbin/alsa-info
(I add full path because if run as root it tells not to do it -so why is it in that path? ;) 

http://alsa-project.org/db/?f=bf524c791341844f2de88b4b8c439f9d0ab74866
Comment 138 Pierre Bossart 2020-04-01 15:06:06 UTC
(In reply to glenn.mccarthy from comment #136)
> There are a number of Chromebooks using KabyLake processors with digital mic
> arrays, for example my Laptop is affected with this issue (HP Elitebook x360
> 1040), but there is an almost identical Chromebook model (HP Chromebook x360
> 14) with I presume a working mic on Linux kernel based ChromeOS.
> 
> Is there any possibility of extracting the firmware/kernel drivers from
> ChromeOS to have linux support for the meantime until the fix for this makes
> it into the kernel?

Different problem that should be tracked in the separate bug report. Yes the DMICs used in Chromebooks, but the hardware does not use a HDAudio codec. All the relevant machine drivers are upstream, but the actual firmware and topologies are not. You may have some success in copying the files from the Chrome distributions, but there are known issues with kernels more recent than 4.19, e.g. I managed to make a SKL 'chell' device work but a KBL 'soraka' one refuses to probe due to topology issues that I wasn't able to root-cause. There are also known compatibility issues with recent ASoC core changes, and for some devices a flag needs to be added for the card so that ASoC topology route checks are bypassed.
Comment 139 Pierre Bossart 2020-04-01 15:09:50 UTC
(In reply to Josep Lladonosa Capell from comment #137)
> http://alsa-project.org/db/?f=bf524c791341844f2de88b4b8c439f9d0ab74866

This shows you don't seem to have Digital microphones attached to the PCH, so it's a different issue to the one discussed in this thread?
Comment 140 Josep Lladonosa Capell 2020-04-13 08:33:20 UTC
(In reply to Pierre Bossart from comment #139)
> (In reply to Josep Lladonosa Capell from comment #137)
> > http://alsa-project.org/db/?f=bf524c791341844f2de88b4b8c439f9d0ab74866
> 
> This shows you don't seem to have Digital microphones attached to the PCH,
> so it's a different issue to the one discussed in this thread?

Well, I have opened a different bug in snd-hda-intel (with no answers yet) as dmesg reports an ALC215.
HP Elitebook 830 G6 has Whiskey Lake architecture.

Intel specs say: Whiskey Lake CPUs come with a dedicated quad-core audio DSP.
830 G6 specs say: Integrated 3 Multi Array Microphone

Have found that under Windows this laptop uses Intel Smart Sound Technology (Intel SST) Audio Controller (included in Realtek HD Audio Driver installer).

Machine has 2 internal microphones and it is happening the same described in this bug.

lsmod shows, among others, these modules:

snd_soc_skl
snd_soc_sst_ipc
snd_soc_sst_dsp
snd_hda_ext_core
snd_soc_acpi_intel_match
snd_soc_acpi
snd_hda_codec_realtek
snd_soc_core
snd_hda_codec_generic
snd_hda_intel
snd_intel_dspcfg


So my guess is that, to make microphones work, intel DSPs need to be correctly configured (snd_intel_dspcfg?).
Comment 141 Pierre Bossart 2020-04-13 10:40:25 UTC
(In reply to Josep Lladonosa Capell from comment #140)
> (In reply to Pierre Bossart from comment #139)
> > (In reply to Josep Lladonosa Capell from comment #137)
> > > http://alsa-project.org/db/?f=bf524c791341844f2de88b4b8c439f9d0ab74866
> > 
> > This shows you don't seem to have Digital microphones attached to the PCH,
> > so it's a different issue to the one discussed in this thread?
> 
> Well, I have opened a different bug in snd-hda-intel (with no answers yet)
> as dmesg reports an ALC215.
> HP Elitebook 830 G6 has Whiskey Lake architecture.
> 
> Intel specs say: Whiskey Lake CPUs come with a dedicated quad-core audio DSP.
> 830 G6 specs say: Integrated 3 Multi Array Microphone
> 
> Have found that under Windows this laptop uses Intel Smart Sound Technology
> (Intel SST) Audio Controller (included in Realtek HD Audio Driver installer).
> 
> Machine has 2 internal microphones and it is happening the same described in
> this bug.
> 
> lsmod shows, among others, these modules:
> 
> snd_soc_skl
> snd_soc_sst_ipc
> snd_soc_sst_dsp
> snd_hda_ext_core
> snd_soc_acpi_intel_match
> snd_soc_acpi
> snd_hda_codec_realtek
> snd_soc_core
> snd_hda_codec_generic
> snd_hda_intel
> snd_intel_dspcfg
> 
> 
> So my guess is that, to make microphones work, intel DSPs need to be
> correctly configured (snd_intel_dspcfg?).

If there is no information detected in the NHLT tables, the microphones are most likely attached to the HDAudio codec, not directly to the PCH.
There are a number of cases where the DSP is used even when no microphones are connected to the DSP, e.g. for post-processing on playback.
Comment 142 Josep Lladonosa Capell 2020-04-13 13:50:19 UTC
(In reply to Pierre Bossart from comment #141)
> (In reply to Josep Lladonosa Capell from comment #140)
> > (In reply to Pierre Bossart from comment #139)
> > > (In reply to Josep Lladonosa Capell from comment #137)
> > > > http://alsa-project.org/db/?f=bf524c791341844f2de88b4b8c439f9d0ab74866
> > > 
> > > This shows you don't seem to have Digital microphones attached to the
> PCH,
> > > so it's a different issue to the one discussed in this thread?
> > 
> > Well, I have opened a different bug in snd-hda-intel (with no answers yet)
> > as dmesg reports an ALC215.
> > HP Elitebook 830 G6 has Whiskey Lake architecture.
> > 
> > Intel specs say: Whiskey Lake CPUs come with a dedicated quad-core audio
> DSP.
> > 830 G6 specs say: Integrated 3 Multi Array Microphone
> > 
> > Have found that under Windows this laptop uses Intel Smart Sound Technology
> > (Intel SST) Audio Controller (included in Realtek HD Audio Driver
> installer).
> > 
> > Machine has 2 internal microphones and it is happening the same described
> in
> > this bug.
> > 
> > lsmod shows, among others, these modules:
> > 
> > snd_soc_skl
> > snd_soc_sst_ipc
> > snd_soc_sst_dsp
> > snd_hda_ext_core
> > snd_soc_acpi_intel_match
> > snd_soc_acpi
> > snd_hda_codec_realtek
> > snd_soc_core
> > snd_hda_codec_generic
> > snd_hda_intel
> > snd_intel_dspcfg
> > 
> > 
> > So my guess is that, to make microphones work, intel DSPs need to be
> > correctly configured (snd_intel_dspcfg?).
> 
> If there is no information detected in the NHLT tables, the microphones are
> most likely attached to the HDAudio codec, not directly to the PCH.
> There are a number of cases where the DSP is used even when no microphones
> are connected to the DSP, e.g. for post-processing on playback.

I see. Thanks.
Perhaps NHLT information should be present but it is behind some BIOS Errors:

++++++++++++++
dmesg |grep "Error"
[    0.882785] ACPI BIOS Error (bug): AE_AML_BUFFER_LIMIT, Field [CAP1] at bit offset/length 64/32 exceeds size of target Buffer (64 bits) (20200110/dsopcode-203)
[    0.882912] ACPI Error: Aborting method \_SB._OSC due to previous error (AE_AML_BUFFER_LIMIT) (20200110/psparse-531)
[    2.227691] ACPI BIOS Error (bug): AE_AML_PACKAGE_LIMIT, Index (0x000000005) is beyond end of object (length 0x5) (20200110/exoparg2-396)
[    2.227786] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_PACKAGE_LIMIT) (20200110/psparse-531)
[    2.227876] ACPI Error: Aborting method \_TZ.CHGZ._CRT due to previous error (AE_AML_PACKAGE_LIMIT) (20200110/psparse-531)
[    2.229299] ACPI BIOS Error (bug): AE_AML_PACKAGE_LIMIT, Index (0x000000005) is beyond end of object (length 0x5) (20200110/exoparg2-396)
[    2.229392] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_PACKAGE_LIMIT) (20200110/psparse-531)
[    2.229485] ACPI Error: Aborting method \_TZ.CHGZ._CRT due to previous error (AE_AML_PACKAGE_LIMIT) (20200110/psparse-531)
++++++++++++++++
Comment 143 Josep Lladonosa Capell 2020-04-13 16:08:53 UTC
(In reply to Josep Lladonosa Capell from comment #142)
> (In reply to Pierre Bossart from comment #141)
> > (In reply to Josep Lladonosa Capell from comment #140)
> > > (In reply to Pierre Bossart from comment #139)
> > > > (In reply to Josep Lladonosa Capell from comment #137)
> > > > >
> http://alsa-project.org/db/?f=bf524c791341844f2de88b4b8c439f9d0ab74866
> > > > 
> > > > This shows you don't seem to have Digital microphones attached to the
> > PCH,
> > > > so it's a different issue to the one discussed in this thread?
> > > 
> > > Well, I have opened a different bug in snd-hda-intel (with no answers
> yet)
> > > as dmesg reports an ALC215.
> > > HP Elitebook 830 G6 has Whiskey Lake architecture.
> > > 
> > > Intel specs say: Whiskey Lake CPUs come with a dedicated quad-core audio
> > DSP.
> > > 830 G6 specs say: Integrated 3 Multi Array Microphone
> > > 
> > > Have found that under Windows this laptop uses Intel Smart Sound
> Technology
> > > (Intel SST) Audio Controller (included in Realtek HD Audio Driver
> > installer).
> > > 
> > > Machine has 2 internal microphones and it is happening the same described
> > in
> > > this bug.
> > > 
> > > lsmod shows, among others, these modules:
> > > 
> > > snd_soc_skl
> > > snd_soc_sst_ipc
> > > snd_soc_sst_dsp
> > > snd_hda_ext_core
> > > snd_soc_acpi_intel_match
> > > snd_soc_acpi
> > > snd_hda_codec_realtek
> > > snd_soc_core
> > > snd_hda_codec_generic
> > > snd_hda_intel
> > > snd_intel_dspcfg
> > > 
> > > 
> > > So my guess is that, to make microphones work, intel DSPs need to be
> > > correctly configured (snd_intel_dspcfg?).
> > 
> > If there is no information detected in the NHLT tables, the microphones are
> > most likely attached to the HDAudio codec, not directly to the PCH.
> > There are a number of cases where the DSP is used even when no microphones
> > are connected to the DSP, e.g. for post-processing on playback.
> 
> I see. Thanks.
> Perhaps NHLT information should be present but it is behind some BIOS Errors:
> 
> ++++++++++++++
> dmesg |grep "Error"
> [    0.882785] ACPI BIOS Error (bug): AE_AML_BUFFER_LIMIT, Field [CAP1] at
> bit offset/length 64/32 exceeds size of target Buffer (64 bits)
> (20200110/dsopcode-203)
> [    0.882912] ACPI Error: Aborting method \_SB._OSC due to previous error
> (AE_AML_BUFFER_LIMIT) (20200110/psparse-531)
> [    2.227691] ACPI BIOS Error (bug): AE_AML_PACKAGE_LIMIT, Index
> (0x000000005) is beyond end of object (length 0x5) (20200110/exoparg2-396)
> [    2.227786] ACPI Error: Aborting method \_TZ.GETP due to previous error
> (AE_AML_PACKAGE_LIMIT) (20200110/psparse-531)
> [    2.227876] ACPI Error: Aborting method \_TZ.CHGZ._CRT due to previous
> error (AE_AML_PACKAGE_LIMIT) (20200110/psparse-531)
> [    2.229299] ACPI BIOS Error (bug): AE_AML_PACKAGE_LIMIT, Index
> (0x000000005) is beyond end of object (length 0x5) (20200110/exoparg2-396)
> [    2.229392] ACPI Error: Aborting method \_TZ.GETP due to previous error
> (AE_AML_PACKAGE_LIMIT) (20200110/psparse-531)
> [    2.229485] ACPI Error: Aborting method \_TZ.CHGZ._CRT due to previous
> error (AE_AML_PACKAGE_LIMIT) (20200110/psparse-531)
> ++++++++++++++++

I have checked these errors and they seem related to time services.
Comment 144 Josep Lladonosa Capell 2020-04-15 08:07:59 UTC
Created attachment 288465 [details]
nhlt.dsl

Just to complete information, managed to obtain, at boot, NHLT data from ACPI for the laptop. Attached is nhlt.dsl file.

Info appearing in dmesg:
ACPI: NHLT 0x00000000B3BC3000 0017F1 (v00 INTEL  CFL-ULT  20170001 INTL 20160422)
Comment 145 Pierre Bossart 2020-04-15 15:35:55 UTC
(In reply to Josep Lladonosa Capell from comment #144)
> Created attachment 288465 [details]
> nhlt.dsl
> 
> Just to complete information, managed to obtain, at boot, NHLT data from
> ACPI for the laptop. Attached is nhlt.dsl file.
> 
> Info appearing in dmesg:
> ACPI: NHLT 0x00000000B3BC3000 0017F1 (v00 INTEL  CFL-ULT  20170001 INTL
> 20160422)

Unfortunately I don't think anyone has a stand-alone NHLT parser, I cobbled together the code in sound/hda/intel-nhlt but that's using ACPI utilities. 

it might be easier to enable dynamic debug for this, and/or instrument intel_nhlt_get_dmic_geo(), to figure out what the kernel detects.

you can do so by adding this in the /etc/modprobe.d/alsa-base.conf file

options snd-intel-dspcfg dyndbg=+p
Comment 146 Josep Lladonosa Capell 2020-04-16 03:23:54 UTC
(In reply to Pierre Bossart from comment #145)
> (In reply to Josep Lladonosa Capell from comment #144)
> > Created attachment 288465 [details]
> > nhlt.dsl
> > 
> > Just to complete information, managed to obtain, at boot, NHLT data from
> > ACPI for the laptop. Attached is nhlt.dsl file.
> > 
> > Info appearing in dmesg:
> > ACPI: NHLT 0x00000000B3BC3000 0017F1 (v00 INTEL  CFL-ULT  20170001 INTL
> > 20160422)
> 
> Unfortunately I don't think anyone has a stand-alone NHLT parser, I cobbled
> together the code in sound/hda/intel-nhlt but that's using ACPI utilities. 
> 
> it might be easier to enable dynamic debug for this, and/or instrument
> intel_nhlt_get_dmic_geo(), to figure out what the kernel detects.
> 
> you can do so by adding this in the /etc/modprobe.d/alsa-base.conf file
> 
> options snd-intel-dspcfg dyndbg=+p

Compiled kernel with debugging on and did enabled dynamic debug.

Line that appeared in /sys/kernel/debug/dynamic_debug/control:

sound/hda/intel-nhlt.c:33 [snd_intel_dspcfg]intel_nhlt_init =p "No NHLT table found\012"

Next, an attachment of all dynamic_debug/control lines
Comment 147 Josep Lladonosa Capell 2020-04-16 03:26:41 UTC
Created attachment 288511 [details]
Attachment of all dynamic_debug/control lines for kernel 5.6.4 in HP Elitebook 830 G6

Attachment of all /sys/kernel/debug/dynamic_debug/control lines for kernel 5.6.4 in HP Elitebook 830 G6.
Comment 148 Pierre Bossart 2020-04-16 15:27:43 UTC
> sound/hda/intel-nhlt.c:33 [snd_intel_dspcfg]intel_nhlt_init =p "No NHLT
> table found\012"

That's game over for the DSP enablement, there is no DMIC on this device. You will have to use the legacy snd-hda-intel driver and blacklist snd-soc-skl and snd-sof-pci.
Comment 149 Josep Lladonosa Capell 2020-04-19 06:09:48 UTC
(In reply to Pierre Bossart from comment #148)
> > sound/hda/intel-nhlt.c:33 [snd_intel_dspcfg]intel_nhlt_init =p "No NHLT
> > table found\012"
> 
> That's game over for the DSP enablement, there is no DMIC on this device.
> You will have to use the legacy snd-hda-intel driver and blacklist
> snd-soc-skl and snd-sof-pci.

Hello, Pierre,

perhaps for intel-nhlt, first sentence is true, as it seems it cannot find in that table.

As linux kernel is an "endless game" I resisted to believe that "there is no DMIC on this device"... so I went on by enabling snd-sof-pci in kernel and setting up firmware and topology files.

For now, I have in dmesg:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[    3.657290] snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    3.657451] snd_hda_intel 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    3.679868] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    3.680004] sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    3.680005] sof-audio-pci 0000:00:1f.3: PCI DSP detected
[    3.680092] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[    3.680135] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_globals_exit [i915])
[    3.684330] sof-audio-pci 0000:00:1f.3: checking for capabilities at offset 0xc00
[    3.684331] sof-audio-pci 0000:00:1f.3: found ML capability at 0xc00
[    3.684342] sof-audio-pci 0000:00:1f.3: checking for capabilities at offset 0x800
[    3.684343] sof-audio-pci 0000:00:1f.3: found DSP capability at 0x800
[    3.684345] sof-audio-pci 0000:00:1f.3: checking for capabilities at offset 0x500
[    3.684346] sof-audio-pci 0000:00:1f.3: found GTS capability at 0x500
[    3.684349] sof-audio-pci 0000:00:1f.3: checking for capabilities at offset 0x1f00
[    3.684349] sof-audio-pci 0000:00:1f.3: found DRSM capability at 0x1f00
[    3.684352] sof-audio-pci 0000:00:1f.3: checking for capabilities at offset 0x700
[    3.684352] sof-audio-pci 0000:00:1f.3: found SPIB capability at 0x700
[    3.684359] sof-audio-pci 0000:00:1f.3: DMA mask is 64 bit
[    3.684374] sof-audio-pci 0000:00:1f.3: hda global caps = 0x1009701
[    3.684374] sof-audio-pci 0000:00:1f.3: detected 9 playback and 7 capture streams
[    3.684430] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[    3.684430] sof-audio-pci 0000:00:1f.3: using IPC IRQ 168
[    3.684593] sof-audio-pci 0000:00:1f.3: PP capability, will probe DSP later.
[    3.688924] sof-audio-pci 0000:00:1f.3: codec_mask = 0x5
[    3.689051] sof-audio-pci 0000:00:1f.3: HDA codec #0 probed OK: response: 10ec0215
[    3.689864] hdaudio ehdaudio0D0: loading codec module: hdaudio:v10EC0215r00100002a01
[    3.751303] sof-audio-pci 0000:00:1f.3: HDA codec #2 probed OK: response: 8086280b
[    3.751904] hdaudio ehdaudio0D2: loading codec module: hdaudio:v8086280Br00100000a01
[    3.757729] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[    3.757733] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[    3.758143] sof-audio-pci 0000:00:1f.3: loading firmware
[    3.760363] sof-audio-pci 0000:00:1f.3: request_firmware intel/sof/sof-cnl.ri successful

++++++++++++++++++++++++++++++++++++++++++

I think that now I need to connect sof work with snd_hda_intel as in alsa-info run I get:

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

--- no soundcards ---
++++++++++++++++++++++++++++++++++


I attach the dynamic_debug/control file in next message.
Comment 150 Josep Lladonosa Capell 2020-04-19 06:14:30 UTC
Created attachment 288609 [details]
Attachment of sound related dynamic_debug/control lines for kernel 5.6.5 in HP Elitebook 830 G6 and sof DSP detections

Attachment of sound related dynamic_debug/control lines for kernel 5.6.5 in HP Elitebook 830 G6 detecting intel DSPs in its Cannon Lake architecture.


- kernel 5.6.5 with SOF enabled
- sof firmware and topologies installed
Comment 151 Josep Lladonosa Capell 2020-04-19 11:22:11 UTC
Finally I got internal microphones working in the 830 G6.
Headphones and speakers work, too.
In alsamixer card appears as "sof-hda-dsp" and chip: Realtek ALC215. 

As a summary, this is what I did:

- Included the sof firmware (stable) from https://github.com/thesofproject/sof-bin. That installed firmware and topology files in /lib/firmware/intel/.

- Set up sof and relatives (make menuconfig) in the kernel (5.6.5) and installed it:

 Device Drivers  --->
  <M>   Advanced Linux Sound Architecture  --->
  <M> Sound card support  --->
  <M>   ALSA for SoC audio support  --->
   [*]   Sound Open Firmware Support (CONFIG_SND_SOC_SOF_TOPLEVEL=y)
   [*]       SOF support for Cannonlake (SND_SOC_SOF_CANNONLAKE_SUPPORT=y)
   Intel Machine drivers  ---> (CONFIG_SND_SOC_INTEL_MACH=y)
     <M>   SKL/KBL/BXT/APL with HDA Codecs (CONFIG_SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH=m)
(detected this because I missed including it!)
   [ ]     HDAudio codec support (# CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC is not set)

- Additionally, I updated libasound2,libatopology2 deb packages (compiled from source alsa-lib to get version 1.2.2-2.1 as Debian 10.3 now only has 1.1.8-1) and alsa-utils (from 1.1.8-2 to 1.2.2-1).

From my guess, all lines (HDMI included) are handed now by sof driver.

Now, the only missing thing is that intenal microhpone appears unplugged.
Cannot check now headphone's mic.

Regards, Josep
Comment 152 Siddharth Pant 2020-04-19 23:35:44 UTC
Hi guys I might be missing a step here but both my internal and external Mic are not working.

I have installed the binaries by executing go.sh from the repository mentioned in #Comment 133
https://github.com/thesofproject/sof-bin/tree/stable-v1.4.2

But no luck

I have an Acer Swift 315-55G running on Ubuntu 18.04.4 Kernel: 5.3.0-46-generic
Comment 153 Siddharth Pant 2020-04-19 23:38:12 UTC
My bad the model number is Swift SF314-55G
Comment 154 Siddharth Pant 2020-04-19 23:41:22 UTC
Created attachment 288625 [details]
ALSA info output for Acer Swift SF314-55G Ubuntu 18.04.4

ALSA info output for my laptop. It has an Intel 8th gen Core i5.
Comment 155 Pierre Bossart 2020-04-20 16:26:29 UTC
(In reply to Siddharth Pant from comment #152)
> Hi guys I might be missing a step here but both my internal and external Mic
> are not working.
> 
> I have installed the binaries by executing go.sh from the repository
> mentioned in #Comment 133
> https://github.com/thesofproject/sof-bin/tree/stable-v1.4.2
> 
> But no luck
> 
> I have an Acer Swift 315-55G running on Ubuntu 18.04.4 Kernel:
> 5.3.0-46-generic

If you are using the 'old' kernel with Ubuntu 18.04 LTS, you need to avoid using the 1.4.2 firmware and just follow the instructions here:
https://github.com/thesofproject/linux/issues/1877
Comment 156 Siddharth Pant 2020-04-20 19:05:41 UTC
(In reply to Pierre Bossart from comment #155)
> If you are using the 'old' kernel with Ubuntu 18.04 LTS, you need to avoid
> using the 1.4.2 firmware and just follow the instructions here:
> https://github.com/thesofproject/linux/issues/1877

Ok, thankfully I followed your advice and backed up the sof and sof-tplg dirs before. So I restored them to their original files now and basically undo the v1.4.2 installation through that.

Based on the shared Github link I also blacklisted snd-hda-intel and snd-soc-skl in /etc/modprobe.d/alsa-base.conf

and copy pasted directory from 
https://github.com/thesofproject/alsa-ucm-conf/tree/sof_ucm1/ucm/sof-skl_hda_card
to
/usr/share/alsa/ucm

Still there is no audio captured by both internal and external mics.

One thing though. This command:

arecord -Dhw:0,6 -c2 -r48000 -f S32_LE -d 10 mytest.wav

is able to record my voice and I can hear the created wav file clearly.

Based on your discussion on the github issue I assume I may require a better suited UCM file since overthere its a Dell inspiron while mine is Acer Swift 3 but I don't know better.
Comment 157 Pierre Bossart 2020-04-20 19:49:53 UTC
> Still there is no audio captured by both internal and external mics.
> 
> One thing though. This command:
> 
> arecord -Dhw:0,6 -c2 -r48000 -f S32_LE -d 10 mytest.wav
> 
> is able to record my voice and I can hear the created wav file clearly.

Well that's good progress!
 
> Based on your discussion on the github issue I assume I may require a better
> suited UCM file since overthere its a Dell inspiron while mine is Acer Swift
> 3 but I don't know better.

Yes, this clearly points to a PulseAudio configuration issue. It's a bit odd, the recipe on GitHub seemed to work for several people, not sure what happens for you. I would try and capture the pulseaudio -vvv log (first by setting autospawn=no in /etc/pulse) and/or try with the alsaucm command to see if the file has any issues.
Comment 158 Siddharth Pant 2020-04-20 20:52:46 UTC
Created attachment 288635 [details]
pulseaudio logs for Acer Swift SF314-55G

So I captured pulseaudio -vvv output and I did see an error which is sort of the same which "alsaucm -i" gives me on command "open sof-skl_hda_card"

D: [pulseaudio] module-udev-detect.c: Loading module-alsa-card with arguments 'device_id="0" name="pci-0000_00_1f.3-platform-skl_hda_dsp_generic" card_name="alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1"'
D: [pulseaudio] dbus-util.c: Successfully connected to D-Bus session bus 050694e5fb4efe8dc28d2d7e5e9e03f1 as :1.87
D: [pulseaudio] reserve-wrap.c: Successfully acquired reservation lock on device 'Audio0'
I: [pulseaudio] (alsa-lib)utils.c: could not open configuration file /usr/share/alsa/ucm/WL-SwiftSF314_55G-V1.07-MILLER_WL/WL-SwiftSF314_55G-V1.07-MILLER_WL.conf
I: [pulseaudio] (alsa-lib)parser.c: error: could not parse configuration for card WL-SwiftSF314_55G-V1.07-MILLER_WL
I: [pulseaudio] (alsa-lib)main.c: unable to execute cset 'name='Capture Switch' on'
I: [pulseaudio] (alsa-lib)main.c: Unable to execute default sequence
I: [pulseaudio] (alsa-lib)main.c: error: failed to import sof-skl_hda_card use case configuration -2
I: [pulseaudio] alsa-ucm.c: UCM not available for card sof-skl_hda_card
D: [pulseaudio] conf-parser.c: Parsing configuration file '/usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf'



Just to help you out here is my ls output as I suspect may be files are not named right:
ls /usr/share/alsa/ucm/sof-skl_hda_card
Hdmi1.conf  Hdmi2.conf  Hdmi3.conf  HdmiHdac.conf  HiFi.conf  Mics.conf  sof-skl_hda_card.conf
Comment 159 Pierre Bossart 2020-04-20 21:02:02 UTC
> I: [pulseaudio] (alsa-lib)utils.c: could not open configuration file
> /usr/share/alsa/ucm/WL-SwiftSF314_55G-V1.07-MILLER_WL/WL-SwiftSF314_55G-V1.
> 07-MILLER_WL.conf
> I: [pulseaudio] (alsa-lib)parser.c: error: could not parse configuration for
> card WL-SwiftSF314_55G-V1.07-MILLER_WL

You can ignore this, this is a misleading error. UCM first tries with the long card name, but then tries with the driver name fallback.

> I: [pulseaudio] (alsa-lib)main.c: unable to execute cset 'name='Capture
> Switch' on'
> I: [pulseaudio] (alsa-lib)main.c: Unable to execute default sequence
> I: [pulseaudio] (alsa-lib)main.c: error: failed to import sof-skl_hda_card
> use case configuration -2
> I: [pulseaudio] alsa-ucm.c: UCM not available for card sof-skl_hda_card
> D: [pulseaudio] conf-parser.c: Parsing configuration file
> '/usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf'

That's odd, but maybe the files you used aren't right... Can you post these files so that we can check? I saw a similar error last week and couldn't figure out where this came from.

> Just to help you out here is my ls output as I suspect may be files are not
> named right:
> ls /usr/share/alsa/ucm/sof-skl_hda_card
> Hdmi1.conf  Hdmi2.conf  Hdmi3.conf  HdmiHdac.conf  HiFi.conf  Mics.conf 
> sof-skl_hda_card.conf

The name looks right, it's more likely the contents that's invalid.
Comment 160 Siddharth Pant 2020-04-20 21:10:33 UTC
I used files from this link:
https://github.com/thesofproject/alsa-ucm-conf/tree/sof_ucm1/ucm/sof-skl_hda_card

Its from the github comment you mentioned here:
https://github.com/thesofproject/linux/issues/1877#issuecomment-602628642
Comment 161 Alejandro Rodriguez 2020-04-27 15:22:22 UTC
Hi, All, just for report I have an Acer Swift3 SF314-54, Intel Core 8th gen, Kaby Lake, which I can't make its DMIC works.

00:1f.3 0401: 8086:9d71 (rev 21)
	Subsystem: 1025:1269
	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 139
	Region 0: Memory at b1228000 (64-bit, non-prefetchable) [size=16K]
	Region 4: Memory at b1200000 (64-bit, non-prefetchable) [size=64K]
	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: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
		Address: 00000000fee00478  Data: 0000
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel, snd_soc_skl

As I read on the comments, the kabylake systems are still not supported on sof driver. Any advance about that?, Thanks so much, Alejandro,
Comment 162 Rinat 2020-05-01 12:28:19 UTC
+1 here

Acer Swift3 SF314-54 

DMIC not working as well
Comment 163 Jaroslav Kysela 2020-05-01 15:35:31 UTC
It's much easier to create PA legacy path for old pulseaudio and linux kernel like in http://people.redhat.com/~jkysela/sof/carbon-x1-pulse.tar.gz . Just replace your PCI ID for the udev rule.

Or try another distribution like Fedora 32 which have working kernel / user space (UCM) environment for this hardware.
Comment 164 Mateusz Gorski 2020-05-05 15:28:14 UTC
This issue was addressed in Skylake SST driver. 
Listed below are the patches needed to enable DMIC capture on HDA DSP configuration:

KERNEL:
- [PATCH series] Add support for different DMIC configurations
        https://patchwork.kernel.org/project/alsa-devel/list/?series=278013

TOPOLOGY:
- topology: Add topology file for generic HDA DSP machine driver
        https://github.com/alsa-project/alsa-topology-conf/commit/6ff63897a8fc1484660e5ff44483b594e40ea561

UCM:
- hda-dsp: add basic ucm config
        https://github.com/alsa-project/alsa-ucm-conf/commit/76df616aa2fcae1cca1f948dac24c98a211c2593

In order to enable DMIC capture on given HDA DSP device one needs to:

1. Rebuild the kernel with listed patches (or, since these patches were merged, from top of "for-next" branch on git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git) 
2. Compile the topology .conf file using alsatplg tool:
               alsatplg -c skl_hda_dsp_generic-tplg.conf -o skl_hda_dsp_generic-tplg.bin
3. Copy the output binary file to your device /lib/firmware/ directory without changing its name
4. To make sure that the proper topology is loaded, delete any other topology files from your /lib/firmware/ directory (to check if there are any left type "ls /lib/firmware/*tplg.bin")

    After rebooting the device one should be able to successfully capture the sound with DMIC array, using arecord app. The command should look similiar to:
        arecord -Dhw:0,13 -c2 -fS16_LE -r48000 dmic_cap.wav

    The number or channels depends on information from NHLT, some devices may have 4-channel array, in which case the -c2 parameter should be changed to -c4. 

5. The additional configuration options are contained in UCM files, in order to use them copy the entire hda-dsp/ directory from alsa-ucm-conf project into your device /usr/share/alsa/ucm/ directory and follow default instructions to enable them.
Comment 165 Pierre Bossart 2020-05-05 15:58:15 UTC
(In reply to Mateusz Gorski from comment #164)
> This issue was addressed in Skylake SST driver. 

@Mateusz, this is good work but you are forgetting about the driver autodetection enabled by distributions. 

Currently the legacy driver is selected for SKL/KBL, you would need to add a quirk to use the SST driver when DMICs are detected. See sound/hda/intel-dsp-config.c

Alternatively, you need to provide the instructions to force the SST driver to be selected.
Comment 166 Cezary Rojewski 2020-05-05 17:52:28 UTC
Addition of 'SST-IF-DMIC' option for cAVS 1.5 is a good idea.

The instructions for forcing enumeration of SST driver withing the need of kernel rebuilding (requires root privileges of course):

Navigate to /etc/modprobe.d/ directory and edit existing or create new config file, e.g.:
    sudo vi /etc/modprobe.d/blacklist.conf

and append at the bottom:
    options snd_intel_dspcfg dsp_driver=2

This will force snd_intel_dspcfg module - which is required by any DSP audio driver to probe - to have its 'dsp_driver' parameter initialized with value of '2', what equals SST.
Comment 167 glenn.mccarthy 2020-05-06 04:59:02 UTC
(In reply to Mateusz Gorski from comment #164)
> This issue was addressed in Skylake SST driver. 
> Listed below are the patches needed to enable DMIC capture on HDA DSP
> configuration:


I have a HP EliteBook x360 with the 8086:9d71 SST Audio, these patches and topology files don't seem to work to enable the DMIC, and when I switch the dsp_driver parameter to 2 I get no audio card at all (i.e. speakers no longer work)

Is there something else I am missing to get this going (i.e. PCI id changes etc?)
Comment 168 Cezary Rojewski 2020-05-06 09:33:42 UTC
Hello Glenn,

Could you provide us with dmesg log from your failing case?
You dump logs from kdmesg buffer via:
    dmesg > my_log_file.txt

Then attach it here, thank you.
Comment 169 glenn.mccarthy 2020-05-06 09:39:46 UTC
Created attachment 288951 [details]
dmesg output as per comment 168
Comment 170 Cezary Rojewski 2020-05-06 09:56:49 UTC
Thank you. It looks like you have no audio driver probing at all. That's probably because Skylake driver is either blacklisted or simply not part of your kernel.

Please see if there are any kernel objects (.ko) found within:
    /lib/modules/$(uname -r)/kernel/sound/soc/intel/skylake

Checkout your kconfig in your root kernel-source directory (called .config) with:
    make menuconfig

nativate to:
    Device Drivers -> Sound card support -> Advanced Linux Sound Archtecture
    -> ALSA for SoC audio support

check:
    [*] Intel ASoC SST drivers
    <M> All Skylake/SST Platforms

As we are probably dealing with HDA-dsp + DMIC configuration, before you finish, make sure your HD-Audio options found in:
    Device Drivers -> Sound card support -> Advanced Linux Sound Archtecture
    -> HD-Audio

are also checked:
    <M> Build Realtek HD-audio codec support
    <M> Build HDMI/DisplayPort HD-audio codec support

Awaiting your response.
Comment 171 glenn.mccarthy 2020-05-06 10:06:20 UTC
(In reply to Cezary Rojewski from comment #170)
> Thank you. It looks like you have no audio driver probing at all. That's
> probably because Skylake driver is either blacklisted or simply not part of
> your kernel.
> 
> Please see if there are any kernel objects (.ko) found within:
>     /lib/modules/$(uname -r)/kernel/sound/soc/intel/skylake

-rw-r--r-- 1 root root  59K May  3 07:11 snd-soc-skl.ko.xz
-rw-r--r-- 1 root root 3.6K May  3 07:11 snd-soc-skl-ssp-clk.ko.xz

> Checkout your kconfig in your root kernel-source directory (called .config)
> with:
>     make menuconfig
> 
> nativate to:
>     Device Drivers -> Sound card support -> Advanced Linux Sound Archtecture
>     -> ALSA for SoC audio support
> 
> check:
>     [*] Intel ASoC SST drivers
>     <M> All Skylake/SST Platforms

zcat /proc/config.gz | grep SND_SOC_INTEL_SKYLAKE
CONFIG_SND_SOC_INTEL_SKYLAKE=m
CONFIG_SND_SOC_INTEL_SKYLAKE_FAMILY=m
CONFIG_SND_SOC_INTEL_SKYLAKE_SSP_CLK=m
# CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC is not set
CONFIG_SND_SOC_INTEL_SKYLAKE_COMMON=m

> As we are probably dealing with HDA-dsp + DMIC configuration, before you
> finish, make sure your HD-Audio options found in:
>     Device Drivers -> Sound card support -> Advanced Linux Sound Archtecture
>     -> HD-Audio
> 
> are also checked:
>     <M> Build Realtek HD-audio codec support
>     <M> Build HDMI/DisplayPort HD-audio codec support

CONFIG_SND_HDA_CODEC_REALTEK=m
CONFIG_SND_HDA_CODEC_HDMI=m

> 
> Awaiting your response.

lspci -nn | grep Audio
00:1f.3 Multimedia audio controller [0401]: Intel Corporation Sunrise Point-LP HD Audio [8086:9d71] (rev 21)

Thank you for your help.
Comment 172 glenn.mccarthy 2020-05-06 10:10:10 UTC
Sorry, I think I've seen the issue.  Will recompile with SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC.
Comment 173 Cezary Rojewski 2020-05-06 10:13:56 UTC
Yeah. This kconfig changes are all or nought if we forget about machine drivers :)

Within '-> ALSA for SoC audio support':
    [*] HDAudio codec support
must also been checked.

Now, within the exact same directory enter:
    -*- Intel Machine drivers

directory and select:
    <M> SKL/KBL/BXT/APL/ with HDA Codecs
Comment 174 glenn.mccarthy 2020-05-06 19:21:53 UTC
(In reply to Cezary Rojewski from comment #173)
> Yeah. This kconfig changes are all or nought if we forget about machine
> drivers :)
> 
> Within '-> ALSA for SoC audio support':
>     [*] HDAudio codec support
> must also been checked.
> 
> Now, within the exact same directory enter:
>     -*- Intel Machine drivers
> 
> directory and select:
>     <M> SKL/KBL/BXT/APL/ with HDA Codecs

I have the KL/KBL/BXT/APL/ with HDA Codecs enabled.

The HDAudio codec support has this warning on it:

This option broke audio on Linus' Skylake laptop in December 2018 and the race conditions during the probe were not fixed since.
This option is DEPRECATED, all HDaudio codec support needs to be handled by the SOF driver.Distributions should not enable this option and there are no known users of this capability.

Unfortunately, the SOF driver does not support firmware loading on KabyLake at the moment.
https://github.com/thesofproject/sof/issues/1899
Comment 175 Cezary Rojewski 2020-05-06 19:28:52 UTC
This is no longer true. Race has already been fixed. Warning is misleading, will remove it, thanks.
Comment 176 glenn.mccarthy 2020-05-07 01:05:43 UTC
(In reply to Cezary Rojewski from comment #175)
> This is no longer true. Race has already been fixed. Warning is misleading,
> will remove it, thanks.

I have recompiled, and have this now:
zcat /proc/config.gz | grep SND_SOC_INTEL_SKYLAKE
CONFIG_SND_SOC_INTEL_SKYLAKE=m
CONFIG_SND_SOC_INTEL_SKYLAKE_FAMILY=m
CONFIG_SND_SOC_INTEL_SKYLAKE_SSP_CLK=m
CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=y
CONFIG_SND_SOC_INTEL_SKYLAKE_COMMON=m

Still no audio probing happening in the dmesg, and the sound is not initialised at all when using the SST driver (snd_intel_dspcfg dsp_driver=2)

Audio works but with no DMIC when using the legacy intel_hda driver (snd_intel_dspcfg dsp_driver=1)

Is this the appropriate forum for this type of help, I notice it is quite noisy here.
Comment 177 Cezary Rojewski 2020-05-07 06:42:01 UTC
Did you try modprobe-ing after reboot? Maybe your have it blacklisted within one of your config files in /etc/modprobe.d/.

Just to make sure:
    /sys/devices/pci0000:00/0000:00:1f.3$ cat device    
    /sys/devices/pci0000:00/0000:00:1f.3$ cat class

Please dump me your current:
    lsmod | grep snd

And the content of:
/lib/modules/$(uname -r)/kernel/sound/hda
/lib/modules/$(uname -r)/kernel/sound/hda/ext
/lib/modules/$(uname -r)/kernel/sound/soc/codecs | grep -iE "hda|dmic"
/lib/modules/$(uname -r)/kernel/sound/soc/intel/boards
/lib/modules/$(uname -r)/kernel/sound/soc/intel/skylake

Thank you.
Comment 178 glenn.mccarthy 2020-05-07 06:51:54 UTC
(In reply to Cezary Rojewski from comment #177)
> Did you try modprobe-ing after reboot? Maybe your have it blacklisted within
> one of your config files in /etc/modprobe.d/.
> 
> Just to make sure:
>     /sys/devices/pci0000:00/0000:00:1f.3$ cat device    
>     /sys/devices/pci0000:00/0000:00:1f.3$ cat class
> 
> Please dump me your current:
>     lsmod | grep snd
> 
> And the content of:
> /lib/modules/$(uname -r)/kernel/sound/hda
> /lib/modules/$(uname -r)/kernel/sound/hda/ext
> /lib/modules/$(uname -r)/kernel/sound/soc/codecs | grep -iE "hda|dmic"
> /lib/modules/$(uname -r)/kernel/sound/soc/intel/boards
> /lib/modules/$(uname -r)/kernel/sound/soc/intel/skylake
> 
> Thank you.
Yep, the module is loaded and not blacklisted.  I have attached all the data you requested.  Thanks.
Comment 179 glenn.mccarthy 2020-05-07 06:52:21 UTC
Created attachment 288975 [details]
Data as per comment #177
Comment 180 Cezary Rojewski 2020-05-07 18:30:18 UTC
Thanks you for providing the data requested.

First, I've forgotten about /sound/pci/hda content when asking about .ko(s) but lsmod and the limited dmesg you've provided shreds enough light:
- driver probes just fine, contrary to comment above
- looks like further pcm component probing gets deferred (soc-core yields -517 when probing link components)

To fully load snd_soc_skl_hda_dsp card, following components are required:
- snd_soc_dmic
- snd_soc_hdac_hdmi
- <hda codec patch e.g.: snd_hda_codec_realtek>

As you can see, _hdac_hdmi gets its refcnt incremented but the probe fails to find component for its analog connections (_realtek). Never gets to dmic so refcnt for snd_soc_dmic remains at 0.

Now, on with the codec_mask:
[    5.152306] snd_soc_skl 0000:00:1f.3: codec #0 probed OK: 14f120d0
[    5.153947] snd_soc_skl 0000:00:1f.3: codec #2 probed OK: 8086280b

The latter, 0x8086280b falls into Kabylake HDMI category and is supported just fine. The former is a surprise though. 0x14f1 denotes Conexant vendor, while 0x20d0 part-id seems completely unknown to kernel's standard codec-tables. Guess when you switch to snd_hda_intel _generic_codec gets loaded as kernel does not know any specifics about that chip.

Back to the problem though - I'd mentioned word 'surprise'. Requirements list only Realtek-descendants for support when DMIC is present. So, your case goes beyond the scope and is not accounted for within CI.

You can try enabling patch_conexant with sound/pci/hda kconfig.

(In reply to Cezary Rojewski from comment #170)
> As we are probably dealing with HDA-dsp + DMIC configuration, before you
> finish, make sure your HD-Audio options found in:
>     Device Drivers -> Sound card support -> Advanced Linux Sound Archtecture
>     -> HD-Audio
> 
> are also checked:
>     <M> Build Realtek HD-audio codec support
>     <M> Build HDMI/DisplayPort HD-audio codec support
> 

select below too:
    <M> Build Conexant HD-audio codec support

Let's see what we get.
Comment 181 glenn.mccarthy 2020-05-07 19:05:08 UTC
(In reply to Cezary Rojewski from comment #180)

> First, I've forgotten about /sound/pci/hda content when asking about .ko(s)

ls /lib/modules/(uname -r)/kernel/sound/pci/hda/
snd-hda-codec-analog.ko.xz  snd-hda-codec-cmedia.ko.xz    snd-hda-codec-idt.ko.xz      snd-hda-codec-via.ko.xz
snd-hda-codec-ca0110.ko.xz  snd-hda-codec-conexant.ko.xz  snd-hda-codec.ko.xz          snd-hda-intel.ko.xz
snd-hda-codec-ca0132.ko.xz  snd-hda-codec-generic.ko.xz   snd-hda-codec-realtek.ko.xz
snd-hda-codec-cirrus.ko.xz  snd-hda-codec-hdmi.ko.xz      snd-hda-codec-si3054.ko.xz

> The latter, 0x8086280b falls into Kabylake HDMI category and is supported
> just fine. The former is a surprise though. 0x14f1 denotes Conexant vendor,
> while 0x20d0 part-id seems completely unknown to kernel's standard
> codec-tables. Guess when you switch to snd_hda_intel _generic_codec gets
> loaded as kernel does not know any specifics about that chip.

Yes, loading snd_hd_intel uses the generic codec.  No microphone, and only two of the four speakers work.

> Back to the problem though - I'd mentioned word 'surprise'. Requirements
> list only Realtek-descendants for support when DMIC is present. So, your
> case goes beyond the scope and is not accounted for within CI.
> 
> You can try enabling patch_conexant with sound/pci/hda kconfig.
> 
> select below too:
>     <M> Build Conexant HD-audio codec support
> 
> Let's see what we get.

That was already enabled :
zcat /proc/config.gz | grep SND_HDA_CODEC_CONEXANT
CONFIG_SND_HDA_CODEC_CONEXANT=m

Thanks again for looking into this.
Comment 182 Cezary Rojewski 2020-05-07 19:31:34 UTC
So, it's one of those cases where OEMs decided to put some silicon on the board without notifying their SW/ FW teams.

As stated, DMIC with HDA configuration is supported officially only with Realtek chips. I'm gonna be honest here: with legacy stack failing to support your model too, my hands are tied and I won't be able to solve your case with desirable result.

What's left, is for me to speak with Takashi about addition of said codec to known-codecs table - more often than not, given codec belongs to entire family of chips and thus shares most - if not all - of the behavior routines. That won't help you with DMIC a bit unfortunately, as it requires link (DSP) capability to be up and running. I'll file shipping order for an exemplar of your laptop. No promises, prefer to stay honest.

I'd like to thank you for letting us know about misleading warning and configuration mismatches. Following two patches have been upstream to address that:
    ASoC: Intel: Skylake: Update description for HDaudio kconfig
    ALSA: hda: Allow SST driver on SKL and KBL platforms with DMIC

Thanks once again for being cooperative and responsive during this debug session.

Czarek
Comment 183 glenn.mccarthy 2020-05-07 20:49:12 UTC
(In reply to Cezary Rojewski from comment #182)
> So, it's one of those cases where OEMs decided to put some silicon on the
> board without notifying their SW/ FW teams.
Wow, it's not like it's a weird obscure laptop, it's a flagship HP - or is that normal for them?

> Thanks once again for being cooperative and responsive during this debug
> session.
> 
> Czarek
No worries, thanks for looking into it.
Comment 184 Cezary Rojewski 2020-05-07 20:51:41 UTC
Let's just say our requirements for Windows are different ^)^
Comment 185 Mykyt 2020-07-03 00:59:58 UTC
Didn`t find any working solution here, any updates? 
Same problem on Acer Swift SF314-57G, Ubuntu 20.04. I can provide more info if needed.
Comment 186 Cezary Rojewski 2020-07-03 14:39:18 UTC
Hello! Upstreamed solution should account for all HDA DSP + DMIC scenarios.

Could you provide similar info to your predecessors?
- lsmod
- dmesg
- content of /lib/modules/$(uname -r)/kernel/sound (pci/hda, soc/intel/skylake, soc/intel/boards)
- kconfig of your current kernel would also be appreciated

Force SST solution by appending:
    options snd_intel_dspcfg dsp_driver=2
within your /etc/modprobe.d/ if it's not enabled by default (if that's true, snd_hda_intel should be enumerated instead).
Comment 187 DDD 2020-07-03 18:48:42 UTC
@HP-x360-1040-G5:~$ lsmod | grep snd
snd_hda_codec_hdmi     61440  1
snd_hda_codec_generic    81920  1
ledtrig_audio          16384  1 snd_hda_codec_generic
snd_hda_intel          53248  2
snd_intel_dspcfg       24576  1 snd_hda_intel
snd_hda_codec         139264  3 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel
snd_hda_core           94208  4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd_hwdep              20480  1 snd_hda_codec
snd_pcm               114688  4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_core
snd_seq_midi           20480  0
snd_seq_midi_event     16384  1 snd_seq_midi
snd_rawmidi            36864  1 snd_seq_midi
snd_seq                69632  2 snd_seq_midi,snd_seq_midi_event
snd_seq_device         16384  3 snd_seq,snd_seq_midi,snd_rawmidi
snd_timer              40960  2 snd_seq,snd_pcm
snd                    94208  14 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_timer,snd_pcm,snd_rawmidi
soundcore              16384  1 snd

@HP-x360-1040-G5:~$ dmesg | grep snd
[    5.786124] snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    5.786149] snd_hda_intel 0000:00:1f.3: enabling device (0000 -> 0002)
[    5.786576] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    5.861703] snd_hda_codec_generic hdaudioC1D0: autoconfig for Generic: line_outs=1 (0x1d/0x0/0x0/0x0/0x0) type:speaker
[    5.861709] snd_hda_codec_generic hdaudioC1D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    5.861712] snd_hda_codec_generic hdaudioC1D0:    hp_outs=1 (0x16/0x0/0x0/0x0/0x0)
[    5.861715] snd_hda_codec_generic hdaudioC1D0:    mono: mono_out=0x0
[    5.861717] snd_hda_codec_generic hdaudioC1D0:    inputs:
[    5.861721] snd_hda_codec_generic hdaudioC1D0:      Mic=0x19


@HP-x360-1040-G5:/lib/modules/5.6.14-050614-generic/kernel/sound/pci/hda$ ls
snd-hda-codec-analog.ko  snd-hda-codec-ca0132.ko  snd-hda-codec-cmedia.ko    snd-hda-codec-generic.ko  snd-hda-codec-idt.ko  snd-hda-codec-realtek.ko  snd-hda-codec-via.ko
snd-hda-codec-ca0110.ko  snd-hda-codec-cirrus.ko  snd-hda-codec-conexant.ko  snd-hda-codec-hdmi.ko     snd-hda-codec.ko      snd-hda-codec-si3054.ko   snd-hda-intel.ko
Comment 188 Cezary Rojewski 2020-07-03 19:59:28 UTC
Indeed legacy solution got chosen. Could you re-check with modprobe.d option I've mentioned above?

One more thing: from the /lib/modules/.., content of /sound/soc/intel/skylake & /sound/soc/intel/boards is missing. Just wanted to see if the modules are there. If they are not, forcing the SST solution in modprobe.d will yield no result.
Comment 189 DDD 2020-07-04 15:13:04 UTC
i have tried this:
"Navigate to /etc/modprobe.d/ directory and edit existing or create new config file, e.g.:
    sudo vi /etc/modprobe.d/blacklist.conf

and append at the bottom:
    options snd_intel_dspcfg dsp_driver=2"
with no luck, now Sound Output is also broken.

No Skylake in my soc/intel, there is only: atom,boards,common and haswell
Comment 190 Cezary Rojewski 2020-07-05 09:26:08 UTC
Exquisite!

Looks like your distribution wants not you to have HDA + DMIC configuration. To be fair it wasn't there until recent months. This leads me to saying:
unfortunately you will have to compile the kernel yourself with Skylake kconfig enabled.

It's best if you re-use your existing kconfig and simply enable required machine board, platform driver and HDA functionality on top of what's there.
For kernel source, I'd go with linux-stable - checkout branch which represents version based on your 'uname -a' output.

Before we proceed, how familiar are you with kernel building? Do you want a step-by-step guide or listing general kconfigs is enough?
Comment 191 DDD 2020-07-05 10:21:59 UTC
Why should it be Skylake? i have a HP x360 1040 G5 like: http://h20195.www2.hp.com/v2/getpdf.aspx/4AA7-3596EEAP.pdf
with kaby Lake R https://ark.intel.com/content/www/us/en/ark/products/124968/intel-core-i7-8650u-processor-8m-cache-up-to-4-20-ghz.html
Is Skylake really our way to go?

I am not familar with Kernel Building, my highest Skills are to install and uninstall an Mainline Kernel :)

Would that Kernel Building help other People also? When i am the only one, i would  wait until ubuntu can integrate the Fix in their Kernel?
Comment 192 Nathaniel Evan 2020-07-07 02:45:11 UTC
Created attachment 290151 [details]
dmesg on acer sf314-54g, arch linux
Comment 193 Nathaniel Evan 2020-07-07 03:15:00 UTC
Created attachment 290153 [details]
Requested outputs for commands in comment#186, for Acer Swift SF314-54G running Arch Linux

Hi, I have an Acer Swift 3 SF314-54G running Arch Linux with the latest kernel (5.7.7 at the time of writing), and I currently experience this issue as well. Adding the option:
    options snd_intel_dspcfg dsp_driver=2
in /etc/modprobe.d/ broke my audio output instead.

Following the instructions in comment#186, attached here are my outputs for the requested commands. I'm very much a complete newbie in kernel-related matters, so I may require additional assistance in troubleshooting and providing more information.

(Please ignore my previous comment - I'm just beginning to figure bugzilla out and I only learned that I can only upload one attachment per comment. Apologies.)
Comment 194 Cezary Rojewski 2020-08-11 19:36:04 UTC
Sorry for the delay in response, got pre-empted to help with different drivers one of which got even released lately.

Let's get back to /skylake.

First - one of our colleagues unintentionally introduced regression in skl_hda_generic in v5.8-rc1 i.e. HDA DSP support board for Skylake and Kabylake platforms. So, we can proceed with compilation of 5.7 kernel but no further (at least for now).

There are plenty of guides available online, one of which is:
https://www.linux.com/topic/desktop/how-compile-linux-kernel-0/
which is rather straight forward. linux-stable:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git is the recommended repo for cloning as one of the safest out there.

In general, it comes down to:
- having appropriate packages installed
- ensuring .config (kernel config or kconfig in short) file have the options you want to be enabled
- make command + target e.g.: make -j`nproc` bindeb-pkg 2>&1 | tee .log_make.txt
- installing image built onto the machine, whether it's direct modules overwrite of standard install e.g.: sudo dpkg -i linux-*5.7*.deb

Your existing kconfig should be available in /boot directory (uname -r is your friend here too). It can serve as a base .config for your later compilation. Simply copy it into topmost folder of your cloned kernel repo e.g.: if my kernel is in ~/src/linux, then I'd make sure said config gets copied to and is available as ~/src/linux/.config. Then do 'make olddefconfig' and from then on, you may happily update the kernel options as you see fit via 'make menuconfig'. I've provided all the required options for /skylake HDA DSP + DMIC configuration in posts above.
Comment 195 Cezary Rojewski 2020-08-11 19:55:34 UTC
Hello Nathaniel,

Could you update your /etc/modprobe.d/blacklist.conf with:
    options snd_hda_core dyndbg==pmf
    options snd_hda_codec dyndbg==pmf

appended at the bottom? Restart the machine and resend dmesg output as you did previously. Thank you in advance for your input.
Comment 196 benjamin.doron00 2020-08-14 22:09:16 UTC
Hi all, thanks for working on this.

I've been trying to get this working for my device, an Acer Aspire VN7-572G laptop (Skylake-U). I've made progress based on comment #173 and comment #164, but have encountered some difficulties as the device has a 1ch array DMIC.

1. The vendor violates the NHLT specification by setting ArrayType=0x1, which is resolved with a small patch to sound/hda/intel-nhlt.c to set the appropriate DMIC configuration. This hack is unnecessary on a coreboot port that I have.
2. The generic ALSA topology doesn't work for me.

So, how do I write a topology for this device? I imagine setting "minimum channels" to "1" would be a start.
Comment 197 Pierre Bossart 2020-08-17 15:21:10 UTC
(In reply to benjamin.doron00 from comment #196)
> Hi all, thanks for working on this.
> 
> I've been trying to get this working for my device, an Acer Aspire VN7-572G
> laptop (Skylake-U). I've made progress based on comment #173 and comment
> #164, but have encountered some difficulties as the device has a 1ch array
> DMIC.
> 
> 1. The vendor violates the NHLT specification by setting ArrayType=0x1,
> which is resolved with a small patch to sound/hda/intel-nhlt.c to set the
> appropriate DMIC configuration. This hack is unnecessary on a coreboot port
> that I have.

can you share this patch (with your Signed-off-by tag)? we've recently dealt with devices with a single mic and didn't see this problem.


> 2. The generic ALSA topology doesn't work for me.
> 
> So, how do I write a topology for this device? I imagine setting "minimum
> channels" to "1" would be a start.

The simpler solution is probably to use a dual-mono 2ch solution.
Comment 200 Nathaniel Evan 2020-08-31 07:18:38 UTC
Created attachment 292253 [details]
dmesg outputs. each scenario described in text file

(In reply to Cezary Rojewski from comment #195)
> Hello Nathaniel,
> 
> Could you update your /etc/modprobe.d/blacklist.conf with:
>     options snd_hda_core dyndbg==pmf
>     options snd_hda_codec dyndbg==pmf
> 
> appended at the bottom? Restart the machine and resend dmesg output as you
> did previously. Thank you in advance for your input.

Hi Cezary, thanks for the response and apologies for the very late reply.
This morning I just updated my packages and I am now running kernel 5.8.5 from the Arch Linux repo. Attached in this comment are dmesg outputs for 3 scenarios:

1. No sound options set in /etc/modprobe.d/
2. options snd_intel_dspcfg dsp_driver=2
3. the above option, appended with the debugging options from comment#195

In case this information is relevant, I have the package sof-firmware from the Arch Linux repo installed, and as of now I'm running PulseAudio version 13.0-3 (version 13.99 available in testing, but not installed on my machine yet).

Looking forward to your reply, and thank you for your assistance.
Comment 201 Nathaniel Evan 2020-08-31 07:24:52 UTC
(In reply to Nathaniel Evan from comment #200)
> Created attachment 292253 [details]
> dmesg outputs. each scenario described in text file
> 
> (In reply to Cezary Rojewski from comment #195)
> > Hello Nathaniel,
> > 
> > Could you update your /etc/modprobe.d/blacklist.conf with:
> >     options snd_hda_core dyndbg==pmf
> >     options snd_hda_codec dyndbg==pmf
> > 
> > appended at the bottom? Restart the machine and resend dmesg output as you
> > did previously. Thank you in advance for your input.
> 
> Hi Cezary, thanks for the response and apologies for the very late reply.
> This morning I just updated my packages and I am now running kernel 5.8.5
> from the Arch Linux repo. Attached in this comment are dmesg outputs for 3
> scenarios:
> 
> 1. No sound options set in /etc/modprobe.d/
> 2. options snd_intel_dspcfg dsp_driver=2
> 3. the above option, appended with the debugging options from comment#195
> 
> In case this information is relevant, I have the package sof-firmware from
> the Arch Linux repo installed, and as of now I'm running PulseAudio version
> 13.0-3 (version 13.99 available in testing, but not installed on my machine
> yet).
> 
> Looking forward to your reply, and thank you for your assistance.

Right now, I don't have any sound output at all (PulseAudio only reports dummy output in pavucontrol), and still no inputs available, with all of the 3 scenarios specified in my latest comment. Sorry I forgot to report this situation in the comment above.
Comment 202 Cezary Rojewski 2020-08-31 07:48:24 UTC
If I'm not mistaken, Acer Swift SF314-54G is running on KBL-R processor and thus you'll need /skylake/ driver enabled.

For SKL/KBL/KBL-R/AML/CML S/APL one will be using /skylake/.
For all the rest, SOF.

By the way:

Problems(In reply to Cezary Rojewski from comment #194)
> First - one of our colleagues unintentionally introduced regression in
> skl_hda_generic in v5.8-rc1 i.e. HDA DSP support board for Skylake and
> Kabylake platforms. So, we can proceed with compilation of 5.7 kernel but no
> further (at least for now).
> 

has been fixed as we can now be making you of topmost broonie/for-next again. /skylake/ topology has been updated too and is now as flexible as it can (possibly?) be across all cAVS (architecture name, your KBL-R is part of saif arch) hardwares.

-

The reason I had mentioned those options (dyndbg) is for you to append them within /etc/modprobe/d/<file e.g.: blacklist.conf> and then provide the dmesg log for us to analyze.

I'll go ahead and list you repos which you should download:
 git://git.alsa-project.org/alsa-topology-conf.git
 git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

alsa-topology-conf contains UCM-syntax topology files which you can compile using: alsatplg -c <ucm file> -o <binary file>. Once cloned, checkout 'master' branch (that should happen by default anyway) and navigate to: topology/hda-dsp/skl_hda_dsp_generic-tplg.conf. Invoke alsatplg commond on that very conf file:
    alsatplg -c skl_hda_dsp_generic-tplg.conf -o skl_hda_dsp_generic-tplg.bin

Generated files are then to be placed within /lib/firmware/intel/ directory.

Make sure 'options snd_intel_dspcfg dsp_driver=2' is set within /etc/modprobe.d/<any file e.g.: blacklist.conf>

Kernel driver is more complicated to setup - you will need your .config (Kconfig) file first. I have explained on comments above how to gather it as you do not want to enable AudioDSP support for KBL-R while removing other functionalities in the process : )
Comment 203 Tristan Mahe 2020-09-08 21:35:08 UTC
Hi,

Noticed a regression between kernel 5.4.1 and kernel 5.7+ on my spectre x360 ap0xxx

No more sound output since kernel 5.7+ when using the sof driver, and when using the legacy driver, sound works but no dmic.

I had both working as of kernel 5.4.1

alsainfo already provided in this thread at https://bugzilla.kernel.org/attachment.cgi?id=284373 I can provide a fresh one if needed, along with any traces that would help troubleshoot this regression.

Card is detected in pulseaudio, but no audio output.

I tried recompiling 5.8.7 kernel with CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=y to no effect.

Let me know if there's anything I can provide to help :)
Comment 204 Pierre Bossart 2020-09-09 19:41:15 UTC
(In reply to Tristan Mahe from comment #203)
> Hi,
> 
> Noticed a regression between kernel 5.4.1 and kernel 5.7+ on my spectre x360
> ap0xxx
> 
> No more sound output since kernel 5.7+ when using the sof driver, and when
> using the legacy driver, sound works but no dmic.
> 
> I had both working as of kernel 5.4.1
> 
> alsainfo already provided in this thread at
> https://bugzilla.kernel.org/attachment.cgi?id=284373 I can provide a fresh
> one if needed, along with any traces that would help troubleshoot this
> regression.
> 
> Card is detected in pulseaudio, but no audio output.
> 
> I tried recompiling 5.8.7 kernel with
> CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=y to no effect.
> 
> Let me know if there's anything I can provide to help :)

It's best if you file an issue on the SOF GitHub.
https://github.com/thesofproject/linux/issues

There were changes in 5.5 IIRC related to card names and control names, so maybe you need new UCM files or a change of configuration.
Comment 205 Tristan Mahe 2020-09-10 16:16:41 UTC
(In reply to Pierre Bossart from comment #204)
> (In reply to Tristan Mahe from comment #203)
> > Hi,
> > 
> > Noticed a regression between kernel 5.4.1 and kernel 5.7+ on my spectre
> x360
> > ap0xxx
> > 
> > No more sound output since kernel 5.7+ when using the sof driver, and when
> > using the legacy driver, sound works but no dmic.
> > 
> > I had both working as of kernel 5.4.1
> > 
> > alsainfo already provided in this thread at
> > https://bugzilla.kernel.org/attachment.cgi?id=284373 I can provide a fresh
> > one if needed, along with any traces that would help troubleshoot this
> > regression.
> > 
> > Card is detected in pulseaudio, but no audio output.
> > 
> > I tried recompiling 5.8.7 kernel with
> > CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=y to no effect.
> > 
> > Let me know if there's anything I can provide to help :)
> 
> It's best if you file an issue on the SOF GitHub.
> https://github.com/thesofproject/linux/issues
> 
> There were changes in 5.5 IIRC related to card names and control names, so
> maybe you need new UCM files or a change of configuration.


Thank you, will do !
Comment 206 glenn.mccarthy 2020-09-27 23:07:35 UTC
Further to where we were last time with my particular case, now under kernel 5.8.1 it looks like the codec is supported, I get this in dmesg:

snd_soc_skl:probe_codec: snd_soc_skl 0000:00:1f.3: codec #0 probed OK: 14f120d0
snd_soc_skl:load_codec_module: hdaudio ehdaudio0D0: loading hdaudio:v14F120D0r00100001a01 codec module

Unfortunately, still no sound.  I think it may have something to do with this message:

snd_soc_skl:skl_nhlt_update_topology_bin: snd_soc_skl 0000:00:1f.3: oem_id INTEL , oem_table_id KBL oem_revision 2
snd_soc_skl:skl_find_machine: snd_soc_skl 0000:00:1f.3: No matching I2S machine driver found
snd_soc_skl:skl_init_dsp: snd_soc_skl 0000:00:1f.3: dsp registration status=0

I looked through my kernel config, and all the possible Intel Machine drivers are enabled.


(In reply to Cezary Rojewski from comment #182)
> So, it's one of those cases where OEMs decided to put some silicon on the
> board without notifying their SW/ FW teams.
> 
> As stated, DMIC with HDA configuration is supported officially only with
> Realtek chips. I'm gonna be honest here: with legacy stack failing to
> support your model too, my hands are tied and I won't be able to solve your
> case with desirable result.
> 
> What's left, is for me to speak with Takashi about addition of said codec to
> known-codecs table - more often than not, given codec belongs to entire
> family of chips and thus shares most - if not all - of the behavior
> routines. That won't help you with DMIC a bit unfortunately, as it requires
> link (DSP) capability to be up and running. I'll file shipping order for an
> exemplar of your laptop. No promises, prefer to stay honest.
> 
> I'd like to thank you for letting us know about misleading warning and
> configuration mismatches. Following two patches have been upstream to
> address that:
>     ASoC: Intel: Skylake: Update description for HDaudio kconfig
>     ALSA: hda: Allow SST driver on SKL and KBL platforms with DMIC
> 
> Thanks once again for being cooperative and responsive during this debug
> session.
> 
> Czarek
Comment 207 Peter 2020-09-29 05:11:25 UTC
HP Zbook 17 G6, Realtek ALC285, i7-9850H

broonie.git, for-next


$ dmesg | grep -e "sof\|snd" 
[    3.617666] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    3.617667] software IO TLB: mapped [mem 0x912b1000-0x952b1000] (64MB)
[    5.532335] snd_soc_skl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    5.532336] snd_soc_skl 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    5.544300] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    5.544302] sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    5.544312] sof-audio-pci 0000:00:1f.3: enabling device (0000 -> 0002)
[    5.544459] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[    5.544490] sof-audio-pci 0000:00:1f.3: init of i915 and HDMI codec failed
[    5.546609] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[    5.559307] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 1
[    5.559308] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[    5.559311] sof-audio-pci 0000:00:1f.3: DMICs detected in NHLT tables: 4
[    6.464679] sof-audio-pci 0000:00:1f.3: error: cl_dsp_init: timeout HDA_DSP_SRAM_REG_ROM_STATUS read
[    6.464687] sof-audio-pci 0000:00:1f.3: error: status = 0x00000000 panic = 0x00000000
[    6.464708] sof-audio-pci 0000:00:1f.3: error: extended rom status:  0x6000021 0x0 0x0 0x0 0x0 0x0 0x183011b 0x0
[    6.464730] sof-audio-pci 0000:00:1f.3: error: dsp init failed after 3 attempts with err: -110
[    6.464735] sof-audio-pci 0000:00:1f.3: ROM error=0xffffffff: FW status=0xffffffff
[    6.464755] sof-audio-pci 0000:00:1f.3: error: status = 0xffffffff panic = 0xffffffff
[    6.464788] sof-audio-pci 0000:00:1f.3: error: extended rom status:  0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
[    6.464797] sof-audio-pci 0000:00:1f.3: error: failed to reset DSP
[    6.464798] sof-audio-pci 0000:00:1f.3: error: failed to boot DSP firmware -110
[    6.515162] sof-audio-pci 0000:00:1f.3: error: hda_dsp_core_reset_enter: timeout on HDA_DSP_REG_ADSPCS read
[    6.515163] sof-audio-pci 0000:00:1f.3: error: dsp core reset failed: core_mask f
[    6.515273] sof-audio-pci 0000:00:1f.3: error: sof_probe_work failed err: -110

$ lsmod | grep -e "sof\|snd"
snd_hda_codec_realtek   110592  0
snd_hda_codec_generic    77824  1 snd_hda_codec_realtek
snd_sof_pci            20480  0
snd_sof_intel_hda_common    69632  1 snd_sof_pci
snd_sof_intel_hda      16384  1 snd_sof_intel_hda_common
snd_sof_intel_byt      20480  1 snd_sof_pci
snd_sof_intel_ipc      16384  1 snd_sof_intel_byt
snd_sof                98304  4 snd_sof_pci,snd_sof_intel_hda_common,snd_sof_intel_byt,snd_sof_intel_ipc
snd_sof_xtensa_dsp     16384  2 snd_sof_intel_hda_common,snd_sof_intel_byt
ledtrig_audio          16384  2 snd_hda_codec_generic,snd_sof
iosf_mbi               16384  1 snd_sof_intel_byt
snd_soc_skl           135168  0
snd_soc_hdac_hda       20480  2 snd_sof_intel_hda_common,snd_soc_skl
snd_hda_ext_core       24576  4 snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_soc_skl,snd_sof_intel_hda
snd_soc_acpi_intel_match    36864  3 snd_sof_pci,snd_sof_intel_hda_common,snd_soc_skl
snd_soc_acpi           16384  4 snd_soc_acpi_intel_match,snd_sof_intel_hda_common,snd_sof_intel_byt,snd_soc_skl
snd_soc_sst_ipc        16384  1 snd_soc_skl
snd_soc_sst_dsp        28672  1 snd_soc_skl
snd_soc_core          217088  4 snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_soc_skl
snd_intel_dspcfg       24576  3 snd_sof_pci,snd_sof_intel_hda_common,snd_soc_skl
snd_hda_codec         114688  3 snd_hda_codec_generic,snd_hda_codec_realtek,snd_soc_hdac_hda
snd_hda_core           77824  8 snd_hda_codec_generic,snd_hda_ext_core,snd_hda_codec,snd_hda_codec_realtek,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_soc_skl,snd_sof_intel_hda

installed sof-firmware-5.1 (from gentoo repository)

How can i push it further ?
Comment 208 Pierre Bossart 2020-09-29 15:00:16 UTC
(In reply to Peter from comment #207)
> [    5.544490] sof-audio-pci 0000:00:1f.3: init of i915 and HDMI codec failed
> [    5.546609] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
> [    5.559307] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 1
> [    5.559308] sof-audio-pci 0000:00:1f.3: using HDA machine driver
> skl_hda_dsp_generic now
> [    5.559311] sof-audio-pci 0000:00:1f.3: DMICs detected in NHLT tables: 4
> [    6.464679] sof-audio-pci 0000:00:1f.3: error: cl_dsp_init: timeout
> HDA_DSP_SRAM_REG_ROM_STATUS read
> [    6.464687] sof-audio-pci 0000:00:1f.3: error: status = 0x00000000 panic
> = 0x00000000
> [    6.464708] sof-audio-pci 0000:00:1f.3: error: extended rom status: 
> 0x6000021 0x0 0x0 0x0 0x0 0x0 0x183011b 0x0
> [    6.464730] sof-audio-pci 0000:00:1f.3: error: dsp init failed after 3
> attempts with err: -110
> [    6.464735] sof-audio-pci 0000:00:1f.3: ROM error=0xffffffff: FW
> status=0xffffffff
> [    6.464755] sof-audio-pci 0000:00:1f.3: error: status = 0xffffffff panic
> = 0xffffffff
> [    6.464788] sof-audio-pci 0000:00:1f.3: error: extended rom status: 
> 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
> 0xffffffff
> [    6.464797] sof-audio-pci 0000:00:1f.3: error: failed to reset DSP
> [    6.464798] sof-audio-pci 0000:00:1f.3: error: failed to boot DSP
> firmware -110
> [    6.515162] sof-audio-pci 0000:00:1f.3: error: hda_dsp_core_reset_enter:
> timeout on HDA_DSP_REG_ADSPCS read
> [    6.515163] sof-audio-pci 0000:00:1f.3: error: dsp core reset failed:
> core_mask f
> [    6.515273] sof-audio-pci 0000:00:1f.3: error: sof_probe_work failed err:
> -110

> installed sof-firmware-5.1 (from gentoo repository)
> 
> How can i push it further ?

Do you mind filing a bug here:

https://github.com/thesofproject/linux/issues

I wonder if you have the correct firmware file setup, this is an firmware authentication issue. Also we should have 1.6 released very soon so that may solve your problem as well. thanks!
Comment 209 Pierre Bossart 2020-09-29 15:10:47 UTC
(In reply to Pierre Bossart from comment #208)
> > installed sof-firmware-5.1 (from gentoo repository)
> > 
> > How can i push it further ?
> 
> Do you mind filing a bug here:
> 
> https://github.com/thesofproject/linux/issues
> 
> I wonder if you have the correct firmware file setup, this is an firmware
> authentication issue. Also we should have 1.6 released very soon so that may
> solve your problem as well. thanks!

actually the pre-release is available for tests, can you look into this:

https://github.com/thesofproject/sof-bin/tree/stable-v1.6

and specifically you'd need to check the signed firmware from:

https://github.com/thesofproject/sof-bin/tree/stable-v1.6/lib/firmware/intel/sof/v1.6/intel-signed
Comment 210 Peter 2020-09-29 15:46:19 UTC
Filled bug report: https://github.com/thesofproject/linux/issues/2478
Comment 211 Parinya Teerakasemsuk 2020-10-26 18:32:29 UTC
I'm using Acer Swift SF514-52T (Intel 8th Gen Core i5) on Ubuntu 20.10 - Linux kernel 5.8.

00:1f.3 Multimedia audio controller: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
	Subsystem: Acer Incorporated [ALI] Sunrise Point-LP HD Audio
	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 138
	Region 0: Memory at b1228000 (64-bit, non-prefetchable) [size=16K]
	Region 4: Memory at b1200000 (64-bit, non-prefetchable) [size=64K]

The sound only works when the HDA driver (snd_hda_intel) is in use (/etc/modprobe.d/alsa-base.conf with options snd-intel-dspcfg dsp_driver=1). However, with this option, DMIC is not working. Moreover, I believe the HDA driver has been deprecated to move onto the SOF driver.

The latest situation regarding Kaby Lake's support with SOF driver, it seems the SOF driver will never support the Kaby Lake platform, as the issues for supporting this platform have been closed ( https://github.com/thesofproject/sof/issues/1899 ). And the proposed workaround to support this platform have been discarded also ( https://github.com/thesofproject/sof/issues/2256 ).

Therefore the only solution left is Intel's SST driver. However, the SST driver (options snd-intel-dspcfg dsp_driver=2) is not working also as both the sound and DMIC are not working.

I'm not a programmer. Can I do anything to help fix this issue?
Comment 212 Pierre Bossart 2020-10-26 23:49:45 UTC
@(In reply to Parinya Teerakasemsuk from comment #211)
> Therefore the only solution left is Intel's SST driver. However, the SST
> driver (options snd-intel-dspcfg dsp_driver=2) is not working also as both
> the sound and DMIC are not working.
> 
> I'm not a programmer. Can I do anything to help fix this issue?

standard answer: please keep 'options snd-intel-dspcfg dsp_driver=2', provide a link to the output of 'alsa-info' and a full dmesg log as attachment. thanks!
My guess is that you don't have the topology or UCM files that are needed.
Comment 213 Parinya Teerakasemsuk 2020-10-27 01:09:57 UTC
Created attachment 293239 [details]
dmesg on Acer Swift SF514-52T running Ubuntu 20.10, as per comment #213.
Comment 214 Parinya Teerakasemsuk 2020-10-27 01:12:56 UTC
(In reply to Pierre Bossart from comment #212)
> @(In reply to Parinya Teerakasemsuk from comment #211)
> > Therefore the only solution left is Intel's SST driver. However, the SST
> > driver (options snd-intel-dspcfg dsp_driver=2) is not working also as both
> > the sound and DMIC are not working.
> > 
> > I'm not a programmer. Can I do anything to help fix this issue?
> 
> standard answer: please keep 'options snd-intel-dspcfg dsp_driver=2',
> provide a link to the output of 'alsa-info' and a full dmesg log as
> attachment. thanks!
> My guess is that you don't have the topology or UCM files that are needed.

Here is my alsa-info link: http://alsa-project.org/db/?f=db024ae3c924d318bda813f73c73e76df36bbca2

A full dmesg log is in comment #213. 

Where can I find the topology or UCM files that are needed. Thanks.
Comment 215 Pierre Bossart 2020-10-27 15:56:24 UTC
(In reply to Parinya Teerakasemsuk from comment #214)
> Here is my alsa-info link:
> http://alsa-project.org/db/?f=db024ae3c924d318bda813f73c73e76df36bbca2
> 
> A full dmesg log is in comment #213. 

there's not a single line related to audio drivers in the logs. did you actually enable audio and the snd-intel-dspcfg driver?

> Where can I find the topology or UCM files that are needed. Thanks.

The topology should be in alsa-lib but distros install it.

the UCM files should be in alsa-ucm-conf and installed in /usr/share/alsa/ucm2/
Comment 216 Pierre Bossart 2020-10-27 15:57:21 UTC
(In reply to Pierre Bossart from comment #215)
> The topology should be in alsa-lib but distros install it.

I meant I am not sure distros install the topologies.
Comment 217 Parinya Teerakasemsuk 2020-10-27 18:27:39 UTC
(In reply to Pierre Bossart from comment #215)
> 
> there's not a single line related to audio drivers in the logs. did you
> actually enable audio and the snd-intel-dspcfg driver?
> 
I enabled the driver with options snd-intel-dspcfg dsp_driver=2 in /etc/modprobe.d/alsa-base.conf. Is this the right way to enable it?
>  
> 
> The topology should be in alsa-lib but distros install it.
> 
This is the contents in my alsa-lib folder: https://photos.app.goo.gl/AC8AQdqQN4kvRKay6
> 
> 
> the UCM files should be in alsa-ucm-conf and installed in
> /usr/share/alsa/ucm2/
> 
This is the contents in my alsa-ucm-conf folder: https://photos.app.goo.gl/Zn5tY6MLgSvbqqYv7 and this is the contents in my ucm2 folder: https://photos.app.goo.gl/b6ogdPssY4QwHJuC6

I don't know whether this will be relevant, here is the content in my ucm.conf file in the ucm2 folder above: https://paste.ubuntu.com/p/qqmJ9PwgHx
Comment 218 Peter 2020-10-30 12:39:11 UTC
Created attachment 293317 [details]
dmesg HP Zbook 17 G6, error: ipc error for 0x50010000 size 108

Back to HP Zbook 17 G6

I managed to get firmware load (ME was disabled in BIOS)

Now i get following error:
[   12.378156] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x50010000
[   12.378159] sof-audio-pci 0000:00:1f.3: ipc tx: 0x50010000
[   12.378247] sof-audio-pci 0000:00:1f.3: error: ipc error for 0x50010000 size 108
[   12.378249] sof-audio-pci 0000:00:1f.3: error: set/get ctrl ipc comp 58
[   12.378250] sof-audio-pci 0000:00:1f.3: error: failed kcontrol value set for widget: 58
[   12.378251] sof-audio-pci 0000:00:1f.3: error: restoring kcontrols after resume
[   12.378252] sof-audio-pci 0000:00:1f.3: error: failed to restore pipeline after resume -22
[   12.378256] sof-audio-pci 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_pm_runtime_get on 0000:00:1f.3: -22

sof-firmware 1.6

attachment:
dmsg | grep -e "snd\|sof"

kernel from broonie sound git
commit 9f5beb42260c4cda64b2594f1a04b987f97dd84f (grafted, HEAD -> for-next, origin/for-next, origin/HEAD)
Author: Mark Brown <broonie@kernel.org>
Date:   Mon Oct 26 23:43:03 2020 +0000

    Merge remote-tracking branch 'asoc/for-5.11' into asoc-next
Comment 219 Peter 2020-10-30 13:02:13 UTC
Created attachment 293319 [details]
dmesg HP Zbook 17 G6, error: ipc error for 0x50010000 size 108

dmesg | grep -e "snd\|sof\|ASoC\|hda"
Comment 220 Pierre Bossart 2020-10-30 16:45:46 UTC
(In reply to Peter from comment #218)

> I managed to get firmware load (ME was disabled in BIOS)

That's good.
 
> Now i get following error:
> [   12.378156] sof-audio-pci 0000:00:1f.3: ipc tx succeeded: 0x50010000
> [   12.378159] sof-audio-pci 0000:00:1f.3: ipc tx: 0x50010000
> [   12.378247] sof-audio-pci 0000:00:1f.3: error: ipc error for 0x50010000
> size 108
> [   12.378249] sof-audio-pci 0000:00:1f.3: error: set/get ctrl ipc comp 58
> [   12.378250] sof-audio-pci 0000:00:1f.3: error: failed kcontrol value set
> for widget: 58
> [   12.378251] sof-audio-pci 0000:00:1f.3: error: restoring kcontrols after
> resume
> [   12.378252] sof-audio-pci 0000:00:1f.3: error: failed to restore pipeline
> after resume -22
> [   12.378256] sof-audio-pci 0000:00:1f.3: ASoC: error at
> snd_soc_pcm_component_pm_runtime_get on 0000:00:1f.3: -22

That's not so good.

> sof-firmware 1.6
> 
> attachment:
> dmsg | grep -e "snd\|sof"
> 
> kernel from broonie sound git
> commit 9f5beb42260c4cda64b2594f1a04b987f97dd84f (grafted, HEAD -> for-next,
> origin/for-next, origin/HEAD)
> Author: Mark Brown <broonie@kernel.org>
> Date:   Mon Oct 26 23:43:03 2020 +0000
> 
>     Merge remote-tracking branch 'asoc/for-5.11' into asoc-next

can you try with the SOF development kernel? There were patches submitted to Takashi's tree related to the codec suspend-resume, I think you are hitting issues due to the kernel version.

Also it's probably easier to use the SOF linux github issues if you want to reach SOF developers directly. Thanks.
Comment 221 Peter 2020-10-30 17:43:34 UTC
Sure, for reference:
https://github.com/thesofproject/linux/issues/2545
Comment 222 Peter 2020-10-30 18:43:11 UTC
I had topology v.1.6 and sof-firmware 1.5.1, after switching to 1.6 sound  works fine including microphone.

Thanks for Pierre for pointing out possible cause.
Comment 223 anitoanto 2020-10-30 19:06:42 UTC
Glad that updating to sof-firmware to 1.6 works. Please provide some insights on how to update sof-firmware, and if possible, how to check whether sof-firmware is installed with linux-firmware package in most distros.
Comment 224 anitoanto 2020-10-30 19:46:07 UTC
I think the sof-bin repo serves the latest versions.
https://github.com/thesofproject/sof-bin/tree/stable-v1.6

Installing sof-firmware v1.6 with go script in this repo doesn't solve the issue. Shows 'Dummy Output' for speaker volume, and no microphone is detected. No souncard is detected.
The script get installed to /lib/firmware/intel/ wiping out old versions.
Peter, anything I am missing out...? Please help.
Comment 225 Peter 2020-10-30 20:02:07 UTC
If you've got HP Zbook make sure you enable ME in BIOS (Advanced tab) - it was main cause of sound not working in my case.
Make sure you are using snd_soc_skl and sof-audio-pci modules (+codecs) - if you are using distro kernel they should be enabled. 
You can disable snd-hda-intel (blacklist snd-hda-intel in /etc/modprobe.d/).

If you still got problem save dmseg output to file and attach it here - someone should be able to help you.
Comment 226 Peter 2020-10-30 20:04:18 UTC
And Intel integrated graphics have to be enabled in BIOS too.
Comment 227 Pierre Bossart 2020-10-30 21:18:05 UTC
(In reply to Peter from comment #226)
> And Intel integrated graphics have to be enabled in BIOS too.

not necessarily, this used to be a limitation but we've enabled audio with NVIDIA graphics a while ago.

You may want to look at 

https://thesofproject.github.io/latest/getting_started/index.html#debugging-audio-issues-on-intel-platforms

I tried to provide step-by-step instructions to explain how do debug issues with SOF.
Comment 228 DDD 2020-10-30 21:53:07 UTC
How to check and enable this?
"Make sure you are using snd_soc_skl and sof-audio-pci modules (+codecs) - if you are using distro kernel they should be enabled."

Blacklisted snd-hda-intel, now the sound output is also gone on ubuntu 20.04 with 5.4.0-52 Kernel.

In Bios on HP x360 1040 i don't find any iGPU and ME related points to enable.
Comment 229 Pierre Bossart 2020-10-30 22:03:21 UTC
(In reply to DDD from comment #228)
> Blacklisted snd-hda-intel, now the sound output is also gone on ubuntu 20.04
> with 5.4.0-52 Kernel.

I don't you can expect this kernel version to support all variants of HDaudio configurations. IIRC the minimum version to be compatible with UCM (alsa-ucm-conf) was 5.5.x. Maybe Ubuntu back-ported stuff though.
Comment 230 DDD 2020-10-30 22:19:43 UTC
also tried 5.9.2 mainline kernel
Comment 231 DDD 2020-10-30 22:21:13 UTC
Created attachment 293327 [details]
HP x360 1040
Comment 232 DDD 2020-10-30 22:31:39 UTC
juri@HP-x360-1040-G5:~$ lspci | grep -i audio 
00:1f.3 Multimedia audio controller: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
juri@HP-x360-1040-G5:~$ lsb_release -d
Description:	Ubuntu 20.04.1 LTS
juri@HP-x360-1040-G5:~$ uname -r
5.9.2-050902-generic
juri@HP-x360-1040-G5:~$ cat /proc/asound/cards
--- no soundcards ---
juri@HP-x360-1040-G5:~$ aplay -l
aplay: device_list:274: keine Klangkarten gefunden …
juri@HP-x360-1040-G5:~$ aplay /usr/share/sounds/alsa/Noise.wav
Wiedergabe: WAVE '/usr/share/sounds/alsa/Noise.wav' : Signed 16 bit Little Endian, Rate: 48000 Hz, mono
juri@HP-x360-1040-G5:~$ lspci -nnk | grep -iA2 audio 
lspci: Unable to load libkmod resources: error -12
00:1f.3 Multimedia audio controller [0401]: Intel Corporation Sunrise Point-LP HD Audio [8086:9d71] (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP HD Audio [103c:8470]
	Kernel driver in use: snd_soc_skl
00:1f.4 SMBus [0c05]: Intel Corporation Sunrise Point-LP SMBus [8086:9d23] (rev 21)
juri@HP-x360-1040-G5:~$ ps -C esd
    PID TTY          TIME CMD
juri@HP-x360-1040-G5:~$ ps -C pulseaudio
    PID TTY          TIME CMD
   1333 ?        00:00:00 pulseaudio
juri@HP-x360-1040-G5:~$ ps -C arts
    PID TTY          TIME CMD
juri@HP-x360-1040-G5:~$ grep "^audio" /etc/group | grep "$USER" | wc -l
0
juri@HP-x360-1040-G5:~$ dpkg -l | tr -s " " | grep " alsa-"
ii alsa-base 1.0.25+dfsg-0ubuntu5 all ALSA driver configuration files
ii alsa-tools-gui 1.1.7-1ubuntu1 amd64 GUI based ALSA utilities for specific hardware
ii alsa-topology-conf 1.2.2-1 all ALSA topology configuration files
ii alsa-ucm-conf 1.2.2-1ubuntu0.4 all ALSA Use Case Manager configuration files
ii alsa-utils 1.2.2-1ubuntu1 amd64 Utilities for configuring and using ALSA
juri@HP-x360-1040-G5:~$ lsmod | grep "snd"
snd_soc_skl_hda_dsp    28672  0
snd_hda_codec         143360  1 snd_soc_skl_hda_dsp
snd_soc_hdac_hdmi      36864  1 snd_soc_skl_hda_dsp
snd_hwdep              20480  1 snd_hda_codec
snd_soc_skl_ssp_clk    16384  0
snd_soc_dmic           16384  0
snd_soc_skl           163840  1 snd_soc_skl_ssp_clk
snd_soc_sst_ipc        20480  1 snd_soc_skl
snd_soc_sst_dsp        36864  1 snd_soc_skl
snd_hda_ext_core       32768  2 snd_soc_hdac_hdmi,snd_soc_skl
snd_soc_acpi_intel_match    45056  1 snd_soc_skl
snd_soc_acpi           16384  2 snd_soc_acpi_intel_match,snd_soc_skl
snd_intel_dspcfg       24576  1 snd_soc_skl
snd_hda_core           94208  5 snd_hda_ext_core,snd_hda_codec,snd_soc_hdac_hdmi,snd_soc_skl,snd_soc_skl_hda_dsp
snd_soc_core          278528  4 snd_soc_hdac_hdmi,snd_soc_skl,snd_soc_dmic,snd_soc_skl_hda_dsp
snd_compress           28672  1 snd_soc_core
ac97_bus               16384  1 snd_soc_core
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_pcm               118784  7 snd_hda_codec,snd_soc_hdac_hdmi,snd_compress,snd_soc_core,snd_soc_skl,snd_hda_core,snd_pcm_dmaengine
snd_seq_midi           20480  0
snd_seq_midi_event     16384  1 snd_seq_midi
snd_rawmidi            36864  1 snd_seq_midi
snd_seq                73728  2 snd_seq_midi,snd_seq_midi_event
snd_seq_device         16384  3 snd_seq,snd_seq_midi,snd_rawmidi
snd_timer              40960  2 snd_seq,snd_pcm
snd                    94208  10 snd_seq,snd_seq_device,snd_hwdep,snd_hda_codec,snd_timer,snd_compress,snd_soc_core,snd_pcm,snd_soc_skl_hda_dsp,snd_rawmidi
soundcore              16384  1 snd
juri@HP-x360-1040-G5:~$ head -n 3 /proc/asound/card0/codec#0
head: '/proc/asound/card0/codec#0' kann nicht zum Lesen geöffnet werden: Datei oder Verzeichnis nicht gefunden
juri@HP-x360-1040-G5:~$ cat ~/.asoundrc
cat: /home/juri/.asoundrc: Datei oder Verzeichnis nicht gefunden
juri@HP-x360-1040-G5:~$ cat /etc/asound.conf 
cat: /etc/asound.conf: Datei oder Verzeichnis nicht gefunden
Comment 234 anitoanto 2020-10-31 03:02:44 UTC
(In reply to Peter from comment #225)
> If you've got HP Zbook make sure you enable ME in BIOS (Advanced tab) - it
> was main cause of sound not working in my case.
> Make sure you are using snd_soc_skl and sof-audio-pci modules (+codecs) - if
> you are using distro kernel they should be enabled. 
> You can disable snd-hda-intel (blacklist snd-hda-intel in /etc/modprobe.d/).
> 
> If you still got problem save dmseg output to file and attach it here -
> someone should be able to help you.

I am not sure snd_soc_skl and sof-audio-pci modules are enabled or installed, as the output of lsmod doesn't contain the modules.
lsmod: https://termbin.com/x42r

blacklist snd-hda-intel doesn't work, still shows 'Dummy Output for speaker volume and no microphone detected.

Without blacklist snd-hda-intel, loads SST driver (shows in dmesg), but no soundcard detected.

aplay -l
aplay: device_list:274: no soundcards found...

(Without blacklist snd-hda-intel) dmesg | grep -C1 -E 'ALSA|HDA|sof|HDMI|snd[_-]|sound|hda.codec|hda.intel'
https://termbin.com/3xg8w

Full dmesg: https://termbin.com/k4in

Output for inxi -Fxz: https://termbin.com/zj63

Updated sof-firmware to 1.6 from,
https://github.com/thesofproject/sof-bin/tree/stable-v1.6
The script get installed to /lib/firmware/intel/ wiping out old versions.

Further info,
Soundcard: ALC256
Machine:
  Type: Laptop System: Acer product: Swift SF315-52G v: V1.07

$ uname -r
5.8.0-7625-generic

Internal Speaker works on setting:
options snd_hda_intel dmic_detect=0
But internal mic doesn't work. Please help.
Comment 235 DDD 2020-11-01 21:20:21 UTC
(In reply to DDD from comment #233)
> http://alsa-project.org/db/?f=4237a4c012b0505892a70fbd4ed9764277bd6ccb

Someone hate an idea? Maybe i should post it in SOF or Ubuntu Forums?!
Comment 236 Parinya Teerakasemsuk 2020-11-02 00:54:43 UTC
(In reply to DDD from comment #235)
> (In reply to DDD from comment #233)
> > http://alsa-project.org/db/?f=4237a4c012b0505892a70fbd4ed9764277bd6ccb
> 
> Someone hate an idea? Maybe i should post it in SOF or Ubuntu Forums?!

I don't think your problem will be solved with the SOF project, according to https://github.com/thesofproject/sof/issues/1899 and https://github.com/thesofproject/sof/issues/2256

And I don't think Ubuntu Forums will help you either as it's not for reporting a bug. However, their Launchpad ( https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1523100 ) is, which you already did (me too). But it seems to be quiet for a while, no movement from the devs there. And the bug has been reported since 2015 and has been confirmed at the medium important status, I don't think it will be fixed soon. Don't hold your breath. 

Our only hope may be here. Give the devs some time to figure it out.

P.S. I want to test this on Fedora and report this issue on their Red Hat Bugzilla too. Unfortunately, they have an issue(bug #1883609) with people who used to install Ubuntu on their device with secure boot enabled. Therefore I can't test Fedora 33 on my device. I will have to wait for Fedora 34.
Comment 237 benjamin.doron00 2020-11-07 16:41:28 UTC
(In reply to Pierre Bossart from comment #197)
> (In reply to benjamin.doron00 from comment #196)
> > Hi all, thanks for working on this.
> > 
> > I've been trying to get this working for my device, an Acer Aspire VN7-572G
> > laptop (Skylake-U). I've made progress based on comment #173 and comment
> > #164, but have encountered some difficulties as the device has a 1ch array
> > DMIC.
> > 
> > 1. The vendor violates the NHLT specification by setting ArrayType=0x1,
> > which is resolved with a small patch to sound/hda/intel-nhlt.c to set the
> > appropriate DMIC configuration. This hack is unnecessary on a coreboot port
> > that I have.
> 
> can you share this patch (with your Signed-off-by tag)? we've recently dealt
> with devices with a single mic and didn't see this problem.

Like I said, the patch is a hack for a vendor violating the spec. It should not be necessary. In any event, you can find it [here](https://github.com/benjamindoron/linux/commit/d965fe061ebd543750ceee21709df86f76ef7bc0).

> > 2. The generic ALSA topology doesn't work for me.
> > 
> > So, how do I write a topology for this device? I imagine setting "minimum
> > channels" to "1" would be a start.
> 
> The simpler solution is probably to use a dual-mono 2ch solution.

How would I go about that? If it's implemented by userspace, there could be an issue, as sound fails in the kernel before that. I'll attach the relevant section of the log.
Comment 238 benjamin.doron00 2020-11-07 16:45:24 UTC
Created attachment 293545 [details]
dmesg output for 1CH DMIC using ALSA generic SKL topology

The final 5-7 lines repeat.
Comment 239 Pierre Bossart 2020-11-09 15:07:55 UTC
(In reply to benjamin.doron00 from comment #237)
> Like I said, the patch is a hack for a vendor violating the spec. It should
> not be necessary. In any event, you can find it
> [here](https://github.com/benjamindoron/linux/commit/
> d965fe061ebd543750ceee21709df86f76ef7bc0).

Thanks for the pointer, looks like a real problem indeed. We do have support for 1-ch DMIC configurations.

Can you add the NHLT tables in an attachment?

cat /sys/firmware/acpi/tables/NHLT > nhlt.bin
gzip nhlt.bin

I'd like to verify if our parser missed this case.
Thanks!
Comment 240 Marcin Obara 2020-11-09 21:24:04 UTC
Please note that predefined mic array types 0xA - 0xE are for very specific array geometries. Most vendors should use 0xF. Linux driver is not using geometry except number of mics. As WA for invalid array type value (or always - as other fields are not used), num_channels from format could be used to determine number of mics.
Comment 241 benjamin.doron00 2020-11-09 21:46:07 UTC
Created attachment 293599 [details]
NHLT ACPI table for 1CH DMIC

For specification violation test
Comment 242 Mateusz Gorski 2020-11-16 11:31:45 UTC
Created attachment 293689 [details]
Modified NHLT with added DMIC configuration blobs

(In reply to benjamin.doron00 from comment #241)
> Created attachment 293599 [details]
> NHLT ACPI table for 1CH DMIC
> 
> For specification violation test

Attached modified NHLT with added DMIC configuration blobs, it contains the blob that driver is looking for according to dmesg log you've uploaded.

Quick guide on how to overwrite the NHLT on your device:

1. Install acpica-tools package on your device (via apt-get)
2. Install the "acpi-upgrades" hook in /etc/initramfs-tools/hooks/ directory (this hook can be found here: https://wiki.up-community.org/Pinout_UP2#Installing_ACPI_overrides_to_enable_spi_in_userspace)
3. Copy the modified NHLT binary file to /lib/firmware/acpi-upgrades/ directory, rename it to nhlt.aml
4. Run this command as root: update-initramfs -u –k `uname -r`
5. Reboot your device

If the NHLT was overwritten correctly, you should see in your dmesg line similar to:

[    0.020230] ACPI: NHLT 0x... Physical table override, new table: 0x...

Please let us know if it helps with your problem.
Comment 243 benjamin.doron00 2020-12-12 21:12:18 UTC
(In reply to Mateusz Gorski from comment #242)
> Created attachment 293689 [details]
> Modified NHLT with added DMIC configuration blobs
> 
> (In reply to benjamin.doron00 from comment #241)
> > Created attachment 293599 [details]
> > NHLT ACPI table for 1CH DMIC
> > 
> > For specification violation test
> 
> Attached modified NHLT with added DMIC configuration blobs, it contains the
> blob that driver is looking for according to dmesg log you've uploaded.

Sorry it took me so long to get back to you.

Thanks for the modified table. However, while the log says "snd_soc_skl 0000:00:1f.3: PCM: ch 2, freq 48000, fmt 16" my laptop has a 1CH DMIC, not 2CH, and I think that the blob is correct. I'm using https://github.com/alsa-project/alsa-topology-conf/blob/master/topology/hda-dsp/skl_hda_dsp_generic-tplg.conf, which seems to only apply to 2CH and 4CH DMICs, which I think is the issue.

Based on this, I'm not sure how to proceed. Please advise.

> Quick guide on how to overwrite the NHLT on your device:
> 
> 1. Install acpica-tools package on your device (via apt-get)
> 2. Install the "acpi-upgrades" hook in /etc/initramfs-tools/hooks/ directory
> (this hook can be found here:
> https://wiki.up-community.org/
> Pinout_UP2#Installing_ACPI_overrides_to_enable_spi_in_userspace)
> 3. Copy the modified NHLT binary file to /lib/firmware/acpi-upgrades/
> directory, rename it to nhlt.aml
> 4. Run this command as root: update-initramfs -u –k `uname -r`
> 5. Reboot your device
> 
> If the NHLT was overwritten correctly, you should see in your dmesg line
> similar to:
> 
> [    0.020230] ACPI: NHLT 0x... Physical table override, new table: 0x...
> 
> Please let us know if it helps with your problem.

I haven't tried this yet because I use Fedora, not an Ubuntu/Debian-based distro. I could install one if necessary. However, there seems to be an issue with the ACPI header (size and checksum)? Should I correct this? Alternatively, I have a coreboot port for this laptop, so I could possibly extract the blobs and use them there.

Thanks.
Comment 244 Mateusz Gorski 2020-12-18 11:47:13 UTC
(In reply to benjamin.doron00 from comment #243)
> (In reply to Mateusz Gorski from comment #242)
> 
> Sorry it took me so long to get back to you.
> 
> Thanks for the modified table. However, while the log says "snd_soc_skl
> 0000:00:1f.3: PCM: ch 2, freq 48000, fmt 16" my laptop has a 1CH DMIC, not
> 2CH, and I think that the blob is correct. I'm using
> https://github.com/alsa-project/alsa-topology-conf/blob/master/topology/hda-
> dsp/skl_hda_dsp_generic-tplg.conf, which seems to only apply to 2CH and 4CH
> DMICs, which I think is the issue.
> 
> Based on this, I'm not sure how to proceed. Please advise.
> 
> > Quick guide on how to overwrite the NHLT on your device:
> > [...]
> 
> I haven't tried this yet because I use Fedora, not an Ubuntu/Debian-based
> distro. I could install one if necessary. However, there seems to be an
> issue with the ACPI header (size and checksum)? Should I correct this?
> Alternatively, I have a coreboot port for this laptop, so I could possibly
> extract the blobs and use them there.
> 
> Thanks.

The topology does not contain 1ch DMIC configuration, because it is not officially supported (as you mentioned, your vendor violates the NHLT specification). 

I would still encourage you to try with this modified NHLT binary, override steps should be identical on Fedora, except for acpica-tools package instalation. Fedora version:

https://src.fedoraproject.org/rpms/acpica-tools

Thanks,
Mateusz
Comment 245 Eli Melucci 2020-12-23 22:30:05 UTC
Having the same issue on an Acer Swift 3

00:1f.3 Multimedia audio controller [0401]: Intel Corporation Sunrise Point-LP HD Audio [8086:9d71] (rev 21)
	Subsystem: Acer Incorporated [ALI] Device [1025:1269]
	Flags: bus master, fast devsel, latency 32, IRQ 129
	Memory at b1128000 (64-bit, non-prefetchable) [size=16K]
	Memory at b1100000 (64-bit, non-prefetchable) [size=64K]
	Capabilities: [50] Power Management version 3
	Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel, snd_soc_skl


Out of the box, dmesg shows this from both snd_intel_hda and snd_soc_skl:
"Digital mics found on Skylake+ platform, using SST driver"

No audio devices are found (only getting "dummy output", no sound and no DMIC);
I have tried forcing the SST driver using the appropriate snd_intel_dspcfg option but dmesg shows nothing and audio devices are still not detected.
Comment 246 ais 2020-12-29 21:39:30 UTC
I have the same issue on Lenovo Yoga C930

00:1f.3 Multimedia audio controller [0401]: Intel Corporation Sunrise Point-LP HD Audio [8086:9d71] (rev 21)
	Subsystem: Lenovo Device [17aa:3831]

Kernel release:    5.9.14-arch1-1

By default neither sound nor DMIC works

With option
    snd_intel_dspcfg: dsp_driver=1
front speakers are working, but not rear.
And DMIC also is not working.
Comment 247 benjamin.doron00 2021-01-19 17:52:44 UTC
(In reply to Mateusz Gorski from comment #244)
> (In reply to benjamin.doron00 from comment #243)
> > (In reply to Mateusz Gorski from comment #242)
> > 
> > Sorry it took me so long to get back to you.
> > 
> > Thanks for the modified table. However, while the log says "snd_soc_skl
> > 0000:00:1f.3: PCM: ch 2, freq 48000, fmt 16" my laptop has a 1CH DMIC, not
> > 2CH, and I think that the blob is correct. I'm using
> >
> https://github.com/alsa-project/alsa-topology-conf/blob/master/topology/hda-
> > dsp/skl_hda_dsp_generic-tplg.conf, which seems to only apply to 2CH and 4CH
> > DMICs, which I think is the issue.
> > 
> > Based on this, I'm not sure how to proceed. Please advise.
> > 
> > > Quick guide on how to overwrite the NHLT on your device:
> > > [...]
> > 
> > I haven't tried this yet because I use Fedora, not an Ubuntu/Debian-based
> > distro. I could install one if necessary. However, there seems to be an
> > issue with the ACPI header (size and checksum)? Should I correct this?
> > Alternatively, I have a coreboot port for this laptop, so I could possibly
> > extract the blobs and use them there.
> > 
> > Thanks.
> 
> The topology does not contain 1ch DMIC configuration, because it is not
> officially supported (as you mentioned, your vendor violates the NHLT
> specification). 

The vendor violates the specification by implementation (array_type=0x1), but perhaps it would be supported if properly implemented as "vendor_defined" (array_type=0xf). However, if the configuration is not supported by Intel... *shrug*

> I would still encourage you to try with this modified NHLT binary, override
> steps should be identical on Fedora, except for acpica-tools package
> instalation. Fedora version:
> 
> https://src.fedoraproject.org/rpms/acpica-tools

I see "undefined DMIC array_type 0xff" (although I adjusted length and checksum in the ACPI header, this should not have caused an issue in the NHLT header). I think the "0xff" comes from the first byte of WAVE_FORMAT_EXTENSIBLE, I will look at the NHLT header, fix it and get back to you.
 
> Thanks,
> Mateusz
Comment 248 mm22 2021-01-26 07:51:08 UTC
Having the same issue on an Acer Swift 5

00:1f.3 Multimedia audio controller [0401]: Intel Corporation Sunrise Point-LP HD Audio [8086:9d71] (rev 21)

I tried the NHLT file you created for benjamin, but get:

ACPI: ACPI OVERRIDE: File length does not match table length [kernel/firmware/acpi/nhlt.aml]

Do I need a different nhlt file for my laptop?

Thanks
Marko

(In reply to Mateusz Gorski from comment #242)
> Created attachment 293689 [details]
> Modified NHLT with added DMIC configuration blobs
> 
> (In reply to benjamin.doron00 from comment #241)
> > Created attachment 293599 [details]
> > NHLT ACPI table for 1CH DMIC
> > 
> > For specification violation test
> 
> Attached modified NHLT with added DMIC configuration blobs, it contains the
> blob that driver is looking for according to dmesg log you've uploaded.
> 
> Quick guide on how to overwrite the NHLT on your device:
> 
> 1. Install acpica-tools package on your device (via apt-get)
> 2. Install the "acpi-upgrades" hook in /etc/initramfs-tools/hooks/ directory
> (this hook can be found here:
> https://wiki.up-community.org/
> Pinout_UP2#Installing_ACPI_overrides_to_enable_spi_in_userspace)
> 3. Copy the modified NHLT binary file to /lib/firmware/acpi-upgrades/
> directory, rename it to nhlt.aml
> 4. Run this command as root: update-initramfs -u –k `uname -r`
> 5. Reboot your device
> 
> If the NHLT was overwritten correctly, you should see in your dmesg line
> similar to:
> 
> [    0.020230] ACPI: NHLT 0x... Physical table override, new table: 0x...
> 
> Please let us know if it helps with your problem.
Comment 249 Pierre Bossart 2021-02-02 17:44:40 UTC
Created attachment 295041 [details]
Changes to NHLT parsing to support 1-mic configuration

This patch *should* remove the need for any ACPI override. Only tested on 4-channel devices so feedback from users is very much desired.

please add this in /etc/modprobe.d/alsa-base.conf to log the results:

options snd_intel_dspcfg dyndbg=+p
Comment 250 ais 2021-02-05 19:28:18 UTC
(In reply to Pierre Bossart from comment #249)
> Created attachment 295041 [details]
> Changes to NHLT parsing to support 1-mic configuration
> 
> This patch *should* remove the need for any ACPI override. Only tested on
> 4-channel devices so feedback from users is very much desired.
> 
> please add this in /etc/modprobe.d/alsa-base.conf to log the results:
> 
> options snd_intel_dspcfg dyndbg=+p

Hi Pierre

I've applied this patch on Lenovo C930.
Mic still not working and not shown in Settings.
The alsa-info.sh output here
http://alsa-project.org/db/?f=d19e0087ec18fd489e24513f685774ed550dd6e0
If you need more logs please let me know
Comment 251 Pierre Bossart 2021-02-05 19:57:40 UTC
(In reply to ais from comment #250)
> If you need more logs please let me know

Thanks for testing.

You need to remove this:

snd_intel_dspcfg: dsp_driver=1

This is forcing the use of the legacy HDaudio driver and not even running the code. Either remove this option completely or set the value to dsp_driver=2 to force the use of the Skylake driver, which is the only one that can deal with DMICs.

Also if you can provide the dmesg log somewhere it'd be nice. alsa-info doesn't show everything.
Comment 252 chessy 2021-02-06 12:11:19 UTC
Hello,

on my laptopb (Acer Swift 5, SF515-51T) with Debian Sid (on kernel 5.9.0-1-amd64 #1 SMP Debian 5.9.1-1 (2020-10-17) x86_64 GNU/Linux) the sound and the micro is working with firmware-sof-signed.

With all newwer kernels starting with 5.9.1-3 to 5.10.X the speakers have no output. They were still shown in gnome properties or pulseaudio mixer but without sound. The micro is still working.

The same without firmware-sof-signed and 
options snd-intel-dspcfg dsp_driver=1
in /etc/modprobe.d/alsa-base.conf
No more sound output after kernel kernel 5.9.0-1-amd64 #1 SMP Debian 5.9.1-1 (2020-10-17).
The internal micro never worked with the intel kernel driver.
So I am still on kernel kernel 5.9.0-1-amd64 #1 SMP Debian 5.9.1-1 (2020-10-17) with firmware-sof-signed.
Comment 253 Eli Melucci 2021-02-06 13:02:06 UTC
I haven't tried the patch as per the NHLT table on my device the configuration should be 2CH. However, snd_soc_skl is totally absent from dmesg. Any idea on how to make it more verbose? Forcing SST with the modprobe option yields no log messages, leaving it empty says something like "microphone array found, switching to the SST driver" and then nothing else.
Comment 254 ais 2021-02-06 13:17:07 UTC
Created attachment 295093 [details]
Lenovo_C930_dmesg
Comment 255 ais 2021-02-06 13:24:32 UTC
(In reply to Pierre Bossart from comment #251)
> (In reply to ais from comment #250)
> > If you need more logs please let me know
> 
> Thanks for testing.
> 
> You need to remove this:
> 
> snd_intel_dspcfg: dsp_driver=1
> 
> This is forcing the use of the legacy HDaudio driver and not even running
> the code. Either remove this option completely or set the value to
> dsp_driver=2 to force the use of the Skylake driver, which is the only one
> that can deal with DMICs.
> 
> Also if you can provide the dmesg log somewhere it'd be nice. alsa-info
> doesn't show everything.

tested both options, without dsp_driver= and with dsp_driver=2
in both Mic not working but also and Sound output device disappeared (dummy output in Settings)
I afraid Skylike is not my case because this laptop has Kaby Lake R platform ((
added dmesg output just for case, with option dsp_driver=2
https://bugzilla.kernel.org/attachment.cgi?id=295093
Comment 256 Pierre Bossart 2021-02-08 14:29:13 UTC
(In reply to ais from comment #255)
> tested both options, without dsp_driver= and with dsp_driver=2
> in both Mic not working but also and Sound output device disappeared (dummy
> output in Settings)
> I afraid Skylike is not my case because this laptop has Kaby Lake R platform
> ((
> added dmesg output just for case, with option dsp_driver=2
> https://bugzilla.kernel.org/attachment.cgi?id=295093

@ais the DMIC detection works now:

[    6.521938] snd_soc_skl 0000:00:1f.3: intel_nhlt_get_dmic_geo: found 1 format definitions
[    6.521942] snd_soc_skl 0000:00:1f.3: intel_nhlt_get_dmic_geo: max channels found 2
[    6.521943] snd_soc_skl 0000:00:1f.3: intel_nhlt_get_dmic_geo: dmic number 2 max_ch 2
[    6.522597] snd_soc_skl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])


To debug further, you need to check if the card is created with a DMIC input, and try capturing from the hardware device (hw:<card>,<device>).

The Settings is related to PulseAudio which depends on UCM, that's another level of complexity.
Comment 257 Pierre Bossart 2021-02-08 14:36:55 UTC
(In reply to chessy from comment #252)
> Hello,
> 
> on my laptopb (Acer Swift 5, SF515-51T) with Debian Sid (on kernel
> 5.9.0-1-amd64 #1 SMP Debian 5.9.1-1 (2020-10-17) x86_64 GNU/Linux) the sound
> and the micro is working with firmware-sof-signed.
> 
> With all newwer kernels starting with 5.9.1-3 to 5.10.X the speakers have no
> output. They were still shown in gnome properties or pulseaudio mixer but
> without sound. The micro is still working.
> 
> The same without firmware-sof-signed and 
> options snd-intel-dspcfg dsp_driver=1

This option explicitly bypasses SOF, and selects the HDaudio legacy driver. That will prevent you from getting microphone support.
Did you mean to say that in this case the speakers also don't have sound? 

That's likely a regression on the HDaudio codec driver side then. We've seen some back-and-forth upstream on power management, but I can't point you to a specific change. If you have the ability to bisect that would be very useful.

I am also unsure what 5.9.1-1 and 5.9.1-3 are, the last digit doesn't map to a kernel version?

That's really a different issue from the DMIC enablement and NHLT parsing, and it's probably better to file a bug at https://github.com/thesofproject/linux/issues
Comment 258 Pierre Bossart 2021-02-08 14:40:59 UTC
(In reply to Eli Melucci from comment #253)
> I haven't tried the patch as per the NHLT table on my device the
> configuration should be 2CH. However, snd_soc_skl is totally absent from
> dmesg. Any idea on how to make it more verbose? Forcing SST with the
> modprobe option yields no log messages, leaving it empty says something like
> "microphone array found, switching to the SST driver" and then nothing else.

add this to /etc/modprobe.d/alsa-base.conf (and reboot):

options snd_hda_intel dyndbg=+p
options snd_soc_skl dyndbg=+p
options snd_soc_skl_hda_dsp dyndbg=+p
options snd_intel_dspcfg dyndbg=+p

Then provide the full dmesg and alsa-info results. Thanks!
Comment 259 Eli Melucci 2021-02-08 15:32:10 UTC
Created attachment 295117 [details]
alsa-info from Acer Swift 3
Comment 260 Eli Melucci 2021-02-08 15:32:56 UTC
Created attachment 295119 [details]
dmesg from Acer Swift 3 with debug logging
Comment 261 Eli Melucci 2021-02-08 15:52:27 UTC
(In reply to Eli Melucci from comment #259)
> Created attachment 295117 [details]
> alsa-info from Acer Swift 3

Doesn't detect CPU for some reason, it's Kaby Lake R
Comment 262 Pierre Bossart 2021-02-08 16:26:02 UTC
(In reply to Eli Melucci from comment #261)
> Doesn't detect CPU for some reason, it's Kaby Lake R

Your logs shows otherwise, the SKL driver was probed and there are attempts to register a sound card. You are using the right driver on this platform.

That said, I don't get why there's no information on DMICs (did you apply the patch above?) and why you don't see a card actually created.

Can you add:

options snd_soc_core dyndbg=+p

This will be very verbose but help figure things out.
Comment 263 Eli Melucci 2021-02-08 16:46:54 UTC
Created attachment 295121 [details]
verbose dmesg from Acer Swift 3 (no patch)
Comment 264 Eli Melucci 2021-02-08 16:48:09 UTC
(In reply to Pierre Bossart from comment #262)
> (In reply to Eli Melucci from comment #261)
> > Doesn't detect CPU for some reason, it's Kaby Lake R
> 
> Your logs shows otherwise, the SKL driver was probed and there are attempts
> to register a sound card. You are using the right driver on this platform.
> 
> That said, I don't get why there's no information on DMICs (did you apply
> the patch above?) and why you don't see a card actually created.
> 
> Can you add:
> 
> options snd_soc_core dyndbg=+p
> 
> This will be very verbose but help figure things out.


No, I didn't apply the patch because going by the NHLT table this laptop has a 2CH configuration (assuming I read it correctly) and I didn't think it'd be an issue.

I'll try it out, in the meantime this is the log with dyndbg on snd_soc_core and the other options.
Comment 265 chessy 2021-02-08 17:08:39 UTC
(In reply to Pierre Bossart from comment #257)

> (In reply to chessy from comment #252)
> > Hello,
> > 
> > on my laptopb (Acer Swift 5, SF515-51T) with Debian Sid (on kernel
> > 5.9.0-1-amd64 #1 SMP Debian 5.9.1-1 (2020-10-17) x86_64 GNU/Linux) the
> sound
> > and the micro is working with firmware-sof-signed.
> > 
> > With all newwer kernels starting with 5.9.1-3 to 5.10.X the speakers have
> no
> > output. They were still shown in gnome properties or pulseaudio mixer but
> > without sound. The micro is still working.
> > 
> > The same without firmware-sof-signed and 
> > options snd-intel-dspcfg dsp_driver=1
> 
> This option explicitly bypasses SOF, and selects the HDaudio legacy driver.
> That will prevent you from getting microphone support.
> Did you mean to say that in this case the speakers also don't have sound? 
> 
> That's likely a regression on the HDaudio codec driver side then. We've seen
> some back-and-forth upstream on power management, but I can't point you to a
> specific change. If you have the ability to bisect that would be very useful.
> 
> I am also unsure what 5.9.1-1 and 5.9.1-3 are, the last digit doesn't map to
> a kernel version?
> 
> That's really a different issue from the DMIC enablement and NHLT parsing,
> and it's probably better to file a bug at
> https://github.com/thesofproject/linux/issues


Thank you. 

With the sof diver and kernel 5.9.1 (uname -r) micro and speakers are working.
With the sof diver and kernel 5.9.3 micro is working, speakers not.
The same is with the legacy driver (always no micro), the speakers are working with 5.9.1.
With 5.9.3 and above the speakers have no sound.

Maybe Acer Swift 3 and Acer Swift 5 are very similar. Perhaps a solution for the Swift 3 is also working for Swift 5 and I don't need the sof-firmware.

Or I will file the bug to github.
Comment 266 Pierre Bossart 2021-02-08 17:21:25 UTC
(In reply to Eli Melucci from comment #264)
> I'll try it out, in the meantime this is the log with dyndbg on snd_soc_core
> and the other options.

This was useful and points to a missing component:
[    3.855329] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: codec component ehdaudio0D0 not found for link Analog Playback and Capture

Can you show what is in /sys/kernel/debug/asoc/components?

Wondering if the match is incorrect (I'm pretty sure we had a change for this upstream) or the component missing.
Comment 267 Pierre Bossart 2021-02-08 17:24:17 UTC
(In reply to chessy from comment #265)
> With the sof diver and kernel 5.9.1 (uname -r) micro and speakers are
> working.
> With the sof diver and kernel 5.9.3 micro is working, speakers not.
> The same is with the legacy driver (always no micro), the speakers are
> working with 5.9.1.
> With 5.9.3 and above the speakers have no sound.
> 
> Maybe Acer Swift 3 and Acer Swift 5 are very similar. Perhaps a solution for
> the Swift 3 is also working for Swift 5 and I don't need the sof-firmware.
> 
> Or I will file the bug to github.

It's clearly a regression in the stable branch between 5.9.1 and 5.9.3. That's not good.

There aren't that many commits affecting HDaudio platforms, if you have the ability to bisect or revert these patches it may help find out what the problem is. Hard to diagnose remotely otherwise.


git log --oneline v5.9.1..v5.9.3 -- sound/pci/hda/
2790292909db ALSA: hda/ca0132 - Add new quirk ID for SoundBlaster AE-7.
bff89d18bff1 ALSA: hda/ca0132 - Add AE-7 microphone selection commands.
5fc1fd5ceb23 ALSA: hda/realtek: Enable audio jacks of ASUS D700SA with ALC887
91f3eabcbac8 ALSA: hda/realtek - Add mute Led support for HP Elitebook 845 G7
2a8bc2526d18 ALSA: hda/realtek - set mic to auto detect on a HP AIO machine
a7a7a58d8821 ALSA: hda/realtek - The front Mic on a HP machine doesn't work
45819223353e ALSA: hda - Fix the return value if cb func is already registered
979328beb55f ALSA: hda - Don't register a cb func if it is registered already
f48d8d15ced4 ALSA: hda/hdmi: fix incorrect locking in hdmi_pcm_close
6aafca025b27 ALSA: hda: fix jack detection with Realtek codecs when in D3
Comment 268 Eli Melucci 2021-02-08 17:25:44 UTC
(In reply to Pierre Bossart from comment #266)
> (In reply to Eli Melucci from comment #264)
> > I'll try it out, in the meantime this is the log with dyndbg on
> snd_soc_core
> > and the other options.
> 
> This was useful and points to a missing component:
> [    3.855329] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: codec
> component ehdaudio0D0 not found for link Analog Playback and Capture
> 
> Can you show what is in /sys/kernel/debug/asoc/components?
> 
> Wondering if the match is incorrect (I'm pretty sure we had a change for
> this upstream) or the component missing.

I was trying to dig around that, the only component shown is the stub one (snd-soc-dummy, listed twice)
Comment 269 Pierre Bossart 2021-02-08 20:40:48 UTC
(In reply to Eli Melucci from comment #268)
> > This was useful and points to a missing component:
> > [    3.855329] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: codec
> > component ehdaudio0D0 not found for link Analog Playback and Capture
> > 
> > Can you show what is in /sys/kernel/debug/asoc/components?
> > 
> > Wondering if the match is incorrect (I'm pretty sure we had a change for
> > this upstream) or the component missing.
> 
> I was trying to dig around that, the only component shown is the stub one
> (snd-soc-dummy, listed twice)

I don't have a magic answer here, the SKL driver is maintained by others at Intel. I know this driver uses an older solution compared to SOF, so likely there's some issue with the code in sound/soc/codecs/hdac_hda.c

I would try instrumenting that code to see what happens, and possibly disable SOF completely in your Kconfig in case there's some sort of interference.
Comment 270 Eli Melucci 2021-02-08 21:29:24 UTC
(In reply to Pierre Bossart from comment #269)
> (In reply to Eli Melucci from comment #268)
> > > This was useful and points to a missing component:
> > > [    3.855329] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: codec
> > > component ehdaudio0D0 not found for link Analog Playback and Capture
> > > 
> > > Can you show what is in /sys/kernel/debug/asoc/components?
> > > 
> > > Wondering if the match is incorrect (I'm pretty sure we had a change for
> > > this upstream) or the component missing.
> > 
> > I was trying to dig around that, the only component shown is the stub one
> > (snd-soc-dummy, listed twice)
> 
> I don't have a magic answer here, the SKL driver is maintained by others at
> Intel. I know this driver uses an older solution compared to SOF, so likely
> there's some issue with the code in sound/soc/codecs/hdac_hda.c
> 
> I would try instrumenting that code to see what happens, and possibly
> disable SOF completely in your Kconfig in case there's some sort of
> interference.

Thank you, I'll try to raise this with Manjaro mantainers and experiment with the code. Could it be due to some missing firmware as well?
Comment 271 Amadeusz Sławiński 2021-02-09 08:19:42 UTC
(In reply to Eli Melucci from comment #270)
> (In reply to Pierre Bossart from comment #269)
> > (In reply to Eli Melucci from comment #268)
> > > > This was useful and points to a missing component:
> > > > [    3.855329] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: codec
> > > > component ehdaudio0D0 not found for link Analog Playback and Capture
> > > > 
> > > > Can you show what is in /sys/kernel/debug/asoc/components?
> > > > 
> > > > Wondering if the match is incorrect (I'm pretty sure we had a change
> for
> > > > this upstream) or the component missing.
> > > 
> > > I was trying to dig around that, the only component shown is the stub one
> > > (snd-soc-dummy, listed twice)
> > 
> > I don't have a magic answer here, the SKL driver is maintained by others at
> > Intel. I know this driver uses an older solution compared to SOF, so likely
> > there's some issue with the code in sound/soc/codecs/hdac_hda.c
> > 
> > I would try instrumenting that code to see what happens, and possibly
> > disable SOF completely in your Kconfig in case there's some sort of
> > interference.
> 
> Thank you, I'll try to raise this with Manjaro mantainers and experiment
> with the code. Could it be due to some missing firmware as well?

If there was missing firmware, there should be print in logs.

Can you share your kernel config?
Comment 272 Eli Melucci 2021-02-09 10:20:53 UTC
Created attachment 295141 [details]
manjaro kconfig from Acer Swift 3

Here it is, should be Manjaro defaults.
Comment 273 Amadeusz Sławiński 2021-02-09 11:11:17 UTC
(In reply to Eli Melucci from comment #272)
> Created attachment 295141 [details]
> manjaro kconfig from Acer Swift 3
> 
> Here it is, should be Manjaro defaults.

I see in provided config:
# CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC is not set

can you enable that option and try again?
Comment 274 Eli Melucci 2021-02-09 13:34:06 UTC
(In reply to Amadeusz Sławiński from comment #273)
> (In reply to Eli Melucci from comment #272)
> > Created attachment 295141 [details]
> > manjaro kconfig from Acer Swift 3
> > 
> > Here it is, should be Manjaro defaults.
> 
> I see in provided config:
> # CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC is not set
> 
> can you enable that option and try again?

With this the driver seems to proceed, still only showing dummy outputs. I'll attach the new dmesg and alsa-info, I think I saw some errors
Comment 275 Eli Melucci 2021-02-09 13:35:13 UTC
Created attachment 295147 [details]
alsa-info from Swift 3 with HDAUDIO_CODEC compiled
Comment 276 Eli Melucci 2021-02-09 13:35:50 UTC
Created attachment 295149 [details]
dmesg from Swift 3 with HDAUDIO_CODEC compiled
Comment 277 Eli Melucci 2021-02-09 14:12:43 UTC
Created attachment 295153 [details]
complete dmesg from Swift 3 with HDAUDIO_CODEC compiled

The previous log had so many messages that dmesg truncated it.
Comment 278 Amadeusz Sławiński 2021-02-09 14:21:48 UTC
Seems like it enumerated properly and I don't see anything worrying in dmesg.

From your alsa-info:

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

 0 [hdadsp         ]: hda-dsp - hda-dsp
                      KBL-SwiftSF314_54-V1.16-Strongbow_KL
(...)

!!Aplay/Arecord output
!!--------------------

APLAY

**** List of PLAYBACK Hardware Devices ****
card 0: hdadsp [hda-dsp], device 7: Analog HDA DSP (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: hdadsp [hda-dsp], device 8: Digital HDA DSP (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: hdadsp [hda-dsp], device 9: Alt Analog HDA DSP (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: hdadsp [hda-dsp], device 10: HDA DSP HDMI1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: hdadsp [hda-dsp], device 11: HDA DSP HDMI2 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: hdadsp [hda-dsp], device 12: HDA DSP HDMI3 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

ARECORD

**** List of CAPTURE Hardware Devices ****
card 0: hdadsp [hda-dsp], device 7: Analog HDA DSP (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: hdadsp [hda-dsp], device 8: Digital HDA DSP (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: hdadsp [hda-dsp], device 9: Alt Analog HDA DSP (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: hdadsp [hda-dsp], device 13: DMIC1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0



You may be missing UCM file, please refer to https://gist.github.com/crojewsk/4e6382bfb0dbfaaf60513174211f29cb#usecasemanagement for instructions on how to obtain one.
Comment 279 Eli Melucci 2021-02-09 15:37:38 UTC
The ucm files are present and match the enumerated devices are matching.
It seems like dummy outputs are displayed because pulseaudio can't match the profile and aborts loading completely. Specifically, speakers are detected just fine (hw:hdadsp,7), but the DMIC is not detected:

(alsa-lib)pcm.c: Unknown PCM plug:hw:hdadsp,13
alsa-util.c: Error opening PCM device plyg:hw:hdadsp,13: Missing file or directory

I have tried arecord on the DMIC to no avail ("unable to install hw params").
Comment 280 Amadeusz Sławiński 2021-02-09 15:50:14 UTC
Can you run:
dmesg -c
to clear dmesg

run:
arecord -D"hw:CARD=hdadsp,DEV=13" --dump-hw-params

and attach dmesg and output of arecord?
Comment 281 Pierre Bossart 2021-02-09 15:57:35 UTC
(In reply to Eli Melucci from comment #277)
> Created attachment 295153 [details]
> complete dmesg from Swift 3 with HDAUDIO_CODEC compiled
> 
> The previous log had so many messages that dmesg truncated it.

You can probably remove the snd_soc_core dynamic debug now.

Also in this case, you can use a 'blacklist snd_soc_skl'. boot and do a dmesg -C, then modprobe snd-soc-skl, that will give you just the dmesg for the audio parts you care about.
Comment 282 Eli Melucci 2021-02-09 16:10:31 UTC
Created attachment 295161 [details]
dmesg when running arecord, swift 3
Comment 283 Eli Melucci 2021-02-09 16:11:27 UTC
Created attachment 295163 [details]
arecord output for dmic, swift 3
Comment 284 Amadeusz Sławiński 2021-02-10 10:27:34 UTC
Can you try with:
arecord -D"hw:CARD=hdadsp,DEV=13" -fS16_LE -r48000 -c2 /tmp/test.wav
instead?
Comment 285 Eli Melucci 2021-02-10 10:57:55 UTC
Created attachment 295179 [details]
dmesg for the second run of arecord
Comment 286 Eli Melucci 2021-02-10 10:59:00 UTC
Created attachment 295181 [details]
second run of arecord on swift 3

Fails to record as before, output has changed accordingly
Comment 287 Amadeusz Sławiński 2021-02-10 13:42:35 UTC
Well, there is awfully lot going on in this log for just DMIC capture...  I see HDMI etc.  Any chance you can stop pulseaudio before trying again.  Make sure it is not running with "ps aux| grep pulseaudio".

Can you also collect dmesg with escape codes, so it's colored? Maybe I'm missing something due to being used to colors in dmesg...
(dmesg -L=always > /tmp/dmesg.txt)

Also it is bit suspicious that I don't see any of NHLT logs, like it doesn't even try to look for NHLT entry... are you using any additional patches or it is with vanilla kernel?
Comment 288 Eli Melucci 2021-02-10 14:02:34 UTC
Sure, will provide a new log soon. This one was captured with:

options snd_hda_intel dyndbg=+p
options snd_soc_skl dyndbg=+p
options snd_soc_skl_hda_dsp dyndbg=+p
options snd_intel_dspcfg dyndbg=+p

let me know if I should change something. As for NHLT, I haven't seen anything about it in dmesg either besides it getting detected with other ACPI tables

> ACPI: NHLT 0x000000008AF98000 00181D (v00 ACRSYS ACRPRDCT 00000002 1025
> 00040000)

kernel is not completely vanilla (https://gitlab.manjaro.org/packages/core/linux59), doesn't seem to have anything ACPI related patches though. I can try and upgrade to 5.10 if that'd help.

I inspected the NHLT by hand and as far as I can tell, there should be two microphones positioned on top, rotated 60 degrees. I could provide the table as well
Comment 289 Amadeusz Sławiński 2021-02-11 10:05:07 UTC
Well, everything seems fine snd_intel_dspcfg and snd_soc_skl should provide debug logs for NHLT if it gets to it... as mentioned before try to disable pulseaudio, so there is no unrelated logs and collect logs with colors, I might've missed something which is easy to notice when there is red print in the middle of logs.
Comment 290 Amadeusz Sławiński 2021-02-23 10:13:17 UTC
(In reply to Eli Melucci from comment #288)
> Sure, will provide a new log soon. 

Hi, any progress?
Comment 291 Eli Melucci 2021-02-23 10:42:26 UTC
Created attachment 295411 [details]
arecord logs for swift 3 without pulseaudio noise

Sorry, forgot to attach this as it seemed strange. Pulseaudio is not running (systemd socket stopped, ran pulseaudio -k for confirmation). Logs have nothing colored in them so I made a normal export. To be sure I even looked at dmesg live (dmesg -w) when running arecord.
Comment 292 Amadeusz Sławiński 2021-02-23 14:59:53 UTC
Yes, that is a lot easier to read.
The flow itself seems ok, but there is not enough information in it.

Can you try and replace debug options with:
options snd_hda_core dyndbg==pmf
options snd_hda_codec dyndbg==pmf
options snd_soc_core dyndbg==pmf
options snd_soc_skl dyndbg==pmf
and try again...

From timestamps I would say it fails at set_params, which agrees with arecord being unable to "install hw params".
Comment 293 Eli Melucci 2021-02-23 15:38:29 UTC
Created attachment 295413 [details]
dmesg for arecord with more debug info

Nothing colored came up this time either
Comment 294 Amadeusz Sławiński 2021-02-23 16:05:00 UTC
I guess, you can try to enable logs for almost everything then... :/

options snd_compress.dyndbg==pmf
options snd_hda_codec.dyndbg==pmf
options snd_hda_codec_generic.dyndbg==pmf
options snd_hda_codec_realtek.dyndbg==pmf
options snd_hda_core.dyndbg==pmf
options snd_hda_ext_core.dyndbg==pmf
options snd_hda_intel.dyndbg==pmf
options snd_hwdep.dyndbg==pmf
options snd_intel_dspcfg.dyndbg==pmf
options snd_pcm.dyndbg==pmf
options snd_pcm_dmaengine.dyndbg==pmf
options snd_soc_acpi.dyndbg==pmf
options snd_soc_acpi_intel_match.dyndbg==pmf
options snd_soc_core.dyndbg==pmf
options snd_soc_dmic.dyndbg==pmf
options snd_soc_hdac_hda.dyndbg==pmf
options snd_soc_hdac_hdmi.dyndbg==pmf
options snd_soc_skl.dyndbg==pmf
options snd_soc_skl_hda_dsp.dyndbg==pmf
options snd_soc_skl_ssp_clk.dyndbg==pmf
options snd_soc_sst_dsp.dyndbg==pmf
options snd_soc_sst_ipc.dyndbg==pmf
options snd_timer.dyndbg==pmf
Comment 295 Eli Melucci 2021-02-23 16:26:41 UTC
Created attachment 295415 [details]
dmesg for arecord with even more debug info

No idea what's going on here, there's just a couple more lines but nothing that indicates failure. 
Also checked dmesg at bootup, there's a couple things that might be interesting and weren't showing up before:

> snd_soc_skl 0000:00:1f.3: Direct firmware load for
> 9d71-ACRSYS-ACRPRDCT-2-tplg.bin failed with error -2
> snd_soc_skl 0000:00:1f.3: tplg fw 9d71-ACRSYS-ACRPRDCT-2-tplg.bin load failed
> with -2, trying alternative tplg name skl_hda_dsp_generic-tplg.bin
> snd_soc_skl 0000:00:1f.3: ASoC: Parent card not yet available, widget card
> binding deferred

and, at the end,
> debugfs: File 'DMIC01 Rx' in directory 'dapm' already present!
Comment 296 Amadeusz Sławiński 2021-02-24 11:29:32 UTC
Created attachment 295419 [details]
patch adding more debug logs

Can you try applying attached patch and collect logs with it.

AS for logs you mentioned they shouldn't cause such problem.

First one merely informs you that it looks for other FW file and seeing as there is no further logs it means that it found it.

Second one means that topology needs small fix, but it shouldn't cause problems with recording.
Comment 297 Amadeusz Sławiński 2021-03-03 13:42:01 UTC
Hi, have you tried collecting logs with patch from previous comment?
Comment 298 Eli Melucci 2021-03-03 13:43:57 UTC
Hi, sorry, missed your message with the patch. Will try to collect logs asap
Comment 299 Xiaoliang Yu 2021-03-06 12:26:22 UTC
Confirming this on a comet lake laptop, which has an ALC256M card with dmic, the auto-selected SST driver fails to register any sound device, legacy driver works without microphone(jack lines incorrect so combo jack with mic not working), Having googled this for a while it seems the kernel fails to deal with many newer skl++ platforms with old soundcard(mine is 8086:9d71 too, which is based on kbl platform). Lack of vendor custom specs could be another reaaon(mine is Xiaomi, old Xiaomi models without dmic works perfectly).
Comment 300 Pierre Bossart 2021-03-08 16:05:09 UTC
(In reply to 尉晓亮 from comment #299)
> Confirming this on a comet lake laptop, which has an ALC256M card with dmic,
> the auto-selected SST driver fails to register any sound device, legacy
> driver works without microphone(jack lines incorrect so combo jack with mic
> not working), Having googled this for a while it seems the kernel fails to
> deal with many newer skl++ platforms with old soundcard(mine is 8086:9d71
> too, which is based on kbl platform). Lack of vendor custom specs could be
> another reaaon(mine is Xiaomi, old Xiaomi models without dmic works
> perfectly).

it's not possible that SST was autoselected on CometLake, you must have used a kernel parameter.
On CometLake you need to use the SOF driver (not SST), and if this doesn't work please file a bug at https://github.com/thesofproject/linux/issues
Comment 301 Xiaoliang Yu 2021-03-08 18:39:26 UTC
(In reply to Pierre Bossart from comment #300)
> (In reply to 尉晓亮 from comment #299)
> > Confirming this on a comet lake laptop, which has an ALC256M card with
> dmic,
> > the auto-selected SST driver fails to register any sound device, legacy
> > driver works without microphone(jack lines incorrect so combo jack with mic
> > not working), Having googled this for a while it seems the kernel fails to
> > deal with many newer skl++ platforms with old soundcard(mine is 8086:9d71
> > too, which is based on kbl platform). Lack of vendor custom specs could be
> > another reaaon(mine is Xiaomi, old Xiaomi models without dmic works
> > perfectly).
> 
> it's not possible that SST was autoselected on CometLake, you must have used
> a kernel parameter.
> On CometLake you need to use the SOF driver (not SST), and if this doesn't
> work please file a bug at https://github.com/thesofproject/linux/issues

Thank you very much for replying. I double checked the soundcard itself is [8086:9d71] as others mentioned above, so that's the same issue with SST driver,.
will check the fedora dafault kconfig and see whether these SST options are on.
Comment 302 Pierre Bossart 2021-03-08 18:58:46 UTC
(In reply to 尉晓亮 from comment #301)
> > On CometLake you need to use the SOF driver (not SST), and if this doesn't
> > work please file a bug at https://github.com/thesofproject/linux/issues
> 
> Thank you very much for replying. I double checked the soundcard itself is
> [8086:9d71] as others mentioned above, so that's the same issue with SST
> driver,.

Ack, 9d71 is KabyLake -> SST driver.
Comment 303 Xiaoliang Yu 2021-03-08 21:54:53 UTC
(In reply to Pierre Bossart from comment #302)
> (In reply to 尉晓亮 from comment #301)
> > > On CometLake you need to use the SOF driver (not SST), and if this
> doesn't
> > > work please file a bug at https://github.com/thesofproject/linux/issues
> > 
> > Thank you very much for replying. I double checked the soundcard itself is
> > [8086:9d71] as others mentioned above, so that's the same issue with SST
> > driver,.
> 
> Ack, 9d71 is KabyLake -> SST driver.

SST should work but it dosn't.

Frdora sets not to compile those skl drivers and codecs in their stock kconfig, but ships all needed modules in other packages. But it's not probing, so as above 
component ehdaudio0D0 not found.
Shall I toggle these on and re-compile? It should generate no more modules but I don;t know whether it make other differences.
Comment 304 Eli Melucci 2021-03-14 11:59:57 UTC
(In reply to Amadeusz Sławiński from comment #297)
> Hi, have you tried collecting logs with patch from previous comment?

Applied the patch, recompiled the kernel with an upgraded version (5.11);
Seems like things broke even more, sharing alsa-info and logs
http://alsa-project.org/db/?f=ee4f822965f25284e39093612368c5b00a283fa5

at some point dmesg says "no hda codecs found!" but config has
CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=y
Comment 305 Eli Melucci 2021-03-14 12:00:58 UTC
Created attachment 295843 [details]
boot 5.11 dmesg from Swift 3 with HDAUDIO_CODEC compiled
Comment 306 Eli Melucci 2021-03-14 13:29:22 UTC
Please disregard what I just posted, by power-cycling and cold-booting it now finds the codec. Let me try to get the logs again.
Also, interesting note, when forcing the legacy driver now an internal microphone appears, though it doesn't seem to work
Comment 307 Eli Melucci 2021-03-14 13:34:24 UTC
Created attachment 295847 [details]
dmesg for arecord with debug info, 5.11, swift 3
Comment 308 Amadeusz Sławiński 2021-03-15 09:50:02 UTC
Created attachment 295859 [details]
patch adding more debug logs 2

So I think I know where it is failing, but let's make sure that I got it right with even more logs, patch attached.

As a side question, do you use topology built like described in: https://gist.github.com/crojewsk/4e6382bfb0dbfaaf60513174211f29cb or from somewhere else?
Comment 309 Eli Melucci 2021-03-15 10:05:34 UTC
The topology binary I use comes from the alsa-topology-conf repository. At this point I don't really remember what was on my system before compiling that (wasn't there at all, probably)
Comment 310 Eli Melucci 2021-03-15 10:46:11 UTC
Created attachment 295861 [details]
Patch application failure

Patch doesn't apply when using 5.11.6 (clean tree of course), last hunk failed, attaching rejects
Comment 311 Amadeusz Sławiński 2021-03-15 10:59:59 UTC
Created attachment 295863 [details]
patch adding more debug logs 3

This one should apply correctly.
Comment 312 Eli Melucci 2021-03-15 12:49:56 UTC
Created attachment 295865 [details]
Swift 3, dmesg, moredebug3 patch

Here's the logs with the new patch applied
Comment 313 Amadeusz Sławiński 2021-03-16 15:53:36 UTC
Created attachment 295883 [details]
patch adding more debug logs 4

Another try, added WARN_ON(1), so there will be backtrace.
Comment 314 Eli Melucci 2021-03-17 13:17:30 UTC
Created attachment 295893 [details]
Swift 3, dmesg, moredebug4 patch

Here's logs, backtrace is present
Comment 315 Amadeusz Sławiński 2021-03-17 13:56:44 UTC
Created attachment 295895 [details]
patch adding more debug logs 5

Ah... there we go, it calls hw_free in error path, on platforms I have access to it gets to hw_params and then usually succeeds or prints some human readable error, but here it seems to fail earlier for some reason. Attached new patch with logs to see how far it gets in snd_pcm_hw_params.
Comment 316 Eli Melucci 2021-03-17 15:39:10 UTC
Created attachment 295903 [details]
Swift 3, dmesg, moredebug5 patch

Logs for patch 5
Comment 317 Amadeusz Sławiński 2021-03-17 16:23:46 UTC
Ok, I managed to reproduce it now. Seems like call to snd_pcm_lib_malloc_pages fails silently...

Can you try changing CONFIG_SND_HDA_PREALLOC_SIZE to 0 in your config?

When above option is set to some value it goes through different path when allocating memory, which seems to be causing problems in this case.

I'll keep investigating what's going on, now that I can reproduce.
Comment 318 Eli Melucci 2021-03-17 16:45:31 UTC
With CONFIG_SND_HDA_PREALLOC_SIZE=0 the microphone is correctly recognised and it all works! The previous value was 4096 (not sure if kernel or distro default)
Comment 319 Pierre Bossart 2021-03-17 21:17:23 UTC
The kernel defaults are

config SND_HDA_PREALLOC_SIZE
	int "Pre-allocated buffer size for HD-audio driver"
	range 0 32768
	default 2048 if SND_DMA_SGBUF
	default 64 if !SND_DMA_SGBUF


it's very odd that this would cause a problem for microphones only, the microphones are handled internally with a GP-DMA but the DSP->host transfers use the same DMA as the HDAudio paths for the headset+speakers.
Comment 320 Eli Melucci 2021-03-17 21:31:33 UTC
I've tried poking at /proc/asound/card0/pcm13c/sub0/prealloc, changing that at runtime doesn't seem to make a difference
Comment 321 Amadeusz Sławiński 2021-03-18 11:06:53 UTC
So, there is a limit of memory per card.

https://elixir.bootlin.com/linux/latest/source/sound/core/pcm_memory.c#L30

max_alloc_per_card = 32UL * 1024UL * 1024UL

When SND_HDA_PREALLOC_SIZE is set to 4096 it only has memory to alloc for 8 frontends, while card has 10 of them (playback and capture), so preallocated memory is exhausted as soon as card is done probing. One of FEs it fails to allocate is DMIC and other one is one HDMI3.

When running arecord, bacause it failed to allocate memory on probe it tries to allocate memory again, but as it is already exhausted it still fails.

One solution is to set SND_HDA_PREALLOC_SIZE to lower value, other is changing memory limit per card
(FEs * SND_HDA_PREALLOC_SIZE * 1024)
10 * 4096 * 1024 = 41943040

It works fine with this calculated value passed to module in /etc/modprobe.d:
options snd_pcm max_alloc_per_card=41943040



The only thing I'm surprised about is that there is no warning or error when it fails to allocate memory on probe and later when it tries to allocate it while running arecord.

Also wonder if it shouldn't try allocating additional memory if preallocated is not enough...

Or maybe we could just raise limit, because 32MB of memory nowadays is really not that much, so we could just change it to something bigger...
Comment 322 Takashi Iwai 2021-03-18 11:30:13 UTC
Ideally, we need to redesgin the preallocation code.  It's not considered that so many streams allocate much space without actually used.  That is, in this case, we allocate 32MB memory and most of them remain unused, which is suboptimal.

As a practical fix for now, lower the buffer_bytes_max from AZX_MAX_BUF_SIZE (1GB) to the realistic value like 4MB and set PREALLOC to 0.  The default PREALLOC value was put back to 2MB because PREALLOC=0 confuses many applications and let them try allocating as much as possible, resulting in -ENOMEM.
Comment 323 ais 2021-03-20 08:00:50 UTC
Just checked the solution with
options snd_pcm max_alloc_per_card=41943040
on Lenovo Yoga C930, kernel 5.11.7, ArchLinux, and it worked!
DMIC appeared.
Only issue on particular laptop is the recording level too quiet and in fact non operational, but i think it is other matter.
Comment 324 Amadeusz Sławiński 2021-03-22 09:49:34 UTC
Yes, if there are any other issues please open a separate bug, I would say this one is already big enough.

Takashi, do you have power to close this bug, now that all current problems are solved?
Comment 325 Takashi Iwai 2021-03-22 09:58:36 UTC
OK let's close.  Thanks.
Comment 326 Vasyl 2021-03-22 21:56:33 UTC
Final question: what Linux core version we can see the fix available for everyone who is not intended to build the driver part of it from sources?
Comment 327 benjamin.doron00 2021-03-31 01:07:39 UTC
Thanks, I can confirm that "arecord" works with the patch here (Audacity does not and the IOMMU must be disabled for DSP FW loading to succeed, but these are different issues).

@Mateusz, thanks for the pointer: While I must have used the wrong offsets when editing the NHLT table, changing the UEFI setup configuration worked. I retrieved the other DMIC blobs and will also test with coreboot.

> Final question: what Linux core version we can see the fix available for
> everyone who is not intended to build the driver part of it from sources?

The patch here first appears on kernel tag 5.12-rc2.
Comment 328 Pierre Bossart 2021-03-31 14:25:16 UTC
(In reply to benjamin.doron00 from comment #327)
> Thanks, I can confirm that "arecord" works with the patch here (Audacity
> does not and the IOMMU must be disabled for DSP FW loading to succeed, but
> these are different issues).

can you clarify what you meant by "IOMMU must be disabled"? I am not aware of such a limitation.
Comment 329 benjamin.doron00 2021-04-20 14:49:04 UTC
(In reply to Pierre Bossart from comment #328)
> (In reply to benjamin.doron00 from comment #327)
> > Thanks, I can confirm that "arecord" works with the patch here (Audacity
> > does not and the IOMMU must be disabled for DSP FW loading to succeed, but
> > these are different issues).
> 
> can you clarify what you meant by "IOMMU must be disabled"? I am not aware
> of such a limitation.

Sorry, I forgot that I hadn't sent this.

With `intel_iommu=on,igfx_off` on the kernel command line, the below error appears in dmesg output.

"
[...]
[   17.417153] snd_soc_skl:is_skl_dsp_core_enable: snd_soc_skl 0000:00:1f.3: DSP core(s) enabled? 1 : core_mask 1
[   17.419311] snd_soc_skl:skl_load_base_firmware: snd_soc_skl 0000:00:1f.3: ROM loaded, we can continue with FW loading
[   17.419313] snd_soc_skl:skl_cldma_copy_to_buf: snd_soc_skl 0000:00:1f.3: skl_cldma_copy_to_buf: Total binary size: 245760
[   17.419314] snd_soc_skl:skl_cldma_fill_buffer: snd_soc_skl 0000:00:1f.3: Size: 20000, intr_enable: 1
[   17.419316] snd_soc_skl:skl_cldma_fill_buffer: snd_soc_skl 0000:00:1f.3: buf_pos_index:0, trigger:1
[   17.419317] snd_soc_skl:skl_cldma_fill_buffer: snd_soc_skl 0000:00:1f.3: spib position: 131072
[   17.419364] DMAR: DRHD: handling fault status reg 3
[   17.419366] DMAR: [DMA Read] Request device [00:1f.3] PASID ffffffff fault addr 105340000 [fault reason 06] PTE Read access is not set

[...]

[   17.924201] snd_soc_skl 0000:00:1f.3: skl_cldma_wait_interruptible: Wait timeout
[   17.925557] snd_soc_skl 0000:00:1f.3: Failed to set Run bit=2 enable=0
[   17.925566] snd_soc_skl 0000:00:1f.3: Transfer firmware failed-5
[   17.926892] snd_soc_skl 0000:00:1f.3: Failed to set Run bit=2 enable=0
[   17.926926] snd_soc_skl:is_skl_dsp_core_enable: snd_soc_skl 0000:00:1f.3: DSP core(s) enabled? 0 : core_mask 1
[   17.926959] snd_soc_skl 0000:00:1f.3: Load base fw failed : -5
[   17.926976] snd_soc_skl 0000:00:1f.3: Failed to boot first fw: -5
[...]
"

The DMAR fault occurs on PCIe device 1f.3, which is the HDA device. DSP FW loading occurs through some of its registers, I suppose?

I can upload the full log if you want, or file another bug report.
Comment 330 Perry.Yuan 2021-04-20 14:49:23 UTC
Created attachment 296445 [details]
attachment-24654-0.html

Hey there,
I’m OOO  4/20.  I won’t be accessing my email during this time.
Please expect response delayed.
Thanks

Best Regards!
Comment 331 glenn.mccarthy 2021-08-30 01:34:01 UTC
Any updates on this being resolved for those of us without a Realtek codec? 
The fix here https://gist.github.com/crojewsk/4e6382bfb0dbfaaf60513174211f29cb does not work for other codecs.  I have a Conexant CX11970 (0x14f120d0).
Comment 333 Janusz Bruckner 2023-07-30 12:11:11 UTC
BACKDOOR over AC and fsk AF/rf
Comment 334 dmbohdan 2023-07-30 12:37:43 UTC
Created attachment 304732 [details]
attachment-31016-0.html

I suggested it could be possible, AC filter?

нд, 30 лип. 2023, 3:11 пп користувач <bugzilla-daemon@kernel.org> пише:

> https://bugzilla.kernel.org/show_bug.cgi?id=201251
>
> Janusz Bruckner (januszbruckner01@gmail.com) changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|                            |
> januszbruckner01@gmail.com
>
> --- Comment #333 from Janusz Bruckner (januszbruckner01@gmail.com) ---
> BACKDOOR over AC and fsk AF/rf
>
> --
> You may reply to this email to add a comment.
>
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 335 dmbohdan 2023-07-30 13:02:58 UTC
Created attachment 304733 [details]
attachment-6363-0.html

Actually hypothetically there was information that locked phone can be
unlocked by using electricity + sound.

At least it can be decrypted and dumped.

But no proof.
Comment 336 Eli Melucci 2023-07-30 14:21:32 UTC
(In reply to Janusz Bruckner from comment #333)
> BACKDOOR over AC and fsk AF/rf

Care to clarify how this relates to this bug?

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