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 607466 - [playbin2] chooses random audio stream
[playbin2] chooses random audio stream
Status: RESOLVED DUPLICATE of bug 634407
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.28
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-19 17:01 UTC by Andreas Frisch
Modified: 2012-11-26 17:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
logfile of input-selector element (157.47 KB, application/octet-stream)
2010-05-26 19:19 UTC, Andreas Frisch
Details
dot graph (65.47 KB, image/png)
2010-11-22 14:31 UTC, Andreas Frisch
Details
media file doesn't preroll anymore (431.38 KB, application/x-bzip)
2010-11-22 14:33 UTC, Andreas Frisch
Details

Description Andreas Frisch 2010-01-19 17:01:41 UTC
I have the following mkv container

General
Complete name                    : /dream/movie/mkv/Tonspuren-Test (OLP).MKV
Format                           : Matroska
File size                        : 96.0 MiB
Duration                         : 6mn 31s
Overall bit rate                 : 2 058 Kbps
Encoded date                     : UTC 2010-01-18 18:02:14
Writing application              : mkvmerge v2.9.8 ('C'est le bon') built on Aug 13 2009 12:49:06
Writing library                  : libebml v0.7.7 + libmatroska v0.8.1

Video
ID                               : 1
Format                           : AVC
Format/Info                      : Advanced Video Codec
Format profile                   : High@L3.0
Format settings, CABAC           : Yes
Format settings, ReFrames        : 3 frames
Muxing mode                      : Container profile=Unknown@3.0
Codec ID                         : V_MPEG4/ISO/AVC
Duration                         : 6mn 31s
Bit rate                         : 930 Kbps
Width                            : 720 pixels
Height                           : 576 pixels
Display aspect ratio             : 16:9
Frame rate                       : 25.000 fps
Standard                         : PAL
Resolution                       : 8 bits
Colorimetry                      : 4:2:0
Scan type                        : Progressive
Bits/(Pixel*Frame)               : 0.090
Stream size                      : 43.4 MiB (45%)
Writing library                  : x264 core 76 r1271 496d79d
Encoding settings                : cabac=1 / ref=3 / deblock=1:-1:-1 / analyse=0x3:0x112 / me=hex / subme=6 / psy=1 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=22.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / aq=1:0.50

Audio #1
ID                               : 2
Format                           : AC-3
Format/Info                      : Audio Coding 3
Codec ID                         : A_AC3
Duration                         : 6mn 31s
Bit rate mode                    : Constant
Bit rate                         : 448 Kbps
Channel(s)                       : 6 channels
Channel positions                : Front: L C R, Surround: L R, LFE
Sampling rate                    : 48.0 KHz
Stream size                      : 20.9 MiB (22%)
Language                         : German

Audio #2
ID                               : 3
Format                           : AC-3
Format/Info                      : Audio Coding 3
Codec ID                         : A_AC3
Duration                         : 6mn 31s
Bit rate mode                    : Constant
Bit rate                         : 448 Kbps
Channel(s)                       : 6 channels
Channel positions                : Front: L C R, Surround: L R, LFE
Sampling rate                    : 48.0 KHz
Stream size                      : 20.9 MiB (22%)
Language                         : English

Audio #3
ID                               : 4
Format                           : AC-3
Format/Info                      : Audio Coding 3
Codec ID                         : A_AC3
Duration                         : 6mn 31s
Bit rate mode                    : Constant
Bit rate                         : 192 Kbps
Channel(s)                       : 2 channels
Channel positions                : L R
Sampling rate                    : 48.0 KHz
Stream size                      : 8.96 MiB (9%)
Language                         : English

Text #1
ID                               : 5
Format                           : VobSub
Codec ID                         : S_VOBSUB
Codec ID/Info                    : The same subtitle format used on DVDs
Language                         : English

Text #2
ID                               : 6
Format                           : VobSub
Codec ID                         : S_VOBSUB
Codec ID/Info                    : The same subtitle format used on DVDs
Language                         : German

Menu
00:00:00.000                     : en:Chapter 1
00:06:31.320                     : en:Chapter 2
00:06:31.920                     : en:Chapter 3
00:06:32.520                     : en:Chapter 4
00:06:33.120                     : en:Chapter 5
00:06:33.720                     : en:Chapter 6
00:06:34.320                     : en:Chapter 7
00:06:34.920                     : en:Chapter 8
00:06:35.520                     : en:Chapter 9
00:06:36.120                     : en:Chapter 10
00:06:36.720                     : en:Chapter 11
00:06:37.320                     : en:Chapter 12

which was created with the flags --default-track --forced-track for german audio stream. playbin2 still selects the audio #3 (while e.g. kmplayer plays the correct track)
Comment 1 Andreas Frisch 2010-01-19 17:22:38 UTC
download location of the piece of content:

ftp://test4711:test4711@82.149.226.170/Tonspuren-Test%20(OLP).MKV
Comment 2 Sebastian Dröge (slomo) 2010-01-19 18:07:53 UTC
Yes, there's no way for demuxers to say which tracks should be the default for one type.
Comment 3 Andreas Frisch 2010-05-26 19:11:20 UTC
i would like to expand this bug to the following issue:

here i've got a matroska container file with 3 audio streams out of which a random one is chosen by playbin2.
when trying to do logging, it will always use the first track, otherwise it could be any of the three.
so i suspect a timing / race issue.
please tell me how i can find out more about it.

here's the mysterious file:
http://www.homeys-bunker.de/dm800/samples/BrokenPlayback2.mkv (53 MB)
Comment 4 Andreas Frisch 2010-05-26 19:19:04 UTC
Created attachment 162043 [details]
logfile of input-selector element

all logfiles were created using the exact same command line:
GST_DEBUG=*input-selector*:4 gst-launch --gst-debug-no-color playbin2 uri=file:///media/hdd/movie/mkv/BrokenPlayback2.mkv fl
ags=3 >logfile-en.log 2>&1
it turned out that logging only the input selector seemed to consume little enough resources that the random audio stream issue still occurs
Comment 5 Sebastian Dröge (slomo) 2010-05-27 05:03:01 UTC
That's no race condition, simply a missing feature. playbin2 exposes the tracks in the order in which they're exposed by decodebin2/uridecodebin. And this happens in many different threads and as such can happen at completely different times every time you try it.

A solution for this would be to add something to playbin2 and the demuxers to gives ranks (or something similar) to pads.
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2010-11-22 12:30:23 UTC
Andreas, does the patch I have in bug #634407 helps your case?
Comment 7 Andreas Frisch 2010-11-22 14:26:47 UTC
unfortunately i had to find out that with current gstreamer 0.10.30, that media file seems to not even wanna preroll anymore. i'm confused right now... gotta investigate what went wrong here, maybe it's an openembedded issue.
Comment 8 Andreas Frisch 2010-11-22 14:31:21 UTC
Created attachment 175036 [details]
dot graph
Comment 9 Andreas Frisch 2010-11-22 14:33:15 UTC
Created attachment 175037 [details]
media file doesn't preroll anymore

GST_DEBUG=*:5 gst-launch --gst-debug-no-color playbin2 uri="file:///media/hdd/movie/mkv/BrokenPlayback2.mkv" flags=3  >nopreroll_6074
66.log 2>&1
Comment 10 Andreas Frisch 2010-12-02 07:10:11 UTC
the new issue (no preroll at all) is obsolete with 0.10.31, however the randomly chosen audio track (and subtitle stream) problem persists
Comment 11 Christian Fredrik Kalager Schaller 2011-07-18 15:44:39 UTC
Should this bug also be marked as a duplicate of 634407?
Comment 12 Tim-Philipp Müller 2012-11-26 17:42:12 UTC
> Should this bug also be marked as a duplicate of 634407?

I guess so, yes (arguably playbin could have sorted the pads irrespective of decodebin, but in any case, I think it's all good now in 1.0, so closing).

*** This bug has been marked as a duplicate of bug 634407 ***