Skip to contentSkip to conversation

ASoC: Intel: sof_es8336: internal analog mic on Gemini Lake laptop needs HEADSET_MIC1 quirk plus explicit mixer writes, no DMI match

DISCUSSION golne tree 1 participant 1 message Nov 4 Sound

lore
Share & tools
lore

golne tree

author
#0 lore raw

Hello,
I have a cheap OEM laptop (Denver brand) with an Intel Celeron N4020 and an ES8336 codec. The internal microphone does not work on Linux, but it works on Windows with the vendor driver. I found a combination that makes it work and would like to ask how this can be made automatic for this board.
Hardware / software
Laptop: Denver (OEM). DMI system and baseboard fields are all "Default string"
BIOS: American Megatrends, version string "$(AMI_ROM_NAME)_T$(2021)$(03)$(12)$(18)$(44)" (looks like an unfilled template, build around 2021-03)
CPU: Intel Celeron N4020, audio controller 8086:3198, subsystem 02f3:f000
Kernel: 7.2.7-1-cachyos (CachyOS)
Driver: snd_soc_sof_es8336, card sof-essx8336
SOF firmware: intel/sof/sof-glk.ri
Topology: intel/sof-tplg/sof-glk-es8336-ssp2.tplg
ACPI: ESSX8336 on I2C2 (address 0x11) with one GpioIo (pin 29), one GpioInt (pin 20) and a large _DSM method
dmesg: "DMICs detected in NHLT tables: 0"
Problem
The internal microphone records only noise or silence. A headset microphone works.
Findings
With the default quirk mask (0x2, SSP2): Differential Mux "lin1-rin1" gives noise only, the two "with 20db Boost" values give digital silence. "lin2-rin2" gives a usable signal only if I turn on "Headset Mic Switch" by hand.
So the internal mic seems to be wired to the MIC2 input (lin2-rin2), which the driver reserves for the headset by default. With the module option snd_soc_sof_es8336 quirk=0x102 (SSP2 | SOC_ES8336_HEADSET_MIC1), dmesg shows "quirk headset at mic1 port enabled".
After a reboot with quirk=0x102 and no manual mixer commands, the internal mic still records only silence, although reading the controls back shows Internal Mic Switch = on, Headset Mic Switch = off and Digital Mic Mux = 0. Writing only Differential Mux = 1 (lin2-rin2) did not help. After I write these four controls explicitly with amixer cset, the internal mic works:
Differential Mux = 1 (lin2-rin2)
Headset Mic Switch = off
Internal Mic Switch = on
Digital Mic Mux = 0
I have not determined which single write is the decisive one, and I do not know why the explicit write is needed when the values read back as correct. To work around it I now run these commands from a systemd user service after login.
Quirk 0x22 (DMIC) with the dmic2ch topology gives only digital silence, which fits the missing DMIC in NHLT.
I have not yet tested the headset microphone with quirk 0x102. Questions
Because all DMI fields are "Default string", I cannot see how a DMI quirk could match this board. Is there another way to set SOC_ES8336_HEADSET_MIC1 automatically (another DMI field, ACPI data, the _DSM method)?
Should the UCM profile for sof-essx8336 write these controls when the internal mic is enabled, and is it expected that the values read back correctly but the path stays inactive until they are written?
I can provide the DSDT, alsa-info output and more logs, and I can test patches on this machine.
Best regards,
Goldi Tree