AnsweredAssumed Answered

run gstreamer app on powerup

Question asked by David Vescovi on Feb 22, 2020
Latest reply on Mar 11, 2020 by karan gajjar

I have a simple gstreamer C++ application called "preview.out" that displays a camera preview on HDMI display.

This application works just fine when I log in as root and launch it by doing ./preview.out.

I would like to launch this same app on power up (without manually logging in as root).

I have a service installed that calls "launchapp.sh" on power up and I have:

 #!/bin/bash
cd /home/root
./preview.out

 

This does seem to launch the app but nothing shows on the display.

I suspect it has something to do with users privileges or something.

 

if I do:

root@imx8mm:~# journalctl -u startup.service --no-pager

 

-- Logs begin at Fri 2020-01-17 21:05:48 UTC, end at Sun 2020-02-23 12:19:39 UT>
Feb 23 12:16:00 imx8mm systemd[1]: Started start preview application.
Feb 23 12:16:01 imx8mm bash[3340]: error: XDG_RUNTIME_DIR not set in the environment.
Feb 23 12:16:01 imx8mm bash[3340]: Unable to set the source pipeline to the playing state.

 

I changed the launchapp.sh adding:

export XDG_RUNTIME_DIR=/home/root

 

Which got rid of the XDG error but I still get the "...pipeline to the playing state" error.

I use V4L2 as the source in the pipeline.

 

How can I launch so display shows on the monitor?

Outcomes