GNOME Bugzilla – Bug 750454
fakesink: Wrong traces when tracing tee with queues to fakesink
Last modified: 2015-06-05 17:13:20 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
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
Bad news, I get the same thing if I replace v4l2 with videotestsrc.
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.
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.
*** This bug has been marked as a duplicate of bug 681642 ***
> 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.