IMX8MP : speaker-test error message while trying to play audio, codec : TLV320AIC3X

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

IMX8MP : speaker-test error message while trying to play audio, codec : TLV320AIC3X

Jump to solution
2,176 Views
mathad22
Contributor III

Hi there,

I have an error message every time I try to play audio :

 

root@imx8mp-var-dart:~# speaker-test -D plughw:HTC2SoundCard,0 -c 2 -r 48000 -F S16_LE -t sine -f 5000

speaker-test 1.1.9

Playback device is plughw:HTC2SoundCard,0
Stream parameters are 48000Hz, S16_LE, 2 channels
Sine wave rate is 5000.0000Hz
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 16384
Period size range from 32 to 8192
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
0 - Front Left
Write error: -5,Input/output error
xrun_recovery failed: -5,Input/output error
Transfer failed: Input/output error

 

 

 

root@imx8mp-var-dart:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HTC2SoundCard [HTC2-Sound-Card], device 0: 30c20000.sai-tlv320aic3x-hifi tlv320aic3x-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@imx8mp-var-dart:~# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
sysdefault:CARD=HTC2SoundCard
    HTC2-Sound-Card, 
    Default Audio Device

 

 

my codec TLV320AIC34 is configured as master and SAI_TXFS signal sends nothing to the codec.

Any idea that could help ?

Many thanks.

Labels (2)
0 Kudos
1 Solution
2,152 Views
mathad22
Contributor III

Hi Igor,

Thanks for all this information, I found the solution, here are my settings for those who would like to know :

 

sound-tlv320aic34 {
compatible = "simple-audio-card";
simple-audio-card,name = "HTC2-Sound-Card";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&dailink_master>;
simple-audio-card,frame-master = <&dailink_master>;
simple-audio-card,mclk-fs = <256>;
simple-audio-card,widgets =
"Microphone", "Microphone Jack",
"Line", "Line In Jack",
"Line", "Line Out Jack",
"Headphone", "Headphone Jack",
"Speaker", "Speaker External";
simple-audio-card,routing =
"Headphone Jack", "HPLOUT",
"Headphone Jack", "HPROUT";
dailink_master: simple-audio-card,cpu {
sound-dai = <&sai2>;
};
simple-audio-card,codec {
sound-dai = <&tlv320aic34>;
clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI2_MCLK1>;
};
};
};

&sai2 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai2>;
assigned-clocks = <&clk IMX8MP_CLK_SAI2>;
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
assigned-clock-rates = <12288000>;
clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI2_IPG>, <&clk IMX8MP_CLK_DUMMY>,
<&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI2_MCLK1>, <&clk IMX8MP_CLK_DUMMY>,
<&clk IMX8MP_CLK_DUMMY>, <&clk IMX8MP_AUDIO_PLL1_OUT>,
<&clk IMX8MP_AUDIO_PLL2_OUT>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k";
fsl,sai-synchronous-rx;
status = "okay";
};

 

&i2c3 {
tlv320aic34: tlv320aic34@18 {
#sound-dai-cells = <0>;
compatible = "ti,tlv320aic3x";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_tlv320>;
reg = <0x18>;
reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
IOVDD-supply = <&reg_audio>; /* 3V3 */
DVDD-supply = <&reg_audio_1v8>; /* 1V8 */
AVDD-supply = <&reg_audio>; /* 3V3 */
DRVDD-supply = <&reg_audio>; /* 3V3 */
};
};

pinctrl_sai2: sai2grp {
fsl,pins = <
MX8MP_IOMUXC_SAI2_MCLK__AUDIOMIX_SAI2_MCLK 0xd6
MX8MP_IOMUXC_SAI2_RXD0__AUDIOMIX_SAI2_RX_DATA00 0xd6
MX8MP_IOMUXC_SAI2_RXFS__AUDIOMIX_SAI2_RX_SYNC 0xd6
MX8MP_IOMUXC_SAI2_TXC__AUDIOMIX_SAI2_TX_BCLK 0xd6
MX8MP_IOMUXC_SAI2_TXD0__AUDIOMIX_SAI2_TX_DATA00 0xd6
>;
};

pinctrl_tlv320: tlv320grp {
fsl,pins = <
MX8MP_IOMUXC_GPIO1_IO06__GPIO1_IO06 0x16
>;
};

 

Cheers, Mathieu.

View solution in original post

0 Kudos
2 Replies
2,153 Views
mathad22
Contributor III

Hi Igor,

Thanks for all this information, I found the solution, here are my settings for those who would like to know :

 

sound-tlv320aic34 {
compatible = "simple-audio-card";
simple-audio-card,name = "HTC2-Sound-Card";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&dailink_master>;
simple-audio-card,frame-master = <&dailink_master>;
simple-audio-card,mclk-fs = <256>;
simple-audio-card,widgets =
"Microphone", "Microphone Jack",
"Line", "Line In Jack",
"Line", "Line Out Jack",
"Headphone", "Headphone Jack",
"Speaker", "Speaker External";
simple-audio-card,routing =
"Headphone Jack", "HPLOUT",
"Headphone Jack", "HPROUT";
dailink_master: simple-audio-card,cpu {
sound-dai = <&sai2>;
};
simple-audio-card,codec {
sound-dai = <&tlv320aic34>;
clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI2_MCLK1>;
};
};
};

&sai2 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai2>;
assigned-clocks = <&clk IMX8MP_CLK_SAI2>;
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
assigned-clock-rates = <12288000>;
clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI2_IPG>, <&clk IMX8MP_CLK_DUMMY>,
<&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI2_MCLK1>, <&clk IMX8MP_CLK_DUMMY>,
<&clk IMX8MP_CLK_DUMMY>, <&clk IMX8MP_AUDIO_PLL1_OUT>,
<&clk IMX8MP_AUDIO_PLL2_OUT>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k";
fsl,sai-synchronous-rx;
status = "okay";
};

 

&i2c3 {
tlv320aic34: tlv320aic34@18 {
#sound-dai-cells = <0>;
compatible = "ti,tlv320aic3x";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_tlv320>;
reg = <0x18>;
reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
IOVDD-supply = <&reg_audio>; /* 3V3 */
DVDD-supply = <&reg_audio_1v8>; /* 1V8 */
AVDD-supply = <&reg_audio>; /* 3V3 */
DRVDD-supply = <&reg_audio>; /* 3V3 */
};
};

pinctrl_sai2: sai2grp {
fsl,pins = <
MX8MP_IOMUXC_SAI2_MCLK__AUDIOMIX_SAI2_MCLK 0xd6
MX8MP_IOMUXC_SAI2_RXD0__AUDIOMIX_SAI2_RX_DATA00 0xd6
MX8MP_IOMUXC_SAI2_RXFS__AUDIOMIX_SAI2_RX_SYNC 0xd6
MX8MP_IOMUXC_SAI2_TXC__AUDIOMIX_SAI2_TX_BCLK 0xd6
MX8MP_IOMUXC_SAI2_TXD0__AUDIOMIX_SAI2_TX_DATA00 0xd6
>;
};

pinctrl_tlv320: tlv320grp {
fsl,pins = <
MX8MP_IOMUXC_GPIO1_IO06__GPIO1_IO06 0x16
>;
};

 

Cheers, Mathieu.

0 Kudos