Other Parts Discussed in Thread: TLV320AIC3204,
Tool/software:
Hi TI team,
I'm working with the TLV320AIC3204 audio codec, which is interfaced with the AM6252 via McASP. In my setup, the codec operates as the master, with MCLK supplied through an external oscillator at 12.288 MHz. The BCLK and WCLK are also generated by the codec.
My requirement is to play audio using the codec at 8 kHz, 16 kHz, 32 kHz, and 48 kHz sample rates in different applications. One observation is that when I run a GStreamer pipeline with 48 kHz first, then stop and try running it with another sample rate, it throws an error: "unable to set hw_params."
With other NXP processors, I have not encountered such an issue.
Please find the dts modifications:
codec_audio1: sound1 {
compatible = "simple-audio-card";
simple-audio-card,name = "AM625x-TLV320AIC3204";
simple-audio-card,widgets =
// "Microphone", "Mic Jack",
// "Headphone", "Headphone Jack";
"Line", "Line In",
"Line", "Line Out";
simple-audio-card,routing =
"Line Out", "HPL",
"Line Out", "HPR",
"IN1_L", "Line In",
"IN1_R", "Line In";
// "IN1_L", "Mic Jack",
// "IN1_R", "Mic Jack",
// "Headphone Jack", "HPL",
// "Headphone Jack", "HPR";
simple-audio-card,format = "i2s";
//simple-audio-card,mclk-fs = <256>;
simple-audio-card,bitclock-master = <&sound_master1>;
simple-audio-card,frame-master = <&sound_master1>;
//simple-audio-card,bitclock-inversion;
simple-audio-card,cpu {
sound-dai = <&mcasp0>;
};
sound_master1: simple-audio-card,codec {
sound-dai = <&tlv320aic3204>;
clocks = <&tlv_mclk>;
};
};
tlv_mclk: tlv-mclk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <12288000>;
};
tlv320aic3204: audio-codec@18 {
compatible = "ti,tlv320aic32x4";
reg = <0x18>;
#sound-dai-cells = <0>;
//aic3x-micbias-vg = <2>;
ldoin-supply = <&vcc_3v3_sys>;
iov-supply = <&vcc_3v3_sys>;
dv-supply = <&vcc_1v8>;
av-supply = <&vcc_1v8>;
clocks = <&tlv_mclk>;
clock-names = "mclk";
status = "okay";
};
&mcasp0 {
status = "okay";
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&main_mcasp0_pins_default>;
op-mode = <0>; /* MCASP_IIS_MODE */
tdm-slots = <2>;
/* 16 serializers */
serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
1 2 0 0
0 0 0 0
0 0 0 0
0 0 0 0
>;
tx-num-evt = <32>;
rx-num-evt = <32>;
};
Please treat it on high priority .
Thanks & Regards
SHEKAR NUTHULA
main_mcasp0_pins_default: main-mcasp0-pins-default {
pinctrl-single,pins = <
AM62X_IOPAD(0x01a4, PIN_INPUT, 0) /* (B20) MCASP0_ACLKX.MCASP0_ACLKX (BCLK)*/
AM62X_IOPAD(0x01a8, PIN_INPUT, 0) /* (D20) MCASP0_AFSX.MCASP0_AFSX (WCLK) */
AM62X_IOPAD(0x01a0, PIN_OUTPUT, 0) /* (E18) MCASP0_AXR0.MCASP0_AXR0 (Din) */
AM62X_IOPAD(0x019c, PIN_INPUT, 0) /* (B18) MCASP0_AXR1.MCASP0_AXR1 (Dout) */
>;
};