Coder Social home page Coder Social logo

Comments (196)

plbossart avatar plbossart commented on May 6, 2024 3

@ejmarkow that's great news, you're the first one that actually successfully tests the mclk1.

It's becoming a real nightmare to maintain all the variations of topologies required for ES8336, so I am thinking we need to
a) try to auto-detect what the mclk is. that might be possible by parsing the NHLT information, IIRC we can skip some bits and just read the clocking information.
b) or add a module parameter
c) or both, with the module parameter overriding the mclk detection if it's not accurate.

Maybe we should start with b), i'll try to look into this in the coming days.

from linux.

MisteryX avatar MisteryX commented on May 6, 2024 2

GREAT THANK YOU, @plbossart !
It works with option:
options snd-soc-sof-es8336 quirk=0x10
in /etc/modprobe.d/alsa-base.conf

So for Teclast F7plus 3 sound problem solved on 5.15.7+patches or 5.16 kernel with sof 1.9.3.
Hope this recipe will help to others.

from linux.

Aromate avatar Aromate commented on May 6, 2024 2

Hi Sir? Please add a virtual master control in es8316/es8336 chip driver. We need it!!! The google's cras software need it, it's chromium os need, brunch project also. Please!!!! Maybe, the chrome os world are need your support.

from linux.

plbossart avatar plbossart commented on May 6, 2024 2

Sorry about that @dezo4 turns out it wasn't just a Git conflict. Updated wiki and branch.

from linux.

plbossart avatar plbossart commented on May 6, 2024 1

@ejmarkow can you save your setup in /lib/firmware/intel/sof-tplg, and then copy all the files in this tar file
es8336-topologies-mclk1.tar.gz

The only change is to use mclk1 instead of mclk0. I don't know if this is the reason for your issue, but since you're a really good tester/reporter that's worth trying. Thanks!

from linux.

andreaconsole avatar andreaconsole commented on May 6, 2024 1

Exciting discussion! Kudos to plbossart for his excellent support and to ejmarkow for his reactivity!

from linux.

plbossart avatar plbossart commented on May 6, 2024 1

Thanks @ejmarkow. I extracted the NHLT information, and it looks like we can find ONE bit in the table that will indicate the use of MCLK0 or MCLK1

From Eugene Markow

/* Specific_Config table #1 */
[4E2h 1250 84] Capabilities :
00 00 00 00 10 FF FF FF 32 FF FF FF 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 37 03 D0 83 00 00 70 C0 00 00 00 00
04 00 01 02 0F 00 00 00 0F 00 00 00 02 40 00 00
04 00 00 00 00 0F 07 07 20 00 00 00 02 00 22 00
02 00 00 00

00 00 00 00 gateway attributes
10 FF FF FF ts_group[0]
32 FF FF FF ts_group[1]
00 00 00 00 ts_group[2]
00 00 00 00 ts_group[3]
00 00 00 00 ts_group[4]
00 00 00 00 ts_group[5]
00 00 00 00 ts_group[6]
00 00 00 00 ts_group[7]
37 03 D0 83 reg0
00 00 70 C0 reg1
00 00 00 00 reg2
04 00 01 02 reg3
0F 00 00 00 reg4
0F 00 00 00 reg5
02 40 00 00 reg6
04 00 00 00 reg7
00 0F 07 07 reg8
20 00 00 00 reg9
02 00 22 00 mdivc
02 00 00 00 mdivr

BIT(1) of mdivc is set -> MCLK1

JSL device

/* Specific_Config table #1 */
[104h 0260 84] Capabilities :
00 00 00 00 10 FF FF FF 32 FF FF FF 10 32 FF FF
10 32 FF FF 10 32 FF FF 10 32 FF FF 10 32 FF FF
10 32 FF FF 37 07 D0 83 00 00 70 C0 00 00 00 00
04 00 01 02 0F 00 00 00 0F 00 00 00 02 40 00 00
04 00 00 00 00 0F 07 07 20 00 00 00 *01 00 02 00 *
02 00 00 00

01 00 02 00 mdivc

BIT(0) of mdivc is set -> MCLK0

from linux.

plbossart avatar plbossart commented on May 6, 2024 1

@ejmarkow I could use your help to re-check my latest changes.

a) re-install the latest topologies (now merged in SOF main branch) - make sure to remove all the mclk1 stuff
es8336_topologies_main.tar.gz
b) remove mclk_id kernel parameter from /etc/modprobe.d/alsa-base.conf
c) install kernel based on PR #3798 (I forced-push, you need commit 013290a)
d) reboot and attach the dmesg log. If you a MCLK mask of 0x2 this should work with sound on your speakers.

This PR #3798 may change a bit in the coming days to account for review comments and improvement suggestions, but that should be minor.

Thanks!

from linux.

plbossart avatar plbossart commented on May 6, 2024 1

Excellent, thanks @ejmarkow for your tests and providing a nice summary of required patches.

from linux.

plbossart avatar plbossart commented on May 6, 2024 1

Added recommended information in https://github.com/thesofproject/linux/wiki/ES8336-support

closing for now, please re-open an issue if the recommended setup doesn't work for you.

from linux.

plbossart avatar plbossart commented on May 6, 2024 1

EDIT: from 86b1959 context it seems like 2ec8b081d59f5c39eb262f09ebc9e81178d222be is missing

Not really, it's a minor conflict that's trivial to solve. Use https://github.com/thesofproject/linux/tree/es8336-v5.19

from linux.

junocomp avatar junocomp commented on May 6, 2024 1

Is it possible to make a dkms module for es8336, instead of recompiling the kernel every time?

from linux.

dezo4 avatar dezo4 commented on May 6, 2024 1

For the record I was successfull with a build-in mic (the left one, the right one seems to be muted or not captured), not any external mic plugged in.

from linux.

junocomp avatar junocomp commented on May 6, 2024 1

@filt3rek If you are successful, you should create a git.

from linux.

plbossart avatar plbossart commented on May 6, 2024

