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 612223 - [base(audio)sink] hangs in _wait_eos
[base(audio)sink] hangs in _wait_eos
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.10.29
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-08 18:44 UTC by Mark Nauwelaerts
Modified: 2010-03-16 14:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Arrange for a running clock for eos syncing (2.35 KB, patch)
2010-03-11 13:59 UTC, Mark Nauwelaerts
committed Details | Review

Description Mark Nauwelaerts 2010-03-08 18:44:40 UTC
Consider some audio playback with a typical audio clock and ringbuffer.

EOS arrives, which triggers draining and going into the loop in _wait_eos.  Assume the thread is at that stage waiting on the clock for the proper render time.  Then a state change to PAUSED happens, the clock wait is unscheduled and the _wait_eos loop waits for PLAYING.  Then application changes state to PLAYING, and the _wait_eos resumes ... to wait_clock again for the right time.

However, while state change to PLAYING performs gst_ring_buffer_may_start, the actual start is postponed to (e.g.) a ringbuffer commit.  But since EOS has arrived, there will be no more _commit, so the ringbuffer does not advance, therefore clock time does not advance (though in PLAYING).  So, the _wait_eos hangs.
Comment 1 Mark Nauwelaerts 2010-03-11 13:59:15 UTC
Created attachment 155860 [details] [review]
Arrange for a running clock for eos syncing

Add some state variable to mark eos rendering and immediately start ringbuffer in PAUSED_TO_PLAYING if eos rendering in progress (rather than only _may_start).
Comment 2 Sebastian Dröge (slomo) 2010-03-15 16:26:55 UTC
Looks good IMHO but Wim might know a better solution ;)
Comment 3 Wim Taymans 2010-03-15 16:52:52 UTC
At first sight, this is how I would do it as well.
Comment 4 Mark Nauwelaerts 2010-03-16 14:40:34 UTC
I guess sufficient votes, so:

commit dcc4b25686b7eb620bf5409d4ecca2c232dd70d0
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Thu Mar 11 14:52:09 2010 +0100

    baseaudiosink: arrange for a running ringbuffer/clock for _wait_eos

    Fixes #612223.