Hi,
I have similar problem. I am trying to run simple PCM5102 based DAC over I2S on BananaPro board but I got errors when I am try to play something.
I have added to dts file:
pcm5102a: pcm5102a {
#sound-dai-cells = <0>;
compatible = "ti,pcm5102a";
status = "okay";
};
sound {
compatible = "simple-audio-card";
simple-audio-card,format = "i2s";
simple-audio-card,cpu {
sound-dai = <&i2s0>;
};
simple-audio-card,codec {
sound-dai = <&pcm5102a>;
};
};
and
&i2s0 {
pinctrl-names = "default";
pinctrl-0 = <&i2s0_pins_a>;
status = "okay";
};
After replacing dtb file and rebooting card is visible:
# aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=sun4icodec
sun4i-codec,
Default Audio Device
sysdefault:CARD=sun4icodec
sun4i-codec,
Default Audio Device
default:CARD=D1c22400i2spcm5
1c22400.i2s-pcm5102a-hifi,
Default Audio Device
sysdefault:CARD=D1c22400i2spcm5
1c22400.i2s-pcm5102a-hifi,
Default Audio Device
but when I'm trying to play something I got error messages. Below I put output from aplay and speaker-test commands.
# aplay -c 2 -D hw:1,0 /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1305: Channels count non available
# speaker-test -t wav -c 2 -D hw:1
speaker-test 1.1.3
Playback device is hw:1
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 128 to 131072
Period size range from 64 to 16384
Using max buffer size 131072
Periods = 4
Unable to set hw params for playback: Invalid argument
Setting of hwparams failed: Invalid argument
After speaker-test I got following kernel message:
sun4i-i2s 1c22400.i2s: ASoC: can't set 1c22400.i2s hw params: -22
Anybody knows what is wrong with my configuration?