udpsrc odd behaviour building a pipeline with two streams

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

udpsrc odd behaviour building a pipeline with two streams

Tiago Katcipis
I'm building a pipeline to use on a voip application, i started building a very simple one, one stream generates the audio and sends it with udpsink the other receives audio at udpsrc and play it at pulsesink. For test purposes i send the audio to myself. But the odd thing is that it only works when i use separated pipelines to build the send and the receive streams.

For example, the following works fine:

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! udpsink host=127.0.0.1 port=5000
gst-launch udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! pulsesink


But if i use only one pipeline to do the work, it starts just ok....but nothing happens (and no data pass through the identity0 or identity1)

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! udpsink host=127.0.0.1 port=5000 udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! pulsesink

I think it is something with udpsrc because if i try:

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! fakesink udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! pulsesink

it will not work too, no data reaches the fakesink.

but if i try

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! udpsink host=127.0.0.1 port=5000 audiotestsrc ! identity ! pulsesink

it works just fine. It sens that for some reason the udpsrc makes the entire pipeline stop, no data flows on either streams.

I tought it could be some error on pulse with udpsrc, but:

gst-launch -v audiotestsrc ! identity ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! fakesink udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! fakesink

wont work either, but if i run on separated gst-launch, it works fine.


i even have made some source code to test this, the same example that works on different pipelines wont work if it is made on only one pipeline.

The ok code:
https://svn.inf.ufsc.br/katcipis/c/gstreamer/pipe_voip_ok

The error code:
https://svn.inf.ufsc.br/katcipis/c/gstreamer/pipe_voip_error

the odd thing is that even if udpsrc didn't receive any data, why is udpsrc blocking the entire pipe?

hope someone can help me see what I'm doing wrong.


best regards,
Katcipis


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: udpsrc odd behaviour building a pipeline with two streams

Tiago Katcipis
I'm doing more tests and my problem seens to be udpsrc + udpsink being used together on the same pipeline. I need to use then together on the same pipeline because on the future i want to use a tee element to log the near stream and the far stream on the same file from the voip chat, and i didn't wanted to use two pipes and mix outside gstreamer.

This simple example wont work, bot streams got locked:
gst-launch -v fakesrc ! identity ! udpsink host=localhost port=6000 udpsrc port=5000 ! identity ! fakesink

But if i use only udpsink OR udpsrc, it works:
gst-launch -v fakesrc ! identity ! fakesink  udpsrc port=5000 ! identity ! fakesink
gst-launch -v fakesrc ! identity ! udpsink host=localhost port=6000 fakesrc ! identity ! fakesink

An i doing some big mistake on the way I'm using gstreamer to do this?

any help will be appreciated.

best regards,
Katcipis

On Wed, Nov 11, 2009 at 9:15 PM, Tiago Katcipis <[hidden email]> wrote:
I'm building a pipeline to use on a voip application, i started building a very simple one, one stream generates the audio and sends it with udpsink the other receives audio at udpsrc and play it at pulsesink. For test purposes i send the audio to myself. But the odd thing is that it only works when i use separated pipelines to build the send and the receive streams.

For example, the following works fine:

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! udpsink host=127.0.0.1 port=5000
gst-launch udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! pulsesink


But if i use only one pipeline to do the work, it starts just ok....but nothing happens (and no data pass through the identity0 or identity1)

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! udpsink host=127.0.0.1 port=5000 udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! pulsesink

I think it is something with udpsrc because if i try:

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! fakesink udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! pulsesink

it will not work too, no data reaches the fakesink.

but if i try

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! udpsink host=127.0.0.1 port=5000 audiotestsrc ! identity ! pulsesink

it works just fine. It sens that for some reason the udpsrc makes the entire pipeline stop, no data flows on either streams.

I tought it could be some error on pulse with udpsrc, but:

gst-launch -v audiotestsrc ! identity ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! fakesink udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! fakesink

wont work either, but if i run on separated gst-launch, it works fine.


i even have made some source code to test this, the same example that works on different pipelines wont work if it is made on only one pipeline.

The ok code:
https://svn.inf.ufsc.br/katcipis/c/gstreamer/pipe_voip_ok

The error code:
https://svn.inf.ufsc.br/katcipis/c/gstreamer/pipe_voip_error

the odd thing is that even if udpsrc didn't receive any data, why is udpsrc blocking the entire pipe?

