Preambule
This is a guide to obtaining images from Argus applications on a remote screen. It’s insecure, slow, requires changes to the source code, and is generally awkward, but it works.
If you encountered this errors, while trying to obtain the images, this guide should help you.
libEGL warning: DRI3: failed to query the version
libEGL warning: DRI2: failed to authenticate
No protocol specified
(Argus) Error NotSupported: Failed to initialize EGLDisplay (in src/eglutils/EGLUtils.cpp, function getDefaultDisplay(), line 77)
Source code for example can be found here (GitHub - grey1man/argus-camera-test-opencv: Application for streaming mipi camera preview on cv::mat for Nvidia Jetson platforms · GitHub)
Build
- Install and build Argus.
Be carefull when installing of nvidia-l4t-jetson-multimedia-api, the wrong version can break the OS.
sudo apt install nvidia-l4t-jetson-multimedia-api=<L4T version>
sudo apt install cmake build-essential libexpat1-dev libgtk-3-dev
cd /usr/src/jetson_multimedia_api/argus/
sudo mkdir build
cd ./build
sudo cmake ..
sudo cmake --build . --parallel
- Build.
cd argus-camera-test-opencv
mkdir build
cd build
cmake ..
cmake --build . --parallel
Launching with ssh -X
- Create new user.
sudo adduser <new username>
- Activate autologin.
sudo nano /etc/gdm3/custom.conf
- Change lines AutomaticLoginEnable and AutomaticLogin to
AutomaticLoginEnable = true
AutomaticLogin = <new username>
- Reboot the device.
sudo reboot
- Login to the device from host PC using ssh -X
ssh -X <new username>@<address>
cd argus-camera-test-opencv/build
- Launch the application.
./argus-camera-test-opencv -o $DISPLAY -a :0 -c 0 -m 1
Window with the image should appear on host pc.
If application crashed with error, for example:
./argus-camera-test-opencv -o $DISPLAY -a :0 -c 0 -m 1
(Argus) Error NotSupported: Failed to initialize EGLDisplay (in src/eglutils/EGLUtils.cpp, function getDefaultDisplay(), line 77)
(Argus) Error BadParameter: (propagating from src/eglstream/FrameConsumerImpl.cpp, function initialize(), line 89)
(Argus) Error BadParameter: (propagating from src/eglstream/FrameConsumerImpl.cpp, function create(), line 44)
Change value in -a
./argus-camera-test-opencv -o $DISPLAY -a :1 -c 0 -m 1
xRDP installation
- Install xRDP and GNOME Desktop prerequisites
sudo apt install xrdp install gnome-session gnome-terminal
- Configure xRDP to Work with GNOME.
Open the script:
sudo nano /etc/xrdp/startwm.sh
Modify it to start GNOME by commenting out (or removing) the lines:
test -x /etc/X11/Xsession && exec /etc/X11/Xsession
exec /bin/sh /etc/X11/Xsession
Add the following lines to ensure GNOME starts:
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_SESSION_DESKTOP=ubuntu
export XDG_SESSION_TYPE=x11
exec gnome-session
- Enable and Start xRDP.
udo systemctl enable xrdp
sudo systemctl start xrdp
- Allow RDP Port Through the Firewall.
sudo ufw allow 3389/tcp
- Check GNOME Display Manager (GDM) Configuration.
Open the GDM configuration file:
sudo nano /etc/gdm3/custom.conf
Comment the line:
WaylandEnable=false
- Restart gdm3 service.
sudo systemctl restart gdm3
Launching with xRDP
- Connect via xRDP (as first user, NOT the new one).
- In remote desktop open terminal, and connect to the device as new user (that was created in “Launching with ssh -X”) using ssh -X.
ssh -X <new username>@127.0.0.1
- Launch the application
./argus-camera-test-opencv -o $DISPLAY -a :0 -c 0 -m 1
Window with the image should appear on xRDP screen.
If application crashed with error, for example:
./argus-camera-test-opencv -o $DISPLAY -a :0 -c 0 -m 1
(Argus) Error NotSupported: Failed to initialize EGLDisplay (in src/eglutils/EGLUtils.cpp, function getDefaultDisplay(), line 77)
(Argus) Error BadParameter: (propagating from src/eglstream/FrameConsumerImpl.cpp, function initialize(), line 89)
(Argus) Error BadParameter: (propagating from src/eglstream/FrameConsumerImpl.cpp, function create(), line 44)
Change value in -a
./argus-camera-test-opencv -o $DISPLAY -a :1 -c 0 -m 1
Notes
All operations was conducted on Xavier-NX with L4T-35.6.1 (NOT headless).
Creation of a new user with autologin is necessary if you use xRDP, because for user logged in from xRDP new virtual monitor will be created, which somehow breaks Argus pipeline. New user will be logged in automatically, and will obtain a “real” monitor (even if it is not physically connected). If you will use only ssh -X, default user with autologin should be enough.
Ability to display image on a remote screen was implemented with as small hack:
- Changing DISPLAY to :0, to properly form Argus pipeline.
- Forming pipeline.
- Changing DISPLAY to localhsot:10.0, to display cv::imshow on a remote screen.
- Displaying the image.
Without changing DISPLAY in runtime Argus will crash with libEGL errors (DSIPLAY=localhost:10.0), or image will not be displayed (DISPLAY=:0).
Thanks to Jeremy Morgan for the xRDP setup guide ( How to Enable Remote Desktop Jetson Orin Nano ).