Platform: RK3399
OS: Android 7.1
Kernel: v4.4.83
现象:
使用系统自带的tinycap录音,发现录取到的wav文件没有声音。
原因:
tinycap运行时,clk_i2sout没有被enable.
如下图,左边是用录音机录音,右边是tinycap录音。
对应代码:
执行tinycap的时候不会调用到rt5640_set_bias_level(),因此mclk不会被enable.
static int rt5640_set_bias_level(struct snd_soc_codec *codec,
enum snd_soc_bias_level level)
{
......
case SND_SOC_BIAS_PREPARE:
/*
* SND_SOC_BIAS_PREPARE is called while preparing for a
* transition to ON or away from ON. If current bias_level
* is SND_SOC_BIAS_ON, then it is preparing for a transition
* away from ON. Disable the clock in that case, otherwise
* enable it.
*/
if (IS_ERR(rt5640->mclk))
break;
if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_ON) {
clk_disable_unprepa