I am trying to test the TLV320DAC3100EVM-U kit with IMX93QS93 Linux board. I am able to detect it know as you can see here:
root@qs93-5210:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: tlv320aic31xxco [tlv320aic31xx-codec], device 0: 443b0000.sai-tlv320dac31xx-hifi tlv320dac31xx-hifi-0 [443b0000.sai-tlv320dac31xx-hifi tlv320dac31xx-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
and,
root@qs93-5210:~# aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=tlv320aic31xxco
tlv320aic31xx-codec, 443b0000.sai-tlv320dac31xx-hifi tlv320dac31xx-hifi-0
Default Audio Device
- But when I tried to aplay sine wave I got the following errors:
root@qs93-5210:~# 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[ 247.600154] tlv320aic31xx-codec 1-0018: aic31xx_setup_pll: Sample rate (48000) and format not supported
Hz, S16_LE, 2 ch[ 247.610738] tlv320aic31xx-codec 1-0018: ASoC: error at snd_soc_dai_hw_params on tlv320dac31xx-hifi: -22
annels
Sine wave[ 247.621511] 443b0000.sai-tlv320dac31xx-hifi: ASoC: error at __soc_pcm_hw_params on 443b0000.sai-tlv320dac31xx-hifi: -22
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
Unable to set hw params for playback: Invalid argument
Setting of hwparams failed: Invalid argument
- I've seen this related kernel messages as well:
alsa-lib /usr/src/debug/alsa-lib/1.2.8-r0/src/ucm/main.c:1541:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -2
No state is present for card tlv320aic31xxco
alsa-lib /usr/src/debug/alsa-lib/1.2.8-r0/src/ucm/main.c:1541:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -2
Found hardware: "simple-card" "" "" "" ""
Hardware is initialized using a generic method
- Here it is my device tree :
audio_clk: audio-clk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <12288000>;
};
codec_audio: sound {
compatible = "simple-audio-card";
simple-audio-card,name = "tlv320aic31xx-codec";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&codec_dai>;
simple-audio-card,frame-master = <&codec_dai>;
simple-audio-card,widgets =
"Microphone", "Mic Jack",
"Line", "Line In",
"Line", "Line Out",
"Headphone", "Headphone Jack",
"Speaker", "Speaker Out";
simple-audio-card,routing =
"Line In", "AIN1", // Line input route
"Line Out", "HPL", // Line out to left headphone
"Line Out", "HPR", // Line out to right headphone
"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>;
status = "okay";
assigned-clocks = <&clk IMX93_CLK_SAI1>;
assigned-clock-parents = <&clk IMX93_CLK_AUDIO_PLL>;
assigned-clock-rates = <12288000>;
clocks = <&clk IMX93_CLK_SAI1_IPG>,
<&clk IMX93_CLK_AUDIO_PLL>,
<&clk IMX93_CLK_DUMMY>, <&clk IMX93_CLK_DUMMY>,
<&clk IMX93_CLK_AUDIO_PLL>;
clock-names = "bus", "mclk1", "mclk2", "mclk3", "pll";
};
&lpi2c2 {
clock-frequency = <400000>;
pinctrl-names = "default";
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-gpio = <&gpio4 9 GPIO_ACTIVE_LOW>;
HPVDD-supply = <®_vdd_3v3>;
AVDD-supply = <®_vdd_3v3>;
DVDD-supply = <®_vref_1v8>;
IOVDD-supply = <®_vdd_3v3>;
SPRVDD-supply = <®_vdd_3v3>;
SPLVDD-supply = <®_vdd_3v3>;
status = "okay";
};
};
I am struggling to make this work, could anyone help me out with this?