nau8822 codec driver 錄音時mic bias 無法自動開啟問題,nau8822bias

來源:互聯網
上載者:User

nau8822 codec driver 錄音時mic bias 無法自動開啟問題,nau8822bias

nau8822 codec driver 錄音時mic bias 無法自動開啟問題

問題描述:

kernel版本:3.10

在nuc970上測試nau8822驅動時發現,雖然驅動中有如下定義:

SND_SOC_DAPM_MICBIAS("Mic Bias", NAU8822_POWER_MANAGEMENT_1, 4, 0),

但在播放錄音時始終調不到該操作。

在route上增加如下路徑

{"Left Boost Mixer", NULL, "Mic Bias"},

後依然無法調用到Mic Bias。

分析:

經測試及查資料發現,是因為SND_SOC_DAPM_MICBIAS在3.10核心中不是起點或終點,所以如果定義mic bias為SND_SOC_DAPM_MICBIAS,它不能位於路徑的起點或終點。

一條完整的dapm音頻路徑,必然有起點和終點,我們把位於這些起點和終點的widget稱之為端點widget。以下這些類型的widget可以成為端點widget:

codec的輸入輸出引腳:

snd_soc_dapm_output

snd_soc_dapm_input

外接的音訊裝置:

snd_soc_dapm_hp

snd_soc_dapm_spk

snd_soc_dapm_line

音頻流(stream domain):

snd_soc_dapm_adc

snd_soc_dapm_dac

snd_soc_dapm_aif_out

snd_soc_dapm_aif_in

snd_soc_dapm_dai_out

snd_soc_dapm_dai_in

電源、時鐘和其它:

snd_soc_dapm_supply

snd_soc_dapm_regulator_supply

snd_soc_dapm_clock_supply

snd_soc_dapm_kcontrol

解決方案有2:

1.構造新的route使bias位於路徑的中間,例如:

{"Left Input Mixer", "Mic Switch", "Mic bias"},

{"Mic bias", NULL, "LMICN"},

{"Mic bias", NULL, "LMICP"},

2.採用新的定義:SND_SOC_DAPM_SUPPLY代替SND_SOC_DAPM_MICBIAS來定義mic bias,具體定義如下:

SND_SOC_DAPM_SUPPLY("Mic Bias",

NAU8822_POWER_MANAGEMENT_1, 4, 0, NULL, 0),

在route定義中增加如下route:

{"Left Boost Mixer", NULL, "Mic Bias"},

測實驗證:

只驗證了方法2,修改代碼後,在nuc970bsp中運行

/usr/arecord -f S16_LE -r 8000 -c 2 -D plughw:0,0 test.wav

成功調出mic bias,log如下:

bash-3.2# /usr/arecord -f S16_LE -r 8000 -c 2 -D plughw:0,0 test.wav

Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo

pop test : Queue RMICN: reg=0xffffffff, 0x1/0x1

pop test : Queue RMICP: reg=0xffffffff, 0x1/0x1

pop test : Queue LMICN: reg=0xffffffff, 0x1/0x1

pop test : Queue LMICP: reg=0xffffffff, 0x1/0x1

pop test : Queue RAUX: reg=0xffffffff, 0x1/0x1

pop test : Queue R2: reg=0xffffffff, 0x1/0x1

pop test : Queue LAUX: reg=0xffffffff, 0x1/0x1

pop test : Queue L2: reg=0xffffffff, 0x1/0x1

pop test : Queue Mic Bias: reg=0x1, 0x10/0x10

pop test : Queue Capture: reg=0xffffffff, 0x1/0x1

pop test : Queue Right Input Mixer: reg=0x2, 0x8/0x8

pop test : Queue Left Input Mixer: reg=0x2, 0xc/0xc

pop test : Queue Right Boost Mixer: reg=0x2, 0x20/0x20

pop test : Queue Left Boost Mixer: reg=0x2, 0x30/0x30

pop test : Queue Left Capture PGA: reg=0x2d, 0x0/0x40

pop test : Queue Right Capture PGA: reg=0x2e, 0x0/0x40

pop test : Queue Right ADC: reg=0x2, 0x2/0x2

pop test : Queue Left ADC: reg=0x2, 0x3/0x3

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.