alsasink does not synchronise properly with a live streaming source, yet (timing skew)
Submitted by Thomas DEBESSE
Hi, alsa modules (alsasrc, alsasink) become silent when used for several hours.
The time before become silent or noisy depend on the whole pipeline.
A pipeline like "udpsrc ! … ! alsasink" breaks after 3 ou 4 hours.
A pipeline like "alsasrc ! … ! alsasink" does the same.
A pipeline like "jackaudiosrc ! … ! alsasink" breaks after 14 hours.
I have tried different uses case, sometimes it's the alsasrc module that become silent, sometimes it's the alsasink module.
On some use case, I get noise instead of silence.
This is a complete pipeline that breaks :
gst-launch-0.10 jackaudiosrc ! "audio/x-raw-float" ! audioconvert ! audioresample ! "audio/x-raw-int, rate=44100, width=16" ! alsasink device="hw:1" sync=0
And another pipeline that breaks :
gst-launch-0.10 -v alsasrc device="hw:0" audioconvert ! audioresample ! "audio/x-raw-int,rate=44100,width=16,channels=2" ! alsasink device="hw:1" sync=false
And another pipeline (Gst 1.0) that breaks :
gst-launch-1.0 alsasrc device="hw:0 ! 'audio/x-raw, format=S16LE' ! audioconvert ! audioresample ! 'audio/x-raw, format=F32LE, channels=2' ! jackaudiosink sync=0
I have some other examples with "alsasrc ! … ! udpsink" or "udpsrc ! … ! alsasink".
Good to know :
- I don't get this problem on other Gstreamer modules.
- This bug affect both Gstreamer 0.10 and Gstreamer 1.0
- The bug appears every time an alsa module (alsasrc or alsasink) is used, just wait long.
- The time before become silent depend on the whole pipeline.
- The fact of getting noise or silence depend on the whole pipeline.
- I use soundcards directly without alsa modules (no 'plug', no 'dmix', no 'dsnoop') or with alsa modules (that changes nothing)
How to reproduce :
- build a pipeline using alsasrc or alsasink
- let the pipeline running a complete day to be sure to get the bug
Note : pipelining alsasrc with alsasink is one of the faster way to get a bug, only 3 or 4 hours instead of more than 12 hours.
Some details :
- gst-inspect with -v option said nothing about any problem.
- GST_DEBUG=3 said nothing about any problem.
- The pipeline isn't broken, state is always Gst.State.PLAYING and the pipeline seems functionnal
- Nothing seems broken, there is no sound so people could say "I got the bug" but software does'nt know there is a bug.
- Some pipeline get noise instead of silent.
- Restarting the pipeline without destroying it (set Gst.State.NULL then set Gst.State.PLAYING) fix it. So you can restart the pipeline every 3 hours to have sound several days dealing with some milliseconds of silence every 3 hours)
The bug was tested and confirmed on :
- several computers
- several soundcards (usb Muse Pocket LT3, pci Audigy CA0106, internal Intel 82801, Nvidia MCP51, some Realtek chip)
- several alsa build
- several linux build (2.6.32 → 3.2.0), rt-kernels or not rt-kernels
- several Gstreamer versions (0.10 → 1.0)
- some distros (Debian Squeeze, Wheezy, Sid, Ubuntu 12.10)
There is a discussion about this bug on the mailing list :