thesofproject / linux

Linux kernel source tree
Other
90 stars 129 forks source link

[BUG] No sound, no mic input in Chuwi Hi10X (N4120 version) #4662

Open callegar opened 11 months ago

callegar commented 11 months ago

This is a followup to bug 2955 (no local devices) that is now closed as you do now get local audio devices on that tablet/laptop machine. However they do not work.

An extended search on the internet reveals that no-one has apparently succeeded in getting any sound out or in that device in linux (would be glad to be contradicted). Conversely, that hardware must be so quirky and non-standard there are many people on windows reporting unrecoverable loss of audio after some windows upgrade or some fatal crash that forced them to reinstall the OS.

What appears to be known at this point:

  1. As of today, speakers/mic/headphone can all be recognized. Until no long ago, the mic was constantly indicated as an "inactive" device.
  2. Headphone plugging is recognized. You need to set a quirk for that (SOF_ES8336_JD_INVERTED, bit 6), otherwise the headphone detection is inverted. The tablet thinks that the headphone is plugged when it is not, and viceversa.
  3. By setting the Left/Right Headphone Mux property with alsamixer (these are two properties, left and right) you can get distinguishable pops from the speaker or noise in the headphones (switching in and out the Boost + PGA property)
  4. By setting the SOF_ES8336_HEADPHONE_GPIO quirk (bit 7) you can make the speakers whistle like hell at an extra loud volume (haven't insisted not to damage the hardware).

Playing a test sound does not bring even the faintest noise to the speakers/headphones, so the problem does not look like the need to "rise" some gain, but the complete gating of some path.

Before answering/commenting, please make sure that you refer to the N4120 version of this convertible tablet/laptop. Apparently, Chuwi has marketed under the same Hi10X name multiple (at least 2) different hardware solutions. Hopefully, there is a single N4120 version.

plbossart commented 11 months ago

An extended search on the internet reveals that no-one has apparently succeeded in getting any sound out or in that device in linux (would be glad to be contradicted). Conversely, that hardware must be so quirky and non-standard there are many people on windows reporting unrecoverable loss of audio after some windows upgrade or some fatal crash that forced them to reinstall the OS.

This is an enlightening paragraph on software support and hardware reliability. Oh well.

callegar commented 10 months ago

Today piece of news is that the Chuwi Hi10x N4120 version now produces sounds!!!

I do not know whether something has recently changed with the kernel (I am now at 6.6 mainline) or with the SOF firmware (I am now at 2023.09.2) or simply with the way in which I was doing my tests.

I first noticed that the tablet was emitting a pop at boot. Then I noticed that I was able to making it re-emit the pop by touching the speaker mute on alsamixer. Finally I noticed that right after the pop I was able to make the tablet emit sounds, but that the audio card was automatically swithing off by itself after about 2 seconds. Then I eventually touched something in the alsamixer configuration that made the card stay on. Would not be able to say what, but I can share my config data.

At every boot I need to manually mute and unmute the speaker from alsamixer to restore the sound.

The microphone still does not work. Should anyone have any idea about what can be tested to make it work I would be extra grateful.

callegar commented 10 months ago

I am currently use quirk=64 for the snd-soc-sof-es8336 module (which should be SOF_ES8336_JD_INVERTED).

Everything else should be just as shipped upstream.

callegar commented 10 months ago

asound.state.txt

callegar commented 10 months ago

Regarding the microphone, I am not getting any DMIC entry in dmesg, such as sof-audio-pci-intel-tgl 0000:00:1f.3: DMICs detected in NHLT tables: 2 as suggested in https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html.

Conversely, I am getting a unknown sof_ext_man header type 3 size 0x30 among the various sof entries. What might that be?

Any attempt at setting a dmic_num using snd_sof_intel_hda_common fails. I believe that this is expected, as the card is not meant to work in hda mode, right?

callegar commented 10 months ago

I have possibly made also the mic work. Did not hear recorded sounds played back, but saw the meter moving while speaking, which looks like a good thing.

The problem is that I cannot seem to be able to keep the audio card alive.

Make it play sound, mic does not work. Touch headset mic and internal mic mute/unmute and differential mux and mic starts working, but playback stops. Mute unmute speaker, touch the headset mic and internal mic mute/unmute and differential mux and playback comes back, but mic stops. For a second I got both alive.

Any clue?

Wonder if this may have been the problem from the very beginning (after ES8336 support arrived). I was testing, but I was never hearing any sound, maybe because the card was in this inactive state...

callegar commented 10 months ago

Looks like there is an incompatibility with the suspend-on-idle functionality. Unloading the suspend-on-idle Pulseaudio module makes the sound work more reliably. Opened dedicated issue #4743