Sometimes first few seconds of audio doesn't play

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

Sometimes first few seconds of audio doesn't play

跳至解决方案
801 次查看
harry_cheng
Contributor II

I have a board based on i.MX 6Quad SABRE, running "imx6qsabresd 3.14.28-1.0.0_ga+g91cf351". Recently I'm trying to play mp3 or wav audio files with HDMI monitor, and I found sometimes the beginning of the audio are cut off. I tried gst-launch-1.0 and aplay, both have this behavior. It happens randomly, and the lost part could be anywhere below 3 seconds.

Based on some posts, it looks similar issue happens to PC and windows, too. Mostly it's related to power saving. With alsa, "options snd-hda-intel power_save=0" fixes the issue for some platforms. I was hoping there is a similar configuration for imx but I couldn't find any.

I did find an easy "workaround": If I keep playing anything such as silence with "gst-launch-1.0 audiotestsrc wave=silence ! autoaudiosink", the real audio files work perfectly. But it uses 5% to 10% of CPU, which I don't want to waste.

A configuration would be an elegant solution. Otherwise I might need a patch on alsa-lib or the kernel.

Thanks. Any suggestion is appreciated.

标签 (3)
1 解答
726 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Harry

one can try with nxp imx-gst1.0 gstreamer plugins described in Linux Guide included in

Linux 3.14.28 BSP & Multimedia Codecs Documentation

and with more new nxp kernels described on

i.MX Software and Development Tools | NXP 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

2 回复数
727 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Harry

one can try with nxp imx-gst1.0 gstreamer plugins described in Linux Guide included in

Linux 3.14.28 BSP & Multimedia Codecs Documentation

and with more new nxp kernels described on

i.MX Software and Development Tools | NXP 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

726 次查看
harry_cheng
Contributor II

Igor,
Thank you for your answer.

I got an error from pulsesink: "error: Failed to connect: Connection refused". So I'm still trying to fix it.

However, I am not really confident it will work. It looks pulsesink still uses alsa as backend, and I suspect the issue is with alsa or even lower level, because I have the same issue when playing raw audio:
gst-launch-1.0 filesrc location=/home/root/somefile.mp3 ! mad ! filesink location=/home/root/decoded.audio
aplay -f s32 -r 44100 -c 2 decoded.audio

Thanks.

0 项奖励