IPU and mfw_isink

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IPU and mfw_isink

Jump to solution
2,642 Views
dmitriykornoush
Contributor III

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?

Labels (1)
1 Solution
1,592 Views
dmitriykornoush
Contributor III

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

View solution in original post

0 Kudos
18 Replies
1,592 Views
LeonardoSandova
Specialist I

are you creating several mfw_isink instances? For debugging gst stuff, always increase the verbosity to highest so more info can be collected.

0 Kudos
1,592 Views
dmitriykornoush
Contributor III

yes, 4 instances. OF cource, I use max debug info

0 Kudos
1,592 Views
Tarek
Senior Contributor I

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

0 Kudos
1,592 Views
dmitriykornoush
Contributor III

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);

0 Kudos
1,592 Views
Tarek
Senior Contributor I

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?

0 Kudos
1,592 Views
dmitriykornoush
Contributor III

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

0 Kudos
1,592 Views
Tarek
Senior Contributor I

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);




0 Kudos
1,592 Views
dmitriykornoush
Contributor III

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

0 Kudos
1,592 Views
Tarek
Senior Contributor I

I have the same problem. Wish I know the answer. I suggest to create a new post for this problem. Maybe we can get an answer.

0 Kudos
1,593 Views
dmitriykornoush
Contributor III

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

0 Kudos
1,592 Views
dmitriykornoush
Contributor III

Have tried your code. Same result as my code. Grow speed about 1MB each minute

0 Kudos
1,592 Views
Tarek
Senior Contributor I

Do you free data ?

0 Kudos
1,592 Views
dmitriykornoush
Contributor III

Only this one

gst_app_src_push_buffer(ctx->appsrc, buffer);


buffer not freed after this. If I free it, it cause error

0 Kudos
1,592 Views
Tarek
Senior Contributor I

memcpy(GST_BUFFER_MALLOCDATA(buffer),data, size);

0 Kudos
1,592 Views
dmitriykornoush
Contributor III

buffer data is camera buffer. It freed by camera thread. I tried app without gst_app_src_push_buffer, it have no eat memory

0 Kudos
1,592 Views
padmajeetp
Contributor I

how did you resolve memory eat problem?? Is it issue with mfw_isink???

0 Kudos
1,592 Views
Tarek
Senior Contributor I

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

0 Kudos
1,592 Views
dmitriykornoush
Contributor III

OK, thank you, will try this patch.

Maybe you know how to free instances if app crashed? I mean from console

0 Kudos