Gstreamer always report error when I want to display testsrc on the second HDMI screen!

In my project, I use TX2 8GB module,The Jetpack version are 28.2 and 32.5.1(I try the both version, the reslut is same). I want to display different image on 2 HDMI monitors. I try to use Gstreamer direct write screen. When I use:
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink display-id=0 -e
the display is OK on the first HDMI monitor. But when I use:
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink display-id=1 -e
there is no display on the second HDMI monitor and report errors like below:

1. Setting pipeline to PAUSED ...
  1. Pipeline is PREROLLING ...
    
  2. Pipeline is PREROLLED ...
    
  3. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  4. Setting pipeline to PLAYING ...
    
  5. New clock: GstSystemClock
    
  6. ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.
    
  7. Additional debug info:
    
  8. gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
    
  9. streaming stopped, reason error (-5)
    
  10. EOS on shutdown enabled -- waiting for EOS after Error
    
  11. Waiting for EOS...
    
  12. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  13. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  14. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  15. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  16. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  17. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  18. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  19. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  20. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  21. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  22. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  23. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  24. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  25. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  26. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  27. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  28. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  29. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  30. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  31. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  32. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  33. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  34. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  35. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  36. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  37. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  38. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  39. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  40. NvxBaseWorkerFunction[2575] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552 
    
  41. Got EOS from element "pipeline0".
    
  42. EOS received - stopping pipeline...
    
  43. Execution ended after 0:00:00.033422451
    
  44. Setting pipeline to PAUSED ...
    
  45. Setting pipeline to READY ...
    
  46. Setting pipeline to NULL ...
    
  47. Freeing pipeline ...
    

I find some methods to solve the problem, but all the same. I can’t display testsrc on the second HDMI screen!

Hi,
Please try the steps in gstreamer user guide

DaneLLL,Thank you for your help!
I followed your guide and run the command below:
# sudo -s
# cd /sys/class/graphics/fb0
# echo 4 > blank // Blanks monitor for changing
# // display setting.
# echo 0x0 > device/win_mask
# // Clears current window setting.
# // window setting.
# echo 0x3f > device/win_mask
# // Assigns all 6 overlay windows
# // in display controller to
# // display 0 (fb0).
# echo 0 > blank // Unblank display.

but when I run line:
echo 0x3f > device/win_mask
the command return error: write error : Invalid argument
and I find demsg output: tegradc 15210000.nvdisplay: win[5] already on fb1
Then the next steps can’t continue.

What can I do? I will read trm doc and waiting ur help, thank you!

I change fb0’s win_mask from 0x18 to 0x1f.
Now I can use :
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink overlay=0,1,2,4 -e
They works well,but they all display on my first HDMI monitor.
When I use :
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink overlay=5 -e
The same error is shown in my topic 1# describe.
The fb1’s win_mask is 0x20 .means win[5] on fb1.
Why :
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink overlay=5 -e
can’t display image on my second HDMI monitor?

Specially,
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink display-id=1 -e
not yet works well,diplay errors like befor.

I think you might need to tell us what is your environment first. Our devkit does not support dual HDMI case, so are you using your own custom carrier board?

Could you also try to assign all the window to your second HDMI, run the same command as your overlay=0,1,2,3,4,5 and see if it can render anything on it?

Do you have ubuntu desktop on your screen?

Hi, WayneWWW. For ur advise:

1)I use our own custom board:
2)I try to assign win[4,5] for fb1,the errors are the same, I will try others win for fb1;
3)I have ubuntu desktop on my screen.

The same code we works well on Nano devKit. We need change nothing and Nano can display images on 2 HDMI monitor(we use a DP to HDMI converter ) .
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink display-id=0 for the first screen;
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink display-id=1 for the second screen.

The window assignment is different between Nano/TX1 and TX2. TRM of TX1 and TX2 will tell that.
That is why you don’t need that for TX1 series platform.

Also, when you use nvoverlaysink and those window stuff, disable the ubuntu desktop because it is occupied one window too…

Thank you for ur reply, WayneWWW!
I just put win[0,1,2,4,5] on fb1 and run command:
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink overlay= 0,1,2,4 5 -e
All of them get wrong messages.

If I want to use overlay display image on the second monitor, I must disable ubuntu desktop?
To disable ubuntu desktop,these command is right?

Stop X11 using following command:

$ sudo systemctl stop gdm

$ sudo loginctl terminate-seat seat0

This is not regarding to which monitor you are using. If you want to use overlay on all 6 windows, you have to disable ubuntu desktop.

