Need help starting development. Problem with OSD on IMX6

I purchased a set of Col IMX6DL, Evaluation board and analogue camera adapter ADV7280.
According to the instructions https://developer-archives.toradex.com/knowledge-base/how-to-use-analogue-camera-module-on-embedded-linux#ApalisColibri_iMX6 I was able to get the image from the camera.
Next, I wanted to overlay OSD, I tried several instructions that mentioned imxeglvivsink, imxg2dcompositor, but could not get the desired result. I tried several different test images as imxeglvivsink or imxg2dcompositor was missing somewhere, the most I got was mixing two test patterns.
The instructions I find for creating my images are outdated.
Can anyone help me find the way in the right direction?
Are there any relevant articles with examples of how this is done?
Thanks.

Hi @SVL !

Have you tried some of the examples from NXP’s documentation?

IIRC, i.MX Linux User Guide can maybe help you. You can get it from the link below (maybe you need to create an NXP account).

Please be sure to get the documentation in accordance with the Linux Kernel version you are using. You can get information from your module using tdx-info: Getting Device Information with Tdx-Info | Toradex Developer Center

Best regards,

Hi.
Thank you for your reply. I have already advanced a little further.
I am currently using an old image in which the tdx-info command does not work. Output uname -a: Linux colibri-imx6 4.1.44-2.7.4+gb1555bf #1 SMP Wed Oct 4 22:20:42 UTC 2017 armv7l GNU/Linux

Using the GitHub - spx-radiodetection/fboverlayset: an iMX6 command line utility to set the overlay characteristics of a framebuffer project I was able to get roughly the result I needed. I output video to /dev/fb0 using gst-launch-1.0 command imxv4l2videosrc device=/dev/video0 ! imxipuvideosink use-vsync=true and draw OSD in /dev/fb1 using lvgl. This looks like what is needed.
Latency seems minimal, I’ll measure it later.

Next I connected the display:

imxipuvideosink stopped working for me due to a change in the screen extension, the image is distorted.
I tried imxeglvivsink, it works, the image is not full screen etc. but OSD is applied normally. I’m not sure what exactly can give me the minimum delay.
Can you tell me what exactly I need to change so that imxipuvideosink works correctly?

Thanks. Best regards.

Hello @SVL,

imxipuvideosink stopped working for me due to a change in the screen extension, the image is distorted.

Could you provide some more details regarding how the image is distorted? Depending on the type of distortion, there are a couple of options that you could try to fix it.

  • You could verify the screen extension settings such as the resolution, refresh rate, pixel format and ensure that they are compatible with the imxipuvideosink configuration.
  • Try various output formats with imxipuvideosink such as RGB565, RGB24, and YUV and see if it resolves the distortion issue.
  • Adjust the video scaling settings of imxipuvideosink(such as window-x, window-y, window-width, window-height, force-aspect-ratio)

Please let me know if that helps.

gst-launch-1.0 videotestsrc pattern=18 ! imxg2dvideosink framebuffer=/dev/fb0

Hi @SVL,

  • Could you please send me the output of cat /proc/cmdline command?

  • Also, which version of BSP are you using?

Besides that, from the documentation of fboverlayset git repository, you can see that the fb0 and fb1 can be aligned by running the following command:

In order to overlay framebuffers it is good to make sure they are configured the same. This is
achieved through fbset. For example to set fb1 the same as fb0.

fbset -fb /dev/fb1 -g `fbset -fb /dev/fb0 | sed -n s/geometry//p` \
                   -t `fbset -fb /dev/fb0 | sed -n s/timings//p`

Please let me know if this helps.

Hi,
BSP version: 2.7 (2018-01-04)
output of the cat /proc/cmdline command:
enable_wait_mode=off galcore.contiguousSize=50331648 ip=off root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait fec_mac=00:14:2d:a8:ce:7c consoleblank=0 no_console_suspend=1 console=tty1 console=ttymxc0,115200n8 video =mxcfb0:dev=lcd,FusionF07A,if=RGB666 video=mxcfb1:off fbmem=8
I guess I confused everyone a little. The problem is only with video output via imxipuvideosink/imxg2dvideosink, and this problem appeared after reconfiguring the screen extension (since I connected a TFT panel). Framebuffer overlay works fine, no problems with it now.
Thanks.

Hello @SVL,

I couldn’t help but notice an extra “space” in this line between video and =Preformatted text symbol:
video =mxcfb0:dev=lcd,FusionF07A,if=RGB666 video=mxcfb1:off fbmem=8
It should be video=mxcfb0:dev=lcd,FusionF07A,if=RGB666 video=mxcfb1:off fbmem=8
Could you please check if removing the extra " " would fix the issue?

If it doesn’t, another thing you could try is by setting the configuration for the second framebuffer (fb1) which would have to be configured to the same display as framebuffer0. It should look something like this:
video=mxcfb0:dev=lcd,FusionF07A,if=RGB666 video=mxcfb1:dev=lcd,FusionF07A,if=RGB666 fbmem=8

Please let me know how it goes.

Sorry, it’s just a text formatting error. There is no space in the configuration.
Now I have executed:
setenv vidargs ‘video=mxcfb0:dev=lcd,FusionF07A,if=RGB666 video=mxcfb1:dev=lcd,FusionF07A,if=RGB666 fbmem=8’
saveenv
It had no effect.

