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 750454 - fakesink: Wrong traces when tracing tee with queues to fakesink
fakesink: Wrong traces when tracing tee with queues to fakesink
Status: RESOLVED DUPLICATE of bug 681642
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-05 15:07 UTC by Jean-Michel Hautbois (jmleo)
Modified: 2015-06-05 17:13 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jean-Michel Hautbois (jmleo) 2015-06-05 15:07:47 UTC
When using a simple :
v4l2src ! tee name=t ! queue ! fakesink name=out1 \
t. ! queue ! fakesink name=out2

The same buffer can go twice on the same queue :
/GstPipeline:pipeline0/GstFakeSink:out1: last-message = chain   ******* (out1:sink) (4147200 bytes, dts: none, pts: 0:00:26.392205875, duration: 0:00:00.200000000, offset: 143, offset_end: 144, flags: 00000000 ) 0x7fdaac01c1d0
/GstPipeline:pipeline0/GstFakeSink:out2: last-message = chain   ******* (out2:sink) (4147200 bytes, dts: none, pts: 0:00:26.392205875, duration: 0:00:00.200000000, offset: 143, offset_end: 144, flags: 00000000 ) 0x7fdaac01c1d0
/GstPipeline:pipeline0/GstFakeSink:out1: last-message = chain   ******* (out1:sink) (4147200 bytes, dts: none, pts: 0:00:26.571866165, duration: 0:00:00.200000000, offset: 144, offset_end: 145, flags: 00000000 ) 0x7fdaac01c0c0
/GstPipeline:pipeline0/GstFakeSink:out2: last-message = chain   ******* (out2:sink) (4147200 bytes, dts: none, pts: 0:00:26.571866165, duration: 0:00:00.200000000, offset: 144, offset_end: 145, flags: 00000000 ) 0x7fdaac01c0c0
/GstPipeline:pipeline0/GstFakeSink:out1: last-message = chain   ******* (out1:sink) (4147200 bytes, dts: none, pts: 0:00:26.751203051, duration: 0:00:00.200000000, offset: 145, offset_end: 146, flags: 00000000 ) 0x7fdaac01c1d0
/GstPipeline:pipeline0/GstFakeSink:out2: last-message = chain   ******* (out2:sink) (4147200 bytes, dts: none, pts: 0:00:26.751203051, duration: 0:00:00.200000000, offset: 145, offset_end: 146, flags: 00000000 ) 0x7fdaac01c1d0
/GstPipeline:pipeline0/GstFakeSink:out1: last-message = chain   ******* (out1:sink) (4147200 bytes, dts: none, pts: 0:00:26.930050295, duration: 0:00:00.200000000, offset: 146, offset_end: 147, flags: 00000000 ) 0x7fdaac01c0c0
/GstPipeline:pipeline0/GstFakeSink:out2: last-message = chain   ******* (out2:sink) (4147200 bytes, dts: none, pts: 0:00:26.930050295, duration: 0:00:00.200000000, offset: 146, offset_end: 147, flags: 00000000 ) 0x7fdaac01c0c0
/GstPipeline:pipeline0/GstFakeSink:out1: last-message = chain   ******* (out1:sink) (4147200 bytes, dts: none, pts: 0:00:27.109112342, duration: 0:00:00.200000000, offset: 147, offset_end: 148, flags: 00000000 ) 0x7fdaac01c1d0
/GstPipeline:pipeline0/GstFakeSink:out2: last-message = chain   ******* (out2:sink) (4147200 bytes, dts: none, pts: 0:00:27.109112342, duration: 0:00:00.200000000, offset: 147, offset_end: 148, flags: 00000000 ) 0x7fdaac01c1d0
/GstPipeline:pipeline0/GstFakeSink:out1: last-message = chain   ******* (out1:sink) (4147200 bytes, dts: none, pts: 0:00:27.288678423, duration: 0:00:00.200000000, offset: 148, offset_end: 149, flags: 00000000 ) 0x7fdaac01c0c0


