Closed playXE closed 2 years ago
If you're hearing something at the speaker, it probably means that the speaker's amplifier is energized - which is kinda weird as it should be turning it on only when playing some music. What happens if you play a music? does the noise keep there or does it shut up?
Same experience. A click sometimes coming. A little background noise in the headphone if plugged. No sound in speakers
I got it working in a glk device with kernel 5.16.x on Arch Linux and sof-firmware v2.0. My devices were recognized, but there were no sound. The problem was my webcam was being detected as the default audio card (the webcam has a microphone). I just created a .asoundrc file in ~/ and set the default audio card correctly. Then, I ran all the commands listed here. Sound works, but there are still some problems. I get a loud crackling noise during login and my jack headphones never works in the first try. I need to connect it, play some audio (the audio will output from speakers, even if headphones are recognized), then disconnect it and connect again.
Can you give details step by step on what you exactly did? Including the creation of soundrc file and whet you put in
Interesting.
To create the .asoundrc file, I first needed to identify the correct sound card. To do this, I just ran:
aplay -l
It will list all sound cards and devices available. You'll need to identify the correct one.
Then, I created the .asoundrc file in my home dir. The file look like this: asoundrc_example.txt
Then I ran the commands in the link I posted in the other comment.
I tried kernel 5.18-rc1, the sound worked, but I got the same problems (crackling noise and headphones not working in the first try). I tried to build sof-firmware v2.1 from souce as the binaries weren't released yet to see if I can solve these problems, but I got some errors during the build.
The pb is I've got " dummy output" now instead of the card in the settings... Strangely with 5.17 first I had the good card ( no sound) and as a sudden...dummy..
Did you change something in alsa folder first? Does your mic works?
I didn't change anything in the alsa folder. The mic works fine.
No mic for me... Which brand is your computer?
The brand is Positivo (it's a brazilian brand). But it's gemini lake, not a comet lake.
You can also try the topologies and alsa ucm confs here. I got it working on debian with these.
Thank you for your help. Checked for performance on Huawei MateBook D15 BOHB-WAX9-PCB-B2 board. Work with https://github.com/mchehab/alsa-ucm-conf, https://github.com/mchehab/linux/commit/0fdb8cd1c26408da870801f425f118a1bec44518 and https://github.com/thesofproject/linux/files/8419519/es8336-topologies-4.tar.gz
Hi, I installed openSUSE Tumbleweed experimental kernel 5.18.0-rc1-2.g11acc76-default. I also tried to add plbossard's tplg files for 8336 and the patches and the script by mchehab. The system is a Chuwi Hi 10X tablet.
Kernel 5.18 doesn't have the patches from my patch series, as they where merged at sound tree on Friday: https://lore.kernel.org/all/cover.1649357263.git.mchehab@kernel.org/
I've no idea what quirks would be needed for Chuwi Hi 10X (or for any other device but MateBook D15). Only the manufacturer knows (or someone needs to test it). Basically, with 5.18-rc1, there are two quirks that aren't auto-detected:
quirk name | bit | value | description |
---|---|---|---|
SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK |
bit 4 | 0x010 (or 16) | use alternative pin to enable speaker |
SOF_ES8336_JD_INVERTED |
bit 6 | 0x040 (or 64) | inverts headphone detection logic |
M patches, also available on the top of 5.17 at: https://github.com/mchehab/linux/tree/sound-es8336 (if you clone it, ensure that you're using branch "sound-es8336") provide two extra quirks:
quirk name | bit | value | description |
---|---|---|---|
SOF_ES8336_HEADPHONE_GPIO |
bit 7 | 0x080 (or 128) | use a separate pin to enable headphone |
SOC_ES8336_HEADSET_MIC1 |
bit 8 | 0x100 (or 256) | change the input for the headset microphone |
The driver also has extra quirks for topology (there are 3 different ones) and for digital mic, but, on its current state, the driver should autodetect it.
Basically, SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK
and SOF_ES8336_HEADPHONE_GPIO
tells the driver how to turn on the speaker and the headphone. There are two possible pins that controls it (GPIO0 and GPIO1), and the same GPIO can be used to turn on both speakers and headphone, or one GPIO can be used by the speaker and another one for the headphone.
So, there are 4 posible combinations:
Speakers | Headphone | bits | value |
---|---|---|---|
GPIO0 | GPIO0 | none | 0 |
GPIO1 | GPIO1 | bit 4 | 0x10 |
GPIO0 | GPIO1 | bit 7 | 0x80 |
GPIO1 | GPIO0 | bits 4 and 7 | 0x90 |
The other two quirks are used by the headphone:
SOF_ES8336_JD_INVERTED
is used when the detection if weather the headphone is plugged or not. If plugging the headphone is misdetected, you need to use itSOC_ES8336_HEADSET_MIC1
is related to the microphone detection. The es8336 chip has two analog inputs for the mic: MIC1
and MIC2
. By default, the driver assumes that:Mic input | connected to |
---|---|
MIC1 | internal mic (if analog mic - maybe unused) |
MIC2 | headphone |
When SOC_ES8336_HEADSET_MIC1
quirk is used, it will assume the opposite:
Mic input | connected to |
---|---|
MIC2 | internal mic (if analog mic - maybe unused) |
MIC1 | headphone |
So, assuming that the driver properly detected digital mic or analog mic, and topology, the 4 quirks above will allow setting device-specific confics that can't be auto-detected. Those can be passed to the Kernel by creating a file like /etc/modprobe.d/sound.conf with:
options snd_soc_sof_essx8336 quirk=<quirk_value>
The
So, for instance, if your board requires SOC_ES8336_HEADSET_MIC1
, SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK
and SOF_ES8336_HEADPHONE_GPIO
, you would place there:
options snd_soc_sof_essx8336 quirk=0x190
You need to reboot the machine every time this is changed, in order for the quirks to be used.
Once the proper quirk combination is discovered, a patch like: https://lore.kernel.org/all/d678aef9fc9a07aced611aa7cb8c9b800c649e5a.1649357263.git.mchehab@kernel.org/ can be added at the Kernel, associating a particular machine with the quirks it needs.
Worth mention that this affects only devices which use snd_soc_sof_essx8336
driver, and that the topology files for such devices should be installed from: https://github.com/thesofproject/linux/files/8419519/es8336-topologies-4.tar.gz
Also, for pulseaudio (or pipewire-pulse) to properly recognize the configuration, the UCM from https://github.com/mchehab/alsa-ucm-conf should be installed.
This is good... But... It just for huawei or any other brand using comet lake?
This is good... But... It just for huawei or any other brand using comet lake?
The quirks are vendor-independent. The last patch from my series is specific to the device I own (Huawei Matebook D15): https://lore.kernel.org/all/d678aef9fc9a07aced611aa7cb8c9b800c649e5a.1649357263.git.mchehab@kernel.org/
Yep... I'm stuck with my teclast F15 plus 2.... If any suggestions I'm in. I'm wondering if there's a chance of a fix in 5.18? Or is it related to alsa ucm too? I'm noob in that field.... Just trying to understand and finding a temporary solution
For any combination of parameters snd_soc_sof_essx8336 quirk=10,20,40,80,180,190,100, Without sound. Switching to headphones and back to speakers is detected correctly. what should alsamixer look like when run with working sound? my model is KLVD-WFH9 (intel version)
For any combination of parameters snd_soc_sof_essx8336 quirk=10,20,40,80,180,190,100, Without sound. Be careful: if you want to use hexadecimal values like above, you need to prepend "0x" to the values e. g., it should be
snd_soc_sof_essx8336 quirk=0x10
for "10" hexadecimal value (orsnd_soc_sof_essx8336 quirk=16
for decimal one).
Alsamixer (alsamixer -D hw:0
) should look like this:
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── AlsaMixer v1.2.6 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Card: sof-essx8336 F1: Help │
│ Chip: Intel Kabylake HDMI F2: System information │
│ View: F3:[Playback] F4: Capture F5: All F6: Select sound card │
│ Item: Headphone [dB gain: 0,00, 0,00] Esc: Exit │
│ │
│ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ │
│ │▒▒│ │ │ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │▒▒│ │ │ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │▒▒│ │ │ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │▒▒│ │ │ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │▒▒│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │▒▒│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │▒▒│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │▒▒│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │▒▒│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ │▒▒│ │ │ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │▒▒│ │
│ ├──┤ └──┘ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐ Normal Normal ┌──┐ └──┘ ┌──┐ └──┘ └──┘ └──┘ └──┘ └──┘ ┌──┐ └──┘ Constant PG └──┘ └──┘ ┌──┐ ┌──┐ ┌──┐ ┌──┐ └──┘ LDATA TO LD └──┘ lin1-rin1 dmic disabl ┌──┐ ┌──┐ ┌──┐ ┌──┐ lin1-rin1 └──┘ └──┘ └──┘ └──┘ ┌──┐ ┌──┐ lin1-rin1 │
│ │OO│ │MM│ │OO│ │MM│ │MM│ │MM│ │OO│ │OO│ │OO│ │OO│ │MM│ │OO│ │MM│ │OO│ │MM│ │OO│ │OO│ │OO│ │OO│ │
│ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ └──┘ │
│ 100<>100 0<>0 59 100 100 100 100 100 100 100 98<>98 100 100 100<>100 100<>100 100<>100 100<>100 │
│ < Headphone >Headphone M Speaker Mic Boost S/PDIF S/PDIF 1 S/PDIF 2 Playback Po Capture Pol ADC Double ADC PGA Gai ADC Soft Ra ALC Capture ALC Capture ALC Capture ALC Capture ALC Capture ALC Capture ALC Capture ALC Capture ALC Capture DAC DAC Double DAC Mono Mi DAC Notch F DAC Soft Ra DAC Soft Ra DAC Source DAC Stereo Differentia Digital Mic Headset Mic Internal Mi Left Headph Left Headph Left Headph PGA1.0 1 Ma PGA5.0 5 Ma PGA6.0 6 Ma PGA7.0 7 Ma Right Headp Right Headp Right Headp │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
The speaker
button can be toggled with the M
key. At the above, it is muted (sound goes to headphone on this case).
Any ideas how to solve my problem? Yes, everything is true if you choose in the terminal (Alsamixer -D HW: 0), then it is displayed as yours. And if you simply enter the terminal (Alsamixer), in the PipeWire field will be selected in the (Card) field. Regarding HEX, I know how to write correctly .... 0x10 and so on.
But there is no sound (I tried many different options (SND_SOC_SOF_SESSX8336 Quirk) What else can I do? Or maybe you give any data?
Any ideas how to solve my problem?
Well, I would try first to play/record directly from the hardware, bypassing pipewire/pulseaudio, with:
aplay -D hw:0 some_song.wav
and record with:
arecord -f S16_LE -d 10 -r 48000 --device=default
Yes, everything is true if you choose in the terminal (Alsamixer -D HW: 0), then it is displayed as yours. And if you simply enter the terminal (Alsamixer), in the PipeWire field will be selected in the (Card) field. Regarding HEX, I know how to write correctly .... 0x10 and so on.
But there is no sound (I tried many different options (SND_SOC_SOF_SESSX8336 Quirk) What else can I do?
I'm running out of ideas. I would expect that other devices from the same manufacturer to be wired the same way. Could you provide the output of dmidecode from your hardware?
Or maybe you give any data?
You could turn on the debug logs and post here. Maybe someone else may have some other hints.
Could you provide the output of dmidecode from your hardware?
tell me how to do it?
You could turn on the debug logs and post here.
tell me how to do it?
I tried the 0x10, 0x20, 0x40 and 0x80 quirks with the 5.18rc1 kernel, but with no success. But I recognized that the noise at the speakers was getting a little bit louder when a program played sound, and got more silent again a few seconds after the playback was finished.
Unfortunately I have no idea how to git-clone your patched 5.17 kernel. I'm not that experienced and usually rely on my package manager to install or uninstall a kernel... :(
It came to my mind again that some time ago I had entered the BIOS setup of the tablet. It has an enormous amount of settings available, even for the audio part. Can you check if my BIOS settings are OK?
The BIOS shows the following audio config page, no kidding...:
Could you provide the output of dmidecode from your hardware?
tell me how to do it?
sudo dmidecode
You could turn on the debug logs and post here.
tell me how to do it?
Place this on a file under /etc/modprobe.d
and reboot it:
options snd_sof_pci dyndbg=+p
options snd_sof_pci_intel_apl dyndbg=+p
options snd_sof_pci_intel_cnl dyndbg=+p
options snd_sof_pci_intel_icl dyndbg=+p
options snd_sof_pci_intel_tgl dyndbg=+p
options snd_intel_dspcfg dyndbg=+p
options snd_sof_intel_ipc dyndbg=+p
options snd_sof_intel_hda_common dyndbg=+p
options snd_sof_intel_hda dyndbg=+p
options snd_sof dyndbg=+p
options snd_soc_sof_essx8336 dyndbg=+p
then, use:
dmesg
to see the Kernel logs.
I tried the 0x10, 0x20, 0x40 and 0x80 quirks with the 5.18rc1 kernel, but with no success. But I recognized that the noise at the speakers was getting a little bit louder when a program played sound, and got more silent again a few seconds after the playback was finished.
Unfortunately I have no idea how to git-clone your patched 5.17 kernel. I'm not that experienced and usually rely on my package manager to install or uninstall a kernel... :(
git clone https://github.com/mchehab/linux.git -b sound-es8336
or, if you already cloned from it, you could just use git checkout -b origin/sound-es8336
.
It came to my mind again that some time ago I had entered the BIOS setup of the tablet. It has an enormous amount of settings available, even for the audio part. Can you check if my BIOS settings are OK?
The BIOS shows the following audio config page, no kidding...:
Yeah, some of the settings could be related, but hard to say what applies there ;-)
*DMIC [Disabled] //Selects DMIC to expose in NHLT table
If this device has digital mic, I would expect DMIC to be enabled.
*HD Audio link Frequency [24 MHz]
The clock frequency should likely match what's set at the driver.
I suggest you to take a look at sound/soc/codecs/es8316.c
in order to see what it is expecting. There are several parts of it that mention clocks. For instance:
/* In slave mode at single speed, the codec is documented as accepting 5
* MCLK/LRCK ratios, but we also add ratio 400, which is commonly used on
* Intel Cherry Trail platforms (19.2MHz MCLK, 48kHz LRCK).
*/
#define NR_SUPPORTED_MCLK_LRCK_RATIOS 6
static const unsigned int supported_mclk_lrck_ratios[] = {
256, 384, 400, 512, 768, 1024
};
...
static int es8316_set_dai_sysclk(struct snd_soc_dai *codec_dai,
int clk_id, unsigned int freq, int dir)
{
struct snd_soc_component *component = codec_dai->component;
struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component);
int i, ret;
int count = 0;
es8316->sysclk = freq;
if (freq == 0) {
es8316->sysclk_constraints.list = NULL;
es8316->sysclk_constraints.count = 0;
return 0;
}
ret = clk_set_rate(es8316->mclk, freq);
if (ret)
return ret;
...
}
...
/* Enable BCLK and MCLK inputs in slave mode */
clksw = ES8316_CLKMGR_CLKSW_MCLK_ON | ES8316_CLKMGR_CLKSW_BCLK_ON;
snd_soc_component_update_bits(component, ES8316_CLKMGR_CLKSW, clksw, clksw);
Both sound/soc/intel/boards/bytcht_es8316
and sound/soc/intel/boards/sof_es8336.c
sets it as with 19.2 MHz. This is, for instance, what sof_es8336.c
does:
static int sof_es8336_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
const int sysclk = 19200000;
int ret;
ret = snd_soc_dai_set_sysclk(codec_dai, 1, sysclk, SND_SOC_CLOCK_OUT);
if (ret < 0) {
dev_err(rtd->dev, "%s, Failed to set ES8336 SYSCLK: %d\n",
__func__, ret);
return ret;
}
return 0;
}
=============================
Miscellaneous Configuration
... Codec Device - INT343A setting [Enabled] Codec Device - INT34C1 setting [Enabled]`
=======
I remember setting Audio DSP Compliance Mode to [HD Audio Inbox or Intel SST driver] causes a sound device error resulting in no sound within Windows 10.
Codec Device - INT343A setting [Enabled] Codec Device - INT34C1 setting [Enabled]`
What device is this on again @SpaLox1? The INT343A is used to point to the Realtek RT286 or RT298, which is completely irrelevant here. Likewise you shouldn't have to select DMIC or not, this should be done for you by the OEM.
*HD Audio link Frequency [24 MHz] This has no influence for ES8336 support, we don't use HDaudio codecs. This link is only used for HDMI.
Looks like you have a copy of the Intel development BIOS with way too many options...
Could you provide the output of dmidecode from your hardware?
@mchehab
Place this on a file under
/etc/modprobe.d
and reboot it: @mchehab file with what name should be to put? /etc/modprobe.d is a directory
Place this on a file under
/etc/modprobe.d
and reboot it:file with what name should be to put? /etc/modprobe.d is a directory
Anything with a .conf name. The system will get them in alphabetic order so you might want to do it with 99-something.conf or similar name.
You could turn on the debug logs and post here. @mchehab
Codec Device - INT343A setting [Enabled] Codec Device - INT34C1 setting [Enabled]`
What device is this on again @SpaLox1? The INT343A is used to point to the Realtek RT286 or RT298, which is completely irrelevant here. Likewise you shouldn't have to select DMIC or not, this should be done for you by the OEM.
*HD Audio link Frequency [24 MHz] This has no influence for ES8336 support, we don't use HDaudio codecs. This link is only used for HDMI.
Looks like you have a copy of the Intel development BIOS with way too many options...
It is a Chuwi Hi 10 X tablet device with 6GB RAM. According to the internet as well as the IDs shown at the Windows 10 device manager, it shoud be equipped with ESSX8336...
The BIOS looks indeed very un-tidied to me with its bitmask cribsheet and 1000s of options. There are even options available to select a different LCD display manufacturer /display type and to tweak different PWM modes of the attached display. So I think I really have to be really careful when entering that BIOS setup. It is probably the first BIOS setup tool I use, since 1994 at my parent's 486, which can severely damage the hardware...
How can such a BIOS affect Linux programming? I always thought that the BIOS fills out the ACPI tables with its starting values, but these tables could be accessed and overridden by any OS as well...? Is a wrong setting like "Codec Device - INT343A setting [Enabled]" appropriate to mislead the Linux hardware detection?
I tried the following:
(1)
git clone https://github.com/mchehab/linux.git -b sound-es8336
Result: Device has been busied several hours fetching 3 GB. No obvious errors were shown. (2) Tried quirks: quirk=0x00, 0x10,0x20,0x40,0x80,0x180,0x190,0x100 (/etc/modprobe.d/sound.conf)
Still no sound.
But I think something went wrong with the basics:
uname-r
5.18.0-rc1-2.g11acc76-default
alsamixer -D hw:0
ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 0 Error opening mixing device: File or directory not found
I tried the following:
(1)
git clone https://github.com/mchehab/linux.git -b sound-es8336
Result: Device has been busied several hours fetching 3 GB. No obvious errors were shown. (2) Tried quirks: quirk=0x00, 0x10,0x20,0x40,0x80,0x180,0x190,0x100 (/etc/modprobe.d/sound.conf)
Still no sound.
But I think something went wrong with the basics:
uname-r
5.18.0-rc1-2.g11acc76-default
alsamixer -D hw:0
ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 0 Error opening mixing device: File or directory not found
Yeah, if alsamixer gives an error, then there's something else wrong there. There are a couple of Kconfig options that prevent the es8336 bindinngs to be compiled. The following commands will disable such options (the NOCODEC ones) and enable the es8336 codec:
scripts/config -d SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH
scripts/config -d SND_SOC_SOF_NOCODEC
scripts/config -d SND_SOC_SOF_NOCODEC_SUPPORT
scripts/config -d SND_SOC_SOF_FORCE_NOCODEC_MODE
scripts/config -e SND_SOC_SOF_HDA_LINK
scripts/config -e SND_SOC_SOF_HDA_AUDIO_CODEC
scripts/config -e SND_SOC_INTEL_SOF_ES8336_MACH
Btw, if the UCM config files are wrong, instead of "hw:0", the device could appear with some other name at alsamixer. Just in case, you could run alsamixer
without any parameter and press F6, in order to list the devices that were exposed by ALSA.
alsamixer -D hw:0
ALSA lib confmisc.c:165:(snd_config_get_card) Cannot get card index for 0 Error opening mixing device: File or directory not found
It's likely that by playing with quirks the card probe failed. You need to check with 'aplay -l' that there's indeed a card successfully registered before you can read the mixer values and try to get sound in/out.
Hooray! a sound appeared with the following parameters alsamixer item https://imgur.com/a/eCOrEe0 BUT the sound comes with wheezing (clicks pass) and interference (the volume is reduced)
@plbossart , @mchehab what can cause clicks in the headphones and through the speaker?
@fcsm1922 it depends on the nature of 'clicks' a) if you play a sine wave and hear periodic clicks with a well defined interval between clicks this hints at a bad configuration of clocks. You can try this with speaker-test -Dhw:0,0 -c2 -r48000 -t sine. You could try recording the output and checking with audacity if you see such a pattern visually. b) if you hear clicks depending on other activity on the platform, such as moving the mouse or plugging/unplugging the power cord this hints at analog interference and/or coupling with an input that remains open.
Not an easy task to get 'good audio'.
@plbossart when I run the command (speaker-test -Dhw: 0,0 -c2 -r48000 -t sine),
speaker-test 1.2.6
Playback device is hw:0,0
Stream parameters are 48000Hz, S16_LE, 2 channels
Sine wave rate is 440,0000Hz
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 96 to 16384
Period size range from 48 to 4096
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
0 - Front Left
1 - Front Right
Time per period = 5,635915
0 - Front Left
1 - Front Right
Time per period = 5,977231
0 - Front Left
1 - Front Right
Time per period = 5,974211
0 - Front Left
1 - Front Right
I hear a sine through the speakers, and there is a slight rustling in the headphones(constant rustling), it feels like some level is coarsened somewhere (crackling) when restarting the command (speaker-test -Dhw: 0,0 -c2 -r48000 -t sine), it issues
speaker test 1.2.6
Playback device is hw:0,0
Stream parameters are 48000Hz, S16_LE, 2 channels
Sine wave rate is 440.0000Hz
Playback open error: -16, Device or resource busy
and there is no sound at all, until you restart your computer
I am using GMK NUCBOX2. It has a coffee lake processor. The vendor provided drivers, in which it contained driver labelled as 'ES8336'.
I am using arch linux and upgraded kernel from 5.16.4 to 5.17.5. This caused HDMI audio out source to disappear. Then I installed sof-firmware but issue still not resolved.
Here is the relevant part of dmesg
$ sudo dmesg | grep -iE 'snd|sof'
[ 0.281190] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.342558] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[ 0.342559] software IO TLB: mapped [mem 0x00000000832de000-0x00000000872de000] (64MB)
[ 2.898927] snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[ 3.236700] snd_soc_skl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[ 3.531771] sof-audio-pci-intel-cnl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[ 3.531842] sof-audio-pci-intel-cnl 0000:00:1f.3: enabling device (0000 -> 0002)
[ 3.532021] sof-audio-pci-intel-cnl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[ 3.532112] sof-audio-pci-intel-cnl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 3.538664] sof-audio-pci-intel-cnl 0000:00:1f.3: use msi interrupt mode
[ 3.579719] sof-audio-pci-intel-cnl 0000:00:1f.3: hda codecs found, mask 4
[ 3.579724] sof-audio-pci-intel-cnl 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[ 3.579731] sof-audio-pci-intel-cnl 0000:00:1f.3: DMICs detected in NHLT tables: 0
[ 3.583201] sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware info: version 2:1:1-3964a
[ 3.583204] sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware: ABI 3:21:0 Kernel ABI 3:18:0
[ 3.583206] sof-audio-pci-intel-cnl 0000:00:1f.3: warn: FW ABI is more recent than kernel
[ 3.583211] sof-audio-pci-intel-cnl 0000:00:1f.3: unknown sof_ext_man header type 3 size 0x30
[ 3.685348] sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware info: version 2:1:1-3964a
[ 3.685352] sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware: ABI 3:21:0 Kernel ABI 3:18:0
[ 3.685354] sof-audio-pci-intel-cnl 0000:00:1f.3: warn: FW ABI is more recent than kernel
[ 3.751430] sof-audio-pci-intel-cnl 0000:00:1f.3: Topology: ABI 3:21:0 Kernel ABI 3:18:0
[ 3.751435] sof-audio-pci-intel-cnl 0000:00:1f.3: warn: topology ABI is more recent than kernel
[ 3.762297] snd_hda_codec_hdmi ehdaudio0D2: Monitor plugged-in, Failed to power up codec ret=[-13]
[ 3.781000] input: sof-hda-dsp HDMI/DP,pcm=1 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input15
[ 3.781040] input: sof-hda-dsp HDMI/DP,pcm=2 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input16
[ 3.781073] input: sof-hda-dsp HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input17
lspci shows this entry 00:1f.3 Multimedia audio controller: Intel Corporation Cannon Point-LP High Definition Audio Controller (rev 30)
card and codec not visible after the upgrade in kernel. Here is codec info obtained before upgrading kernel:
# cat /proc/asound/card0/codec#2
Codec: Intel Kabylake HDMI
Address: 2
AFG Function Id: 0x1 (unsol 0)
Vendor Id: 0x8086280b
Subsystem Id: 0x80860101
Revision Id: 0x100000
No Modem Function Group found
Default PCM:
rates [0x0]:
bits [0x0]:
formats [0x0]:
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
State of AFG node 0x01:
Power states: D0 D3 CLKSTOP EPSS
Power: setting=D0, actual=D0, Clock-stop-OK
GPIO: io=0, o=0, i=0, unsolicited=0, wake=0
Node 0x02 [Audio Output] wcaps 0x6611: 8-Channels Digital
Converter: stream=15, channel=0
Digital: Enabled KAE
Digital category: 0x0
IEC Coding Type: 0x0
PCM:
rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
bits [0x1a]: 16 24 32
formats [0x5]: PCM AC3
Power states: D0 D3 EPSS
Power: setting=D0, actual=D0
Node 0x03 [Audio Output] wcaps 0x6611: 8-Channels Digital
Converter: stream=0, channel=0
Digital: Enabled KAE
Digital category: 0x0
IEC Coding Type: 0x0
PCM:
rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
bits [0x1a]: 16 24 32
formats [0x5]: PCM AC3
Power states: D0 D3 EPSS
Power: setting=D0, actual=D0
Node 0x04 [Audio Output] wcaps 0x6611: 8-Channels Digital
Converter: stream=0, channel=0
Digital: Enabled KAE
Digital category: 0x0
IEC Coding Type: 0x0
PCM:
rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000
bits [0x1a]: 16 24 32
formats [0x5]: PCM AC3
Power states: D0 D3 EPSS
Power: setting=D3, actual=D3
Node 0x05 [Pin Complex] wcaps 0x40778d: 8-Channels Digital Amp-Out CP
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
Amp-Out vals: [0x00 0x00]
Pincap 0x0b000094: OUT Detect HBR HDMI DP
Pin Default 0x18560010: [Jack] Digital Out at Int HDMI
Conn = Digital, Color = Unknown
DefAssociation = 0x1, Sequence = 0x0
Pin-ctls: 0x00:
Unsolicited: tag=00, enabled=0
Power states: D0 D3 EPSS
Power: setting=D0, actual=D0
Devices: 0
Connection: 0
Node 0x06 [Pin Complex] wcaps 0x40778d: 8-Channels Digital Amp-Out CP
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
Amp-Out vals: [0x00 0x00]
Pincap 0x0b000094: OUT Detect HBR HDMI DP
Pin Default 0x18560020: [Jack] Digital Out at Int HDMI
Conn = Digital, Color = Unknown
DefAssociation = 0x2, Sequence = 0x0
Pin-ctls: 0x40: OUT
Unsolicited: tag=00, enabled=0
Power states: D0 D3 EPSS
Power: setting=D0, actual=D0
Devices: 0
Connection: 3
0x02* 0x03 0x04
Node 0x07 [Pin Complex] wcaps 0x40778d: 8-Channels Digital Amp-Out CP
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
Amp-Out vals: [0x00 0x00]
Pincap 0x0b000094: OUT Detect HBR HDMI DP
Pin Default 0x18560030: [Jack] Digital Out at Int HDMI
Conn = Digital, Color = Unknown
DefAssociation = 0x3, Sequence = 0x0
Pin-ctls: 0x00:
Unsolicited: tag=00, enabled=0
Power states: D0 D3 EPSS
Power: setting=D0, actual=D0
Devices: 0
Connection: 0
Node 0x08 [Vendor Defined Widget] wcaps 0xf00000: Mono
Original discussion available here: https://bbs.archlinux.org/viewtopic.php?pid=2034225#p2034225
Hence, it seems like this issue is not just affecting Huawei laptop and comet lake
Hello!
Huawei Matebook 14 (2021) KLVD-WXX9 Intel Core i5 i5-1135G7 (Tiger Lake)
I managed to get a working sound using the following soft:
5.18.0-0.rc3.27
with this patch https://lore.kernel.org/all/cover.1649357263.git.mchehab@kernel.org/sof-tgl-es8336-dmic4ch-ssp0.tplg
By default, quirk=0x20
is defined, the sound works, but there are the following problems:
quirk=0x30
both the built-in speakers and the connected analog headphones play simultaneously (but the playback device is displayed as one Headphones)Has anyone encountered such problems? Is this an alsa problem?
By default,
quirk=0x20
is defined, the sound works, but there are the following problems:
Can you clarify what you mean what 'the sound works'? What works out of the box, speaker playback?
1. The sound is too quiet (you need to set the second Headphones slider to 100 via alsamixer, so you need to do this every time after disabling your headphones or rebooting)
Can you clarify which alsa mixer you changed? This might need to be added to the UCM file.
2. The built-in microphone does not work with any quirk value (I tried 10, 20, 30, 40, 80, 90, 100, 120, 130, 180, 190)
You should not play with quirks to change hardware connection to dmic and SSP. Those were added for 'power users', you should only handle GPIO-related quirks
Which means only these bits should be changed in the quirks, the rest need to be left alone with the values setup by the driver.
Please add this file sof-dyndbg.conf.txt as /etc/modprobe.d/sof-dyndbg.conf, reboot and attach the dmesg log and result of 'alsa-info'. Thanks!
3. Analog headphones are detected when connected, but do not play. If you set quirk=0x30, sound appears in the headphones, but the built-in speakers do not turn off -- that is, with `quirk=0x30` both the built-in speakers and the connected analog headphones play simultaneously (but the playback device is displayed as one Headphones)
quirk 0x30 set the BIT(4) and BIT(5). I don't think this can make the sound appear in headphones, something is odd...
You may need to set #define SOF_ES8336_HEADPHONE_GPIO BIT(7)
Please add this file sof-dyndbg.conf.txt as /etc/modprobe.d/sof-dyndbg.conf, reboot and attach the dmesg log and result of 'alsa-info'. Thanks!
Done:
# dmesg | grep -iE "snd|sof|audio|err|warn"
[ 0.164283] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
[ 0.202871] ACPI: EC: interrupt blocked
[ 0.318308] ACPI: Using IOAPIC for interrupt routing
[ 0.378373] ACPI: PCI: Interrupt link LNKA configured for IRQ 3
[ 0.378510] ACPI: PCI: Interrupt link LNKB configured for IRQ 4
[ 0.378644] ACPI: PCI: Interrupt link LNKC configured for IRQ 5
[ 0.378781] ACPI: PCI: Interrupt link LNKD configured for IRQ 6
[ 0.378913] ACPI: PCI: Interrupt link LNKE configured for IRQ 7
[ 0.379044] ACPI: PCI: Interrupt link LNKF configured for IRQ 9
[ 0.379186] ACPI: PCI: Interrupt link LNKG configured for IRQ 10
[ 0.379318] ACPI: PCI: Interrupt link LNKH configured for IRQ 11
[ 0.391527] ACPI Warning: GPE type mismatch (level/edge) (20211217/evxface-791)
[ 0.391565] ACPI: EC: interrupt unblocked
[ 0.392296] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.443979] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[ 0.443982] software IO TLB: mapped [mem 0x0000000066c00000-0x000000006ac00000] (64MB)
[ 0.471551] xor: measuring software checksum speed
[ 0.535228] sdhci: Copyright(c) Pierre Ossman
[ 0.536789] wbsd: Copyright(c) Pierre Ossman)
[ 7.276584] snd_hda_intel 0000:00:0e.0: DSP detected with PCI class/subclass/prog-if info 0x040100
[ 7.853234] i801_smbus 0000:00:1f.1: SMBus using PCI interrupt
[ 8.098951] sof-audio-pci-intel-apl 0000:00:0e.0: DSP detected with PCI class/subclass/prog-if info 0x040100
[ 8.099278] sof-audio-pci-intel-apl 0000:00:0e.0: DSP detected with PCI class/subclass/prog-if 0x040100
[ 8.329525] sof-audio-pci-intel-apl 0000:00:0e.0: bound 0000:00:02.0 (ops 0xffffffffa0327fa0)
[ 8.400147] sof-audio-pci-intel-apl 0000:00:0e.0: use msi interrupt mode
[ 8.458906] sof-audio-pci-intel-apl 0000:00:0e.0: hda codecs found, mask 4
[ 8.499773] sof-audio-pci-intel-apl 0000:00:0e.0: Firmware info: version 2:1:1-3964a
[ 8.499782] sof-audio-pci-intel-apl 0000:00:0e.0: Firmware: ABI 3:21:0 Kernel ABI 3:18:0
[ 8.499785] sof-audio-pci-intel-apl 0000:00:0e.0: warn: FW ABI is more recent than kernel
[ 8.499794] sof-audio-pci-intel-apl 0000:00:0e.0: unknown sof_ext_man header type 3 size 0x30
[ 8.541180] sof-audio-pci-intel-apl 0000:00:0e.0: Firmware info: version 2:1:1-3964a
[ 8.541187] sof-audio-pci-intel-apl 0000:00:0e.0: Firmware: ABI 3:21:0 Kernel ABI 3:18:0
[ 8.541191] sof-audio-pci-intel-apl 0000:00:0e.0: warn: FW ABI is more recent than kernel
[ 9.070789] sof-essx8336 sof-essx8336: quirk mask 0x2
[ 9.070792] sof-essx8336 sof-essx8336: quirk SSP2
[ 9.085740] sof-audio-pci-intel-apl 0000:00:0e.0: Topology: ABI 3:21:0 Kernel ABI 3:18:0
[ 9.085749] sof-audio-pci-intel-apl 0000:00:0e.0: warn: topology ABI is more recent than kernel
[ 9.085955] sof-essx8336 sof-essx8336: ASoC: Parent card not yet available, widget card binding deferred
[ 9.382381] input: sof-essx8336 Headset as /devices/pci0000:00/0000:00:0e.0/sof-essx8336/sound/card0/input15
[ 9.386404] input: sof-essx8336 HDMI/DP,pcm=5 as /devices/pci0000:00/0000:00:0e.0/sof-essx8336/sound/card0/input16
[ 9.386507] input: sof-essx8336 HDMI/DP,pcm=6 as /devices/pci0000:00/0000:00:0e.0/sof-essx8336/sound/card0/input17
[ 9.386589] input: sof-essx8336 HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:0e.0/sof-essx8336/sound/card0/input18
[ 9.398641] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 9.519545] usb 1-8: Warning! Unlikely big volume range (=4096), cval->res is probably wrong.
[ 9.519712] usbcore: registered new interface driver snd-usb-audio
[ 9.550112] bluetooth hci0: Direct firmware load for rtl_bt/rtl8723b_config.bin failed with error -2
doesn't look like you have dynamic debug enabled @TurboBlaze ? there's not much I can do with this limited information.
@plbossart same problem as @jsonguard there is no microphone. There is sound but it's quiet. here is my file alsa-info kernel 5.18.0-rc5-1-mainline
@plbossart yep. Look at this log http://alsa-project.org/db/?f=25c864a6ad8ef494ad32f3190edf478e052bf445 Thanks.
@plbossart yep. Look at this log http://alsa-project.org/db/?f=25c864a6ad8ef494ad32f3190edf478e052bf445 Thanks.
not much better, you clearly don't have any dynamic logging enabled.
Hello,
following this discussion for a while. Have the same Problem. Huawei Matebook 14 i5-10210U Kernel 5.18rc6.220609gc5eb0a6-1 No additional quirks.
Sound level ist displayed and Alsamixer is on 100%, but no hiss of a Sound on speakers. Also no audio Input. Alsa-info quits with an error. So Sorry no alsa file. Any Idea?
Thx Andre
me again ;-) Got a little bit more Information: ALSA-Informationsskript v 051.txt
Hope this will help. Thx
me again ;-) Got a little bit more Information: ALSA-Informationsskript v 051.txt
Hope this will help. Thx
Did you manage to solve it? I happen to have exactly the same laptop
No further progress. Sorry.
So fed up.... I gave up. I put windows 11 on it. To let you know even with windows there's no sound. Teclast provides with special drivers... You even need one patch for the microphone!
A nightmare. But with all that it works.
Good luck.
I can't wait any longer. Tks for your work
Artix Linux user here, I just installed linux kernel 5.18.0-rc7, there's no longer "Dummy Output" on pulsemixer, neither any sound output. At least is detecting sound card :D
EDIT: There was static output from speakers, but it stopped outputing anything, I guess because I reinstalled sof-firmware, I was using the topologies from sof-bin repository before it.
I've tried a lot to be able to have audio on my Huawei Matebook D14 i3 device, so far, I haven't be able to fix it. If I put a monitor with speakers with HDMI, I can play sound on it, but the onboard soundcard seems to not be recognize. Has anyone can fix this already on their Huawei laptop?
Moved from thesofproject/sof
Is your feature request related to a problem? Please describe. Huawei laptops ship with an Everest ES8336 sound card that is not supported by sofproject. Describe the solution you'd like Adding support for it would be really awesome Describe alternatives you've considered I already tried this repo which seems to contain a kernel built with support for it but the audio clearly does not work: https://github.com/himozzza/essx8336 Additional context Booting Linux and trying lsmod or dmsg shows only one valid HDMI sound output on the laptop and nothing more. Here's what I get from Device Manager on Windows: