[gst-devel] Why can't multiple pipelines run in one process

Kalyanavarathan, Vasanth VKalyanavarathan at ndsuk.com
Thu Jun 15 15:23:20 CEST 2006


Hello 

I guess you want to dynamically setup pipelines and remove
Them in your gstreamer application.

The pipeline runs in the context of g_main_loo_run thread.

The g_main_loop_quit should also be invoked in the context
Of the same thread. Otherwise it would not work.

Hence to two run to pipelines simultaneous you need two
G_main_loo_run. Which suggest that your gstreamer application should
create two threads and invoke
G_main_loo_run for each of the pipeline you have setup

Thanks
Vasanth

PS: I have tried to do something similar to what I have detailed above
and it is working.

I am not sure if that is the best and correct way to do it.


-----
 
I want to playback multiple audio files in one process at the same time.
However, when I create another pipeline after constructing a pipeline,
the older pipeline can't work well, even if the newer pipeline is over.

The following step is my experiment:

1.create pipeline1
2.set pipeline1 to GST_STATE_PLAYING to playback, ok
3.after 10 seconds , create pipeline2, but pipeline1 can't work well at
the same time
4.set pipeline2 to GST_STATE_PLAYING to playback, ok


So I want to know whether gstreamer can support multiple pipelines in
one process at the same time, OR how to playback multiple files in one
process synchronously?

Thanks in advance.

-----Original Message-----
From: gstreamer-devel-bounces at lists.sourceforge.net
[mailto:gstreamer-devel-bounces at lists.sourceforge.net] On Behalf Of
gstreamer-devel-request at lists.sourceforge.net
Sent: 14 June 2006 16:27
To: gstreamer-devel at lists.sourceforge.net
Subject: gstreamer-devel Digest, Vol 1, Issue 2319

Send gstreamer-devel mailing list submissions to
	gstreamer-devel at lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
or, via email, send a message with subject or body 'help' to
	gstreamer-devel-request at lists.sourceforge.net

You can reach the person managing the list at
	gstreamer-devel-owner at lists.sourceforge.net

When replying, please edit your Subject line so it is more specific than
"Re: Contents of gstreamer-devel digest..."


Today's Topics:

   1. Re: simultaneous OSS playback/record (Thomas Vander Stichele)
   2. gstreamer thread problem? (woo john)
   3. Re: gstreamer thread problem? (Wim Taymans)
   4. Re: gstreamer thread problem? (Tim M?ller)
   5. Why can't multiple pipelines run in one process at the	same
      time? (zs p)
   6. Re: Why can't multiple pipelines run in one process at	the
      same time? (Antoine Tremblay)
   7. Re: simultaneous OSS playback/record (Wilson, Diego)


----------------------------------------------------------------------

Message: 1
Date: Wed, 14 Jun 2006 11:10:59 +0200
From: Thomas Vander Stichele <thomas at apestaart.org>
Subject: Re: [gst-devel] simultaneous OSS playback/record
To: "Wilson, Diego" <dwilson at ti.com>
Cc: gstreamer-devel at lists.sourceforge.net,	Edgard Lima
	<edgard.lima at indt.org.br>
Message-ID: <1150276259.23862.43.camel at otto.amantes>
Content-Type: text/plain

On Tue, 2006-06-13 at 13:20 -0500, Wilson, Diego wrote:
> Edgard,
> 
> None of them work. I'm getting the following error on all of them:
> 
> ERROR: from element /pipeline0/osssrc0: Unable to open device /dev/dsp

> for recording: Device or resource busy

Well, then your oss driver really *does not* allow two opens, even from
the same process.

I have the same for my ac97 intel sound card.  alsasrc ! alsasink works
fine on it, so it's not the hardware's fault.

Thomas





------------------------------

Message: 2
Date: Wed, 14 Jun 2006 09:32:12 +0000
From: "woo john" <wuym2000cn at hotmail.com>
Subject: [gst-devel] gstreamer thread problem?
To: gstreamer-devel at lists.sourceforge.net
Message-ID: <BAY113-F963D88BDA788807B2AC64D68D0 at phx.gbl>
Content-Type: text/plain; format=flowed

hi,
  i am reading the plugin writer's guide. i am confused about scheduling
mode.

  It is clear for me that a filter or sink element can has its own
thread(act as puller).There is a simple example in the PWG to explain
this case.

  My question is :

1 whether a source element can work at pull mode or push mode ?

  2 if it is at pull mode, is there a thread assigned for it?
    if it is at push mode, is there a thread assigned for it?

  3 As i know,I can insert a queue between a source element and the
downstream elements. In this case,what mode does the source element
work? 
pull or push?

  thanks in advance!

woo.





------------------------------