Removing the queues and making it single threaded solves the issue :
v4l2src ! tee name=t ! fakesink name=out1 async=0 \
t. ! fakesink name=out2 async=0
/GstPipeline:pipeline0/GstFakeSink:out1: last-message = chain   ******* (out1:sink) (4147200 bytes, dts: none, pts: 0:00:26.392205875, duration: 0:00:00.200000000, offset: 143, offset_end: 144, flags: 00000000 ) 0x7fdaac01c1d0
/GstPipeline:pipeline0/GstFakeSink:out2: last-message = chain   ******* (out2:sink) (4147200 bytes, dts: none, pts: 0:00:26.392205875, duration: 0:00:00.200000000, offset: 143, offset_end: 144, flags: 00000000 ) 0x7fdaac01c1d0
/GstPipeline:pipeline0/GstFakeSink:out1: last-message = chain   ******* (out1:sink) (4147200 bytes, dts: none, pts: 0:00:26.571866165, duration: 0:00:00.200000000, offset: 144, offset_end: 145, flags: 00000000 ) 0x7fdaac01c0c0
/GstPipeline:pipeline0/GstFakeSink:out2: last-message = chain   ******* (out2:sink) (4147200 bytes, dts: none, pts: 0:00:26.571866165, duration: 0:00:00.200000000, offset: 144, offset_end: 145, flags: 00000000 ) 0x7fdaac01c0c0
/GstPipeline:pipeline0/GstFakeSink:out1: last-message = chain   ******* (out1:sink) (4147200 bytes, dts: none, pts: 0:00:26.751203051, duration: 0:00:00.200000000, offset: 145, offset_end: 146, flags: 00000000 ) 0x7fdaac01c1d0
/GstPipeline:pipeline0/GstFakeSink:out2: last-message = chain   ******* (out2:sink) (4147200 bytes, dts: none, pts: 0:00:26.751203051, duration: 0:00:00.200000000, offset: 145, offset_end: 146, flags: 00000000 ) 0x7fdaac01c1d0
/GstPipeline:pipeline0/GstFakeSink:out1: last-message = chain   ******* (out1:sink) (4147200 bytes, dts: none, pts: 0:00:26.930050295, duration: 0:00:00.200000000, offset: 146, offset_end: 147, flags: 00000000 ) 0x7fdaac01c0c0
/GstPipeline:pipeline0/GstFakeSink:out2: last-message = chain   ******* (out2:sink) (4147200 bytes, dts: none, pts: 0:00:26.930050295, duration: 0:00:00.200000000, offset: 146, offset_end: 147, flags: 00000000 ) 0x7fdaac01c0c0
/GstPipeline:pipeline0/GstFakeSink:out1: last-message = chain   ******* (out1:sink) (4147200 bytes, dts: none, pts: 0:00:27.109112342, duration: 0:00:00.200000000, offset: 147, offset_end: 148, flags: 00000000 ) 0x7fdaac01c1d0
/GstPipeline:pipeline0/GstFakeSink:out2: last-message = chain   ******* (out2:sink) (4147200 bytes, dts: none, pts: 0:00:27.109112342, duration: 0:00:00.200000000, offset: 147, offset_end: 148, flags: 00000000 ) 0x7fdaac01c1d0
/GstPipeline:pipeline0/GstFakeSink:out1: last-message = chain   ******* (out1:sink) (4147200 bytes, dts: none, pts: 0:00:27.288678423, duration: 0:00:00.200000000, offset: 148, offset_end: 149, flags: 00000000 ) 0x7fdaac01c0c0
Comment 1 Jean-Michel Hautbois (jmleo) 2015-06-05 15:15:53 UTC
The bad behaviour is this one, bad copy/paste one the same message, sorry

    /GstPipeline:pipeline0/GstFakeSink:out1: last-message = chain   ******* (out1:sink) (4147200 bytes, dts: none, pts: 0:00:02.028061449, duration: 0:00:00.200000000, offset: 7, offset_end: 8, flags: 00000000 ) 0x7fd06c01a120
    /GstPipeline:pipeline0/GstFakeSink:out2: last-message = chain   ******* (out2:sink) (4147200 bytes, dts: none, pts: 0:00:02.028061449, duration: 0:00:00.200000000, offset: 7, offset_end: 8, flags: 00000000 ) 0x7fd06c01a120
    /GstPipeline:pipeline0/GstFakeSink:out2: last-message = chain   ******* (out2:sink) (4147200 bytes, dts: none, pts: 0:00:02.206729169, duration: 0:00:00.200000000, offset: 8, offset_end: 9, flags: 00000000 ) 0x7fd06c01a010
    /GstPipeline:pipeline0/GstFakeSink:out2: last-message = chain   ******* (out2:sink) (4147200 bytes, dts: none, pts: 0:00:02.206729169, duration: 0:00:00.200000000, offset: 8, offset_end: 9, flags: 00000000 ) 0x7fd06c01a010
    /GstPipeline:pipeline0/GstFakeSink:out1: last-message = chain   ******* (out1:sink) (4147200 bytes, dts: none, pts: 0:00:02.386629961, duration: 0:00:00.200000000, offset: 9, offset_end: 10, flags: 00000000 ) 0x7fd06c01a120
    /GstPipeline:pipeline0/GstFakeSink:out2: last-message = chain   ******* (out2:sink) (4147200 bytes, dts: none, pts: 0:00:02.564456964, duration: 0:00:00.200000000, offset: 10, offset_end: 11, flags: 00000000 ) 0x7fd06c01a010
Comment 2 Nicolas Dufresne (ndufresne) 2015-06-05 16:35:36 UTC
Bad news, I get the same thing if I replace v4l2 with videotestsrc.
Comment 3 Nicolas Dufresne (ndufresne) 2015-06-05 16:46:32 UTC
Interestingly, if we do the test using file sink:

gst-launch-1.0  v4l2src num-buffers=100 ! tee name=t t. ! queue ! filesink location=a t. ! queue ! filesink location=b

or

gst-launch-1.0  videotestsrc is-live=1 num-buffers=100 ! tee name=t t. ! queue ! filesink location=a t. ! queue ! filesink location=b

And then compare a and b, both files are identical. This lead to something being wrong with the trace.
Comment 4 Thiago Sousa Santos 2015-06-05 17:01:49 UTC
The way gst-launch/fakesink prints their messages is racy. There was another bug about it, but I couldn't find.

IIRC fakesink emits a signal that gst-launch receives and when it goes get the message to print the message might have already changed so it might print the wrong message from time to time.
Comment 5 Nicolas Dufresne (ndufresne) 2015-06-05 17:09:43 UTC

*** This bug has been marked as a duplicate of bug 681642 ***
Comment 6 Tim-Philipp Müller 2015-06-05 17:13:20 UTC
> The way gst-launch/fakesink prints their messages is racy. There was another
> bug about it, but I couldn't find.

It was bug #681642

 
> IIRC fakesink emits a signal that gst-launch receives and when it goes get
> the message to print the message might have already changed so it might
> print the wrong message from time to time.

But the signal emission is done synchronously from the same thread, and the g_object_get() is done right there and then as well, so nothing should change during the emission.

My theory is that the deep-notify stuff interferes somehow.