TLV320DAC3100 AUDIO CODEC on i.MX8 M Mini

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TLV320DAC3100 AUDIO CODEC on i.MX8 M Mini

1,108 Views
deeksha
Contributor III

Hi , 

I am working on L5.4.70 kernel on i.MX8 M Mini processor . We are using tlv320dac100 codec module.

 

when I gave : aplay -l

Hardware device listed successfully -->

*** List of PLAYBACK Hardware Devices ***
card 0: imxspdif [imx-spdif], device 0: S/PDIF PCM snd-soc-dummy-dai-0 [S/PDIF PCM snd-soc-dummy-dai-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Output [Audio Output], device 0: 30050000.sai-tlv320dac31xx-hifi tlv320dac31xx-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

When I am trying to play audio[earphone ] with 

aplay -D plughw:1,0 /unit_tests/Audio/sample_22_frames.mp3

I am getting following error :

 

root@iWave-G39H:~# aplay -D plughw:1,0 /unit_tests/Audio/sample_22_frames.mp3
Playing raw data '/unit_tests/Audio/sample_22_frames.mp3' : Unsigned 8 bit, Rate 8000 Hz, Mono

[ 3483.772935] tlv320aic31xx-codec 1-0018: aic31xx_set_dai_sysclk: Unsupported frequency 208000
[ 3483.785232] asoc-simple-card sound-tlv320dac31: ASoC: machine hw_params failed: -22
aplay: set_params:1403: 
Unable to install hw params:
ACCESS: RW_INTERLEAVED
FORMAT: U8 SUBFORMAT: STD
SAMPLE_BITS: 8 FRAME_BITS: 8
CHANNELS: 1
RATE: 8000
PERIOD_TIME: 125000
PERIOD_SIZE: 1000
PERIOD_BYTES: 1000
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 4000
BUFFER_BYTES: 4000
TICK_TIME: 0

[ 3483.946043] tlv320aic31xx-codec 1-0018: aic31xx_set_dai_sysclk: Unsupported frequency 0

 

Here I attached my dts tree ,

/ TLV amplifier /
sound-tlv320dac31 {
compatible = "simple-audio-card";
simple-audio-card,name = "Audio Output";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&sound_codec>;
simple-audio-card,frame-master = <&sound_codec>;
/*simple-audio-card,mclk-fs=<256>;*/
simple-audio-card,widgets =
"Headphone", "Headphone Jack";
simple-audio-card,routing =
"Headphone Jack", "HPL",
"Headphone Jack", "HPR";
/* simple-audio-card,aux-devs = <&hpa1>;* /

simple-audio-card,cpu {
sound-dai = <&sai5>;
};

sound_codec: simple-audio-card,codec {
sound-dai = <&codec>;
/*clocks = <&clk IMX8MM_CLK_SAI5_ROOT>;*/
system-clock-frequency=<12000000>;
};
};

&sai5 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai5>;
assigned-clocks = <&clk IMX8MM_CLK_SAI5>;
assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
assigned-clock-rates = <12000000>;
clocks = <&clk IMX8MM_CLK_SAI5_IPG>, <&clk IMX8MM_CLK_DUMMY>,
<&clk IMX8MM_CLK_SAI5_ROOT>, <&clk IMX8MM_CLK_DUMMY>,
<&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_AUDIO_PLL1_OUT>,
<&clk IMX8MM_AUDIO_PLL2_OUT>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k";
status = "okay";
};

 

codec: codec@18 {
compatible = "ti,tlv320dac3100";
pinctrl-names = "default";
/*pinctrl-0 = <&pinctrl_codec>;*/
reg = <0x18>;
#sound-dai-cells = <0>;
HPVDD-supply = <&reg_3p3v>;
SPRVDD-supply = <&reg_3p3v>;
SPLVDD-supply = <&reg_3p3v>;
AVDD-supply = <&reg_3p3v>;
IOVDD-supply = <&reg_3p3v>;
DVDD-supply = <&reg_1p8v>;
/*gpio-reset = <&gpio1 6 GPIO_ACTIVE_LOW>;*/   /* configured in the hardware */
status = "okay";
};

pinctrl_sai5: sai5grp { / SAI5: IOMUX Pin Configuration /
fsl,pins = <
MX8MM_IOMUXC_SAI5_MCLK_SAI5_MCLK 0xd6
MX8MM_IOMUXC_SAI5_RXD2_SAI5_TX_BCLK 0xd6
MX8MM_IOMUXC_SAI5_RXD1_SAI5_TX_SYNC 0xd6
MX8MM_IOMUXC_SAI5_RXD3_SAI5_TX_DATA0 0xd6
MX8MM_IOMUXC_SAI5_RXD0_SAI5_RX_DATA0 0xd6
>;
};

Here is some dmesg print 

dmesg | grep tlv
[ 3.676843] asoc-simple-card sound-tlv320dac31: tlv320dac31xx-hifi <-> 30050000.sai mapping ok
[ 3.689218] asoc-simple-card sound-tlv320dac31: ASoC: no DMI vendor name!
root@iWave-G39H:~# dmesg | grep sai
[ 3.663954] debugfs: Directory '30050000.sai' with parent 'Audio Output' already present!

Anything I am missing out in dts tree, why I am getting hardware parameter failed  and unsupported frequency error. Please help me in resolving this error 

 

Thanks in advance,

Regards,

Deeksha

Labels (1)
0 Kudos
1 Reply

1,075 Views
jamesbone
NXP TechSupport
NXP TechSupport

Hello,

 

If you try with different frequencies you are still having problems?,   I am asking because I have seen some wrong behaviors under this port (SAI5), if you try SAI1  and make a small test using  ALSA test.

 

Unfortunately, the RM has some errors that have crept in in the latest revision.

  • The SYNC bit field of both TCR2 and RCR2 should be reserved for values of 10b and 11b.  
  • Remove section 13.10.3.3.2 entirely

Rev 2 of the 8M Mini RM was correct regarding the above. For some reason, the two items above were mistakenly inserted into the Rev 3 RM.

 

External connections are required for the 8M Mini to operate different SAI instances synchronously with each other. This would depend on the sources of the master clock, bit clock, and frame sync. If all are external, then both SAI instances need to be configured to receive all three. If one or the other SAI is generating them, then the other SAI needs to be configured to receive them. There is no way to route the signals internally, so external, board level connections need to be made.

 

 

 

0 Kudos