thesofproject / linux

Linux kernel source tree
Other
88 stars 128 forks source link

ASoC: rt711-sdca: add GE selected mode control #4969

Closed shumingfan closed 3 weeks ago

shumingfan commented 1 month ago

ASoC: rt711-sdca: add GE selected mode control This patch adds the 'selected mode' control which overrides the detected_mode.

fredoh9 commented 3 weeks ago

@fredoh9 @marc-hb can you try to see if this patch improve the alsa-bat results with the option options snd_soc_rt711_sdca detected_mode=5

I can quickly test with this today. Will update soon.

fredoh9 commented 3 weeks ago

I was able to test with this PR and the module param.

options snd_soc_rt711_sdca detected_mode=5

Looks detected_mode is consistent throughout multiple tests, however test results have more failure than pass. Captured wave file has very low volume, not even tell whether it's sinewave. Still looking at it. i.e increasing gain. Will update.

Headset Mic Jack also stays ON.

numid=37,iface=CARD,name='Headset Mic Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on
$ grep detected_mode 20240506_dmesg01_pr4969_detected_mode_add_alsabat_tests.txt
[    6.041556] snd_soc_rt711_sdca:rt711_sdca_headset_detect: rt711-sdca sdw:0:0:025d:0711:01: rt711_sdca_headset_detect, detected_mode=0x0
[    6.440514] snd_soc_rt711_sdca:rt711_sdca_headset_detect: rt711-sdca sdw:0:0:025d:0711:01: rt711_sdca_headset_detect, detected_mode=0x5
[   43.739315] snd_soc_rt711_sdca:rt711_sdca_headset_detect: rt711-sdca sdw:0:0:025d:0711:01: rt711_sdca_headset_detect, detected_mode=0x5
[   43.774153] snd_soc_rt711_sdca:rt711_sdca_headset_detect: rt711-sdca sdw:0:0:025d:0711:01: rt711_sdca_headset_detect, detected_mode=0x5
[  177.001368] snd_soc_rt711_sdca:rt711_sdca_headset_detect: rt711-sdca sdw:0:0:025d:0711:01: rt711_sdca_headset_detect, detected_mode=0x5
[  204.427909] snd_soc_rt711_sdca:rt711_sdca_headset_detect: rt711-sdca sdw:0:0:025d:0711:01: rt711_sdca_headset_detect, detected_mode=0x5
[  964.759599] snd_soc_rt711_sdca:rt711_sdca_headset_detect: rt711-sdca sdw:0:0:025d:0711:01: rt711_sdca_headset_detect, detected_mode=0x5
marc-hb commented 3 weeks ago

Headset Mic Jack also stays ON.

From the narrow perspective of this PR, this is a PASS! We can discuss and debug alsabat and other issues elsewhere.

Could you test basic, manual hotplug with a sample of headphones and headsets? evtest is the most convenient for this.

marc-hb commented 3 weeks ago

I had the idea of using an alsa control but the module parameter is fine to start testing.

A module parameter will be less flexible and less convenient for testing automation.

shumingfan commented 3 weeks ago

@marc-hb @plbossart I will update the patch, creating an alsa control to change the jack type.

shumingfan commented 3 weeks ago

Can you send to Mark Brown, maybe with an updated commit message such as:

Sure, will send the patch soon.

plbossart commented 3 weeks ago

shared upstream, thanks @shumingfan

marc-hb commented 3 weeks ago

@plbossart don't we need this in this branch already to unblock investigation of other capture issues?

plbossart commented 3 weeks ago

good point @marc-hb. I was planning to pick it up at the next merge, but that merge might be a ways off since we have nothing to send. I'll merge it to topic/sof-dev.