Other Parts Discussed in Thread: TLV320DAC3100,
Tool/software:
I integrated tlv320dac3100 into my linux IMX93QS93 board. It is working, I can test-speaker and aplay some wav files. Butthe thing that the first time I power the board and codec on I got error while testing it and I hear just noise when I test the speaker. I power them off and on again and magically the codec works fine without any error and I hear the correct sound coming out of speaker.
The error I got :
~# aplay -D plughw:0,0 /usr/share/sounds/alsa/Rear_Right.wav Playing WAVE '/usr/share/sounds/alsa/Rear_Right.w[ 38.619370] tlv320aic31xx-codec 1-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic31xx-codec.1-0018 for register: [0x00000040] -5 av' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
and when I test speaker I got an error but I can hear just noise coming out:
~# speaker-test -D plughw:0,0 -c 2 -r 48000 -F S16_LE -t sine -f 500 speaker-test 1.2.8 Playback device is plughw:0,0 Stream parameters are 48000[ 156.926645] tlv320aic31xx-codec 1-0018: ASoC: error at snd_soc_component_update_bits on tlv320aic31xx-codec.1-0018 for register: [0x00000040] -5 Hz, S16_LE, 2 channels Sine wave rate is 500.0000Hz Rate set to 48000Hz (requested 48000Hz) Buffer size range from 32 to 131072 Period size range from 16 to 8184 Using max buffer size 131072 Periods = 4 was set period_size = 4096 was set buffer_size = 131072 0 - Front Left 1 - Front Right Time per period = 3.264035
Here it is my DT configuration:
`
audio_clk: audio-clk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <12000000>;
};
codec_audio: sound {
compatible = "simple-audio-card";
simple-audio-card,name = "tlv320dac3100-codec";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&cpu_dai>;
simple-audio-card,frame-master = <&cpu_dai>;
simple-audio-card,widgets =
"Line", "Line Out",
"Headphone", "Headphone Jack",
"Speaker", "Speaker Out";
simple-audio-card,routing =
"Line Out", "HPL",
"Line Out", "HPR",
"Headphone Jack", "HPL",
"Headphone Jack", "HPR";
status = "okay";
cpu_dai: simple-audio-card,cpu {
sound-dai = <&sai1>;
};
codec_dai: simple-audio-card,codec {
sound-dai = <&audio_codec>;
clocks = <&audio_clk>;
};
};
};
&sai1 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai1>;
assigned-clocks = <&clk IMX93_CLK_SAI1>;
assigned-clock-parents = <&clk IMX93_CLK_AUDIO_PLL>;
assigned-clock-rates = <12288000>;
fsl,sai-mclk-direction-output;
status = "okay";
};
&lpi2c2 {
clock-frequency = <400000>;
pinctrl-names = "default", "gpio";
pinctrl-0 = <&pinctrl_lpi2c2>;
status = "okay";
// Add TLV320AIC3100 audio codec node
audio_codec: codec@18 {
compatible = "ti,tlv320dac3100";
pinctrl-names = "default";
reg = <0x18>;
#sound-dai-cells = <0>;
reset-gpios = <&gpio4 9 GPIO_ACTIVE_LOW>;
HPVDD-supply = <®_audio_pwr_3v3>; // 1.8V in the schematic BUT 3.3V in the TLV320AIC3100 datasheet !
AVDD-supply = <®_audio_pwr_3v3>;
DVDD-supply = <®_audio_pwr_1v8>;
IOVDD-supply = <®_audio_pwr_3v3>;
SPRVDD-supply = <®_audio_pwr_3v3>;
SPLVDD-supply = <®_audio_pwr_3v3>;
SPKVDD-supply = <®_audio_pwr_5v>;
};
};
pinctrl_lpi2c2: lpi2c2grp {
fsl,pins = <
MX93_PAD_I2C2_SCL__LPI2C2_SCL 0x40001a1e
MX93_PAD_I2C2_SDA__LPI2C2_SDA 0x40001a1e
>;
};
What ids the problem here, is there something that I missed ? probably there is something missed related to device initialization !!