That's a GLK device, which should be handled already.
soc/sof/intel/pci-apl.c: { PCI_DEVICE(0x8086, 0x3198), /* GeminiLake */

can you try using

speaker-test -Dhw:0:0 -c2 -r48000 (you can use -t sine as well)
and try to set the volume with alsamixer to set "DAC" to 100

also try with headphones to see if you see any difference.

from linux.

MisteryX avatar MisteryX commented on May 6, 2024

DAC have been already at 100%, still no sound

$ speaker-test -Dhw:0:0 -c2 -r48000

speaker-test 1.2.5.1

Playback device is hw:0:0
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 0:0
Playback open error: -19,No such device

from linux.

MisteryX avatar MisteryX commented on May 6, 2024

Headphones have already tested - no sound, only flutter.

from linux.

plbossart avatar plbossart commented on May 6, 2024

speaker-test -Dhw:0,0 -c2 -r48000 (comma, not . as show above).

This may be a case of the wrong I2S being used. we assumed it was SSP2 but it could very well be wrong. You could try with the recommendations made for CometLake devices using the same codec device
#3248

Trial and error it is until we figure out a way to detect what the hardware is (#3337)

from linux.

MisteryX avatar MisteryX commented on May 6, 2024

Tested
options snd-soc-sof-es8336 quirk=0x30 (with SSP0 topology)
options snd-soc-sof-es8336 quirk=0x31 (with SSP1 topology)
options snd-soc-sof-es8336 quirk=0x32 (with SSP2 topology)
And only SSP2 topology forces sound device creation, but unfortunately no sound output still

from linux.

plbossart avatar plbossart commented on May 6, 2024

can you install acpica-tools and attach the NHLT information (dump.bin.gz)

sudo acpidump > dump.bin
gzip dump.bin

from linux.

MisteryX avatar MisteryX commented on May 6, 2024

yep
dump.bin.gz

from linux.

plbossart avatar plbossart commented on May 6, 2024

this is good information @MisteryX, it looks like this device uses SSP0 instead of SSP2 for other GLK devices. There is no PDM DMIC listed.

nhlt.dsl.txt

so what you'd need to do is use this

options snd-soc-sof-es8336 quirk=0x00
or
options snd-soc-sof-es8336 quirk=0x10

explanations: SSP0, no DMIC, GLK or TGL quirks for the speaker GPIO.

Please try this topology file:
sof-glk-es8336-ssp0.tplg.gz copied as /lib/firmware/inte/sof-tplg/sof-glk-es8336.tplg

Also add this file
sof-dyndbg.conf.txt as /etc/modprobe.d/sof-dyndbg.conf

And attach full results of 'dmesg' and 'alsa-info'.

This is painful but it shouldn't be too hard to figure out.

from linux.

MisteryX avatar MisteryX commented on May 6, 2024

Done.
http://alsa-project.org/db/?f=fdc5c3d7123d8bbf731b38726122bb7c6bc1a44e

from linux.

plbossart avatar plbossart commented on May 6, 2024

@MisteryX so the logs show you have a card created, no dmic on capture.

There's something odd with this

[8.824265] sof-essx8336 sof-essx8336: quirk SSP2

that tells me the quirk override didn't work?

'modinfo snd_soc_sof_es8336' should show you the value, if it's -1 then the quirk override didn't work...

from linux.

MisteryX avatar MisteryX commented on May 6, 2024

$ sudo modinfo snd_soc_sof_es8336
filename: /lib/modules/5.15.0+/kernel/sound/soc/intel/boards/snd-soc-sof_es8336.ko
import_ns: SND_SOC_INTEL_HDA_DSP_COMMON
alias: platform:sof-essx8336
license: GPL
description: ASoC Intel(R) SOF + ES8336 Machine driver
srcversion: 24CBA85909871848940F804
depends: snd-soc-core,snd-soc-intel-hda-dsp-common,snd
retpoline: Y
intree: Y
name: snd_soc_sof_es8336
vermagic: 5.15.0+ SMP mod_unload modversions
sig_id: PKCS#7
signer: Build time autogenerated kernel key
sig_key: 44:A6:4A:08:80:04:1D:C2:31:45:2D:B9:A7:37:FF:71:2D:9B:95:13
sig_hashalgo: sha512
signature: 97:B0:ED:7A:63:C0:9E:15:2A:AB:9F:18:E0:5A:32:3E:A8:4C:0E:99:
5C:77:D4:0E:F0:45:F7:76:43:7B:AD:46:F5:45:E4:7B:C1:A2:20:C3:
14:6E:D3:CD:85:56:9F:E5:27:2B:0D:A1:6C:C7:AC:5D:28:8D:ED:5E:
CB:53:D3:9B:C1:BE:66:D9:70:3D:F4:C9:0E:AC:1E:43:4B:9C:6B:07:
2E:09:2A:2A:8E:80:0E:E5:56:AB:DE:CF:8C:DD:C2:3D:D8:77:50:CA:
2D:22:BD:6C:09:72:29:2D:0A:AC:76:DC:81:CB:E3:E3:B4:15:0B:8A:
E3:AD:C8:6F:CD:E9:3B:4D:48:E4:DC:03:09:06:BF:B0:B0:2D:EA:71:
D0:FA:58:DB:23:DB:65:71:2F:D8:27:A6:0D:55:5C:CF:69:26:D2:39:
BE:7F:C1:0F:39:55:EF:FA:FF:F4:08:92:E9:A6:57:CC:C5:CB:59:4F:
A3:4B:73:9C:DD:FB:AE:5A:0B:0A:6F:E2:D9:6B:4F:49:CC:CF:DC:1E:
9A:D9:BF:0E:0C:8E:62:66:5A:2D:BF:96:79:00:A3:AC:FC:60:92:D2:
08:34:6A:46:1E:99:08:75:BD:1B:DC:C1:4E:8D:AB:A2:45:CB:10:73:
C0:AF:DD:32:34:3A:4A:6B:3A:47:81:6A:D9:85:61:02:FE:C5:EC:F1:
12:C2:FA:FC:A1:7E:D9:9D:F3:9C:5C:40:3B:96:67:78:82:26:3F:A3:
3A:B8:77:6F:75:C7:9A:D7:A6:5C:6F:0A:5F:5B:9A:8F:8A:BA:85:F0:
21:45:40:FC:EC:9C:29:10:81:40:55:89:E0:56:36:2A:82:F6:76:3F:
FC:17:B4:24:AA:42:EE:44:B6:0D:88:48:25:1D:BD:95:9E:F5:A0:E3:
9C:F9:41:53:A9:62:60:0A:3D:B3:4E:AF:60:59:8B:8C:73:7E:04:33:
93:B1:10:68:EB:24:B6:DF:8B:B6:E2:F7:AE:57:8E:41:4A:18:15:E2:
7C:21:DE:1B:19:70:E0:95:37:6B:E2:B8:22:F6:83:51:90:D1:1E:66:
DE:8C:C6:D6:85:D2:33:FD:90:6B:9E:C3:ED:6E:61:F4:96:65:96:82:
7B:9C:63:65:A3:3E:A4:AD:C6:06:BC:39:B2:63:FC:74:CE:41:60:2A:
05:A9:9F:6D:65:78:43:F0:5B:29:E8:8F:1B:1B:2A:BC:EA:25:83:F7:
0E:3A:9F:C4:4F:EC:70:A0:25:2E:FC:E2:61:DB:F6:85:AD:E5:6F:71:
BE:83:91:B1:52:90:35:BE:9F:38:B5:49:1E:6D:D2:8E:08:3F:17:4A:
2D:5D:40:38:D3:BF:06:4A:0B:E7:38:B2
parm: quirk:Board-specific quirk override (int)

from linux.

plbossart avatar plbossart commented on May 6, 2024

parm: quirk:Board-specific quirk override (int)

value not shown...

does this command give more information?
cat /sys/module/snd_soc_sof_es8336/parameters/quirk

from linux.

MisteryX avatar MisteryX commented on May 6, 2024

$ cat /sys/module/snd_soc_sof_es8336/parameters/quirk
0

from linux.

plbossart avatar plbossart commented on May 6, 2024

@MisteryX then I really don't get how you got the log
[8.824265] sof-essx8336 sof-essx8336: quirk SSP2

static void log_quirks(struct device *dev)
{
	dev_info(dev, "quirk SSP%ld",  SOF_ES8336_SSP_CODEC(quirk));
}
	if (quirk_override != -1) {
		dev_info(dev, "Overriding quirk 0x%lx => 0x%x\n",
			 quirk, quirk_override);
		quirk = quirk_override;
	}
	log_quirks(dev);

so quirk cannot be zero...

from linux.

MisteryX avatar MisteryX commented on May 6, 2024

logs were dumped after setting - options snd-soc-sof-es8336 quirk=0x00
and reboot

from linux.

plbossart avatar plbossart commented on May 6, 2024

I am a bit lost here, not sure where I saw the quirk SSP2.

[    5.803179] sof-essx8336 sof-essx8336: Overriding quirk 0x2 => 0x0
[    5.803187] sof-essx8336 sof-essx8336: quirk SSP0

so with that you should have all the right connections setup. try playing with the alsa mixer settings, that's about all I can do remotely with blind debug.

from linux.

plbossart avatar plbossart commented on May 6, 2024

@MisteryX can you clarify if the following works

a) playback on speakers
b) playback on headphone (need something plugged in)
c) capture on internal mic
d) capture on headset mic (need something plugged in)