Message: 3
Date: Wed, 14 Jun 2006 11:45:58 +0200
From: Wim Taymans <wim at fluendo.com>
Subject: Re: [gst-devel] gstreamer thread problem?
To: woo john <wuym2000cn at hotmail.com>
Cc: gstreamer-devel at lists.sourceforge.net
Message-ID: <1150278358.24276.38.camel at localhost>
Content-Type: text/plain

On Wed, 2006-06-14 at 09:32 +0000, woo john wrote:
> hi,
>   i am reading the plugin writer's guide. i am confused about 
> scheduling mode.
> 
>   It is clear for me that a filter or sink element can has its own 
> thread(act as puller).There is a simple example in the PWG to explain 
> this case.
> 
>   My question is :
> 
> 1 whether a source element can work at pull mode or push mode ?

See the docs for basesrc
(http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-libs
/html/gstreamer-libs-GstBaseSrc.html) for when the element can operate
in pull mode.

> 
>   2 if it is at pull mode, is there a thread assigned for it?
>     if it is at push mode, is there a thread assigned for it?

An element operating in pull mode is not normally managing a thread
since it is being pulled by another element that normally uses a thread
to do this.
An element in push mode either uses a thread to push stuff out or uses
the thread from an upstream element (a typical _chain based element,
like a decoder). 

> 
>   3 As i know,I can insert a queue between a source element and the 
> downstream elements. In this case,what mode does the source element
work?
> pull or push?
Push, queue will not pull from any upstream peer. This means the source
starts a thread to push stuff into the queue. This also means that the
source has to perform the seeks on its own (currently).

Hope this helps,
Wim

> 
>   thanks in advance!
> 
> woo.
> 
> 
> 
> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Wim Taymans <wim at fluendo.com>




------------------------------

Message: 4
Date: Wed, 14 Jun 2006 10:58:01 +0100
From: Tim M?ller <t.i.m at zen.co.uk>
Subject: Re: [gst-devel] gstreamer thread problem?
To: woo john <wuym2000cn at hotmail.com>
Cc: gstreamer-devel at lists.sourceforge.net
Message-ID: <1150279081.23506.14.camel at sceptic>
Content-Type: text/plain

On Wed, 2006-06-14 at 09:32 +0000, woo john wrote:

>   My question is :
> 
> 1 whether a source element can work at pull mode or push mode ?

That depends on the element (some only support one type, some support
both types, and some support pull-mode only under certain circumstances,
like with certain URIs).


>   2 if it is at pull mode, is there a thread assigned for it?
>     if it is at push mode, is there a thread assigned for it?

Yes, there is always at least one streaming thread, the difference is
just which element is driving the pipeline. Example:

   cdiocddasrc ! audioconvert ! audioresample ! autoaudiosink

cdiocddasrc only works push-based. The source will create a thread and
push out data as fast as it can, the audio sink will then block
according to the timestamps etc.


   cdiocddasrc ! audioconvert ! audioresample ! queue ! autoaudiosink

The source will create a thread and push out data as fast as it can. The
queue will block when it hits one of the configured max limits. The
queue will start a thread of its own when its source pad is linked and
push out data towards the sink. So here you have two streaming threads
altogether.


   filesrc ! wavparse ! ... ! autoaudiosink

filesrc can operate both pull and push-based. Wavparse will check if
upstream supports pull mode and use that if possible. So in this case
wavparse creates a thread and reads data from filesrc via
gst_pad_pull_range() as fast as it can and pushes buffers out as fast as
it can (and the sink will block to sync against the clock according to
the timestamps on the buffers).



>   3 As i know,I can insert a queue between a source element and the 
> downstream elements. In this case,what mode does the source element
work? 
> pull or push?

If you insert a queue, you force the right/downstream side of the queue
to be push-based. What happens to the left/upstream side of the queue
depends on the elements, if there is only a source upstream then the
source will operate in push-mode, e.g.:

   filesrc ! queue ! wavparse ! ... ! autoaudiosink

will force wavparse to work in streaming mode rather than pull-based
like in the example above.

Hope this helps.

Cheers
 -Tim





------------------------------

Message: 5
Date: Wed, 14 Jun 2006 20:28:13 +0800 (CST)
From: zs p <paaa1976 at yahoo.com.cn>
Subject: [gst-devel] Why can't multiple pipelines run in one process
	at the	same time?
To: gstreamer-devel at lists.sourceforge.net
Message-ID: <20060614122813.25754.qmail at web15607.mail.cnb.yahoo.com>
Content-Type: text/plain; charset="gb2312"

I want to playback multiple audio files in one process at the same time.
However, when I create another pipeline after constructing a pipeline,
the older pipeline can't work well, even if the newer pipeline is over.

The following step is my experiment:

1.create pipeline1
2.set pipeline1 to GST_STATE_PLAYING to playback, ok
3.after 10 seconds , create pipeline2, but pipeline1 can't work well at
the same time
4.set pipeline2 to GST_STATE_PLAYING to playback, ok


