[alsa-devel] RT5640 jack detection

Carlo Caione carlo at endlessm.com
Tue Sep 22 11:18:57 CEST 2015


Hi,
I'm working with the ALC5640-VB audio codec based on the Realtek
RT5640. On my setup the codec is only used for audio output through an
headphone jack, otherwise the audio should be routed via HDMI.

The problem is that the jack sensing only works when the codec is
actively playing something, that is when the bias set for the codec is
not SND_SOC_BIAS_OFF. When the codec is suspended and it is powered
off I'm not able to detect anymore the presence of the jack. Because
of this issue actively switching the audio from HDMI to HP when the
jack is inserted is not working.

The driver I'm using for the RT5640 in the .set_bias_level hook
function among other things is gating the I2S input clock and this
seems to prevent the generation of the IRQ signal I'm using to detect
the presence/absence of the jack (the culprit here is MX-FA[0] bit for
those interested).

I can easily modify the codec driver to avoid gating the I2S clock
when the bias is off but this seems in contrast with the whole DAPM
principle.

How this is usually supposed to be working?

-- 
Carlo Caione  |  +39.340.80.30.096  |  Endless


More information about the Alsa-devel mailing list