Also we cannot detect this quirk:
#define SOF_ES8336_TGL_GPIO_QUIRK BIT(4)

So can you share the results of 'sudo dmidecode' ? I'll add a quirk for your device. I'll have to think more about the automatic topology selection, so you'll have to keep overriding the topology file for now.

from linux.

MisteryX avatar MisteryX commented on May 6, 2024

a) playback on speakers - works
b) playback on headphone - works
c) capture on internal mic - works
d) capture on headset mic - not sure (may be it works only internal, because sound capture is very noisy)
dmidecode.log.gz

from linux.

plbossart avatar plbossart commented on May 6, 2024

Holy broccoli, there's not much information we can use...

System Information
	Manufacturer: Default string
	Product Name: Default string
	Version: Default string
	Serial Number: 8350S213360037
	UUID: 116b1ae6-aea5-11eb-8e6e-7f747ab86500
	Wake-up Type: Power Switch
	SKU Number: B1A1_A1
	Family: Default string

Base Board Information
	Manufacturer: Default string
	Product Name: Default string
	Version: Default string
	Serial Number: 8350S213360037
	Asset Tag: Default string
	Features:
		Board is a hosting board
		Board is replaceable
	Location In Chassis: Default string
	Chassis Handle: 0x0003
	Type: Motherboard
	Contained Object Handles: 0

SKU and serial number, that's super specific...

from linux.

plbossart avatar plbossart commented on May 6, 2024

@MisteryX can you try with this patch https://github.com/thesofproject/linux/commit/d4737003122fba16f34409cb91d8fb4dd53d72bd.patch and the quirk removed, that should detect your hardware.

The auto detection of the SSP will have to be done later.

from linux.

MisteryX avatar MisteryX commented on May 6, 2024

Patch had been tested on 5.16rc5 and /etc/modprobe.d/alsa-base.conf was removed, but after reboot no sound devices were available.

from linux.

plbossart avatar plbossart commented on May 6, 2024

@MisteryX wondering if the DMI matching works, can you e.g. try with just

  •   	DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
    

to see what happens? There should be a message telling you which quirk is used.

from linux.

MisteryX avatar MisteryX commented on May 6, 2024

Unfortunately can not test it. Notebook had been bought as NY present, and was presented already.

from linux.

RezinoviyDed avatar RezinoviyDed commented on May 6, 2024

Faced the same difficulties on Alldocube i1405 laptop (ES8336).
My ALSA information: http://alsa-project.org/db/?f=0ea691041f622a70564471f46ec8706839604e6a
sof-bin v2.0 is installed
I also see 0 in /sys/module/snd_soc_sof_es8336/parameters/quirk

@plbossart I can help you with testing.

from linux.

plbossart avatar plbossart commented on May 6, 2024

@RezinoviyDed your PCI ID 4dc8 points to a JasperLake device so different hardware. If you know how to install a kernel, please try with #3338 so that we can find if you have digital microphones and which I2S/SSP link is used for the ES8336 connection.

from linux.

sasongko26 avatar sasongko26 commented on May 6, 2024

I tried some quirk (0x00, 0x10, 0x20, 0x30, 0x31), but failed with error code -22. No sound works.
With quirk 0x32 or no quirk or no tricks on /etc/modprobe.d, soundcard detected but no sound

dmidecode.txt
dmesg.log
alsa-info.txt

.

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

My recently purchased Minisforum N40 mini-pc uses GeminiLake with ES8336. There is NO SOUND, but i can hear some random, spontaneous click sounds (a click every once in a while) via my speakers upon card initialization. The pc contains only one connector jack for headphone / headset / microphone / speakers.

I'm on Linux Debian Sid and compile my own custom kernel, using the latest:

$ uname -a
Linux brzoza 5.19.0-rc7-git-af2c9ac-Pogorze-Karpackie-CUSTOM-KERNEL #6 SMP PREEMPT_DYNAMIC Sat Jul 30 20:47:05 CEST 2022 x86_64 GNU/Linux

The card is recognized and there must be some basic fix to get the sound working. Seems so close, but what fix/patch/adjustment am I missing?

I tried:
options snd-soc-sof-es8336 quirk=0x00
options snd-soc-sof-es8336 quirk=0x10
options snd-soc-sof-es8336 quirk=0x30
options snd-soc-sof-es8336 quirk=0x40
options snd-soc-sof-es8336 quirk=0x50

... nothing enabled sound in the speakers.

I do notice in dmesg:

  • sof-essx8336 sof-essx8336: ASoC: Parent card not yet available, widget card binding deferred
  • es8316 i2c-ESSX8336:01: assuming static mclk

