This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
In order to configure the audiocodec as master we modified the DTS but still no sound is coming after playing sound recorded from arecord command :- arecord -r 16000 test
The is the previous DTS node entries for the 3262 audiocodec device when SOC is master (In this aplay command is able to play sound recorded from arecord command above):-
sound0: sound0 { compatible = "simple-audio-card"; simple-audio-card,name = "BeagleBoard-X15"; simple-audio-card,format = "dsp_b"; simple-audio-card,bitclock-master = <&cpu_dai>; simple-audio-card,frame-master = <&cpu_dai>; simple-audio-card,bitclock-inversion; cpu_dai: simple-audio-card,cpu { sound-dai = <&mcasp3>; clocks = <&clkout2_clk>; system-clock-id = <MCASP_CLK_HCLK_AUXCLK>; }; sound0_master: simple-audio-card,codec { sound-dai = <&tlv320aic3262>; clocks = <&clkout2_clk>; }; };
This is the modified DTS entry as below:-
sound0: sound0 { compatible = "simple-audio-card"; simple-audio-card,name = "BeagleBoard-X15"; simple-audio-card,format = "dsp_b"; simple-audio-card,bitclock-master = <&sound0_master>; simple-audio-card,frame-master = <&sound0_master>; simple-audio-card,bitclock-inversion; cpu_dai: simple-audio-card,cpu { sound-dai = <&mcasp3>; clocks = <&clkout2_clk>; system-clock-id = <MCASP_CLK_HCLK_AUXCLK>; }; sound0_master: simple-audio-card,codec { sound-dai = <&tlv320aic3262>; clocks = <&clkout2_clk>; system-clock-frequency=<22579200>; system-clock-direction-out; }; };
What else are we missing ?
Hi Guy
Where will you get the aic3262 driver code?
Would you be so kind and share the run-time log?
I have a question on you new dts setting: since aic3262 has been already set as master:
simple-audio-card,bitclock-master = <&sound0_master>;
simple-audio-card,frame-master = <&sound0_master>;
Why still clocks and system-clock-id for cpu_dai: simple-audio-card,cpu?
Hope following links can help you.
(+) TLV320AIC3262: AIC3262 I2S configuration problem - Audio forum - Audio - TI E2E support forums
Hi,
1. The driver code from github is ported to be used. The source link is, as below:-
https://github.com/bigbiff/kernel_asus_tf700t/blob/master/sound/soc/codecs/tlv320aic326x.h
https://github.com/bigbiff/kernel_asus_tf700t/blob/master/sound/soc/codecs/tlv320aic326x.c
2. The output of dmesg upon inserting the device driver is as below .
[ 121.410195] #aic3x_i2c_probe: Entered [ 121.414464] #aic3x_i2c_probe: Done ret 0 [ 121.419382] of_get_named_gpiod_flags: can't parse 'simple-audio-card,hp-det-gpio' property of node '/sound0[0]' [ 121.419396] of_get_named_gpiod_flags: can't parse 'simple-audio-card,mic-det-gpio' property of node '/sound0[0]' [ 121.419452] #aic3262_probe: Invoked.. [ 121.423133] #reg_def_conf: Invoked.. [ 121.457930] #reg_def_conf: Done.. [ 121.461506] #aic3262_probe: I2C IRQ Configuration is Wrong. Please check it.. [ 121.469032] #aic3262_asi_default_config: Invoked. Will Config ASI Registers to Defaults.. [ 121.477374] #aic3262_set_bias_level: Codec Active 0[0] [ 121.483177] aic3262_add_controls++ [ 121.486814] #Completed adding new dapm widget controls size=40 [ 121.492795] aic3262-codec 3-0018: Control not supported for path IN1L -> [IN1L Route] -> Left ADC [ 121.501726] aic3262-codec 3-0018: ASoC: no dapm match for IN1L --> IN1L Route --> Left ADC [ 121.510091] aic3262-codec 3-0018: ASoC: Failed to add route IN1L -> IN1L Route -> Left ADC [ 121.518617] aic3262-codec 3-0018: Control not supported for path IN2L -> [IN2L Route] -> Left ADC [ 121.527604] aic3262-codec 3-0018: ASoC: no dapm match for IN2L --> IN2L Route --> Left ADC [ 121.535935] aic3262-codec 3-0018: ASoC: Failed to add route IN2L -> IN2L Route -> Left ADC [ 121.544441] aic3262-codec 3-0018: Control not supported for path IN3L -> [IN3L Route] -> Left ADC [ 121.553420] aic3262-codec 3-0018: ASoC: no dapm match for IN3L --> IN3L Route --> Left ADC [ 121.561780] aic3262-codec 3-0018: ASoC: Failed to add route IN3L -> IN3L Route -> Left ADC [ 121.570112] aic3262-codec 3-0018: Control not supported for path IN4L -> [IN4L Route] -> Left ADC [ 121.579070] aic3262-codec 3-0018: ASoC: no dapm match for IN4L --> IN4L Route --> Left ADC [ 121.587368] aic3262-codec 3-0018: ASoC: Failed to add route IN4L -> IN4L Route -> Left ADC [ 121.595727] aic3262-codec 3-0018: Control not supported for path IN1R -> [IN1R Route] -> Right ADC [ 121.604739] aic3262-codec 3-0018: ASoC: no dapm match for IN1R --> IN1R Route --> Right ADC [ 121.613183] aic3262-codec 3-0018: ASoC: Failed to add route IN1R -> IN1R Route -> Right ADC [ 121.621586] aic3262-codec 3-0018: Control not supported for path IN2R -> [IN2R Route] -> Right ADC [ 121.630640] aic3262-codec 3-0018: ASoC: no dapm match for IN2R --> IN2R Route --> Right ADC [ 121.639042] aic3262-codec 3-0018: ASoC: Failed to add route IN2R -> IN2R Route -> Right ADC [ 121.647465] aic3262-codec 3-0018: Control not supported for path IN3R -> [IN3R Route] -> Right ADC [ 121.656494] aic3262-codec 3-0018: ASoC: no dapm match for IN3R --> IN3R Route --> Right ADC [ 121.664929] aic3262-codec 3-0018: ASoC: Failed to add route IN3R -> IN3R Route -> Right ADC [ 121.673376] aic3262-codec 3-0018: Control not supported for path IN4R -> [IN4R Route] -> Right ADC [ 121.682441] aic3262-codec 3-0018: ASoC: no dapm match for IN4R --> IN4R Route --> Right ADC [ 121.690881] aic3262-codec 3-0018: ASoC: Failed to add route IN4R -> IN4R Route -> Right ADC [ 121.699322] #Completed adding DAPM routes [ 121.703356] #Completed updating dapm [ 121.707174] #aic3262_probe: done.. [ 121.710689] #aic3262_multi_i2s_set_dai_sysclk: DAI ID 1 Freq 22579200 Direction 0 [ 121.718312] aic3262_multi_i2s_asi1_set_dai_fmt: DAI_ID 1 fmt 4869 [ 121.724729] #aic3262_multi_i2s_asi1_set_dai_fmt: Configuring ASI1 as Frame Master.. [ 121.732449] #aic3262_multi_i2s_asi1_set_dai_fmt: Configuring ASI1 for DSP_B Mode.. [ 121.741273] asoc-simple-card sound0: aic3262-asi1 <-> 48468000.mcasp mapping ok [ 121.748631] asoc-simple-card sound0: ASoC: no DMI vendor name! [ 121.755291] #aic3262_set_bias_level: Codec Active 0[0]
3. DTS CHANGES ARE AS MENTIONED IN MY PREV POST. Apart from these, the driver changes, as suggested in our another related query : https://e2e.ti.com/support/audio-group/audio/f/audio-forum/1356927/tlv320aic3262-configure-wclk/5175612#5175612 by pdjuandi , are also incorporated as below:-
diff --git a/sound/soc/codecs/tlv320aic326x.c b/sound/soc/codecs/tlv320aic326x.c
index 1ca2dd1..3183432 100644
--- a/sound/soc/codecs/tlv320aic326x.c
+++ b/sound/soc/codecs/tlv320aic326x.c
@@ -1235,7 +1235,7 @@ static const struct aic3262_rate_divs aic3262_divs[] = {
{{0, 60, 1}, {0, 61, 1} } },
{15000000, 11025, 1, 4, 96, 128, 8, 6, 128, 8, 6, 4,
{{0, 60, 1}, {0, 61, 1} } },
- {22579200, 11025, 1, 3, 7632, 128, 4, 4, 128, 4, 4, 4,
+ {22579200, 11025, 1, 6, 5307, 128, 3, 12, 128, 3, 12, 4,
{{0, 60, 1}, {0, 61, 1} } },
{11289600, 11025, 1, 3, 7632, 128, 4, 2, 128, 4, 2, 4,
{{0, 60, 1}, {0, 61, 1} } },
@@ -1254,7 +1254,8 @@ static const struct aic3262_rate_divs aic3262_divs[] = {
{10000000, 16000, 1, 4, 96, 128, 8, 6, 128, 8, 6, 4,
{{0, 60, 1}, {0, 61, 1} } },
-
+ {22579200, 16000, 1, 6, 5307, 128, 3, 12, 128, 3, 12, 4,
+ {{0, 60, 1}, {0, 61, 1} } },
{15000000, 16000, 1, 4, 96, 128, 8, 6, 128, 8, 6, 4,
{{0, 60, 1}, {0, 61, 1} } },
@@ -2307,6 +2308,8 @@ static int aic3262_multi_i2s_hw_params(struct snd_pcm_substream *substream,
i = aic3262_get_divs(aic3262->sysclk, params_rate(params));
i2c_verify_book0(component);
@@ -2828,7 +2831,10 @@ static const struct aic3262_configs aic3262_reg_init[] = {
{0, REF_PWR_DLY, 0x01},
//Clock Initialize
- {0, DAC_ADC_CLKIN_REG, 0x00}, /*DAC ADC CLKIN*/
+ //{0, DAC_ADC_CLKIN_REG, 0x00}, /*DAC ADC CLKIN*/
+ {0, DAC_ADC_CLKIN_REG, 0x33}, /*DAC ADC CLKIN*/
+ {0, PLL_CKIN_DIV, 0x02}, /*PLL_CLKIN Divider*/
+
4. AUDIOCODEC REGISTER SETTING :
4.1 The following registers were set before recording from the mic.
#ASI config
/usr/sbin/i2cset -f -y 3 0x18 0x00 0x04
/usr/sbin/i2cset -f -y 3 0x18 0x0a 0x24
4.2 The following registers were set while recording from the mic.
/usr/sbin/i2cset -f -y 3 0x18 0x00 0x00
/usr/sbin/i2cset -f -y 3 0x18 0x0c 0x8c
/usr/sbin/i2cset -f -y 3 0x18 0x00 0x04
/usr/sbin/i2cset -f -y 3 0x18 0x0c 0x88
5. CLOCKING VERIFICATION BY OSCILLOSCOPE: -
After the registers mentioned in 4.1 and 4.2 were set both WCLK and BCLK were probed. Their values came out to be 16Khz and 256Khz
respectively. As per our understanding these seem to be ok for recording audio at 16Khz sampling rate using command mentioned in 6:-
6. ARECORD TO VERIFY THE MICROPHONE : command used to record is:-
arecord -r 16000 -f S16_LE test16
Then upon playing the test16 using aplay the playback happens at a lower tempo(speed) than the actual tempo(speed). How can this be resolved?
The command used to play the recorded file is:-
aplay -r 16000 -f S16_LE test16
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Why still clocks and system-clock-id for cpu_dai: simple-audio-card,cpu?
Even after removing these (clocks and system-clock-id) entries from dts, the same behaviour is observed as mentioned in point 6 above.
What's the kernel version and kindly dump all the registers.
Kindly also upload the recorded audio clip here. I will check the bitstream.