So I want to know whether gstreamer can support multiple pipelines in
one process at the same time, OR how to playback multiple files in one
process synchronously?

Thanks in advance.

 __________________________________________________
?????????????????????????????
http://cn.mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://sourceforge.net/mailarchive/forum.php?forum=gstreamer-devel/attac
hments/20060614/350384a4/attachment.html 

------------------------------

Message: 6
Date: Wed, 14 Jun 2006 09:32:58 -0400
From: "Antoine Tremblay" <hexa00 at gmail.com>
Subject: Re: [gst-devel] Why can't multiple pipelines run in one
	process at	the same time?
To: "zs p" <paaa1976 at yahoo.com.cn>
Cc: gstreamer-devel at lists.sourceforge.net
Message-ID:
	<6bd63b970606140632k70dfcca2vf8b875bf8f23cdcd at mail.gmail.com>
Content-Type: text/plain; charset="gb2312"

It's possible , just run each pipeline in a separate thread, it should
work
fine :)



On 6/14/06, zs p <paaa1976 at yahoo.com.cn> wrote:
>
> I want to playback multiple audio files in one process at the same
time.
> However, when I create another pipeline after constructing a pipeline,
the
> older pipeline can't work well, even if the newer pipeline is over.
>
> The following step is my experiment:
>
> 1.create pipeline1
> 2.set pipeline1 to GST_STATE_PLAYING to playback, ok
> 3.after 10 seconds , create pipeline2, but pipeline1 can't work well
at
> the same time
> 4.set pipeline2 to GST_STATE_PLAYING to playback, ok
>
>
> So I want to know whether gstreamer can support multiple pipelines in
one
> process at the same time, OR how to playback multiple files in one
process
> synchronously?
>
> Thanks in advance.
>
> __________________________________________________
> ?????????????????????????????
> http://cn.mail.yahoo.com
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://sourceforge.net/mailarchive/forum.php?forum=gstreamer-devel/attac
hments/20060614/0c48dd7d/attachment.html 

------------------------------

Message: 7
Date: Wed, 14 Jun 2006 10:26:46 -0500
From: "Wilson, Diego" <dwilson at ti.com>
Subject: Re: [gst-devel] simultaneous OSS playback/record
To: "Thomas Vander Stichele" <thomas at apestaart.org>
Cc: gstreamer-devel at lists.sourceforge.net,	Edgard Lima
	<edgard.lima at indt.org.br>
Message-ID: <FAF67D6D4373D1419B86EEF694A20B4555BC78 at DLEE09.ent.ti.com>
Content-Type: text/plain;	charset="us-ascii"

Thomas,

Here's my problem. I am very aware my OSS driver does not allow two
opens. What's more I even know the person who wrote this OSS driver. And
I contacted him regarding the "full duplex" issue. 

The driver writer (say that three times fast) is arguing you should not
open a /dev/dsp device twice using OSS to begin with. And the "Open
Sound System Programmer's Guide" supports his argument. The guide says
you should open the device once, turn on a full duplex mode and then
read and write like there was no tomorrow. The guide *is* the golden
standard for OSS Audio isn't it? Cuz maybe I'm looking in the wrong
place.

Now IMHO there's only two possible solutions to my problem:

1. Convince the writer of the OSS driver that you *should* be able to
open the /dev/dsp device twice.
2. Find a way of doing OSS full duplex in GStreamer by opening the
/dev/dsp device once.

For now, I'm making a plea to the GStreamer gods for an answer. C'mon, I
know your watching.

Regards,

___________________
Diego Wilson

-----Original Message-----
From: Thomas Vander Stichele [mailto:thomas at apestaart.org] 
Sent: Wednesday, June 14, 2006 4:11 AM
To: Wilson, Diego
Cc: Edgard Lima; gstreamer-devel at lists.sourceforge.net
Subject: Re: [gst-devel] simultaneous OSS playback/record

On Tue, 2006-06-13 at 13:20 -0500, Wilson, Diego wrote:
> Edgard,
> 
> None of them work. I'm getting the following error on all of them:
> 
> ERROR: from element /pipeline0/osssrc0: Unable to open device /dev/dsp
> for recording: Device or resource busy

Well, then your oss driver really *does not* allow two opens, even from
the same process.

I have the same for my ac97 intel sound card.  alsasrc ! alsasink works
fine on it, so it's not the hardware's fault.

Thomas





------------------------------



------------------------------

_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


End of gstreamer-devel Digest, Vol 1, Issue 2319
************************************************



=========================================================

This email message and any attachments thereto are intended only for use by the addressee(s) named above, and may contain legally privileged and/or confidential information. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster at nds.com and destroy the original message




More information about the gstreamer-devel mailing list