Sometimes first few seconds of audio doesn't play

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sometimes first few seconds of audio doesn't play

Jump to solution
732 Views
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.

Labels (3)
1 Solution
657 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

2 Replies
658 Views
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!
-----------------------------------------------------------------------------------------------------------------------

657 Views
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 Kudos