Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Tiger Lake audiocontroller/sound card not found
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
AstroFloyd
n00b
n00b


Joined: 18 Oct 2011
Posts: 59

PostPosted: Wed Jan 12, 2022 3:09 pm    Post subject: Tiger Lake audiocontroller/sound card not found Reply with quote

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.

Code:
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
Code:
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
Code:
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.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Wed Jan 12, 2022 3:13 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
AstroFloyd
n00b
n00b


Joined: 18 Oct 2011
Posts: 59

PostPosted: Wed Jan 12, 2022 3:48 pm    Post subject: Reply with quote

It's a ThinkPad T14 Gen 2. How can I find its CODEC?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5372
Location: Bavaria

PostPosted: Wed Jan 12, 2022 4:03 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Wed Jan 12, 2022 4:17 pm    Post subject: Reply with quote

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:
Code:
Kernel driver in use: sof-audio-pci
      Kernel modules: snd_hda_intel, snd_sof_pci

I would like to see:
Code:
Kernel driver in use: snd_hda_intel

Try a newer kernel: 5.15.
Back to top
View user's profile Send private message
AstroFloyd
n00b
n00b


Joined: 18 Oct 2011
Posts: 59

PostPosted: Wed Jan 12, 2022 6:24 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Wed Jan 12, 2022 10:36 pm    Post subject: Reply with quote

Next step: take a look at the output of
Code:
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.
Back to top
View user's profile Send private message
AstroFloyd
n00b
n00b


Joined: 18 Oct 2011
Posts: 59

PostPosted: Tue Jan 25, 2022 2:30 pm    Post subject: Reply with quote

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
Code:
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?
Back to top
View user's profile Send private message
xgivolari
Tux's lil' helper
Tux's lil' helper


Joined: 26 Jul 2021
Posts: 102

PostPosted: Tue Jan 25, 2022 6:10 pm    Post subject: Reply with quote

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:

Code:
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
Back to top
View user's profile Send private message
AstroFloyd
n00b
n00b


Joined: 18 Oct 2011
Posts: 59

PostPosted: Sat Feb 12, 2022 3:23 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
xgivolari
Tux's lil' helper
Tux's lil' helper


Joined: 26 Jul 2021
Posts: 102

PostPosted: Sat Feb 12, 2022 8:59 pm    Post subject: Reply with quote

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:

Code:
  │ 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]              │ 
  │                                                                                                                                                                           
Back to top
View user's profile Send private message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1563
Location: switzerland

PostPosted: Sun Feb 13, 2022 7:31 am    Post subject: Reply with quote

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
_________________
*** !f j00 c4n r34D tH15 tH3N j00 n33D t0 l0g Off ***
Back to top
View user's profile Send private message
AstroFloyd
n00b
n00b


Joined: 18 Oct 2011
Posts: 59

PostPosted: Sun Feb 13, 2022 7:54 am    Post subject: Reply with quote

@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! :)

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
Back to top
View user's profile Send private message
AstroFloyd
n00b
n00b


Joined: 18 Oct 2011
Posts: 59

PostPosted: Sun Feb 13, 2022 10:14 am    Post subject: Reply with quote

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

dmesg says
Code:
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
Code:
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
Code:
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...
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5372
Location: Bavaria

PostPosted: Sun Feb 13, 2022 11:08 am    Post subject: Reply with quote

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):

Code:
#
# 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).
Back to top
View user's profile Send private message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1563
Location: switzerland

PostPosted: Tue Feb 15, 2022 2:35 pm    Post subject: Reply with quote

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)
_________________
*** !f j00 c4n r34D tH15 tH3N j00 n33D t0 l0g Off ***
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum