thesofproject / linux

Linux kernel source tree
Other
91 stars 131 forks source link

No sound ES8336 GeminiLake laptop (IPASON MaxBook) #3874

Open linas opened 2 years ago

linas commented 2 years ago

As reported on alsa mailing list. Cheap laptop with ES8336 chepset. Soundcard is detected, driver appears to function normally; but no sound, except for a faint pop when muted, or when driver turns off the i915 power.

Details: Follow instructions at https://github.com/thesofproject/linux/wiki/ES8336-support More precisely, these are:

git clone https://github.com/thesofproject/linux/
git checkout es8336-v5.19
cp /boot/config .config
make oldconfig
make menuconfig
-> Device Drivers
-> Sound card support
-> Advanced Linux Sound Architecture
-> ALSA for SoC audio support
-> Intel Machine drivers
-> SOF with ES8336 or ES8326 codec in I2S mode
Verify manually that
CONFIG_SND_SOC_ES8316=m
CONFIG_SND_SOC_INTEL_SOF_ES8336_MACH=m
make
make INSTALL_MOD_STRIP=1 modules_install && make install

get https://github.com/thesofproject/linux/files/9280208/es8336_topologies_main.tar.gz
mkdir tmp; cd tmp; tar -xf es8336_topologies_main.tar.gz
cp * /lib/firmware/intel/sof-tplg/

edit /etc/modprobe.d/sof-dyndbg.conf as recommended; also add entries for
options snd_soc_es8316 dyndbg=+p
options snd_soc_es8336 dyndbg=+p
options snd_soc_sof_es8336 dyndbg=+p

reboot

After reboot, the card is detected:

cat /proc/asound/cards
 0 [sofessx8336    ]: sof-essx8336 - sof-essx8336
                      IPASON-MaxBookP1X-Defaultstring-G142R

aplay -l reports four devices: one ES8336 and three HDMI

dmesg does not show any warnings or errors that I can make out.

/usr/bin/speaker-test makes no sound. It does cause lots of real-time printing to /var/log/syslog when started and stopped. None of the prints seem to be warnings or errors.

/usr/bin/alsabat seems to think everything works.

There is a faint pop, when the speakers are muted, and when the driver prints

[  163.142527] sof-audio-pci-intel-apl 0000:00:0e.0: Turning i915 HDAC power 0

Playing with volume controls and mixer suggests that it is talking to the driver just fine. The faint pop on mute suggests driver is telling the hardware something ... but fiddling with mixer controls does not provide sound.

Here is alsa-info after reboot and running speaker-test http://alsa-project.org/db/?f=fc32b769438710684ff5fe2319e7aa6d3fd56be8

I don't see any warnings or errors; I'm stumped as to what to try next.

linas commented 2 years ago

Oh, this is interesting:

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

speaker-test 1.2.7

Playback device is hw:0,0
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Playback open error: -16,Device or resource busy

I assume that hw:0,0 refers to the first etry from aplay -l:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sofessx8336 [sof-essx8336], device 0: ES8336 (*) []
  Subdevices: 0/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 #3581 

I don't understand why speaker-test default is not hw0,0 ... ... but maybe this is a red herring?

linas commented 2 years ago

After a fresh reboot, speaker-test -Dhw:0,0 -c2 -r48000 does work (but produces no sound)

here's info, before the speaker test: http://alsa-project.org/db/?f=7fa7c59ef643c5ae28704e2b2bbbc84ff16c3c29

linas commented 2 years ago

per issue #3336 should I be trying quirk masks? perhaps SSP0 ? Per warnings, I don't want to blow up any hardware...

From what I can tell, the Playback open error: -16,Device or resource busy was because pulseaudio grabbed the device. After moving /usr/bin/pulseaudio out of the way, there's no longer any competition for the hardware. (but also, still no sound)

plbossart commented 2 years ago

https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html#es8336-support lists a set of quirks you can use. Do not touch SSP or DMIC quirks, only GPIO and headset ones.

All standard disclaimers apply when using quirks and exploring how the device is wired without documentation. Don't do it if you are not comfortable with such experiments.

linas commented 2 years ago

Setting either Speakers GPIO1 quirk or quirk headphone GPIO causes a brief but clearly audible zap/crackle when speaker-test is run. This did not use to be the case.

plbossart commented 2 years ago

oh, there could also be an issue with the mixer settings. I completely forgot to mention this in the wiki but there are settings that need to be applied. I think the UCM file that was started in https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/Intel/sof-essx8336/HiFi.conf has some settings that are useful but I am not sure if that's the latest.

@yangxiaohua2009 can you chime in on mixer settings?

linas commented 2 years ago

My distro Debian testing already had the ucm2 sof-essx8336 files installed, exactly as in github.

Playing with alsaucm gives errors (but maybe I'm using it wrong):

alsaucm -n -b - <<EOM
> open sof-essx8336
> reset
> set _verb HiFi
> list _devices
> EOM
ALSA lib main.c:826:(execute_sequence) unable to execute cset 'name='Headset Switch' on'
ALSA lib main.c:2573:(set_verb_user) error: failed to initialize new use case: HiFi
alsaucm: error failed to set _verb=HiFi: No such file or directory

Next, I played with alsamixergui while speaker-test was running. There are a zillion things to control, but most are not adjustable or responsive. Some cause clicks and pops, and I can (inconsistently) alter the volume of the clicks & pops. I can alter Head. and Head. Mixer volume, and there are clicks and pops that get louder when I do. I cannot adjust Speaker volume at all: it stays stuck at zero. Very rarely, I can get it to pop, when I mute it.

Other controls that click when muted include Right Head. Mixer LLIN, Right Head. Mixer RLIN, Left Head. Mixer Left DAC, Left Head. Mixer Right DAC but some of these do not allow volume adjustments. The PGA1.0 1 Master control is suggestive, but it behaves oddly and does not click/pop.

yangxiaohua2009 commented 2 years ago

@linas

After a fresh reboot, speaker-test -Dhw:0,0 -c2 -r48000 does work (but produces no sound)

here's info, before the speaker test: http://alsa-project.org/db/?f=7fa7c59ef643c5ae28704e2b2bbbc84ff16c3c29

From the alsa info I see your DAC volume and Headphone volume very low, can you play with alsamixergui or alsamxier and adjust them to 0dB (largest)? Apart from them, other mixers are okay.

When you plug in headset/jack, can you see the device in the sound setting change? If not, you may need to modify the mclk setting.

plbossart commented 2 years ago

The PGA1.0 1 Master control is suggestive, but it behaves oddly and does not click/pop.

Please keep those to 0dB. They are volume controls in the SOF firmware, unrelated to the codec settings. You can to change only the codec settings.

linas commented 2 years ago

can you play with alsamixergui or alsamxier and adjust them to 0dB (largest)?

Playing with these has minimal effect: no sound, only a click-pop when stopping a sound source. The loudness of the click-pop is controlled by the mixer settings (although it is relatively quiet, never really loud.)

When you plug in headset/jack, can you see the device in the sound setting change?

I don't understand how to "see the device in the sound setting change". However, the clicks-pops do come out of the headphone, and the loudness of the clicks-pops are controlled by the headphone mixer volume.

I conclude the problem is upstream of the mixer...