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 750747 - splitmuxtest sometimes fails
splitmuxtest sometimes fails
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.5.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-10 22:14 UTC by Olivier Crête
Modified: 2015-06-23 02:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
log with GST_DEBUG=*split*:9 (711.72 KB, text/plain)
2015-06-11 02:39 UTC, Olivier Crête
  Details
splitmuxsink: Take released-but-not-yet-output bytes into account (3.31 KB, patch)
2015-06-11 03:39 UTC, Jan Schmidt
none Details | Review
splitmuxsink: Take released-but-not-yet-output bytes into account (4.00 KB, patch)
2015-06-11 12:52 UTC, Jan Schmidt
committed Details | Review
splitmuxsink: Mask async-start/done while switching files. (4.58 KB, patch)
2015-06-23 02:03 UTC, Jan Schmidt
none Details | Review
splitmuxsrc: Fix startup and shutdown races. (10.96 KB, patch)
2015-06-23 02:03 UTC, Jan Schmidt
none Details | Review

Description Olivier Crête 2015-06-10 22:14:17 UTC
make elements/splitmux.forever

And after some iterations:

elements/splitmux.c:190:F:general:test_splitmuxsink:0: Expected 3 output files, got 2
Comment 1 Tim-Philipp Müller 2015-06-10 22:29:39 UTC
Any chance you could try and get a debug log as well? :)

(I've been running .forever for half an hour here, and it's still going)
Comment 2 Olivier Crête 2015-06-11 02:39:27 UTC
Created attachment 305040 [details]
log with GST_DEBUG=*split*:9

From a quick look at the log, it looks like the sink failed to create the files correctly.. I had another failure where the test_playback after at the end of the sink test failed to open the files.

I included two runs in log, the first is successful, the second isn't
Comment 3 Olivier Crête 2015-06-11 02:42:04 UTC
For the failed runs, the tmp dir only contains two files instead of 3, so it's definitely a bug in the sink.
Comment 4 Jan Schmidt 2015-06-11 03:39:45 UTC
Created attachment 305042 [details] [review]
splitmuxsink: Take released-but-not-yet-output bytes into account

When deciding whether it's time to switch to a new file, take into
account data that's been released for pushing, but hasn't yet
been pushed - because downstream is slow or the threads haven't been
scheduled.

Fixes a race in the unit test and probably in practice - sometimes
failing to switch when it should for an extra GOP or two.
Comment 5 Jan Schmidt 2015-06-11 03:41:11 UTC
Classic - make elements/splitmux.forever ran for 10 minutes and then failed the exact moment the 'git bz attach' command finished.

50%: Checks: 2, Failures: 1, Errors: 0
elements/splitmux.c:190:F:general:test_splitmuxsink:0: Expected 3 output files, got 2

I'll try again.
Comment 6 Jan Schmidt 2015-06-11 12:52:04 UTC
Created attachment 305071 [details] [review]
splitmuxsink: Take released-but-not-yet-output bytes into account

When deciding whether it's time to switch to a new file, take into
account data that's been released for pushing, but hasn't yet
been pushed - because downstream is slow or the threads haven't been
scheduled.

Fixes a race in the unit test and probably in practice - sometimes
failing to switch when it should for an extra GOP or two.

Also fix a problem in splitmuxsrc where playback sometimes
stalls at startup if types are found too quickly.
Comment 7 Jan Schmidt 2015-06-11 13:04:28 UTC
This seems to make things better, but I sometimes get a stall inside playbin when playing back the files, so I can't be completely sure. Not sure what the playback stall is yet.
Comment 8 Jan Schmidt 2015-06-11 15:59:32 UTC
Comment on attachment 305071 [details] [review]
splitmuxsink: Take released-but-not-yet-output bytes into account

Pushed this one, as it seems to address the bug, even if there's something else lurking in splitmuxsrc somewhere.

Please check and report back if things seem better for you?
Comment 9 Jan Schmidt 2015-06-23 02:03:25 UTC
Created attachment 305883 [details] [review]
splitmuxsink: Mask async-start/done while switching files.

Sometimes, extra async-start/done from the internal sink
while the element is still starting up can cause splitmuxsink
to stall in PAUSED state when it has been set to PLAYING
by the app. Drop the child's async-start/done messages while
switching, so they don't cause state changes at the
splitmuxsink level.
Comment 10 Jan Schmidt 2015-06-23 02:03:30 UTC
Created attachment 305884 [details] [review]
splitmuxsrc: Fix startup and shutdown races.

Fix 2 startup races when things happen too quickly, and 1
at shutdown by holding a ref to the pads in use until the
loop functions exit.

Handle errors activating file parts and publish them on
the bus.
Comment 11 Jan Schmidt 2015-06-23 02:05:28 UTC
With these 2 patches, I ran 168000 iterations of the unit test without failure.