In /sys/bus/acpi/devices, there are two (2) ESSX8336 devices listed:
ESSX8336:00 (cat status = 0)
ESSX8336:01 (cat status = 15)

It must be noted:

  • When playing any video on YouTube via Google Chrome browser, the volume/sound bar in pavucontrol is actively moving, but there isn't any sound

  • In alsamixer, there are no "volume bars" for the speaker section (which is not muted)

I'm very willing to apply any required test patches you may have to the Linux Kernel and recompile it on the fly, and will report results on this thread immediately.

All relevant files are attached.

I appreciate any help, thank you very much!

Eugene

alsa_info.txt
dmesg_info.txt
lsmod_info.txt
lspci_info.txt
cml-dump.bin.gz
dmidecode_info.txt

from linux.

plbossart avatar plbossart commented on May 6, 2024

@ejmarkow Thanks for the report. You want to take a look at the latest documentation where I explained which quirks can be used. https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html#es8336-support

The difference in HID is handled by the kernel with this piece of code

	/* fixup codec name based on HID */
	adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1);
	if (adev) {
		snprintf(codec_name, sizeof(codec_name),
			 "i2c-%s", acpi_dev_name(adev));
		put_device(&adev->dev);
		dai_links[0].codecs->name = codec_name;

		/* also fixup codec dai name if relevant */
		if (!strncmp(mach->id, "ESSX8326", SND_ACPI_I2C_ID_LEN))
			dai_links[0].codecs->dai_name = "ES8326 HiFi";
	} else {
		dev_err(dev, "Error cannot find '%s' dev\n", mach->id);
		return -ENXIO;
	}

I would recommend you use our development kernel on topic/sof-dev, or Mark Brown's for-next branch, there are missing patches for this codec that will be in 5.20-rc1.

You should also enable dynamic debug to see what happens by copying this file
sof-dyndbg.conf.txt
as /etc/modprobe.d/sof-dyndbg.conf

Hope this helps!

from linux.

plbossart avatar plbossart commented on May 6, 2024

@ejmarkow use this file, forgot to include es8336.
sof-dyndbg.conf.txt

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

Thank you for your assistance @plbossart!

After I posted yesterday, I immediately went to Linux-Next to see if any patches were there that didn't make it into 5.19 and saw these (5) for sof_es8336.c:

ASoC: Intel: sof_es8336: remove hard-coded SSP selection ( commit 2491366 )
ASoC: Intel: sof_es8336: reset the num_links during probe ( commit fae93e3 )
ASoC: Intel: sof_es8336: add support for HDMI_In capture ( commit 86b1959 )
ASoC: Intel: sof_es8336: ignore GpioInt when looking for speaker/headset GPIO... ( commit 751e770 )
ASoC: Intel: sof_es8336: Fix GPIO quirks set via module option ( commit 5e60f1c )

I applied them, recompiled the 5.19 kernel, and the result wasn't positive: The es8336 card was not recognized at all (there was no card detected) and hence, no sound.

I'll have to enable dynamic debug in the kernel, recompile and then provide output results for both the 5.19 kernel as it stands (without the Linux-Next patches) and with them.

I'm very patient with all of this. Hopefully, it will be resolved.

from linux.

plbossart avatar plbossart commented on May 6, 2024

Thank you @ejmarkow, you're the ideal tester for us. I don't have any hardware so can only help by pointing to the documentation or possible issues.

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@plbossart, I now have the latest final 5.19 Linux Kernel compiled with Dynamic Debug enabled. Your /etc/modprobe.d parameters are included in the output.

The 5.19 final kernel is "as is", without any additional Linux-Next patches applied or module parameters (except for debug) passed.

  • es8336 is recognized & detected
  • NO SOUND from speakers except for random "clicks" every once in a while

$ uname -a
Linux brzoza 5.19.0-NP-Pogorze-Karpackie-CUSTOM-KERNEL #2 SMP PREEMPT_DYNAMIC Mon Aug 1 23:17:01 CEST 2022 x86_64 GNU/Linux

"NP" indicates "No Kernel Patches".

After this post, I will begin applying each of the 5 Linux-Next patches sequentially & cumulatively, from first to last, to catch which patch disables the es8336 card (issue mentioned earlier). When the patch is known, I will post about it with full info.

alsa-info.txt
cml-dump.bin.gz
dmesg_info.txt
dmidecode_info.txt
kernel_config_info.txt
lsmod_info.txt
lspci_info.txt

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@plbossart: Applied the first 3 commits / patches in sequential order, cumulative, and it is the 3rd commit (one or more of the several patches within it) which breaks / disables the sound card, not to be found.

Hence, I did not bother proceeding with the other two commits, unless you wish to see output from them.

Summary:

1 ) commit 5e60f1c - ASoC: Intel: sof_es8336: Fix GPIO quirks set via module option | RESULT - Card detected, no sound except for random clicking sounds on speakers

2 ) commit 751e770 - ASoC: Intel: sof_es8336: ignore GpioInt when looking for speaker/headset GPIO... | RESULT - Card detected, no sound except for random clicking sounds on speakers

3 ) commit 86b1959 - ASoC: Intel: sof_es8336: add support for HDMI_In capture | RESULT - NO CARD DETECTED, no sound or clicking at all

$ uname -a
Linux brzoza 5.19.0-P123-Pogorze-Karpackie-CUSTOM-KERNEL #5 SMP PREEMPT_DYNAMIC Tue Aug 2 15:00:39 CEST 2022 x86_64 GNU/Linux

Attached are relevant files containing Dynamic Debug information for this Linux Kernel 5.19 with all 3 mentioned commits / patches applied.

Please let me know how next to proceed, thanks.

alsa-info.txt
dmesg_info.txt
lsmod_info.txt

from linux.

plbossart avatar plbossart commented on May 6, 2024

Thanks @ejmarkow, the only thing that comes to my mind is the quirk change added in the 3rd patch

	if (pdev->id_entry && pdev->id_entry->driver_data)
 		quirk = (unsigned long)pdev->id_entry->driver_data;

can you try to comment out those two lines and see what happens?

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@plbossart, Yes, will do it now and post the result very soon.

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

Thanks @ejmarkow, the only thing that comes to my mind is the quirk change added in the 3rd patch

	if (pdev->id_entry && pdev->id_entry->driver_data)
 		quirk = (unsigned long)pdev->id_entry->driver_data;

can you try to comment out those two lines and see what happens?

Applied & recompiled the kernel, but it didn't help. Soundcard es8336 still not showing up.

Regarding the sof-apl-es8336-ssp5.tplg file, I saw that post several days ago, downloaded & extracted it into the following directory on my system:

/lib/firmware/intel/sof-tplg-v2.1.1/sof-apl-es8336-ssp5.tplg