hope someone can help me see what I'm doing wrong.


best regards,
Katcipis




--
"Se você se perder na selva africana, não precisa se desesperar. Basta sentar em uma pedra e começar a instalar GNU/Linux em seu laptop. Em menos de 5 minutos aparecerá alguém pra discordar de sua escolha de distribuição, do particionamento, do gerenciador de janelas, do ambiente de desktop, do editor de textos..."

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: udpsrc odd behaviour building a pipeline with two streams

Tiago Katcipis
In reply to this post by Tiago Katcipis
I got some advice that maybe conecting both streams with a tee element would resolve the problem, so i tried this:

gst-launch -v tee name=near adder name=mixer fakesrc ! identity ! near.sink near.src0 ! queue ! udpsink host=localhost port=5000  near.src1 ! queue ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! queue ! mixer. tee name=far udpsrc port=6000  ! identity ! far.sink far.src0 ! queue ! fakesink far.src1 ! queue ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! queue ! mixer. mixer.src ! fakesink

basically i added 2 tees , the tee gets the fakedata and sends it to a fakesink and to a adder, the adder gets the received fakedata from both streams and sends it to a fakesink too. i used queue on the src pad from the tee and on the sinkpads of the adder. Even connecting both streams with the tees + adder seens to not work, both streams got locked. I would expect to not received data on the udpsrc, but the fakesrc stream blocks too.

any hint on what is wrong?

On Wed, Nov 11, 2009 at 9:15 PM, Tiago Katcipis <[hidden email]> wrote:
I'm building a pipeline to use on a voip application, i started building a very simple one, one stream generates the audio and sends it with udpsink the other receives audio at udpsrc and play it at pulsesink. For test purposes i send the audio to myself. But the odd thing is that it only works when i use separated pipelines to build the send and the receive streams.

For example, the following works fine:

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! udpsink host=127.0.0.1 port=5000
gst-launch udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! pulsesink


But if i use only one pipeline to do the work, it starts just ok....but nothing happens (and no data pass through the identity0 or identity1)

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! udpsink host=127.0.0.1 port=5000 udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! pulsesink

I think it is something with udpsrc because if i try:

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! fakesink udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! pulsesink

it will not work too, no data reaches the fakesink.

but if i try

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! udpsink host=127.0.0.1 port=5000 audiotestsrc ! identity ! pulsesink

it works just fine. It sens that for some reason the udpsrc makes the entire pipeline stop, no data flows on either streams.

I tought it could be some error on pulse with udpsrc, but:

gst-launch -v audiotestsrc ! identity ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! fakesink udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! fakesink

wont work either, but if i run on separated gst-launch, it works fine.


i even have made some source code to test this, the same example that works on different pipelines wont work if it is made on only one pipeline.

The ok code:
https://svn.inf.ufsc.br/katcipis/c/gstreamer/pipe_voip_ok

The error code:
https://svn.inf.ufsc.br/katcipis/c/gstreamer/pipe_voip_error

the odd thing is that even if udpsrc didn't receive any data, why is udpsrc blocking the entire pipe?

hope someone can help me see what I'm doing wrong.


best regards,
Katcipis




--
"Se você se perder na selva africana, não precisa se desesperar. Basta sentar em uma pedra e começar a instalar GNU/Linux em seu laptop. Em menos de 5 minutos aparecerá alguém pra discordar de sua escolha de distribuição, do particionamento, do gerenciador de janelas, do ambiente de desktop, do editor de textos..."

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: udpsrc odd behaviour building a pipeline with two streams

Tiago Katcipis
i started to think that maybe it is a bug at udpsink/src when both are used on the same pipe.

The following test works fine, udpsrc receives data and sends it to the fakesink...that prints it on the screen:
gst-launch -v audiotestsrc ! audioconvert ! audiorate ! "audio/x-raw-int,rate=8000,channels=1,endianness=1234,width=16,depth=16,signed=true" ! udpsink host=127.0.0.1 port=5000
gst-launch -v udpsrc port=5000 caps="audio/x-raw-int,rate=8000,channels=1,endianness=1234,width=16,depth=16,signed=true" ! fakesink


