Hello everyone,
I'm trying to use the xcvr controller of the imx8m plus in yocto linux to output audio throught spdif.
The current device tree configuration for the xcvr is the following:
sound-xcvr {
compatible = "fsl,imx-audio-card";
model = "imx-audio-xcvr";
pri-dai-link {
link-name = "XCVR PCM";
cpu {
sound-dai = <&xcvr>;
};
};
};
&xcvr {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_xcvr>;
status = "okay";
};
pinctrl_xcvr: xcvrgrp {
fsl,pins = <
MX8MP_IOMUXC_SPDIF_TX__AUDIOMIX_SPDIF1_OUT 0xd6
>;
};
After booting the system and doing
speaker-test -D hw:0,0 -r 48000 -c 2 -t wav
I get the following error:
Playback device is hw:0,0
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Sample format not available for playback: Invalid argument
Setting of hwparams failed: Invalid argument
However, doing a speaker-test using
speaker-test -D iec958 -c 2 -r 48000 -t wav
the speaker-test plays fine.
These are the hw params:
--------------------
ACCESS: MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT: IEC958_SUBFRAME_LE
SUBFORMAT: STD
SAMPLE_BITS: 32
FRAME_BITS: 64
CHANNELS: 2
RATE: [32000 192000]
PERIOD_TIME: (83 255969)
PERIOD_SIZE: [16 8191]
PERIOD_BYTES: [128 65528]
PERIODS: [2 4096]
BUFFER_TIME: (166 2048000]
BUFFER_SIZE: [32 65536]
BUFFER_BYTES: [256 524288]
TICK_TIME: ALL
--------------------
So from my understanding the problem is that it only accepts IEC958 subframes and not PCM.
Is there any way to configure the driver so that it accepts pcm frames and thus be used with hw:x,x directly?
Thanks in advance
已解决! 转到解答。
Hi,
Converting from kernel layer, it's not a good solution. The converting should be done in application layer.For example, you can use alsa pcm plugin to convert pcm to iec958.
Best Regards,
Zhiming
Hi,
Converting from kernel layer, it's not a good solution. The converting should be done in application layer.For example, you can use alsa pcm plugin to convert pcm to iec958.
Best Regards,
Zhiming