Is that directory correct, or should it be /lib/firmware/intel ?

It looks good, because it is soft-linked:
lrwxrwxrwx 1 root root 15 Apr 25 04:04 sof-tplg -> sof-tplg-v2.1.1

from linux.

plbossart avatar plbossart commented on May 6, 2024

I don't know what happens @ejmarkow, I would add dev_info messages in sof_es8336 and see what goes wrong.

Regarding the location, it has to land in /lib/firmware/intel/sof-tplg. the kernel doesn't know anything about local symlinks.

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

IMO, at this point in time, the author of Linux Kernel Commit86b1959 "ASoC: Intel: sof_es8336: add support for HDMI_In capture" must review the code, and either adjust it or reverse the commit.

from linux.

plbossart avatar plbossart commented on May 6, 2024

it's not how things work unfortunately. The changes for HDMI input were on a different platform and the author has no way of testing on yours. It's likely a silly mistake somewhere, and someone needs to check what went wrong.

from linux.

plbossart avatar plbossart commented on May 6, 2024

one way to debug is to add 'options snd-soc-core dyndbg=+pmf', that should show you exactly why the card is not created. it'll be really verbose but hopefully contain error logs. Please attach the entire dmesg log.

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@plbossart, 'options snd-soc-core dyndbg=+pmf' added and dmesg log attached.

dmesg_info.txt

from linux.

plbossart avatar plbossart commented on May 6, 2024

@ejmarkow I still don't see anything that actually probes the machine driver. My guess is that the problematic commit changed the name of the driver somehow.

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@ejmarkow I still don't see anything that actually probes the machine driver. My guess is that the problematic commit changed the name of the driver somehow.

@plbossart, take a look at this line of the commit in question. Could this be it?

+ .name = "adl_es83x6_c1_h02",

S/B adl_es8336... (and not adl_es83x6...) ?

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

I just tested out that line by itself by changing the "x" to "3" and recompiling the kernel. Didn't work. Soundcard still not detected.

from linux.

plbossart avatar plbossart commented on May 6, 2024

@ejmarkow can you please re-test if the PR #3798 fixes the probe issue? It works for me with a remote test but it you can give it a try it'd be much appreciated.

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@plbossart Will apply the patch now, test it, and report result ASAP.

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@plbossart PR #3798 works, sof-essx8336 now detected and recognized!

Tested for audio on speakers, same as before, no audio, only the random 'clicking sound' every once in a while.

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@plbossart, OMG, I have beautiful sound 🎶 🎶 🎶 on my speakers, finally ! Unbelievable. You're brilliant, thank you so much! I only needed to use alsamixer to bring up some volume in the 'Headphone' sections.

Was there any possible way to initially pass a module parameter or quirk without using those .tplg files you provided?

Now I'm going to test out headphones and microphone.

from linux.

plbossart avatar plbossart commented on May 6, 2024

@ejmarkow I have a quick hack in #3798 to override the mclk_id with a kernel module parameter.

If you restore your previous setup, and add this in /etc/modprobe.d/alsa-base,conf this should do the same trick of switching from mclk0 to mclk1

options snd_sof_intel_hda_common mclk_id=1

I think I found a way to detect this directly, but I would need the ACPI tables to verify this. you will need acpica-tools installed on your device:

