r24.2.3 : NvEglRenderer::setOverlayText and flicker

Hello,
I used fd and render for display USB camera.
I have well image from camera o nscreen.

But, then i try to draw a text in corner , i have a flicker text rendering.

I try 2 threads , one for renderer with a FD and 2nd for a text update (setOverlayText).

In second, i try to refreash text update thread with 30ms and 1 s … same result.

i read in NvEglRenderer exemple, that’s used XDrawString.

Where does it come from ? how can i fix that ?

Hi Syd, are you able to try r28.2.1?

not yet.

TX1 works on a auvidea J120 carryboard.
I see their new update in last week. A new 3.0 firmware for Jetpack 3.3

For now, it’s on r24.2.3.

Hi syd, do you have a patch we can apply to existing samples and try to reproduce the issue?

Hello,
I work with eCon System example of their camera and I realized that on their sample, the text also flashes.
Next step, integrate TX2. So, I can not waste more time on this feature.

MMAPI uses Xlib functions to draw text. In the future, on TX2, maybe I’m looking for the OpenGL function used.

thx

I am seeing this problem on the TX2 with r28.2.1. Just use the test app attached at https://devtalk.nvidia.com/default/topic/1037450/jetson-tx2/use-gstreamer-or-tegra_multimedia_api-to-decode-video-would-be-more-efficient-and-increase-throughpu-/post/5270860/ and add in a call to setOverlayText. It flickers like crazy. I’d appreciate any help on this.

Hi,
You need to sync buffers to host or device. Please check

/**
* This method must be used for hw memory cache sync for the CPU.
* @param[in] dmabuf_fd DMABUF FD of buffer.
* @param[in] plane video frame plane.
* @param[in] pVirtAddr Virtual Addres pointer of the mem mapped plane.
*
* @returns 0 for success, -1 for failure.

*/
int NvBufferMemSyncForCpu (int dmabuf_fd, unsigned int plane, void **pVirtAddr);

/**
* This method must be used for hw memory cache sync for device.
* @param[in] dmabuf_fd DMABUF FD of buffer.
* @param[in] plane video frame plane.
* @param[in] pVirtAddr Virtual Addres pointer of the mem mapped plane.
*
* @returns 0 for success, -1 for failure.
*/
int NvBufferMemSyncForDevice (int dmabuf_fd, unsigned int plane, void **pVirtAddr);

setOverlayText use Xorg resources (Xlib). I leaved this function.

I modified NvEglRenderer by adding a shader.

With the already existing “Video” shader , I added a new Shader to display a “text” texture on the same idea of displaying a 2D video image,

In this current version, I display an hour through a combination of the texture.

Today, the problem is the optimization of this texture (like pixel align).

Syncing the buffers did not work. The sample app 00_video_decode also shows flicker when displaying text. It even has calls to sync the buffers when saving to an out file. I added in other calls with no luck.

Please share a patch on 00_video_decode and we will try to reproduce it on r28.2.1.

Doesn’t matter where you put it. I’ve put it before and after every call to NvEGLRenderer::render in 00_video_decode and in the test app I mentioned earlier. Run it at fullscreen and the text flickers.

Hi,
We can observe the issue. The function is implemented in X APIs and it looks to have race condition with eglimage.

We suggest you check
https://devtalk.nvidia.com/default/topic/1028073/jetson-tx1/jetson-tx1-x-windown-character-blink/post/5229357/#5229357