Hello @SVL,

I noticed that the images that you posted are from an external monitor and in that case the displays are expected to be distorted. You should be testing it with our parallel RGB display instead. Let’s take a step back here and I would suggest the following steps:

  1. Disconnect the TFTP display.
  2. Connect the 7" parallel RGB display from Toradex
  3. Start the board with the vidargs set as setenv vidargs 'video=mxcfb0:dev=lcd,FusionF07A,if=RGB666 video=mxcfb1:dev=lcd,FusionF07A,if=RGB666 fbmem=8'
  4. Post a picture of what is shown on the parallel RGB display just when the system boots (without anything started)
  5. Start the gstreamer pipeline
  6. Post a picture of what is shown on the parallel RGB display when the gstreamer piepline is running
  7. Send all the commands as well as the output of the commands you are using to start gstreamer
  8. Send the output of fbset -i , fbset -i -fb /dev/fb0, fbset -i -fb /dev/fb1

Let me know how that goes :slight_smile:

Hello @rudhi.tx,
ok.
boot logo:


loading the system:

desktop (LXDE panel is disabled):

gst-launch-1.0 videotestsrc pattern=18 ! imxipuvideosink use-vsync=true

gst-launch-1.0 videotestsrc pattern=18 ! imxeglvivsink fullscreen=true

fbset -i

mode “800x480-60”
# D: 33.260 MHz, H: 31.496 kHz, V: 59.993 Hz
geometry 800 480 832 512 16
timings 30066 88 40 33 10 128 2
rgba 5/11,6/5,5/0,0/0
endmode

Frame buffer device information:
Name : DISP3 BG
Address : 0x1b400000
Size : 8358400
Type : PACKED PIXELS
Visual : TRUECOLOR
XPanStep : 1
YPanStep : 1
YWrapStep : 1
LineLength : 1664
Accelerator : No

fbset -i -fb /dev/fb0

mode “800x480-60”
# D: 33.260 MHz, H: 31.496 kHz, V: 59.993 Hz
geometry 800 480 832 512 16
timings 30066 88 40 33 10 128 2
rgba 5/11,6/5,5/0,0/0
endmode

Frame buffer device information:
Name : DISP3 BG
Address : 0x1b400000
Size : 8358400
Type : PACKED PIXELS
Visual : TRUECOLOR
XPanStep : 1
YPanStep : 1
YWrapStep : 1
LineLength : 1664
Accelerator : No

fbset -i -fb /dev/fb1

mode “800x480-60”
# D: 33.260 MHz, H: 31.496 kHz, V: 59.993 Hz
geometry 800 480 832 512 32
timings 30066 88 40 33 10 128 2
rgba 8/16,8/8,8/0,8/24
endmode

Frame buffer device information:
Name : DISP3 FG
Address : 0x1bc00000
Size : 1703936
Type : PACKED PIXELS
Visual : TRUECOLOR
XPanStep : 1
YPanStep : 1
YWrapStep : 1
LineLength : 3328
Accelerator : No

Hello @SVL,

Thanks for sending the outputs.

Could you please try these gstreamer pipelines and see if that solves the issue:

This will play a test pattern on framebuffer1:
gst-launch-1.0 videotestsrc pattern=18 ! video/x-raw,width=800,height=480,format=YUY2 ! imxv4l2sink async=1 device=/dev/video17

This will play a test pattern on frambuffer0:
gst-launch-1.0 videotestsrc pattern=18 ! video/x-raw,width=800,height=480,format=YUY2 ! imxv4l2sink async=1 device=/dev/video16

Hello @rudhi.tx,
These commands play the video without distortion, but a very low fps.
How to fix imxeglvivsink or imxg2dcompositor?

Hello @SVL ,

These commands play the video without distortion, but a very low fps.

Glad to hear that it works without distortion. To increase the fps, you could try something like this:

gst-launch-1.0 videotestsrc pattern=18 ! video/x-raw,width=800,height=480,framerate=60/1,format=YUY2 ! imxv4l2sink async=1 device=/dev/video17

In this pipeline, the framerate option is set to 60 fps. You can adjust this value to your preferred framerate.

How to fix imxeglvivsink or imxg2dcompositor?

May I know if you have a particular reason to get it fixed with imxeglvivsink or imxg2dcompositor?

Hello @rudhi.tx,
I would like to get the minimum possible delay.
The time between when something moved in space and when it moved on the screen should be minimal.

Hello @SVL,

I would like to get the minimum possible delay.

How much delay are you having right now and what is the magnitude to which you would like to get it reduced?

Hello @rudhi.tx,
currently around 130ms, I would like to get 20-50ms

Hi @SVL,

The low fps might have something to do with the color conversion by the CPU. You will have to play around with the pipeline that already works to find the correct settings as you need. You could also take a look at the colorspace conversion or scaling options in GStreamer (e.g: imxipuvideotransform, imxg2dvideotransform, imxpxpvideotransform).

Other than that, BSP 2.7 is quite outdated and is not supported anymore. So we recommend you to move to a newer BSP where most likely you should just use a framework like Qt Multimedia Framework which does the job for you.

Hi @SVL,

Hope you are doing well. Have you been able to make any progress here?