sudo acpidump > acpi.bin
gzip acpi.bin
```
and attach the result acpi.bin.gz

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

Excellent! Attached is the ACPI info file.

Meanwhile, I'll restore my previous .tplg setup, make the addition to modprobe.d and test.

Will post the result very soon!

acpi.bin.gz

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@plbossart, commit "537c5db ASoC: SOF: add quirk to override topology mclk_id" applied and Linux kernel recompiled.

Works like a charm, perfect!

$ uname -a
Linux brzoza 5.19.0-PATCHED-Pogorze-Karpackie-CUSTOM-KERNEL #6 SMP PREEMPT_DYNAMIC Thu Aug 4 20:26:31 CEST 2022 x86_64 GNU/Linux

I can't believe how quickly you produced the patches because earlier you said "I'll try to look into this in the coming days", and not "minutes"!

Thank you so much, this is great! When commits are merged, I'm going to post on the "Minisforum Mini-PC" website forum to let them know audio now works on this model with Linux very well, and will provide relevant info, procedures, kernel config file, and links for any users that eventually use this product with Linux.

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@plbossart, fabulous, looks like this will enable auto-detection for either MCLK1 or MCLK0 on sof-essx8336 without having to pass a module parameter!

from linux.

andreaconsole avatar andreaconsole commented on May 6, 2024

Sorry to interrupt the thread, but I have a question, if I can. Just to be sure that I did not misunderstand how it works: all of this is not applicable to laptops with AMD Ryzen processors, but only to Intel-powered systems, correct?

from linux.

plbossart avatar plbossart commented on May 6, 2024

Sorry to interrupt the thread, but I have a question, if I can. Just to be sure that I did not misunderstand how it works: all of this is not applicable to laptops with AMD Ryzen processors, but only to Intel-powered systems, correct?

Correct @andreaconsole.

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@ejmarkow I could use your help to re-check my latest changes.

a) re-install the latest topologies (now merged in SOF main branch) - make sure to remove all the mclk1 stuff es8336_topologies_main.tar.gz b) remove mclk_id kernel parameter from /etc/modprobe.d/alsa-base.conf c) install kernel based on PR #3798 (I forced-push, you need commit 013290a) d) reboot and attach the dmesg log. If you a MCLK mask of 0x2 this should work with sound on your speakers.

This PR #3798 may change a bit in the coming days to account for review comments and improvement suggestions, but that should be minor.

Thanks!

Will do and report on it.

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@plbossart, success, working nicely with sound and a MCLK mask of 0x2 detected from NHLT! 🎵 🙂

$ uname -a
Linux brzoza 5.19.0-PATCHED-Pogorze-Karpackie-CUSTOM-KERNEL #6 SMP PREEMPT_DYNAMIC Thu Aug 4 20:26:31 CEST 2022 x86_64 GNU/Linux

$ dmesg | grep -i mclk
[    6.313886] snd_sof_intel_hda_common:hda_machine_select: sof-audio-pci-intel-apl 0000:00:0e.0: MCLK mask 0x2 found in NHLT
[    6.315337] sof-audio-pci-intel-apl 0000:00:0e.0: Overriding topology with MCLK mask 0x2 from NHLT
[    6.586988] snd_sof:sof_link_ssp_load: sof-audio-pci-intel-apl 0000:00:0e.0: tplg: overriding topology mclk_id 0 by quirk 1
[    6.586991] snd_sof:sof_link_ssp_load: sof-audio-pci-intel-apl 0000:00:0e.0: tplg: config SSP2 fmt 0x4001 mclk 19200000 bclk 2400000 fclk 48000 width (24)25 slots 2 mclk id 1 quirks 0 clks_control 0x0
[    6.587023] snd_sof:sof_link_ssp_load: sof-audio-pci-intel-apl 0000:00:0e.0: tplg: overriding topology mclk_id 0 by quirk 1
[    6.587026] snd_sof:sof_link_ssp_load: sof-audio-pci-intel-apl 0000:00:0e.0: tplg: config SSP2 fmt 0x4001 mclk 19200000 bclk 2400000 fclk 48000 width (24)25 slots 2 mclk id 1 quirks 0 clks_control 0x0
[    6.992434] es8316 i2c-ESSX8336:01: assuming static mclk

Summary:

  • Latest topology files installed
  • mclk_id kernel parameter disabled in /etc/modprobe.d
  • Applied an additional two commits from Pull Request (PR) #3798 to this Linux Kernel
1) 502a706 ALSA: hda: intel-nhlt: add intel_nhlt_ssp_mclk_mask() 
2) 013290a ASoC: SOF: Intel: hda: override mclk_id after parsing NHLT SSP blob

Attached is the dmesg log file, dmesg_info.txt.

dmesg_info.txt

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

Here is a summary (so far) of all components for this Linux Kernel tested for sof-essx8336.

  • Linux Kernel 5.19.0 + [9 Applied Commits] + New Topology files:
1) Linux Kernel 5.19.0 [commit 3d7cb6b] from "Linux Kernel Source Tree" [kernel/git/torvalds/linux.git]

Plus: 5 commits applied from "Linux-Next Integration Testing Tree" [kernel/git/next/linux-next.git]

2)  5e60f1c ASoC: Intel: sof_es8336: Fix GPIO quirks set via module option
3)  751e770 ASoC: Intel: sof_es8336: ignore GpioInt when looking for speaker/headset GPIO lines
4)  86b1959 ASoC: Intel: sof_es8336: add support for HDMI_In capture
5)  fae93e3 ASoC: Intel: sof_es8336: reset the num_links during probe
6)  2491366 ASoC: Intel: sof_es8336: remove hard-coded SSP selection

Plus: 4 commits applied from Pull Request (PR) #3798:

7)  e667d83 ASoC: Intel: fix sof_es8336 probe 
8)  718959c ASoC: SOF: add quirk to override topology mclk_id 
9)  502a706 ALSA: hda: intel-nhlt: add intel_nhlt_ssp_mclk_mask() 
10) 013290a ASoC: SOF: Intel: hda: override mclk_id after parsing NHLT SSP blob

Plus: New topology files added in /lib/firmware/intel/sof-tplg (link below)

es8336_topologies_main.tar.gz

from linux.

dezo4 avatar dezo4 commented on May 6, 2024

Hello @plbossart, @ejmarkow
applying
4) 86b1959 ASoC: Intel: sof_es8336: add support for HDMI_In capture
results in a conflict for me, could you pls doublecheck? Thanks!

$ git cherry-pick 86b1959
Auto-merging sound/soc/intel/common/soc-acpi-intel-adl-match.c
CONFLICT (content): Merge conflict in sound/soc/intel/common/soc-acpi-intel-adl-match.c
error: could not apply 86b1959a2ccb... ASoC: Intel: sof_es8336: add support for HDMI_In capture
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

$ git diff
diff --cc sound/soc/intel/common/soc-acpi-intel-adl-match.c
index c1385161cdc8,9990d5502d26..000000000000
--- a/sound/soc/intel/common/soc-acpi-intel-adl-match.c
+++ b/sound/soc/intel/common/soc-acpi-intel-adl-match.c
@@@ -485,6 -525,21 +490,24 @@@ struct snd_soc_acpi_mach snd_soc_acpi_i
                .drv_name = "adl_cs35l41",
                .sof_tplg_filename = "sof-adl-cs35l41.tplg",
        },
++<<<<<<< HEAD
++=======
+       {
+               .comp_ids = &essx_83x6,
+               .drv_name = "adl_es83x6_c1_h02",
+               .machine_quirk = snd_soc_acpi_codec_list,
+               .quirk_data = &adl_lt6911_hdmi,
+               .sof_tplg_filename = "sof-adl-es83x6-ssp1-hdmi-ssp02.tplg",
+       },
+       {
+               .comp_ids = &essx_83x6,
+               .drv_name = "sof-essx8336",
+               .sof_tplg_filename = "sof-adl-es83x6", /* the tplg suffix is added at run time */
+               .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |
+                                       SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
+                                       SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
+       },
++>>>>>>> 86b1959a2ccb (ASoC: Intel: sof_es8336: add support for HDMI_In capture)
        {},
  };
  EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_adl_machines);

EDIT: from 86b1959 context it seems like 2ec8b081d59f5c39eb262f09ebc9e81178d222be is missing

from linux.

dezo4 avatar dezo4 commented on May 6, 2024

@plbossart

  CC [M]  sound/soc/intel/common/soc-acpi-intel-hda-match.o
sound/soc/intel/common/soc-acpi-intel-adl-match.c:494:30: error: ‘essx_83x6’ undeclared here (not in a function)
  494 |                 .comp_ids = &essx_83x6,
      |                              ^~~~~~~~~
make[7]: *** [scripts/Makefile.build:249: sound/soc/intel/common/soc-acpi-intel-adl-match.o] Error 1

This is what 2ec8b081d59f5c39eb262f09ebc9e81178d222be added

from linux.

junocomp avatar junocomp commented on May 6, 2024

@plbossart do you have a deb linux-image package for this https://github.com/thesofproject/linux/tree/es8336-v5.19? I would like to test it on Debian.

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@junocomp @plbossart: Just FYI, I've been testing this the entire time on Debian Sid (aka Unstable) with a custom kernel config and it works well, however, I did not build a ready to install .deb package for it. When I compile the kernel from source, I install the modules separately (make modules_install) into /lib/modules, with the "config, initrd.img, System.map, vmlinuz" files going into /boot.

$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux bookworm/sid"
NAME="Debian GNU/Linux"
ID=debian

The default kernel config file which comes with the Debian install does not have all of the required modules enabled and thus I had to cherry pick all of the modules myself. The same for the Ubuntu install, its default config does not have the required modules enabled. The only Linux distribution I've tested that has the appropriate kernel config is Fedora Rawhide.

Attached is my config if you would like to see it:

kernel_config.txt

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@dezo4 @plbossart

I see what happened.

When I initially tested the patches in Linux-Next I only applied the 5 commits (which I listed in my original post #3336 (comment)) attributed to sound/soc/intel/boards/sof_es8336.c thinking these were the only commits affecting es8336 in Linux-Next.

The 2 commits in Linux-Next for sound/soc/intel/common/soc-acpi-intel-adl-match.c were never applied and probably explains why ess8336 was not recognized in my test to begin with. So, it appears it is my bad for omitting the latter two patches.

My sincere apologies.

Thank you for bringing this to light.

from linux.

dezo4 avatar dezo4 commented on May 6, 2024

@ejmarkow No trouble, I'm happy it works now :)

@junocomp I have an amd64 deb, I can put it somewhere if you want

from linux.

junocomp avatar junocomp commented on May 6, 2024

@dezo4 I would love if you can share your deb image kernel. Is the microphone detected?

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@dezo4 I would love if you can share your deb image kernel. Is the microphone detected?

Even though sound via speakers is working fine, microphone is still not detected and not working when plugged in. Good you asked.

Attached is my:

(A) kernel config file (kernel_config.txt)
(B) kernel image file, compressed (vmlinuz_5.19.gz)

Before you use the kernel image file:

  1. Compare your kernel config file with mine to see if you are missing anything using:
    $ diff -y --suppress-common-lines yourconfig myconfig

  2. After you compile your kernel and create your kernel image file, you must run:
    # dracut -f (to create a new initrd file if using dracut)

kernel_config.txt
vmlinuz_5.19.gz

from linux.

junocomp avatar junocomp commented on May 6, 2024

@ejmarkow mmmm.. I thought you had the mic working. In that case you have the same kernel that I do. I have a deb one that I made a bit ago.

https://github.com/junocomp/linux-chuwi-hi10-go/tree/main/kernel

Has sof managed to get the mic working for es8336?

from linux.

dezo4 avatar dezo4 commented on May 6, 2024

@junocomp http://stuff.pitris.info/linux-image-5.19.0-custom_5.19.0-custom-3_amd64.deb is the kernel I use

Mic is working for me (not in all apps - but that's probably a different issue), with MS Teams it works ok. More here: #3447 (comment)

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@junocomp @dezo4

I made some progress with my microphone (dmic) being detected when using the following in /etc/modprobe.d :

options snd_sof_intel_hda_common dmic_num=4

From dmesg:

$ dmesg | grep -i dmic [ 6.918685] sof-essx8336 sof-essx8336: quirk DMIC enabled

Alsamixer now shows Dmic0 & Dmic1 (4 columns), but still unable to get it working. I must be very close though, just missing something.

2022-08-16-114833_1920x1080_scrot

from linux.

plbossart avatar plbossart commented on May 6, 2024

@ejmarkow that sounds very suspicious. The local microphones can be either connected to the ES8336 codec or to the PCH. These are completely different IP and layouts. If you force the use of digital microphones, you will see a number of controls but if they are not connected you will never hear anything captured....

from linux.

plbossart avatar plbossart commented on May 6, 2024

@ejmarkow in an earlier post, the logs for your device were

[    6.309870] snd_intel_dspcfg:intel_nhlt_get_dmic_geo: sof-audio-pci-intel-apl 0000:00:0e.0: dmic number 0 max_ch 0

That is a very strong hint that you don't have any microphones connected to the PCH.

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@plbossart I currently have my microphone plugged into the input jack. When my speakers are plugged in, sound works fine, no problem there.

I disabled options snd_sof_intel_hda_common dmic_num=4.

Kernel with dynamic_debug:

$ dmesg | grep -i nhlt
[    0.015932] ACPI: NHLT 0x00000000795CC000 00053E (v00 ALASKA A M I    01072009 AMI  01000013)
[    0.016048] ACPI: Reserving NHLT table memory at [mem 0x795cc000-0x795cc53d]
[    6.666825] snd_intel_dspcfg:intel_nhlt_get_dmic_geo: sof-audio-pci-intel-apl 0000:00:0e.0: dmic number 0 max_ch 0
[    6.668113] sof-audio-pci-intel-apl 0000:00:0e.0: NHLT_DEVICE_I2S detected, ssp_mask 0x5
[    6.672928] snd_sof_intel_hda_common:hda_machine_select: sof-audio-pci-intel-apl 0000:00:0e.0: MCLK mask 0x2 found in NHLT
[    6.672933] sof-audio-pci-intel-apl 0000:00:0e.0: Overriding topology with MCLK mask 0x2 from NHLT

Screenshot of pavucontrol attached.

2022-08-16-122502_1920x1080_scrot

from linux.

plbossart avatar plbossart commented on May 6, 2024

@ejmarkow what do you mean by "When my speakers are plugged in"

Do you have local speakers or a line-out with additional speakers connected?

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@plbossart There is only one input area on this mini pc for microphone/speakers/headphone set and I'm not using a splitter or headphone set. Currently, I'm testing it with a separate, stand-alone microphone (that's one jack). Speakers are also separate (a separate jack). I must unplug one to use the other.

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

My mini pc has no built-in microphone or built-in speaker or separate line-out. Audio in/out must be external, and using only one input area which serves a dual purpose (for both input and output).

For this separate, stand-alone microphone (audio input) which is currently plugged in, it is showing up on pavucontrol (see previous graphic) as Headset Microphone (unplugged), but I'm not using a headset.

If I unplug the microphone and then plug in the jack for speakers, sound (audio output) works fine.

from linux.

junocomp avatar junocomp commented on May 6, 2024

@dezo4 I tried your kernel and is just as good as mine. I get the same result.

It won't detect the tablet's mic but it will once I plug in headphones with mic intergrated it.

I even tested with options snd_sof_intel_hda_common dmic_num=4 but it still doesnt find the internal mic.

How can I identify my tablet's mic?

from linux.

plbossart avatar plbossart commented on May 6, 2024

For this separate, stand-alone microphone (audio input) which is currently plugged in, it is showing up on pavucontrol (see previous graphic) as Headset Microphone (unplugged), but I'm not using a headset.

ok, I am not sure if the ES8336 supports this configuration, you may have to tell the codec to use a line-in configuration. @yangxiaohua2009 can you help?

from linux.

yangxiaohua2009 avatar yangxiaohua2009 commented on May 6, 2024

It's a box PC like this. Since ES8336 reads flag for configuration, a line-in configuration may ruins normal 4 pole config.
9c6c4c303da6c13e9cf6475326e941b

from linux.

yangxiaohua2009 avatar yangxiaohua2009 commented on May 6, 2024

@ejmarkow
Please enable dyndbg so you can read dbg info from 8316.c.
You may need to replace the code in static irqreturn_t es8316_irq(int irq, void *data)

replace the code behind
dev_dbg(comp->dev,"%s, gpio flags %#04x\n", __func__, flags);

with

    `dev_dbg(comp->dev,"%s, gpio flags %#04x\n", __func__, flags);
    es8316_enable_micbias_for_mic_gnd_short_detect(comp); /* always enable mic bias*/
