У меня есть Khadas VIM2
и WM8960
Audio Board, и у меня проблема с использованием WM8960
.
Мое соединение:
Vim2 [https://forum.khadas.com/uploads/default/original/1X/7ef0044c493212392a5d954bf598eefa9425fd8d.png]
<>
WM8960 Audio Board [https://www.waveshare.com/w/upload/b/b6/WM8960_Audio_Board_Schematic..pdf]
I2C_CLK_A (pin 22) <> I2C_SCL (pin 8)
I2C_SDA_A (pin 23) <> I2S_SDA (pin 6)
3V3 (pin 27) <> VCC 3V3 (pin 2)
GND (pin 28) <> GND (pin 4)
I2S_SCLK (pin 29) <> I2S_CLK (pin 10)
I2S_SDO (pin 31) <> I2S_DAC (pin 14)
I2S_LRCK (pin 32) <> I2S_LRCLK (pin 12)
I2S_SDI (pin 33) <> I2S_ADC (pin 13)
I2S_MCLK is not connected
Я изменил дерево устройств:
aml_sound_meson {
compatible = "aml, meson-snd-card";
status = "okay";
aml-sound-card,format = "i2s";
aml_sound_card,name = "AML-MESONAUDIO";
aml,audio-routing =
"Ext Spk","SPK_LP",
"Ext Spk","SPK_LN",
"Ext Spk","SPK_RP",
"Ext Spk","SPK_RN",
"LINPUT1","MAIN MIC",
"RINPUT1","MAIN MIC";
hp_disable;
hp_paraments = <800 300 0 5 1>;
pinctrl-names = "audio_i2s";
pinctrl-0 = <&audio_i2s_pins>;
cpu_list = <&cpudai0 &cpudai1 &cpudai2>;
codec_list = <&codec0 &codec1 &codec2>;
plat_list = <&i2s_plat &i2s_plat &pcm_plat>;
cpudai0: cpudai0 {
sound-dai = <&i2s_dai>;
};
cpudai1: cpudai1 {
sound-dai = <&spdif_dai>;
};
cpudai2: cpudai2 {
sound-dai = <&pcm_dai>;
};
codec0: codec0 {
sound-dai = <&wm8960_codec>;
//sound-dai = <&amlogic_codec>;
};
codec1: codec1 {
sound-dai = <&spdif_codec>;
};
codec2: codec2 {
sound-dai = <&pcm_codec>;
};
};
i2s_plat: i2s_platform {
#sound-dai-cells = <0>;
compatible = "amlogic, aml-i2s";
interrupts = <0 29 1>;
};
i2s_dai: I2S {
#sound-dai-cells = <0>;
compatible = "amlogic, aml-i2s-dai";
clocks =
<&clkc CLKID_MPLL2>,
<&clkc CLKID_AMCLK_COMP>,
<&clkc CLKID_AIU_GLUE>,
<&clkc CLKID_IEC958>,
<&clkc CLKID_I2S_OUT>,
<&clkc CLKID_AMCLK>,
<&clkc CLKID_AIFIFO2>,
<&clkc CLKID_MIXER>,
<&clkc CLKID_MIXER_IFACE>,
<&clkc CLKID_ADC>,
<&clkc CLKID_AIU_TOP>,
<&clkc CLKID_AOCLK_GATE>,
<&clkc CLKID_I2S_SPDIF>;
clock-names =
"mpll",
"mclk",
"top_glue",
"aud_buf",
"i2s_out",
"amclk_measure",
"aififo2",
"aud_mixer",
"mixer_reg",
"adc",
"top_level",
"aoclk",
"aud_in";
i2s_pos_sync = <0>;
/*DMIC;*/ /* I2s Mic or Dmic, default for I2S mic */
};
&i2c0 {
status = "okay";
clock-frequency = <400000>;
pinctrl-names="default";
pinctrl-0=<&a_i2c_master>;
wm8960_codec:wm8960_codec@1a {
compatible = "wlf,wm8960";
reg = <0x1a>;
#sound-dai-cells = <0>;
clock-frequency = <12288000>;
clocks = <&clkc CLKID_AMCLK_COMP>;
clock-names = "mclk";
pinctrl-names = "audio_i2s";
pinctrl-0 = <&audio_i2s_pins>;
status = "okay";
wlf,shared-lrclk;
};
};
Но все равно не работает.
У меня в журнале ошибок нет:
khadas@Khadas:~$ sudo dmesg | grep snd
[ 5.251160] usbcore: registered new interface driver snd-usb-audio
[ 5.258237] snd_i2s_dai: clock source gate top_glue : ffffffc05dc8ea80
[ 5.258270] snd_i2s_dai: clock source gate aud_buf : ffffffc05dc8eac0
[ 5.258303] snd_i2s_dai: clock source gate i2s_out : ffffffc05dc8eec0
[ 5.258340] snd_i2s_dai: clock source gate amclk_measure : ffffffc05dc8ef80
[ 5.258382] snd_i2s_dai: clock source gate aififo2 : ffffffc05dc8ef00
[ 5.258429] snd_i2s_dai: clock source gate aud_mixer : ffffffc05dc8ee80
[ 5.258480] snd_i2s_dai: clock source gate mixer_reg : ffffffc05dc8ee00
[ 5.258537] snd_i2s_dai: clock source gate adc : ffffffc073afa380
[ 5.258605] snd_i2s_dai: clock source gate top_level : ffffffc05fdc8000
[ 5.258673] snd_i2s_dai: clock source gate aoclk : ffffffc05fdc8080
[ 5.258743] snd_i2s_dai: clock source gate aud_in : ffffffc05fdc8100
[ 5.258752] snd_i2s_dai: ignore aud_buf/vdac_clk gate
[ 5.259853] snd_pcm_dai: pcm mode detection =1
[ 5.260091] snd_pcm_dai: tdm config: 0x0, 0x0, 0, 0
[ 5.260726] snd_spdif_dai: enterd aml_spdif_play,set_clock:-1,sample_rate=4
[ 5.260896] snd_spdif_dai: set normal 512 fs /4 fs
[ 5.260898] snd_spdif_dai: set 958 audio clk div 4
[ 5.262602] snd_card_meson: aml_card_dai_parse_of codec_node count:1
[ 5.262715] snd_card_meson: aml_card_dai_parse_of codec_node count:1
[ 5.262857] snd_card_meson: aml_card_dai_parse_of codec_node count:1
[ 5.263502] snd_card_meson: headphone detection disable=1
[ 5.263506] snd_card_meson: no spk event delay time set
[ 5.267488] aml_meson_snd_card aml_sound_meson: wm8960-hifi <-> I2S mapping ok
[ 5.268338] aml_meson_snd_card aml_sound_meson: dit-hifi <-> SPDIF mapping ok
[ 5.268470] snd_pcm: enter aml_pcm_new dai->name: PCM dai->id: 0
[ 5.269379] aml_meson_snd_card aml_sound_meson: pcm2bt-pcm <-> PCM mapping ok
[ 5.384167] snd_card_meson: enable i2sclk in startup
[ 18.764030] snd_i2s: aml_audio_i2s_mute_flag: flag=1
[ 18.764089] snd_spdif_codec: aml_audio_set_spdif_mute: flag=1
[ 18.764215] snd_i2s_dai: Fine tdm clk setting range (0~2000000), 4096000
[ 18.764255] snd_spdif_dai: Fine spdif sysclk setting range(0~2000000), 4096000
[ 18.764283] snd_card_meson: aml_set_spk: aml_spk_enabled=1
[ 20.548826] snd_i2s: aml_audio_i2s_mute_flag: flag=1
[ 20.548870] snd_spdif_codec: aml_audio_set_spdif_mute: flag=1
[ 20.548946] snd_i2s_dai: Fine tdm clk setting range (0~2000000), 4096000
[ 20.554067] snd_spdif_dai: Fine spdif sysclk setting range(0~2000000), 4096000
[ 20.561399] snd_card_meson: aml_set_spk: aml_spk_enabled=1
[ 43.050329] aml_meson_snd_card aml_sound_meson: I2S capture prepare!
[ 43.051391] aml_meson_snd_card aml_sound_meson: I2S capture enable!
[ 43.992622] aml_meson_snd_card aml_sound_meson: I2S capture disable!
[ 48.464914] aml_meson_snd_card aml_sound_meson: I2S capture prepare!
[ 48.465405] aml_meson_snd_card aml_sound_meson: I2S capture enable!
[ 49.064622] aml_meson_snd_card aml_sound_meson: I2S capture disable!
[ 51.441037] snd_spdif_dai: enterd aml_spdif_play,set_clock:4,sample_rate=4
[ 51.441084] snd_spdif_dai: set 958 audio clk div 2
[ 53.765902] aml_meson_snd_card aml_sound_meson: I2S playback prepare!
[ 74.755225] snd_spdif_dai: enterd aml_spdif_play,set_clock:10,sample_rate=4
Почему не работает?