# Tiger Lake audiocontroller/sound card not found

## AstroFloyd

I've been trying to get the sound on my new ThinkPad working for several days, but no luck so far.  I seem to be missing some driver or firmware in my kernel config.

```
lspci -k

00:1f.3 Audio device: Intel Corporation Tiger Lake-LP Smart Sound Technology Audio Controller (rev 20)

     Subsystem: Lenovo Tiger Lake-LP Smart Sound Technology Audio Controller

     Kernel driver in use: sof-audio-pci

```

while Arch Linux says

```
lspci -k

00:1f.3 Audio device: Intel Corporation Tiger Lake-LP Smart Sound Technology Audio Controller (rev 20)

      Subsystem: Lenovo Device 22c9

      Kernel driver in use: sof-audio-pci

      Kernel modules: snd_hda_intel, snd_sof_pci

```

Relevant dmesg lines seem to be

```
dmesg | grep -Eiw -A3 'audio|alsa|sound|error|sof'  # edited

ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)

Advanced Linux Sound Architecture Driver Initialized.

snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040380

snd_hda_intel 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver

sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040380

sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver

sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040380

sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops)

ALSA device list:

platform regulatory.0: Direct firmware load for regulatory.db failed with error -2

  No soundcards found.

sof-audio-pci 0000:00:1f.3: use msi interrupt mode

cfg80211: failed to load regulatory.db

sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5

sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now

sof-audio-pci 0000:00:1f.3: DMICs detected in NHLT tables: 2

Loading firmware: intel/sof/sof-tgl.ri

sof-audio-pci 0000:00:1f.3: Firmware info: version 1:6:1-53680

sof-audio-pci 0000:00:1f.3: Firmware: ABI 3:17:0 Kernel ABI 3:17:0

```