snd_soc_component_write(comp, ES8316_ADC_PDN_LINSEL, 0x30); /* or 20 */
snd_soc_component_write(comp, 0x25, 0x08); /* disable dmic */
if(0x20==flags)
{
	dev_dbg(comp->dev,"%s, unplug detected!\n", __func__);
	if ((es8316->jack->status & SND_JACK_HEADPHONE)) 
		snd_soc_jack_report(es8316->jack, 0,
				    SND_JACK_HEADSET );
}else if(0x22==flags){
	dev_dbg(comp->dev,"%s, SND_JACK_MICROPHONE!\n", __func__);
	snd_soc_jack_report(es8316->jack, SND_JACK_MICROPHONE,
				    SND_JACK_HEADSET );
}else if(0x24==flags){
	dev_dbg(comp->dev,"%s, SND_JACK_HEADPHONE!\n", __func__);
	snd_soc_jack_report(es8316->jack, SND_JACK_HEADPHONE,
				    SND_JACK_HEADSET );
}else if(0x26==flags){
	dev_dbg(comp->dev,"%s, SND_JACK_HEADSET!\n", __func__);
	snd_soc_jack_report(es8316->jack, SND_JACK_HEADSET,
				    SND_JACK_HEADSET );
}`

Basically you need to open the termial, type dmesg -wH. Then plug in either speaker or mic or both and read the flag.
Now modify 8316.c to report the correct jack control to the system. SND_JACK_MICROPHONE for mic, SND_JACK_HEADPHONE for speaker, SND_JACK_HEADSET for both and 0 for neither.

from linux.

yangxiaohua2009 avatar yangxiaohua2009 commented on May 6, 2024

@dezo4 I tried your kernel and is just as good as mine. I get the same result.

It won't detect the tablet's mic but it will once I plug in headphones with mic intergrated it.

I even tested with options snd_sof_intel_hda_common dmic_num=4 but it still doesnt find the internal mic.

How can I identify my tablet's mic?

If there is no dmic in NHLT/UEFI, forcing enable won't help. First enable Headset Mic and Interal Mic by
amixer sset 'Headset Mic' on and amixer sset 'Internal Mic' on, then switch between
amixer sset ‘Differential Mux' 'lin1-rin1' and amixer sset ‘Differential Mux' 'lin2-rin2'
If you still can't get internal mic work, dump your UEFI by acpixtract and let's see what you get

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

It's a box PC like this. Since ES8336 reads flag for configuration, a line-in configuration may ruins normal 4 pole config.

@yangxiaohua2009 That's not the board I have. Mine has only one (1) "Headphone/Headset/Microphone jack", and no other out-line or in-line. Your photo shows two (2) jacks. My pc is the "Minisforum N40"

In the attached photo, yellow circle where it reads "Headphone" denotes the only jack on my pc.

I'll follow your instruction and report soon. Thank you.

screenshot-i shgcdn com-2022 08 17-10_51_42

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@yangxiaohua2009 Photo of the actual N40 board.

screenshot-i shgcdn com-2022 08 17-11_21_48

from linux.

filt3rek avatar filt3rek commented on May 6, 2024

Hej all !

I wonder like @junocomp if Is it possible to make a dkms module for es8336, instead of recompiling the kernel every time please, it would be very useful...

from linux.

junocomp avatar junocomp commented on May 6, 2024

@filt3rek I tried to make one but was not successful.

I used this for reference

https://jksinton.com/linux/building-a-linux-kernel-driver-on-ubuntu-using-dkms/

from linux.

filt3rek avatar filt3rek commented on May 6, 2024

Thanks for your answer @junocomp !
I'll give it a try but I'm not an expert.
If anybody can advice us it will be cool.
Thanks !

from linux.

junocomp avatar junocomp commented on May 6, 2024

@yangxiaohua2009 sorry for the late reply. I tried what you suggested and still can't get the mic to be detected.

Here's my ACPI dump

https://file.io/4d6MsVXSGY3v

from linux.

ejmarkow avatar ejmarkow commented on May 6, 2024

@yangxiaohua2009 When running "dmesg -wH" & simultaneously plugging / unplugging the mic and then the speaker jacks with Dynamic Debug activated for the file es8316.c [ # echo "file sound/soc/codecs/es8316.c +p" > /sys/kernel/debug/dynamic_debug/control ], there is no real-time response at all, with no output for any flags & no effect.

For the file es8316.c, I tested this with both the current code (A) unmodified and then (B) modified as per your instructions, recompiling the kernel.

Everything for Dynamic Debug is enabled correctly. Why aren't any real-time flags (or response for that matter) displayed when "dmesg -wH" is active while plugging / unplugging the mic and speakers?

# cat .config | grep -i dynamic_debug
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DYNAMIC_DEBUG_CORE=y

# mount | grep -i debug
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)

# cat /proc/sys/kernel/printk
8	4	1	7

When I cat the current status of Dynamic Debug for es8316.c with code unmodified for both mic & speakers:

# cat /sys/kernel/debug/dynamic_debug/control | grep -i 8316
sound/soc/codecs/es8316.c:608 [snd_soc_es8316]es8316_irq =p "gpio flags %#04x\012"
sound/soc/codecs/es8316.c:600 [snd_soc_es8316]es8316_irq =p "jack unplugged\012"
sound/soc/codecs/es8316.c:591 [snd_soc_es8316]es8316_irq =p "gpio flags %#04x\012"

When I cat the current status of Dynamic Debug for es8316.c with code modified and kernel recompiled for both mic & speakers:

# cat /sys/kernel/debug/dynamic_debug/control | grep -i 8316
sound/soc/codecs/es8316.c:612 [snd_soc_es8316]es8316_irq =p "%s, SND_JACK_HEADSET!\012"
sound/soc/codecs/es8316.c:608 [snd_soc_es8316]es8316_irq =p "%s, SND_JACK_HEADPHONE!\012"
sound/soc/codecs/es8316.c:604 [snd_soc_es8316]es8316_irq =p "%s, SND_JACK_MICROPHONE!\012"
sound/soc/codecs/es8316.c:599 [snd_soc_es8316]es8316_irq =p "%s, unplug detected!\012"
sound/soc/codecs/es8316.c:591 [snd_soc_es8316]es8316_irq =p "gpio flags %#04x\012"

You wrote: ❝Now modify 8316.c to report the correct jack control to the system.❞

If I had a "real-time" flag (value) response with dmesg -wH enabled (which was not the case), where in the code for es8316.c would I replace the value?

from linux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.