Closed yurisuki closed 2 years ago
┌───────────────────────────────────────────────────────────────────────────────────── AlsaMixer v1.2.6 ──────────────────────────────────────────────────────────────────────────────────────┐
│ Card: sof-essx8336 F1: Help │
│ Chip: Intel Geminilake HDMI F2: System information │
│ View: F3:[Playback] F4: Capture F5: All F6: Select sound card │
│ Item: Headphone [dB gain: -48.00, -48.00] Esc: Exit │
│ │
│ │
│ │
│ │
│ │
│ │
│ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ │
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ →
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ →
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ →
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ →
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ →
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ →
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ →
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ →
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ →
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ →
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ →
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ ├──┤ └──┘ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ L + R In Invert ┌──┐ └──┘ ┌──┐ └──┘ └──┘ └──┘ └──┘ └──┘ ┌──┐ └──┘ Mute ADC │
│ │MM│ │OO│ │OO│ │MM│ │OO│ │OO│ │OO│ │OO│ │OO│ │
│ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ │
│ 0<>0 100<>100 100 100 100 100 100 100 100 │
│ <Headphon>Headphon Speaker Mic Boos S/PDIF S/PDIF 1 S/PDIF 2 Playback Capture ADC Doub ADC PGA ADC Soft ALC Capt ALC Capt ALC Capt ALC Capt ALC Capt ALC Capt ALC Capt ALC Capt │
│ │
│ │
│ │
│ │
│ │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Tried all quirks, that were mentioned in other issues, and nothing helped. Tried all topologies and it doesn't help either.
quirks 0x12 and 0x32 make crackling noises
may i get some ssp2 topology please? 0x32 makes the most noise when playing through headphones, still doesn't detect my speakers though.
we've already provided an update in PR #3338 where you don't need to play with SSP and DMIC quirks. the only thing that you may need to play with is the GPIO quirk.
I don't really understand what these words mean. I'm just gonna wait for upstream release, although thank you for your support! If there's anything I could help you with, hit me up in this thread.
Hi, I have exactly the same machine, but running a newer kernel 5.19.0-rc6-amd64 with firmware firmware-sof-signed 2.1.1-1. I have absolutely no sound at all. My alsainfo is http://alsa-project.org/db/?f=07e366a015bc61623916da57a19743aaf07e018c
I'm not sure which sof modules version is in this kernel:
$ lsmod | awk '{print $1}' | grep sof_ | xargs /sbin/modinfo | grep -i '\<name\|version'
name: snd_sof_probes
vermagic: 5.19.0-rc6-amd64 SMP preempt mod_unload modversions
name: snd_sof_pci_intel_apl
vermagic: 5.19.0-rc6-amd64 SMP preempt mod_unload modversions
name: snd_sof_intel_hda_common
vermagic: 5.19.0-rc6-amd64 SMP preempt mod_unload modversions
name: snd_sof_intel_hda
vermagic: 5.19.0-rc6-amd64 SMP preempt mod_unload modversions
name: snd_sof_pci
vermagic: 5.19.0-rc6-amd64 SMP preempt mod_unload modversions
name: snd_sof_xtensa_dsp
vermagic: 5.19.0-rc6-amd64 SMP preempt mod_unload modversions
name: snd_sof_utils
vermagic: 5.19.0-rc6-amd64 SMP preempt mod_unload modversions
Should I tune something in BIOS? Or anything else?
Tunable BIOS stuff:
@plbossart Hello, this thread is half a year old and seems to be forgotten, but it exactly matches my laptop so I didn't want to create another one for the same machine. Could you please have a look what is wrong in my case? Thanks!
@dezo4 Unfortunately we have a regression in 5.19, tentative fix is here https://github.com/thesofproject/linux/pull/3798
Recommended setup is described here: https://github.com/thesofproject/linux/issues/3336#issuecomment-1207200602
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.
Hi @plbossart, I followed the recommendations but still no soundcard detected. Could you pls check? Thanks! dmesg.txt
@dezo4 you're missing patches, clearly this is the same issue fixed by https://github.com/thesofproject/linux/pull/3798
@plbossart
OK, I must be missing something... (newbie in kernel compilation)
I compiled your branch es8336-v5.19
make -j8 bindeb-pkg LOCALVERSION=-custom
transfered linux-image-5.19.0-custom_5.19.0-custom-2_amd64.deb
to the target machine
installed dpkg -i linux-image-5.19.0-custom_5.19.0-custom-2_amd64.deb
copied the new topologies
rebooted to the new kernel
but dmesg still looks the same
What am I missing?
dmesg2.txt
@dezo4 you are using the new kernel if I look at
[ 7.664110] sof-audio-pci-intel-apl 0000:00:0e.0: NHLT_DEVICE_I2S detected, ssp_mask 0x1
[ 7.664116] snd_sof_intel_hda_common:hda_machine_select: sof-audio-pci-intel-apl 0000:00:0e.0: MCLK mask 0x2 found in NHLT
[ 7.664118] sof-audio-pci-intel-apl 0000:00:0e.0: Overriding topology with MCLK mask 0x2 from NHLT
That's only available in the branch. But somehow you haven't probed the machine driver. Did you enable that machine driver in the config? You need
CONFIG_SND_SOC_INTEL_SOF_ES8336_MACH=m CONFIG_SND_SOC_ES8316=m
Wooohooo! That was it! Soundcard detected and playing! Thank you very much! :+1:
**** List of PLAYBACK Hardware Devices ****
card 0: sofessx8336 [sof-essx8336], device 0: ES8336 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: sofessx8336 [sof-essx8336], device 5: HDMI 1 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: sofessx8336 [sof-essx8336], device 6: HDMI 2 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: sofessx8336 [sof-essx8336], device 7: HDMI 3 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
Now I'm gonna test headphones and mic.
Hello @plbossart I'm not sure if something can be done about it but at least a report: Seems like I have 2 sliders for volume, "Headphone" and "Headphone Mixer", both controlling speakers volume. The first one "harder", the second one "softer". If I connect headphones, the first's volume goes down a little and mutes when headphones are disconnected. Best show in video. https://user-images.githubusercontent.com/110043557/183877605-7d5b3f1c-abdf-4925-a379-8fd2284230ab.mp4
Input: I haven't managed to record any audio so far. In the volume control the indicator is moving as I speak, so it is capturing something. But I wasn't successful in recording, audacity records silence and firefox and chromium seem to use the "Monitor" instead of actual microphone (still don't know how to force another device). Also this machine has two mics, the left one seems to be captured (I can see the indicator moving in volume control), the right one looks like not used (no indicator moving if i knock).
The port also shows "Headset mic" even if it is obviously capturing the internal mic.
@dezo4 I can't help you with userspace settings. There was an UCM file contributed to https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/Intel/sof-essx8336/sof-essx8336.conf but I have no idea if it works or not - I don't have a device to test.
You should first try to see if the jack detection works. There should be a 'Jack' mixer that changes status when you plug/unplug the headphone/headset. If that doesn't work there's no point in trying to do more since it'll wreck all the setup.
use 'amixer -Dhw:0 controls | grep Jack' to get the list and then 'amixer -Dhw:0 numid=
@plbossart
$ amixer -Dhw:0 controls | grep Jack
numid=33,iface=CARD,name='HDMI/DP,pcm=5 Jack'
numid=39,iface=CARD,name='HDMI/DP,pcm=6 Jack'
numid=45,iface=CARD,name='HDMI/DP,pcm=7 Jack'
numid=27,iface=CARD,name='Headphone Jack'
numid=28,iface=CARD,name='Headset Mic Jack'
Plugged in:
$ amixer -Dhw:0 cget numid=27
numid=27,iface=CARD,name='Headphone Jack'
; type=BOOLEAN,access=r-------,values=1
: values=on
Unplugged:
$ amixer -Dhw:0 cget numid=27
numid=27,iface=CARD,name='Headphone Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off
@dezo4 I think you'll have to experiment with the quirks suggested in https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html#es8336-support
specifically this quirk is likely to impact jack detection:
it's a real hassle since there's no documentation and no way to discover how the hardware is wired, so you may have to experiment by trial and error - there's not even a guarantee that the existing quirks will cover your setup :-(
@plbossart > no way to discover how the hardware is wired
I noticed DSDT ACPI table contains _DSM method (think its UUID is a9800c04-e016-343e-f441-6bcce70f4332). Pretty sure it contains this information and the Windows ES8336 drivers are using it. Maybe Everest can be persuaded to reveal its layout?
Is that DSM method in the scope of the ES8336 device @tea? If yes, can you attach the DSDT? Thanks!
Sure it is. See attached. dsdt.txt Not even restricted to ES8336; here is an example for ES8316
Thanks @tea I also see this in other devices.
@yangxiaohua2009 would you happen to know what this _DSM method does and if it can be used by drivers to figure out what the hardware layout is? Thanks!
@plbossart Yes I have the definition. If you know how to read hardware info from DSM then the misery life of guessing hardware configuration can come to an end. ESSX8326.zip
Thanks @yangxiaohua2009 this looks very promising.
It's my understanding that all these definitions are 'functions' that can be queried, e.g.
#define PLATFORM_MAINMIC_TYPE 0x00
#define PLATFORM_HPMIC_TYPE 0x01
#define PLATFORM_SPK_TYPE 0x02
#define PLATFORM_HPDET_INV 0x03
#define PLATFORM_MIC_DE_POP 0x06
we could use something like
static const guid_t es8336_dsm_guid =
GUID_INIT(0xc7033113, 0x8720, 0x4ceb,
0x90, 0x90, 0x9d, 0x52, 0xb3, 0xe5, 0x2d, 0x73);
#define ES8336_DSM_REVID 1
obj = acpi_evaluate_dsm(handle, &es8336_dsm_guid,
ES8336_DSM_REVID,
PLATFORM_HPDET_INV, NULL);
and use obj->integer.value to set the inverted jack detection quirk.
I am not sure though about most of the details you provided, the values are defined for ES8326 and ES8396, I am not sure what to make of the information. For volumes it looks like most of the information could be used to set the regmap values?
This looks really promising again but I am missing too many details.
The definition is the same for ES8336/8326/8396. Only the first few values about hardware configuration are meaningful for linux. I will try to get the _dsm from my side first. Thanks. @plbossart
Guys no idea what this means but I can test whatever you have for a test :)
Hello, one more question @plbossart On my other laptop I can nicely switch output to HDMI via gui: But I cannot do the same on es8336: Is it a driver problem?
I can however play to HDMI with mplayer -ao alsa:device=plughw=0.5
Thanks
This is a userspace problem, HDMI and ES8336 handling are independent at the hardware level and in firmware they are treated as different pipelines. The fact that you can play at the ALSA level show the problem is at a higher level.
@plbossart Thank you. Any idea where should I look and dig? Can it be related to pulseaudio?
@dezo4 You need a ucm. ucm.zip Or https://github.com/alsa-project/alsa-ucm-conf/tree/master/ucm2/Intel/sof-essx8336
Ucm lies in /usr/share/alsa/ucm or /usr/share/alsa/ucm2.
After modifying the ucm files, try alsaucm reload
and pulseaudio -k
to make the change work.
@yangxiaohua2009 Any hints what/which files I should modify? Looks quite complicated. Thanks
$ alsaucm dump text
Verb.HiFi {
Comment "Play and record HiFi quality Music"
Device.Speaker {
Comment Speakers
ConflictingDevices [
Headphones
]
Values {
CaptureCTL "_ucm0001.hw:sofessx8336"
PlaybackCTL "_ucm0001.hw:sofessx8336"
PlaybackMasterElem DAC
PlaybackMixerElem "Headphone Mixer"
PlaybackPCM "_ucm0001.hw:sofessx8336"
PlaybackPriority 100
}
}
Device.Headphones {
Comment Headphones
ConflictingDevices [
Speaker
]
Values {
CaptureCTL "_ucm0001.hw:sofessx8336"
JackControl "Headphone Jack"
JackHWMute Speaker
PlaybackCTL "_ucm0001.hw:sofessx8336"
PlaybackMasterElem DAC
PlaybackMixerElem "Headphone Mixer"
PlaybackPCM "_ucm0001.hw:sofessx8336"
PlaybackPriority 300
}
}
Device.Headset {
Comment "Headset Microphone"
ConflictingDevices [
Mic
]
Values {
CaptureCTL "_ucm0001.hw:sofessx8336"
CaptureMasterElem ADC
CaptureMixerElem "ADC PGA Gain"
CapturePCM "_ucm0001.hw:sofessx8336"
CapturePriority 300
JackControl "Headset Mic Jack"
PlaybackCTL "_ucm0001.hw:sofessx8336"
}
}
Device.HDMI1 {
Comment "HDMI / DisplayPort 1 Output"
Values {
CaptureCTL "_ucm0001.hw:sofessx8336"
JackControl "HDMI/DP,pcm=5 Jack"
PlaybackCTL "_ucm0001.hw:sofessx8336"
PlaybackPCM "_ucm0001.hw:sofessx8336,5"
PlaybackPriority 500
}
}
Device.HDMI2 {
Comment "HDMI / DisplayPort 2 Output"
Values {
CaptureCTL "_ucm0001.hw:sofessx8336"
JackControl "HDMI/DP,pcm=6 Jack"
PlaybackCTL "_ucm0001.hw:sofessx8336"
PlaybackPCM "_ucm0001.hw:sofessx8336,6"
PlaybackPriority 600
}
}
Device.HDMI3 {
Comment "HDMI / DisplayPort 3 Output"
Values {
CaptureCTL "_ucm0001.hw:sofessx8336"
JackControl "HDMI/DP,pcm=7 Jack"
PlaybackCTL "_ucm0001.hw:sofessx8336"
PlaybackPCM "_ucm0001.hw:sofessx8336,7"
PlaybackPriority 700
}
}
Device.Mic {
Comment "Analog Microphone"
ConflictingDevices [
Headset
]
Values {
CaptureCTL "_ucm0001.hw:sofessx8336"
CaptureMasterElem ADC
CaptureMixerElem "ADC PGA Gain"
CapturePCM "_ucm0001.hw:sofessx8336"
CapturePriority 100
PlaybackCTL "_ucm0001.hw:sofessx8336"
}
}
@dezo4 The script in ucm.zip should automaticaly copy the ucm files. I can see all the devices, maybe you can use pavucontrol to set the output device?
@yangxiaohua2009 unfornunatelly I cannot
Thanks @yangxiaohua2009 it helped! Although this file is already present in debian's alsa-ucm-conf 1.2.7.2-1 so I'll try to merge those two. Btw any idea why there's 3 HDMI devices when there's only 1 HDMI out?
**** List of PLAYBACK Hardware Devices ****
card 0: sofessx8336 [sof-essx8336], device 0: ES8336 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: sofessx8336 [sof-essx8336], device 5: HDMI 1 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: sofessx8336 [sof-essx8336], device 6: HDMI 2 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: sofessx8336 [sof-essx8336], device 7: HDMI 3 (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
@plbossart I can see your patches from es8336-v5.19 are already merged in linux/master but if I boot debian's 6.0.0-2-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.0.5-1 (2022-10-28) x86_64 GNU/Linux I still get no sound...
$ aplay -l
aplay: device_list:275: no soundcards found...
Any idea? Thanks
I recompiled with CONFIG_SND_SOC_INTEL_SOF_ES8336_MACH=m, that helped. Now I see the card as usual but no sound at all, just a scratch at the end of a playback. Nothing is muted in alsamixer. dmesg.txt.gz
@dezo4 please provide your amixer settings or alsainfo. If the playback device changes when you plug/unplug the jack then you are lucky, changing the amixer kcontrol settings should give you sound.
@yangxiaohua2009 Thanks, I'll upload the alsainfo as soon as I get to the machine.
To summarize:
well d'uh, 6.0.0 does not have all the patches required, see https://github.com/thesofproject/linux/wiki/ES8336-support#60-support
@plbossart Useful page, thanks! So I just have to wait for all the pataches to get to master.
Default debian's 6.1.0-1 with sound! Awesome!
Hello, I'm another person to have this issue.
I'm hopeless. I'm using Arch Linux.