The next problems.I use mfw_isink for draw pipeline to the screen.
1. Very offten I have messages in console
createVideoSurface: max surfaces on device support on device1 exceeded!
After that, I can not draw any pipeline on screen. Only reboot can help me.
2. Very offten mfw_isink plugin freeze. I.e. program freeze in
const char * p3="appsrc name=mysource is-live=true ! video/x-h264 ! h264parse ! vpudec framedrop=true low-latency=true ! mfw_isink name=vsink sync=true max-lateness=5000000000 qos=true";
GstElement * pipeline=gst_parse_launch(p3,NULL);
In this case,
gst-inspect mfw_isink
also freeze
I think, problem in VPU driver from imx, or in mfw_isink plugin
Questions:
How to reload/reset this driver without rebooting?
已解决! 转到解答。
I found, problem in mfw_isink plugin.
If I remove usr/lib/gstreamer-0.10/libmfw_gst_isink0.so (libmfw_gst_isink1.so or libmfw_gst_isink.so ). App start, but without pictures on the screen
The maximum hard-coded instances is 4. You have to make sure you close all instances properly by setting the pipeline to NULL state before closing the application. In my case I found it to be unreliable that's why I try to avoid terminating the pipeline in my app. I create the pipeline at startup and keep the 4 pipelines for the entire lifetime of the system. I'm using appsrc so to change the stream I set the state to NULL - change the source - set it to PLAYING.
The main point is to avoid link/unlink the pipeline.
hope that helps
Yes, I`m doing same.
When app halt for example with error, I need reboot device to use 4 instances again. It it problem.
Also antoher bug. I use gstreamer to record stream from MJPEG camera to file.
Pipeline is the next:
appsrc name=mysource is-live=true ! queue ! matroskamux name=mux ! queue max-size-time=0 ! filesink name=f1 sync=false location=/home/user/4.avi
Problem: this pipeline eat memory. Very fast cached memory in Linux grow and grow. When it eat all memory, app closed with "Killed".
This code in appsrc:
gpointer buf=(gpointer )g_malloc0(size);
memcpy(buf,Cambuffer,size);
buffer = gst_app_buffer_new (buf, size, g_free, buf);
gst_buffer_set_caps(buffer, gst_caps_from_string (con->caps));
ret=gst_app_src_push_buffer(GST_APP_SRC(con->appsrc),buffer);
Try replacing:
gpointer buf=(gpointer )g_malloc0(size);
memcpy(buf,Cambuffer,size);
buffer = gst_app_buffer_new (buf, size, g_free, buf);
With:
GstBuffer *buffer;
buffer = gst_buffer_try_new_and_alloc (size);
And see if you still have the memory problem?
This code:
guint8 * buf=(guint8 *)g_malloc0(size);
memcpy(buf,Cambuffer,size);
buffer=gst_buffer_new_and_alloc(size);
GST_BUFFER_MALLOCDATA(buffer)=buf;
GST_BUFFER_SIZE(buffer)=size;
GST_BUFFER_DATA(buffer) = GST_BUFFER_MALLOCDATA(buffer);
gst_buffer_set_caps(buffer, gst_caps_from_string (con->caps));
ret=gst_app_src_push_buffer(GST_APP_SRC(con->appsrc),buffer);
eat memory faster that previouse
I think you are double allocating the buffer. This is the code I use:
GstBuffer *buffer;
buffer = gst_buffer_try_new_and_alloc (size);
memcpy(GST_BUFFER_MALLOCDATA(buffer),data, size);
gst_app_src_push_buffer(ctx->appsrc, buffer);
Also I have the next problem.
When app killed for example with killall -KILL app
It freeze in
GstElement * pipeline=gst_parse_launch(p3,NULL);
Only reboot helps.
If app closed correctly (all GstElements gst_object_unref()), I have no this problems
I found, problem in mfw_isink plugin.
If I remove usr/lib/gstreamer-0.10/libmfw_gst_isink0.so (libmfw_gst_isink1.so or libmfw_gst_isink.so ). App start, but without pictures on the screen
You can increase the number of instances by applying this patch:
diff --exclude CVS --exclude .git -uNr gst-fsl-plugins-3.0.7/libs/vss/mfw_gst_vss_common.h gst-fsl-plugins-3.0.7.modified/libs/vss/mfw_gst_vss_common.h
--- gst-fsl-plugins-3.0.7/libs/vss/mfw_gst_vss_common.h 2013-02-21 08:01:16.000000000 +0000
+++ gst-fsl-plugins-3.0.7.modified/libs/vss/mfw_gst_vss_common.h 2013-05-23 12:51:52.000000000 +0100
@@ -54,7 +54,9 @@
#define FOURCC_FMT "%c%c%c%c"
#define FOURCC_ARGS(fourcc) (char)(fourcc),(char)((fourcc)>>8),(char)((fourcc)>>16),(char)((fourcc)>>24)
-#define VS_MAX 8
+/*TSE: Support 4 x 4 display*/
+//#define VS_MAX 8
+#define VS_MAX 32
#define VS_SUBFRAME_MAX 1
#define ALPHA_TRANSPARENT 0
diff --exclude CVS --exclude .git -uNr gst-fsl-plugins-3.0.7/libs/vss/vssconfig gst-fsl-plugins-3.0.7.modified/libs/vss/vssconfig
--- gst-fsl-plugins-3.0.7/libs/vss/vssconfig 2013-02-21 08:01:16.000000000 +0000
+++ gst-fsl-plugins-3.0.7.modified/libs/vss/vssconfig 2013-05-23 12:53:43.000000000 +0100
@@ -8,4 +8,4 @@
format = RGBP
fb_num = 1
main_fb_num = 0
-
+vsmax = 32