Error : running GStreamer in systemd

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error : running GStreamer in systemd

571 Views
Patrick-Kim
Contributor II

Hello,

There's an issue with starting GStreamer in systemd, and here is the error message:

root@imx8mpevk:~# systemctl status my
x my.service - GStreamer Service
Loaded: loaded (/etc/systemd/system/my.service; enabled; preset: disabled)
Active: failed (Result: exit-code) since Thu 2024-05-02 02:35:05 UTC; 15s ago
Duration: 309ms
Process: 469 ExecStart=/bin/bash /home/root/run.sh (code=exited, status=255/EXCEPTION)
Main PID: 469 (code=exited, status=255/EXCEPTION)

May 02 02:35:05 imx8mpevk systemd[1]: Started GStreamer Service.
May 02 02:35:05 imx8mpevk bash[470]: Setting pipeline to PAUSED ...
May 02 02:35:05 imx8mpevk bash[470]: Failed to set pipeline to PAUSED.
May 02 02:35:05 imx8mpevk bash[470]: Setting pipeline to NULL ...
May 02 02:35:05 imx8mpevk bash[470]: Freeing pipeline ...
May 02 02:35:05 imx8mpevk systemd[1]: my.service: Main process exited, code=exited, status=255/EXCEPTION
May 02 02:35:05 imx8mpevk systemd[1]: my.service: Failed with result 'exit-code'.

And here is my test environment.

/etc/systemd/system/my.service

[Unit]
Description=GStreamer Service

[Service]
Type=simple
ExecStart=/bin/bash /home/root/run.sh
User=root

[Install]
WantedBy=multi-user.target

/home/root/run.sh

export XDG_RUNTIME_DIR=/run/user/0/

gst-launch-1.0 v4l2src device=/dev/video2 ! waylandsink

System:

Target Board:
    imx8mpevk

 

Build Environment:
    imx-docker: imx-6.6.3-1.0.0
    Dockerfile: Dockerfile-Ubuntu-22.04
    Build docker image:    
        ./docker-build.sh Dockerfile-Ubuntu-22.04
   
    Edit env.sh:
        IMAGES="imx-image-multimedia"

If I run it after boot, it works without any problem.

imx8mpevk login: root
root@imx8mpevk:~# ./run.sh
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[ 98.480714] bypass csc
[ 98.483112] input fmt YUV4
[ 98.485901] output fmt YUYV
Redistribute latency...
0:00:01.1 / 99:99:99.

I would appreciate your assistance with this issue.

Best regards,
Patrick Kim

 

 

Tags (3)
0 Kudos
Reply
3 Replies

483 Views
Patrick-Kim
Contributor II

Does anyone have any idea about this problem?

0 Kudos
Reply

537 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

Something happens in your build that is not building gstreamer completely, please download the full-image  yocto package to avoid this error.

Regards

0 Kudos
Reply

523 Views
Patrick-Kim
Contributor II

When I complete the boot process and run GStreamer, it works fine without any issues. The problem arises only when trying to run it under systemd. Is it still likely a build issue?

I'm sorry, but there's one thing I forgot. I forgot to report the changes regarding the camera. I modified the dts as follows and also edited /etc/modules-load.d/modules.conf as shown below

imx8mp-mv.dts

#include "imx8mp-evk.dts"
 
&ov5640_0{
powerenable-gpios = <&gpio3 14 GPIO_ACTIVE_HIGH>;
status = "disabled";
};
 
&ov5640_1{
csi_id = <1>;
powerenable-gpios = <&gpio3 14 GPIO_ACTIVE_HIGH>;
powerdown-gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
status = "okay";
};
 
&mipi_csi_0 {
status = "disabled";
};
 
&mipi_csi_1 {
status = "okay";
};
 
&cameradev {
status = "okay";
};
 
&isi_0 {
status = "disabled";
};
 
&isi_1 {
status = "okay";
};
 

/etc/modules-load.d/modules.conf

vvcam-video

vvcam-isp

Could these changes cause problems?

 

 

 

 

0 Kudos
Reply