The logic here is simple, if you see anything on the screen, that one must at least occupy one window. Thus, if you want to use overlay on all windows, you should at least free the one that is occupied by gdm.

As for your current issue, please tell me what is your step to assign window to fb1. Also, are you sure the second HDMI is fb1?

I don’t want to use all windows, I just want to use 2 windows: one for the first monitor, one for the second monitor. I think there are 6 windows, if gdm occupied 2 windows(because I have 2 monitors), I can use the left 6-2=4 windows . If I use: gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink overlay= 0 , I can see testsrc add on my desktop.
The step to assign window to fb1:
cd /sys/class/graphics/fb1
echo 4 > blank // Blanks monitor for changing
echo 0x0 > device/win_mask
echo 0x37 > device/win_mask //set win [0,1,2,4,5] to fb1
echo 0 > blank // Unblank display.

I’m sure the second HDMI is fb1,because I use command :
echo 4 > blank // Blanks monitor for changing
the second monitor is turn off.

Please give all windows to fb1 and disable gdm3 first. Just for debug purpose.

Please also disable fb0 when you are doing those blank/ublank work on fb1.

I disable fb0 use command :
cd /sys/class/graphics/fb1
echo 4 > blank // Blanks monitor for changing
echo 0x0 > device/win_mask

and set all windows to fb1:
cd /sys/class/graphics/fb1
echo 4 > blank // Blanks monitor for changing
echo 0x0 > device/win_mask
echo 0x3f > device/win_mask //set win [0,1,2,3,4,5] to fb1
echo 0 > blank // Unblank display.

and stop gdm3 use :

systemctl stop gdm3

Now we have only the second HDMI screen output!
but run command :
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink overlay= 0,1,2,3,4,5 -e
they all return errors!

Surprise, this command can work now:
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink display-id=1 -e
this command use display-id=1 which error before. But when I assigned 6 windows on fb1, this command can display testsrc on the second HDMI screen!

Hi,

What if you output the overlay one by one? I mean just overlay=0. and then overlay=1…

Actually, I think your steps look correct. If this error keeps happening, I may have to find a TX2 device and try to reproduce this error.

I out put overlay one by one! The step is :
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink overlay= 0
Wrong,then I use :
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink overlay= 1
Wrong,then I use :
gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink overlay= 2

gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink overlay= 5

I don’t display these overlay and the same time!
And I disable disable output in DTS file(based dsi-hdmi-hdmi.dtsi)! The board only have 2 HDMI output.

Thank you for ur help, I will continues work on it and waiting for ur good new!

What release are you using for this latest test?

I use latest version : JetPack_4.5.1_Linux_JETSON_TX2

Hi,

I just tried some steps locally and eventually it can have both display work.

The steps are as follow

  1. Before doing any blank step here, use commands to disable gdm3.

$ sudo systemctl stop gdm
$ sudo loginctl terminate-seat seat0

  1. Do all the steps you’ve done to blank/assign window/unblank on both fb*.

  2. Run two pipeline, one pipeline with nvoverlaysink display-id=0 overlay=0
    and another one with display-id=1 overlay=0

This one should bring you the two rendering on each screen.

Hi,
I just test the method ur advise, but there are some problems:

  1. When I diable gdm3, there is not any display on the screen, I can’t type any commands. So I think I must use a serial terminal to input step 2) and step 3).
  2. If I don’t use serial terminal. I use Ctrl+Alt+F2 to enter tty Screen. And do step 2) and step 3), there is the same error, So I think ur method only can use like a .sh file which contain these commands!

Now I find a method can realize my function no need close gdm:

  1. open a terminal on the second monitor;

  2. run a script contain window set for fb:
    cd /sys/class/graphics/fb0
    echo 4 > blank // Blanks monitor for changing
    echo 0x0 > device/win_mask
    echo 0x7 > device/win_mask //set win[0,1,2] to fb0
    echo 0 > blank // Unblank display,here the screen is gray,no desktop, can only see mouse pointer on the screen;

    cd /sys/class/graphics/fb1
    echo 4 > blank // Blanks monitor for changing
    echo 0x0 > device/win_mask
    echo 0x38 > device/win_mask //set win [,3,4,5] to fb1
    echo 0 > blank // Unblank display.here the second monitor display right: have desktop!

  3. Now the windows set is successfully, then I can type commands below:
    gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink display-id=0 -e // Works right on the first screen.
    gst-launch-1.0 videotestsrc ! video/x-raw,format=I420 ! nvoverlaysink display-id=1 -e// works right on the second screen.