Hi,
I make a gstreamer plugin with nvosd lib to overlay text on the video. While when I try to overlay text in a video stream which selected from several video streams using gst-input-selector plugin, the text would flash several seconds and then disappear. The Error is
NvMapMemCacheMaint:1075334668 failed [14]
And look the kernal log, it outputs something likes:
WARNING: All NvMap Allocations must have a tag to identify the subsystem allocating memory.Please pass the tag to the API call NvRmMemHanldeAllocAttr() or relevant.
Any help to correct this would be appreciated, thanks.
Hi,
I use Jetpack 4.6 [L4T 32.6.1]. And the issue happens when I try to use one nvosd_ctx for several dmabuf_fd (more than 4 fds) use the nvosd_put_text api :
int nvosd_put_text(void *nvosd_ctx, NvOSD_Mode mode, int fd, int num_strings,
NvOSD_TextParams *text_params_list);
So whether it caused this issue. Anyway, I will try to create the same amount of nvosd_ctx as the dmabuf_fds to check whether it works, thanks.
The code will be called for different fds ( e.g. four different dmabuf_fds will input into the function ) in a thread. If this is the correct way to call jetson multimedia api, or what I can do to call the apis correctly. Thanks.
More details, when I use diffrent camera sources (hdmi + ipc) as input , this issue always happens. And when I use one type of cameras ( e.g. three ipc cameras ) as input, sometimes it works well and sometimes the text disappears .
Hi,
For further check, we would need your help to share a test code(better to be based on 02_video_dec_cuda) for replicating the issue. So that we can check further.
Hi,
Thank you for your timely reply. I will try to construct a test code for replicating the issue. And I will try the solution of cairo.
And as I say before, the vic_freq is too high, means that I do too much video format transformation. Because textovley only support RGBA format, and the video format in my case must be I420, so I want to transform I420->RGBA, textoverlay and then RGBA->I420 using cuda. I know I can get egl image from NvBuffer by NvEGLImageFromFd(), and then map it to cuda memory. In my opinion, the I420 buffer and the RGBA buffer in cuda/NvBuffer/EglImage have different byte size. I must allocate a new buffer for transforming I420 to RGBA (or RGBA to I420). There are two questions:
How can I copy the new allocated cuda memory to the NvBuffer (dmabuf fd) ?
Whether I must call NvBufferCreateEx to create a new NvBuffer for accepting transformed cuda data ?
Hi,
Sorry for my late response. I try to build a gstreamer plugin and a test code for rebuild the issue.
The source code and Makefile of the plugin is as follows : gstmyosd.c (14.6 KB) gstmyosd.h (1.8 KB) Makefile (2.3 KB)
And the test code is as follows with the compiler command gcc input-selector.c -o input-selector pkg-config --cflags --libs gstreamer-1.0``: input-selector.c (3.5 KB)
The test steps :
input o to run the pipeline;
input r to selector the new pad;
And the issue will happen and output the error NvMapMemCacheMaint:1075334668 failed [14]
HI,
I try the solution that to use cairo APIs to put text and then call NvBufferMemSyncForDevice() then it works with some cost of CPU. While it is better to fix the issue when use nvosd api.
Thanks.
Hi,
cairo APIs should work same as nvosd_put_text() since we support only MODE_CPU:
/**
* Overlays clock and given text at given location on a buffer.
*
* To overlay the clock, you must set clock params using
* nvosd_set_clock_params().
* You must ensure that the length of @a text_params_list is at least
* @a num_strings.
*
* @note Currently only #MODE_CPU is supported. Specifying other modes wil have
* no effect.
*
* @param[in] nvosd_ctx A pointer to NvOSD context.
* @param[in] mode Mode selection to draw the text.
* @param[in] fd DMABUF FD of buffer on which text is to be overlayed.
* @param[in] num_strings Number of strings to be overlayed.
* @param[in] text_params_list A pointer to an array of NvOSD_TextParams
* structure for the clock and text to be overlayed.
*
* @returns 0 for success, -1 for failure.
*/
int nvosd_put_text(void *nvosd_ctx, NvOSD_Mode mode, int fd, int num_strings,
NvOSD_TextParams *text_params_list);
MODE_GPU does not work. We may miss to return error when the mode is not supported.