Recently i experience some thing and want to improve my English, so i will try to use English to write the new document completely.
0. background
OK, let’s go straight to the topic. We will found the line-out output singal is not stable, while the hardware engineer test the speaker power.
The problem is confused and unbelievable.
1. Solution
The key problem that causes this problem is the HW delay. Qualcomm design is adapted to their own wsa pa. When we use the third party PA, we need to change to HW delay to stabilize the singal .
code path as sample:
./kernel/msm-3.18/sound/soc/codecs/msm8x16-wcd.c
static int msm8x16_wcd_lo_dac_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
struct snd_soc_codec *codec = w->codec;
dev_dbg(codec->dev, "%s %s %d\n", __func__, w->name, event);
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
...
msleep(5);
break;
case SND_SOC_DAPM_POST_PMU:
snd_soc_update_bits(codec,
MSM8X16_WCD_A_ANALOG_RX_LO_DAC_CTL, 0x80, 0x80);
snd_soc_update_bits(codec,
MSM8X16_WCD_A_ANALOG_RX_LO_DAC_CTL, 0x08, 0x00);
snd_soc_update_bits(codec,
MSM8X16_WCD_A_ANALOG_RX_LO_EN_CTL, 0x40, 0x40);
msleep(20);//value is adjustable
break;
case SND_SOC_DAPM_POST_PMD:
...
break;
}
return 0;
}
2. Author Note
/******
@article{Linux Audio Driver,
Author = { 1byte ≠ 8bit},
Year = { 2021},
}
******/