GStreamer audio pipeline hangs

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

GStreamer audio pipeline hangs

1,718 Views
chikigai
Contributor II

Hi all,

I'm using i.MX6Q (with Freescale's BSP 3.0.35) and having issues with a GStreamer audio pipeline hanging in an infinite loop.

I have i.MX6Q as the I2S slave sending out an audio stream to an external device set as the I2S master.

Audio is streamed through the alsasink element without any problems until the external device stops the I2S clock.

When the I2S clock stops, the alsasink element keeps trying to write pcm buffers left in the pipeline (gstalsasink.c: gst_alsasink_write: snd_pcm_writei).

The pcm ring buffer in the kernel eventually becomes full, and returns EAGAIN (sound/core/pcm_lib.c: snd_pcm_lib_write1).

Upon receiving EAGAIN, the alsasink element retries indefinitely thinking that a buffer would free up eventually.

Obviously, a buffer is never going to free up since the kernel cannot write out the remaining pcm buffers when the I2S clock stops.

Once in this state, I cannot stop the pipeline since it is stuck in an infinite loop.

Are there any suggestions in overcoming this?

Currently, the best way I can think of is change the kernel code so that the remaining pcm buffers are thrown away when the I2S clock stops.

I checked the kernel source code contained in BSP 3.10.17, but it looks like the issue will still be present.

Any help would be greatly appreciated.


Tags (4)
0 Kudos
Reply
3 Replies

1,159 Views
DarioCosta
Contributor II

Hi,

I'm having the same issue on a custom board with iMX6S.

Any news about this matter? Have you found a workaround/fix?

Thanks in advance

Dario

0 Kudos
Reply

1,159 Views
chikigai
Contributor II

I tried to see if a fix could be applied to the kernel, but unfortunately never managed.

As a temporary workaround, I currently have a standalone process handling the gstreamer pipelines which is forked/killed appropriately.

Not a proper fix by any means...

0 Kudos
Reply

1,159 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

I will delve into this. weidong.sun sorry to bother you, but do you have a clue about this?

Best Regards,

Alejandro

0 Kudos
Reply