Skip to contentSkip to conversation

ASoC: rt711-sdca: headset detected as headphone after runtime resume

DISCUSSION HyeongJun An 1 participant 1 message Nov 13 Sound

lore
Share & tools
lore
#0 lore raw

Hello Shuming, Jack and Oder,

On a Dell Latitude 9420 (SKU 0A5B, sof_sdw with RT711_JD2 [1]), a 4-pole headset that stays plugged in is sometimes reported as a headphone after the rt711 runtime resumes. The headset mic is then gone until a later resume detects it again.

Each of these resumes runs rt711_sdca_io_init(), which detects the jack again. With a CTIA headset plugged in, GE49 DETECTED_MODE came back 0x3 in 17 of 69 resumes. Plugging the jack in gave 0x5 every time (5 of 5). With runtime PM off for the codec, it does not happen.

It is not an early read. Reading DETECTED_MODE again up to 800 ms later gave the same value every time. But the wrong result arrives later. From "jack_init enable" to the detection, 0x5 took 0.39 to 0.42 s and 0x3 took 0.47 to 0.50 s, with no overlap in 48 detections:

[  947.426026] rt711-sdca sdw:0:0:025d:0711:01: in rt711_sdca_jack_init enable
[  947.798095] rt711-sdca sdw:0:0:025d:0711:01: rt711_sdca_interrupt_callback control_port_stat=4, sdca_cascade=1
[  947.832056] rt711-sdca sdw:0:0:025d:0711:01: rt711_sdca_headset_detect, detected_mode=0x5
[  930.117765] rt711-sdca sdw:0:0:025d:0711:01: in rt711_sdca_jack_init enable
[  930.582117] rt711-sdca sdw:0:0:025d:0711:01: rt711_sdca_interrupt_callback control_port_stat=4, sdca_cascade=1
[  930.615049] rt711-sdca sdw:0:0:025d:0711:01: rt711_sdca_headset_detect, detected_mode=0x3

The rt721-sdca driver checks the jack type on resume since commit e2eb4873b901 ("ASoC: rt721-sdca: Adjust blindwrite flow to fix type detection issue"). When the new result differs from the retained one, it detects again. Here the wrong result does not change when read again, so I am not sure that would be enough for rt711.

Would starting the detection again help, or keeping the retained type when the jack was not removed? Or is there a register sequence that makes the detection after reset and calibration reliable? I can test patches on this machine and send the full logs.

This was on 7.4-rc1 plus soundwire next, SOF firmware 2:2:0-57864, BIOS 1.50.0. It also happens on 7.0 and 7.3-rc7. The codec reports RT711_JD_PRODUCT_NUM 0x0021 (hw_ver 1, VD1 init path).

[1] https://lore.kernel.org/all/[email protected]/

I found and checked this with Claude Code (Claude Opus 5.5) on x86_64.

Best regards,
HyeongJun An