IMX8M PLUS: Output audio through SPDIF, problem with PCM transmittion

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

IMX8M PLUS: Output audio through SPDIF, problem with PCM transmittion

跳至解决方案
99 次查看
coulomz
Contributor I

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

标签 (3)
0 项奖励
回复
1 解答
50 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

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.

https://askubuntu.com/questions/1320944/how-to-set-s-pdif-iec958-to-be-default-audio-out-via-alsa-co...

 


Best Regards,
Zhiming

在原帖中查看解决方案

1 回复
51 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

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.

https://askubuntu.com/questions/1320944/how-to-set-s-pdif-iec958-to-be-default-audio-out-via-alsa-co...

 


Best Regards,
Zhiming