Dual Monitor Configuration

I have 2 Display running with TX1 R24.2.1.

  1. HDMI Monitor (1920x1080)
  2. eDP panel (1920x1200)

Below is my xrandr output

ubuntu@tegra-ubuntu:~$ xrandr
Screen 0: minimum 8 x 8, current 3840 x 1200, maximum 16384 x 16384
DP-0 connected primary 1920x1200+1920+0 (normal left inverted right x axis y axis) 220mm x 140mm
   1920x1200     60.02*+
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 480mm x 270mm
   1920x1080     60.00*+  59.95    50.00    61.25    60.05    51.04  
   1600x900      60.00  
   1440x576      52.08  
   1440x480      62.69  
   1280x1024     75.03    60.00  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    60.01  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   720x400       70.04  
   640x480       75.00    59.94    59.94

By default, Both display appear as side by side as extended display.

In my application, i required my primary display as eDP where my application GUI is running.
At startup HDMI monitor should be OFF or should be displaying some logo without mirroring my GUI application. I just want to display Gstreamer Camera Preview on HDMI on request.

How can i start any application on a particular display (eDP or HDMI) from command line and also from my QT GUI app?

If you guys have any better idea for nVidia TX1?

Hi RiteshPanchal,

I just want to display Gstreamer Camera Preview on HDMI on request.
Please take a look at below note in http://developer.nvidia.com/embedded/dlc/l4t-accerated-gstreamer-guide-24-2-1 to see if help your case.

Note: When you do not use the primary display to render video, use the
display-id property of nvoverlaysink. For example, refer to the
pipeline below.

Thanks vickyy for the Reply.

Using display-id property of nvoverlaysink, I can choose display on which to render the video.
display-id=0 (For eDP)
display-id=1 (For HDMI Monitor)

Some more questions,

  1. Can i make QT application to run only on eDP display by default? Because i make my Qt app to be loaded on Ubuntu Autostart.

  2. As Both display init as extended display, mouse can be panning to total Screen 0 resolution 3840 x 1200 of xrandr. So can i disable HDMI display to be active on mouse/keyboard event? I just want to use HDMI display just to view video no control/event from it.

Hi RiteshPanchal,

Could you explain what is “run only on eDP dispaly by default”? What do you want to see?

By “run only on eDP display by default” means,
In my application,
my primary display is eDP, where my QT UI app is running. And HDMI monitor is only used to preview camera feed or play the recorded video.

At power up, eDP panel will show QT App and HDMI should be showing a company logo image.

My 2 displays initiated as the extended display. And as per the Ubuntu standard whichever display is on the left is selected as a primary display or on which display is my mouse pointer is.
So my requirement is to open QT app forcefully starts on eDP display irrespective of which is the primary display. I need to verify from the QT side is there any way to do this? But is there any way from Ubuntu side?

After successfully start Qt app on eDP display I can show logo image on HDMI using GStreamer sink element display-id property. For now, i only knows this way. But Can I display image using command line forcefully on HDMI?

And the second problem is, As both displays are extended displays. the mouse pointer is panning through whole 3840 x 1200 virtual display (1920x1200(eDP) + 1920x1080(HDMI)). I just want to limit mouse pointer planning limited to only eDP display.
Is there any way to do using xrandr or any other utility.?

Hi RiteshPanchal,

Sorry that tegra does not officially support Qt, so I don’t know the configuration of it.
But if you want to control the monitor, few ways can do:

  1. By using xrandr
xrandr --output HDMI-0 --off 
xrandr --output HDMI-0 --right-of DP-0 --auto  (unblank and back to extended)
xrandr --output HDMI-0 --auto (unblank, but mirrored one)
  1. By using debugfs
echo 1 > /sys/devices/platform/host1x/tegradc.0/graphics/fb0 or fb1 under tegradc.1

As for the mouse limitation, I have no idea. Maybe xrandr with --panning parameter would help.

Is Qt based on x11? Can it use fb0 for eDP panel and you can render your Logo on fb1?

How can i show camera preview to both HDMI and eDP display with no frame drop.
My camera input is 1920x1080 60 FPS UYVY.

I have tried below 2 pipelines.

  1. Below pipeline show preview on either one display(video is smooth)
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=1920, height=1080, format=UYVY, framerate=60/1' \
! nvvidconv ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=I420, framerate=60/1' \
! tee name=t ! queue ! nvoverlaysink sync=false async=false display-id=0 t.\
! queue ! nvoverlaysink sync=false async=false display-id=1

And sometimes gives below error when no video on both display.

NvxBaseWorkerFunction[2520] comp OMX.Nvidia.std.iv_renderer.overlay.yuv420 Error -2147479552
  1. Gives preview on both display but eDP preview is smooth but HDMI preview is sluggish.
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=1920, height=1080, format=UYVY, framerate=60/1' \
! tee name=t ! queue \
! nvvidconv ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=I420, framerate=60/1' \
! nvoverlaysink display-id=0 sync=false async=false t. ! queue \
! nvvidconv ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=I420, framerate=60/1' \
! nvoverlaysink display-id=1 sync=false async=false
  1. Gives preview on both display but HDMI preview is smooth but eDP preview is sluggish.
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=1920, height=1080, format=UYVY, framerate=60/1' \
! tee name=t ! queue \
! nvvidconv ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=I420, framerate=60/1' \
! nvoverlaysink sync=false async=false t. ! queue \
! nvvidconv ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=I420, framerate=60/1' \
! nvhdmioverlaysink sync=false async=false

I tried Mirroring the Displays but the result are same for above pipelines.
Can there is any way so that i can get smooth video render on both displays.?

Hi RiteshPanchal,
Please try two sink first. I’ll look into overlaysink to see if there is any problem.

gst-launch-1.0 nvcamerasrc ! tee name=t ! queue ! nvvidconv ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=I420, framerate=60/1' ! nvoverlaysink display-id=1 sync=false async=false t. ! queue ! nvvidconv ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=I420, framerate=60/1' ! nvegltransform ! nveglglessink -e

Yeah using nveglglessink instead of nvoverlaysink shows preview on both displays smoothly.

gst-launch-1.0 v4l2src ! 'video/x-raw, width=1920, height=1080, format=UYVY, framerate=60/1' ! tee name=t ! queue ! nvvidconv ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=I420, framerate=60/1' ! nvoverlaysink display-id=1 sync=false async=false t. ! queue ! nvvidconv ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=I420, framerate=60/1' ! nvegltransform ! nveglglessink -e

But nveglglessink shows preview in windowed mode. I required preview to be shown in full screen. Or without border windows. So is there any way i can show in full screen.?
Or may be i can use display property to preview this on Qt Widget or Qt video surface?

Hi RiteshPanchal,

The sluggish problem seems a bug in nvoverlaysink and is expected to be fixed in next release.

Hi Wayne,

Can you tell me the expected release date?
Or in the meantime, can you send me the updated built-in library of nvoverlaysink with this problem solved.

Hi RiteshPanchal,

The next release is in QA validation stage, it will be published after passed the criteria, please stay tuned.

Thanks