If i run both streams on the same pipeline, it simply wont work:
gst-launch -v audiotestsrc ! audioconvert ! audiorate ! "audio/x-raw-int,rate=8000,channels=1,endianness=1234,width=16,depth=16,signed=true" ! udpsink host=127.0.0.1 port=5000 udpsrc port=5000 caps="audio/x-raw-int,rate=8000,channels=1,endianness=1234,width=16,depth=16,signed=true" ! fakesink

no data reaches the fakesink, and it is basically the same thing, the only diference is that they are on the same pipeline.

Is WRONG to use udpsink and udpsrc together on the same pipe to build two diferent streams? If it is not wrong im going to report this as a bug at udpsink/udpsrc. I already builded examples that use pulsesrc and pulsesink on two diferent streams on the same pipeline and worked perfectly fine, thats why im suspicious at udp.

hope someone can give me some help on this.

best regards,
Katcipis

On Mon, Nov 16, 2009 at 1:48 PM, Tiago Katcipis <[hidden email]> wrote:
I got some advice that maybe conecting both streams with a tee element would resolve the problem, so i tried this:

gst-launch -v tee name=near adder name=mixer fakesrc ! identity ! near.sink near.src0 ! queue ! udpsink host=localhost port=5000  near.src1 ! queue ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! queue ! mixer. tee name=far udpsrc port=6000  ! identity ! far.sink far.src0 ! queue ! fakesink far.src1 ! queue ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! queue ! mixer. mixer.src ! fakesink

basically i added 2 tees , the tee gets the fakedata and sends it to a fakesink and to a adder, the adder gets the received fakedata from both streams and sends it to a fakesink too. i used queue on the src pad from the tee and on the sinkpads of the adder. Even connecting both streams with the tees + adder seens to not work, both streams got locked. I would expect to not received data on the udpsrc, but the fakesrc stream blocks too.

any hint on what is wrong?

On Wed, Nov 11, 2009 at 9:15 PM, Tiago Katcipis <[hidden email]> wrote:
I'm building a pipeline to use on a voip application, i started building a very simple one, one stream generates the audio and sends it with udpsink the other receives audio at udpsrc and play it at pulsesink. For test purposes i send the audio to myself. But the odd thing is that it only works when i use separated pipelines to build the send and the receive streams.

For example, the following works fine:

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! udpsink host=127.0.0.1 port=5000
gst-launch udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! pulsesink


But if i use only one pipeline to do the work, it starts just ok....but nothing happens (and no data pass through the identity0 or identity1)

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! udpsink host=127.0.0.1 port=5000 udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! pulsesink

I think it is something with udpsrc because if i try:

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! fakesink udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! pulsesink

it will not work too, no data reaches the fakesink.

but if i try

gst-launch -v audiotestsrc ! identity ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! udpsink host=127.0.0.1 port=5000 audiotestsrc ! identity ! pulsesink

it works just fine. It sens that for some reason the udpsrc makes the entire pipeline stop, no data flows on either streams.

I tought it could be some error on pulse with udpsrc, but:

gst-launch -v audiotestsrc ! identity ! audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true ! fakesink udpsrc port=5000 caps="audio/x-raw-int,rate=44100,channels=1,endianness=1234,width=16,depth=16,signed=true" ! identity ! fakesink

wont work either, but if i run on separated gst-launch, it works fine.


i even have made some source code to test this, the same example that works on different pipelines wont work if it is made on only one pipeline.

The ok code:
https://svn.inf.ufsc.br/katcipis/c/gstreamer/pipe_voip_ok

The error code:
https://svn.inf.ufsc.br/katcipis/c/gstreamer/pipe_voip_error

the odd thing is that even if udpsrc didn't receive any data, why is udpsrc blocking the entire pipe?

hope someone can help me see what I'm doing wrong.


best regards,
Katcipis




--
"Se você se perder na selva africana, não precisa se desesperar. Basta sentar em uma pedra e começar a instalar GNU/Linux em seu laptop. Em menos de 5 minutos aparecerá alguém pra discordar de sua escolha de distribuição, do particionamento, do gerenciador de janelas, do ambiente de desktop, do editor de textos..."



--
"Se você se perder na selva africana, não precisa se desesperar. Basta sentar em uma pedra e começar a instalar GNU/Linux em seu laptop. Em menos de 5 minutos aparecerá alguém pra discordar de sua escolha de distribuição, do particionamento, do gerenciador de janelas, do ambiente de desktop, do editor de textos..."

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel