[gst-devel] New DXR3 components and scheduling problem

Martin Soto soto at informatik.uni-kl.de
Mon Mar 31 05:55:33 CEST 2003


Hi all:

I'm currently developing elements to write video, audio, and SPU
graphics to the Creative DXR3, Real Magic Hollywood and other compatible
DVD cards supported by the driver at dxr3.sourceforge.net.  I'm aware
that there is already such a plugin in Gstreamer, but after checking the
code, I decided to restart from the scratch, among other reasons,
because I'm taking a different approach to synchronization that so far
is giving really good results.

The idea is to complete a GPL'd Gstreamer based DVD player for the
DXR3.  I will be releasing an alpha version soon (and want to integrate
as much of it back into Gstreamer as possible) but let me tell you, for
the moment, that I have used my software to watch entire feature films
with no (visible) audio/video sync glitches, and very low processor use.

However, trying to add support for PCM sound, have brought me to some
weird scheduling problems.  I modified the mpegdemux element in
Gstreamer to support DVD PCM sound.  That works fine.  My dxr3audiosink
element, on the other hand, already supports two input pads, one for AC3
sound (sent directly to the receiver using the coax digital output in
the card) and one for PCM sound.  Of course, the two pads cannot be used
at the same time, which means that you connect the elements as follows:

        +-------+ac3_stream        ac3_sink +-----------+
        |       |----------o      o---------|           |
        | MPEG  |                           | DXR3Audio |
        | Demux |                           |  Sink     |
        |       |pcm_stream         pcm_sink|           |
        |       |---------------------------|           |
        +-------+                           +-----------+

This works properly and I get sound in my receiver, both PCM (as
depicted) or AC3.

However, in order to be able to play video and subtitles simultaneously,
I need to put the dxr3audiosink in a separate thread.  As far as I know,
a reasonable structure would be:

                        +-----------------------------------+
                        | Thread                            |
                        |                                   |
  +-------+ac3_stream   |  +-------+ ac3_sink +-----------+ |
  |       |-----o   o---+--| Queue |----------|           | |
  | MPEG  |             |  +-------+          | DXR3Audio | |
  | Demux |             |                     |  Sink     | |
  |       |pcm_stream   |  +-------+  pcm_sink|           | |
  |       |-------------+--| Queue |----------|           | |
  +-------+             |  +-------+          +-----------+ |
                        |                                   |
                        +-----------------------------------+

However, as soon as I do that, no more sound buffers are delivered to
the dxr3audiosink element.  The pipeline seams to run however, in that I
can see the video running, but no flow of data seems to happen inside
the thread.  By fiddling with the structure, I have seen that the sole
fact of having two queues in the thread is enough to stop the flow of
data, even if only one of them is connected. Putting the queues outside
the thread seems not to have an effect, i. e. the problem persists.

Any ideas of what may be happening?  I did my last tests using CVS from
yesterday (Sunday).  In general I tested with the opt scheduler, but the
use of other schedulers doesn't seem to improve the situation.

Cheers,

M. S.
-- 
Martin Soto <soto at informatik.uni-kl.de>
Universität Kaiserslautern - AG Software Engineering





More information about the gstreamer-devel mailing list