After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 606649 - Problems pausing playbin2 on some files with large audio-buffer
Problems pausing playbin2 on some files with large audio-buffer
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-11 18:10 UTC by Michael Smith
Modified: 2018-05-04 09:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Core: allow subclasses of basesink to override prerolling behaviour (1.72 KB, patch)
2010-01-11 18:10 UTC, Michael Smith
none Details | Review
Base: audiosinks can preroll if they have data in their ringbuffer (3.46 KB, patch)
2010-01-11 18:11 UTC, Michael Smith
none Details | Review

Description Michael Smith 2010-01-11 18:10:55 UTC
Created attachment 151174 [details] [review]
Core: allow subclasses of basesink to override prerolling behaviour

If you have a large audio ringbuffer, sometimes pausing can fail - the PAUSE never prerolls.

Because of the large audio buffer, the steady-state in playback has the video side of the decodebin2 multiqueue full, and the audio side empty. So, at any given time, most likely, the demuxer will be blocked trying to push a buffer into the video queue.

When we set to PAUSED, then, we try to preroll the sinks. The video sink pretty much immediately prerolls with a buffer from the video queue. The demuxer can now push its buffer into the queue, and gets unblocked.

Now, the demuxer goes to push again. In the files I'm testing with, the audio is in large (~0.5 seconds) chunks, so usually the next thing to push will be another video frame. We try to push that - and it blocks in the video queue again. Now we're deadlocked - we can't push anything into the audio queue, so we can't preroll the audio sink.

Testing with seek.c, used like this: ./seek 15 'playbin2 uri=file:///tmp/test.mov audio-sink="pulsesink buffer-time=5000000"'

I ran into this originally with Songbird, which uses a large audio ringbuffer.

Wim suggested that we could make the audio sink preroll based on audio in the ring buffer. I'm attaching an attempt at implementing this (two patches: one to core, one to base)
Comment 1 Michael Smith 2010-01-11 18:11:25 UTC
Created attachment 151175 [details] [review]
Base: audiosinks can preroll if they have data in their ringbuffer
Comment 2 Tim-Philipp Müller 2010-01-11 18:29:05 UTC
FWIW, there also was bug #342155 at some point.
Comment 3 Wim Taymans 2010-01-13 11:27:44 UTC
Seems good to me. We probably need a different implementation for pulseaudio.
Comment 4 Sebastian Dröge (slomo) 2010-01-14 18:19:01 UTC
What should be done different for pulsesink? Doesn't it just use it's custom ringbuffer implementation and would simply work with the baseaudiosink patch?
Comment 5 Sebastian Dröge (slomo) 2011-05-23 14:33:56 UTC
Ping? Wim?
Comment 6 Edward Hervey 2013-07-22 14:32:03 UTC
Ping? Wim?
Comment 7 Alexandre Franke 2017-07-17 19:15:31 UTC
Ping? Wim?
Comment 8 Sebastian Dröge (slomo) 2018-05-04 09:12:06 UTC
Let's close this then, it's been a decade now and a lot of stuff has changed. The underlying problem is still relevant but the solution would probably look different. Someone needs to come up with a testcase and implementation plan then