More than three daemons?

hobbesc7 hobbesc7 at gmail.com
Wed Jan 23 15:20:06 PST 2013


Here's my setup.

My encoder board provides two capture devices that record video from a
single source, and each capture device can be started, stopped, and
configured independently.

I have three encoder boards connected via usb, and each board has one
camera.

My goal is to record high bandwidth via one capture device on each encoder,
and stream low bandwidth udp via the other capture device on each encoder.

I have a small daemon that I run six instances of.  The daemon takes two
parameters, one to indicate record/stream mode, and one to indicate the
/dev/ location of the capture device.

This more or less works -- I can record three cameras at once, and I stream
over udp to my client station running my Qt app that displays the three
streams (and which can send commands to the daemons to start/stop recording
or streaming.)

The problem is that when I'm running 4 or more daemons, gstreamer
occasionally locks up on a gst_element_set_state (GST_ELEMENT(pipeline),
GST_STATE_NULL).  (Previous state was GST_STATE_PLAYING.)  It doesn't matter
what functions the daemons are performing -- i.e. I can have three
recording, and one streaming, or two recording and two streaming, and the
problem occurs.  In debugging this, I added a transition from PLAYING to
PAUSED, which returns an ASYNC change state, which never happens.

Anyone else run into problems with multiple processes/daemons, each with
their own GMainLoop, pipeline, etc.?  Here's some code:

...

	GstState state;
	GstState pending;
	GstClockTime stateWaitTime = 5 * GST_SECOND;
	
	GstStateChangeReturn change;

	gst_element_get_state(GST_ELEMENT(pipeline), &state, &pending,
stateWaitTime);
	g_print("Pipeline state: %s\n",gst_element_state_get_name (state));
	
	change = gst_element_set_state (GST_ELEMENT(pipeline), GST_STATE_PAUSED);
	g_print("Pipeline change state:
%s\n",gst_element_state_change_return_get_name (change));

	while ( state != GST_STATE_PAUSED ) {
		usleep(100000);
		gst_element_get_state(GST_ELEMENT(pipeline), &state, &pending,
stateWaitTime);
		g_print("Waiting to change from %s to
%s\n",gst_element_state_get_name(state),
gst_element_state_get_name(pending));
	}

...

output:

Pipeline state: PLAYING
Pipeline change state: ASYNC
Waiting to change from PLAYING to PAUSED
Waiting to change from PLAYING to PAUSED
Waiting to change from PLAYING to PAUSED
Waiting to change from PLAYING to PAUSED
...





--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/More-than-three-daemons-tp4658126.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list