(I'm guessing the regularoty.db lines are unrelated(?)).

I seem to have tried all I can think of or find online, and it clearly isn't enough.  All help is welcome!

I posted my full dmesg and kernel config.

----------

## mike155

Which Thinkpad do you have? Which CODEC does it have? If you don't the latter, just tell us the exact model name of your Thinkpad.

----------

## AstroFloyd

It's a ThinkPad T14 Gen 2.  How can I find its CODEC?

----------

## pietinger

 *AstroFloyd wrote:*   

> It's a ThinkPad T14 Gen 2.  How can I find its CODEC?

 

Google this: "Chip set ThinkPad T14" and you will find:

https://support.lenovo.com/en/solutions/pd500529-linux-certification-thinkpad-t14-gen-2-20w0z90aus

Now disable all other codecs in your kernel config.

----------

## mike155

Your notebook seems to have a Realtek ALC3287 codec - as @pietinger already pointed out. 

CONFIG_SND_HDA_CODEC_REALTEK=y must be enabled. That option is enabled, so that's fine.

It seems that CONFIG_SND_SOC is enabled, too. Disable that option. It seems that it prohibits initialization of the HDA driver:

```
Kernel driver in use: sof-audio-pci

      Kernel modules: snd_hda_intel, snd_sof_pci 
```

I would like to see:

```
Kernel driver in use: snd_hda_intel
```

Try a newer kernel: 5.15.

----------

## AstroFloyd

Thanks both for your help!

@pietinger: I apologise - I wasn't trying to be lazy, but under the impression that online info would not yield useful results about my laptop, since the Gen2 could have a i5/i7 CPU, Intel/NVidia graphics, etc. - I wasn't aware that the codecs would all be the same.

@mike155: disabling CONFIG_SND_SOC yields a longer list of entries in /dev/snd/ and alsamixer now works and lspci says "Kernel driver in use: snd_hda_intel", even though dmesg still claims "No soundcards found."  So this seems to have solved things, but I need to have a good look when I have more time.

----------

## mike155

Next step: take a look at the output of

```
aplay -l
```

If your 'analog device' is NOT card #0, device #0, it could be necessary to configure your 'analog device' in /etc/asound.conf.

----------

## AstroFloyd

After following your suggestions, everything works (output over internal speakers, earphones, HDMI, bluetooth -> hifi and the mike of my headset) EXCEPT the internal microphone.  It is listed in alsamixer and I can en/disable it using the space bar or change its volume, but it does not want to record anything.  When using my headset, arecord /tmp/test.wav works and I can aplay the file.  However, without headset, when I would expect the internal mike to jump in, I get

```
Recording WAVE '/tmp/test.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono

ALSA lib /var/tmp/portage/media-plugins/alsa-plugins-1.2.2/work/alsa-plugins-1.2.2/pulse/pcm_pulse.c:752:(pulse_prepare) PulseAudio: Unable to create stream: Input/Output error

arecord: set_params:1407: Unable to install hw params:

ACCESS:  RW_INTERLEAVED

FORMAT:  U8

SUBFORMAT:  STD

SAMPLE_BITS: 8

FRAME_BITS: 8

CHANNELS: 1

RATE: 8000

PERIOD_TIME: 125000

PERIOD_SIZE: 1000

PERIOD_BYTES: 1000

PERIODS: 4

BUFFER_TIME: 500000

BUFFER_SIZE: 4000

BUFFER_BYTES: 4000

TICK_TIME: [0 0]
```

Also, when the headset is plugged in, my Fn-F4 mute mike button with LED follows alsamixer or the other way around.  However, without headset, the button does not work (no change in LED when pressed) and it doesn't seem to change anything in alsamixer either...

Do you have any idea what the issue might be or how to start figuring this out?

----------

## xgivolari

I also have a Lenovo Laptop with Tiger Lake CPU. On my machine, the ALC257 chip uses the normal HDA_REALTEK driver, while the internal mic is powered by the SoC DMIC driver. To enable both at the same time, the following options must be selected:

```
CONFIG_SND_SOC

CONFIG_SND_SOC_SOF_TOPLEVEL

CONFIG_SND_SOC_SOF_PCI

CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL

CONFIG_SND_SOC_SOF_INTEL_TIGERLAKE

CONFIG_SND_SOC_SOF_HDA_LINK

CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC

CONFIG_SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH

CONFIG_SND_SOC_DMIC (this is the actual mic driver; auto-selected by the above)

CONFIG_SND_HDA_CODEC_HDMI

CONFIG_SND_HDA_CODEC_REALTEK

```

----------

## AstroFloyd

Thanks a lot @xgivolari, and apologies for the slow response.  

Somehow, this doesn't seem to work for me - my HDA device disappears, as @mike155 would predict when reenabling CONFIG_SND_SOC.  You must have done something else to get both HDA and SoC DMIC working...?

Also, do you happen to have any of the SND_SOC_INTEL_SKYLAKE_* enabled?

----------

## xgivolari

Instead of CONFIG_SND_SOC_SOF_INTEL_TIGERLAKE , I meant to write CONFIG_SND_SOC_SOF_TIGERLAKE, my bad. SND_SOC_INTEL_SKYLAKE is only necessary on older systems. Tiger Lake is exclusively supported by SOF. Snd_hda_intel being blocked from loading is perfectly normal. I have it disabled alltogether. (not the hda codec drivers though!) Which driver does lspci report now for your sound card? Ideally, it should be sof-audio-intel-pci-tgl.

The relevant kernel option we need is SND_SOC_SOF_INTEL_TGL. This cannot be selected manually, it enables itself when all its dependencies are satisfied. (That's the other config options I listed in my previous post) To check wether or not it is enabled in your current config, boot up menuconfig, press "/" and type "tgl" into the search prompt. This shows you the current status of SND_SOC_SOF_INTEL_TGL, as well as all of its dependencies and their respective statuses. With my config, it looks like this:

```
  │ Symbol: SND_SOC_SOF_INTEL_TGL [=y]                                                                                                                                                    │  

  │ Type  : tristate                                                                                                                                                                      │  

  │ Defined at sound/soc/sof/intel/Kconfig:177                                                                                                                                            │  

  │   Depends on: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_SOF_TOPLEVEL [=y] && SND_SOC_SOF_INTEL_TOPLEVEL [=y] && SND_SOC_SOF_PCI [=y]                                  │  

  │ Selects: SND_SOC_SOF_HDA_COMMON [=y] && SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE [=y]                                                                                                │  

  │ Selected by [y]:                                                                                                                                                                      │  

  │   - SND_SOC_SOF_TIGERLAKE [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_SOF_TOPLEVEL [=y] && SND_SOC_SOF_INTEL_TOPLEVEL [=y] && SND_SOC_SOF_PCI [=y]              │  

  │ Selected by [n]:                                                                                                                                                                      │  

  │   - SND_SOC_SOF_ELKHARTLAKE [=n] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_SOF_TOPLEVEL [=y] && SND_SOC_SOF_INTEL_TOPLEVEL [=y] && SND_SOC_SOF_PCI [=y]            │  

  │   - SND_SOC_SOF_ALDERLAKE [=n] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_SOF_TOPLEVEL [=y] && SND_SOC_SOF_INTEL_TOPLEVEL [=y] && SND_SOC_SOF_PCI [=y]              │  

  │                                                                                                                                                                            

```

----------

## luna80

 *AstroFloyd wrote:*   

> It's a ThinkPad T14 Gen 2.  How can I find its CODEC?

 

I have the same since 5 day and me too I try to configure the audio.

The sound works with CONFIG_SND_HDA_CODEC_REALTEK=y but if I add the others required options (CONFIG_SND_SOC_*) to get works the mic, it doesn't works anymore

sorry for my bad english, I hope you understand

----------

## AstroFloyd

@xgivolari Thanks for the clarification (and no worries about the typo; I'm really glad you're helping out).  I'm going to try this.  Just to be sure, is the CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL in your list (which also features SND_SOC_SOF_INTEL) correct?  Edit: I see it is correct from the menuconfig deps.

@luna80 You are perfectly understandable!    :Smile: 

PS:I just noticed that no *TGL* exists in my kernel - I'm still on v5.10, so I'll need to upgrade to v5.15 first  (I never did that after (nearly) everything started working).

One of the nonintuitive ones is that you need to enable GPIOLIB to select CONFIG_SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH

----------

## AstroFloyd

OK, I booted a 5.15.23 kernel with all _SOF_ options enabled, but no luck.

dmesg says

```
snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040380

snd_hda_intel 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver

sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040380

sof-audio-pci-intel-tgl 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver

sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040380

sof-audio-pci-intel-tgl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops)

ALSA device list:

  No soundcards found.

sof-audio-pci-intel-tgl 0000:00:1f.3: use msi interrupt mode

sof-audio-pci-intel-tgl 0000:00:1f.3: hda codecs found, mask 5

sof-audio-pci-intel-tgl 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now

sof-audio-pci-intel-tgl 0000:00:1f.3: DMICs detected in NHLT tables: 2

Loading firmware: intel/sof/sof-tgl.ri

sof-audio-pci-intel-tgl 0000:00:1f.3: Direct firmware load for intel/sof/sof-tgl.ri failed with error -2

sof-audio-pci-intel-tgl 0000:00:1f.3: error: sof firmware file is missing, you might need to

sof-audio-pci-intel-tgl 0000:00:1f.3:        download it from https://github.com/thesofproject/sof-bin/

sof-audio-pci-intel-tgl 0000:00:1f.3: error: failed to load DSP firmware -2

sof-audio-pci-intel-tgl 0000:00:1f.3: error: sof_probe_work failed err: -2
```

I've got sys-firmware/sof-firmware-1.9.3-r1 installed (also tried 1.6.1) and /lib/firmware/intel/sof/sof-tgl.ri exists.  I think this worked ~2 months ago before I disabled all SOF options, but I'm not 100% sure and my notes from that time are not very clear.

In addition, I also get 

```
i915 0000:00:02.0: Direct firmware load for i915/tgl_dmc_ver2_12.bin failed with error -2

i915 0000:00:02.0: [drm] Failed to load DMC firmware i915/tgl_dmc_ver2_12.bin. Disabling runtime power management.

i915 0000:00:02.0: [drm] DMC firmware homepage: https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/i915
```

which loaded without errors before.

lspci -k gives 

```
00:1f.3 Audio device: Intel Corporation Tiger Lake-LP Smart Sound Technology Audio Controller (rev 20)

     Subsystem: Lenovo Tiger Lake-LP Smart Sound Technology Audio Controller

     Kernel driver in use: sof-audio-pci-intel-tgl
```

which should look good.

I have no idea why the firmware driver cannot be loaded when the kernel asks for it and it exists...

----------

## pietinger

 *AstroFloyd wrote:*   

> I have no idea why the firmware driver cannot be loaded when the kernel asks for it and it exists...

 

It depends whether you build a kernel module as module or static into your kernel. If it is build static into your kernel AND it needs firmware, then this module has a "problem": At boot time there is no access to root partition and THEREFORE the firmware must be included INTO the kernel also.

Only if you build this kernel module as module it has the chance (because it will be loaded at a later time) to load its firmware from /lib/firmware/... residing on your root partition.

So, if you build your module static you must define it here (example from my station: loading firmware for Intel GPU and microcode for INTEL CPU):

```
#

# Firmware loader

#

CONFIG_FW_LOADER=y

CONFIG_EXTRA_FIRMWARE="i915/skl_dmc_ver1_27.bin intel-ucode/06-5e-03"

CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"
```

With this my firmware is included as binary blob in my kernel (after compiling the kernel of course).

----------

## luna80

AstroFloyd

have you found a solution?

I get the audio working, if you put the CONFIG_SND_SOC_SOF_INTEL_TIGERLAKE like module in the kernel, it will load the firmware automatically, and don't forget to load the module at start (/etc/modules-load.d/, in a *.conf file put snd-sof-pci-intel-tgl)

----------

