How to start camera in SMART-EVB-G5 kit with IOT module SC206E-EM

Hi everyone

I wants to start front camera(J0402) in SMART-EVB-G5 kit with module SC206E-EM.
I added default linux image and trying to start camera using gst-launch command.

I use below command.
$ gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! autovideosink

When I apply this command I got below error.

root@qrbx210-rbx:~# gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! autovideosink

(gst-plugin-scanner:2528): GLib-GObject-CRITICAL **: 08:01:45.396: g_param_spec_internal: assertion '!(flags & G_PARAM_STATIC_NAME) || is_canonical (name)' failed

(gst-plugin-scanner:2528): GLib-GObject-CRITICAL **: 08:01:45.396: g_param_spec_internal: assertion '!(flags & G_PARAM_STATIC_NAME) || is_canonical (name)' failed
[   99.432947] msm_vidc:   high: 00000001: ....d: Opening video instance: 0000000000000000, 1
[   99.443703] msm_vidc:   high: 00000001: ....d: Closed video instance: 0000000000000000
[   99.451768] msm_vidc:   high: 00000001: ....e: Opening video instance: 0000000000000000, 0
[   99.461959] msm_vidc:   high: 00000001: ....e: Closed video instance: 0000000000000000
[   99.470007] CAM_ERR: CAM-CPAS: cam_cpas_subdev_ioctl: 749 Invalid command -2140645888 for CPAS!
[   99.479049] CAM_ERR: CAM-CORE: cam_subdev_ioctl: 78 Invalid command -2140645888 for cam-isp
[   99.487700] CAM_ERR: CAM-CSIPHY: cam_csiphy_subdev_ioctl: 134 Wrong ioctl : -2140645888
[   99.496114] CAM_ERR: CAM-CSIPHY: cam_csiphy_subdev_ioctl: 134 Wrong ioctl : -2140645888
[   99.504447] CAM_ERR: CAM-ACTUATOR: cam_actuator_subdev_ioctl: 68 Invalid ioctl cmd: 2154321408
[   99.513390] CAM_ERR: CAM-SENSOR: cam_sensor_subdev_ioctl: 101 Invalid ioctl cmd: -2140645888
[   99.522158] CAM_ERR: CAM-SENSOR: cam_sensor_subdev_ioctl: 101 Invalid ioctl cmd: -2140645888
[   99.530908] CAM_ERR: CAM-SENSOR: cam_sensor_subdev_ioctl: 101 Invalid ioctl cmd: -2140645888
[   99.539628] CAM_ERR: CAM-FLASH: cam_flash_subdev_ioctl: 309 Invalid ioctl cmd type
[   99.547495] CAM_ERR: CAM-CORE: cam_subdev_ioctl: 78 Invalid command -2140645888 for cam-ope
[   99.556250] CAM_INFO: CAM-SMMU: cam_smmu_need_force_alloc_cached: 383 force_cache_allocs=0
[   99.565087] CAM_WARN: CAM-CRM: cam_req_mgr_close: 195 release invoked associated userspace process has died, open_cnt: 1
[   99.576175] CAM_WARN: CAM-CPAS: __cam_cpas_subdev_close: 706 device already closed, open_cnt: 0
[   99.812185] msm_vidc:   high: 00000001: ....d: Opening video instance: 0000000000000000, 1
[   99.822533] msm_vidc:   high: 00000001: ....d: Closed video instance: 0000000000000000
[   99.830592] msm_vidc:   high: 00000001: ....e: Opening video instance: 0000000000000000, 0
[   99.840199] msm_vidc:   high: 00000001: ....e: Closed video instance: 0000000000000000
[   99.848220] CAM_ERR: CAM-CPAS: cam_cpas_subdev_ioctl: 749 Invalid command -2140645888 for CPAS!
[   99.857282] CAM_ERR: CAM-CORE: cam_subdev_ioctl: 78 Invalid command -2140645888 for cam-isp
[   99.865951] CAM_ERR: CAM-CSIPHY: cam_csiphy_subdev_ioctl: 134 Wrong ioctl : -2140645888
[   99.874246] CAM_ERR: CAM-CSIPHY: cam_csiphy_subdev_ioctl: 134 Wrong ioctl : -2140645888
[   99.882543] CAM_ERR: CAM-ACTUATOR: cam_actuator_subdev_ioctl: 68 Invalid ioctl cmd: 2154321408
[   99.891438] CAM_ERR: CAM-SENSOR: cam_sensor_subdev_ioctl: 101 Invalid ioctl cmd: -2140645888
[   99.900219] CAM_ERR: CAM-SENSOR: cam_sensor_subdev_ioctl: 101 Invalid ioctl cmd: -2140645888
[   99.908902] CAM_ERR: CAM-SENSOR: cam_sensor_subdev_ioctl: 101 Invalid ioctl cmd: -2140645888
[   99.917677] CAM_ERR: CAM-FLASH: cam_flash_subdev_ioctl: 309 Invalid ioctl cmd type
[   99.925545] CAM_ERR: CAM-CORE: cam_subdev_ioctl: 78 Invalid command -2140645888 for cam-ope
[   99.934277] CAM_INFO: CAM-SMMU: cam_smmu_need_force_alloc_cached: 383 force_cache_allocs=0
[   99.943001] CAM_WARN: CAM-CRM: cam_req_mgr_close: 195 release invoked associated userspace process has died, open_cnt: 1
[   99.953972] CAM_WARN: CAM-CPAS: __cam_cpas_subdev_close: 706 device already closed, open_cnt: 0
Setting pipeline to PAUSED ...
error: XDG_RUNTIME_DIR not set in the environment.
error: XDG_RUNTIME_DIR not set in the environment.
Caught SIGSEGV
exec gdb failed: No such file or directory
Spinning.  Please run 'gdb gst-launch-1.0 2527' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

For reference please find attached boot log.
boot log.txt (114.7 KB)

@keven.wu-Q Could you assist me with this problem?

—>Please execute export XDG_RUNTIME_DIR=/run/user/root to set the environment

Hi @keven.wu-Q

I apply export XDG_RUNTIME_DIR=/run/user/root but still got below error.

root@qrbx210-rbx:~# gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! autovideosink

(gst-plugin-scanner:2615): GLib-GObject-CRITICAL **: 08:03:42.132: g_param_spec_internal: assertion '!(flags & G_PARAM_STATIC_NAME) || is_canonical (name)' failed

(gst-plugin-scanner:2615): GLib-GObject-CRITICAL **: 08:03:42.132: g_param_spec_internal: assertion '!(flags & G_PARAM_STATIC_NAME) || is_canonical (name)' failed
[  216.510446] msm_vidc:   high: 00000001: ....d: Opening video instance: 0000000000000000, 1
[  216.521677] msm_vidc:   high: 00000001: ....d: Closed video instance: 0000000000000000
[  216.529771] msm_vidc:   high: 00000001: ....e: Opening video instance: 0000000000000000, 0
[  216.540577] msm_vidc:   high: 00000001: ....e: Closed video instance: 0000000000000000
[  216.548602] CAM_ERR: CAM-CPAS: cam_cpas_subdev_ioctl: 749 Invalid command -2140645888 for CPAS!
[  216.557742] CAM_ERR: CAM-CORE: cam_subdev_ioctl: 78 Invalid command -2140645888 for cam-isp
[  216.566442] CAM_ERR: CAM-CSIPHY: cam_csiphy_subdev_ioctl: 134 Wrong ioctl : -2140645888
[  216.574876] CAM_ERR: CAM-CSIPHY: cam_csiphy_subdev_ioctl: 134 Wrong ioctl : -2140645888
[  216.583268] CAM_ERR: CAM-ACTUATOR: cam_actuator_subdev_ioctl: 68 Invalid ioctl cmd: 2154321408
[  216.592387] CAM_ERR: CAM-SENSOR: cam_sensor_subdev_ioctl: 101 Invalid ioctl cmd: -2140645888
[  216.601267] CAM_ERR: CAM-SENSOR: cam_sensor_subdev_ioctl: 101 Invalid ioctl cmd: -2140645888
[  216.610153] CAM_ERR: CAM-SENSOR: cam_sensor_subdev_ioctl: 101 Invalid ioctl cmd: -2140645888
[  216.619078] CAM_ERR: CAM-FLASH: cam_flash_subdev_ioctl: 309 Invalid ioctl cmd type
[  216.627092] CAM_ERR: CAM-CORE: cam_subdev_ioctl: 78 Invalid command -2140645888 for cam-ope
[  216.635997] CAM_INFO: CAM-SMMU: cam_smmu_need_force_alloc_cached: 383 force_cache_allocs=0
[  216.644785] CAM_WARN: CAM-CRM: cam_req_mgr_close: 195 release invoked associated userspace process has died, open_cnt: 1
[  216.655787] CAM_WARN: CAM-CPAS: __cam_cpas_subdev_close: 706 device already closed, open_cnt: 0
[  216.910682] msm_vidc:   high: 00000001: ....d: Opening video instance: 0000000000000000, 1
[  216.921222] msm_vidc:   high: 00000001: ....d: Closed video instance: 0000000000000000
[  216.929297] msm_vidc:   high: 00000001: ....e: Opening video instance: 0000000000000000, 0
[  216.939017] msm_vidc:   high: 00000001: ....e: Closed video instance: 0000000000000000
[  216.947116] CAM_ERR: CAM-CPAS: cam_cpas_subdev_ioctl: 749 Invalid command -2140645888 for CPAS!
[  216.956405] CAM_ERR: CAM-CORE: cam_subdev_ioctl: 78 Invalid command -2140645888 for cam-isp
[  216.965204] CAM_ERR: CAM-CSIPHY: cam_csiphy_subdev_ioctl: 134 Wrong ioctl : -2140645888
[  216.973694] CAM_ERR: CAM-CSIPHY: cam_csiphy_subdev_ioctl: 134 Wrong ioctl : -2140645888
[  216.982087] CAM_ERR: CAM-ACTUATOR: cam_actuator_subdev_ioctl: 68 Invalid ioctl cmd: 2154321408
[  216.991144] CAM_ERR: CAM-SENSOR: cam_sensor_subdev_ioctl: 101 Invalid ioctl cmd: -2140645888
[  216.999923] CAM_ERR: CAM-SENSOR: cam_sensor_subdev_ioctl: 101 Invalid ioctl cmd: -2140645888
[  217.008783] CAM_ERR: CAM-SENSOR: cam_sensor_subdev_ioctl: 101 Invalid ioctl cmd: -2140645888
[  217.017595] CAM_ERR: CAM-FLASH: cam_flash_subdev_ioctl: 309 Invalid ioctl cmd type
[  217.025591] CAM_ERR: CAM-CORE: cam_subdev_ioctl: 78 Invalid command -2140645888 for cam-ope
[  217.034348] CAM_INFO: CAM-SMMU: cam_smmu_need_force_alloc_cached: 383 force_cache_allocs=0
[  217.043155] CAM_WARN: CAM-CRM: cam_req_mgr_close: 195 release invoked associated userspace process has died, open_cnt: 1
[  217.054183] CAM_WARN: CAM-CPAS: __cam_cpas_subdev_close: 706 device already closed, open_cnt: 0
Setting pipeline to PAUSED ...
GBM_INFO::msmgbm_mapper(160)::gbm mapper instantiated

gbm_create_device(225): Info: backend name is: msm_drm
gbm_create_device(225): Info: b[  217.192803] CAM_INFO: ackend name is: [  217.30msm_drm
[  217.491878] CAM_WARN: CAM-CPAS: __cam_cpas_subdev_close: 706 device already closed, open_cnt: 0
gbm_create_device(225): Info: backend name is: msm_drm
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Error getting capabilities for device '/dev/video0': It isn't a v4l2 driver. Check if it is a v4l1 driver.
Additional debug info:
../gst-plugins-good-1.16.3/sys/v4l2/v4l2_calls.c(91): gst_v4l2_get_capabilities (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: Inappropriate ioctl for device
Setting pipeline to NULL ...
Freeing pipeline ...
GBM_INFO::~msmgbm_mapper(167)::gbm mapper de-instantiated

gst-launch-1.0: /local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_dir/checkout/build-qti-distro-fullstack-noselinux-debug/tmp-glibc/work/qrbx210_rbx-oe-linux/adreno/1.0-r0/.
Aborted (core dumped)

I also probed the CAM_I2C_SDA and CAM_I2C_SCL but saw no activity on those pins.

---->Please use the following command:
export XDG_RUNTIME_DIR=/run/user/root
gst-launch-1.0 -e qtiqmmfsrc camera=0 name=qmmf ! video/x- raw,format=NV12,width=640,height=480,framerate=30/1 ! waylandsink x=40 y=400 width=640 height=480 async=true sync=false
The v4l2 interface in your command should not be implemented, so you cannot use this command

Hi Keven,

export XDG_RUNTIME_DIR=/run/user/root
gst-launch-1.0 -e qtiqmmfsrc camera=0 name=qmmf ! video/x- raw,format=NV12,width=640,height=480,framerate=30/1 ! waylandsink x=40 y=400 width=640 height=480 async=true sync=false

We tried the command you suggested but still getting the following error:

root@qrbx210-rbx:~# export XDG_RUNTIME_DIR=/run/user/root
root@qrbx210-rbx:~# gst-launch-1.0 -e qtiqmmfsrc camera=0 name=qmmf ! video/x- raw,format=NV12,width=640,height=480,framerate=30/1 ! waylandsink x=40 y=400 width=640 height=480 async=true sync=false
(gst-plugin-scanner:2519): GLib-GObject-CRITICAL **: 08:01:26.063: g_param_spec_internal: assertion ‘!(flags & G_PARAM_STATIC_NAME) || is_canonical (name)’ failed
(gst-plugin-scanner:2519): GLib-GObject-CRITICAL **: 08:01:26.063: g_param_spec_internal: assertion ‘!(flags & G_PARAM_STATIC_NAME) || is_canonical (name)’ failed
[ 71.112733] msm_vidc: high: 00000001: …d: Opening video instance: 0000000000000000, 1
[ 71.129730] subsys-pil-tz 5ab0000.qcom,venus: venus: loading from 0x0000000051400000 to 0x0000000051900000
[ 71.208936] subsys-pil-tz 5ab0000.qcom,venus: venus: Brought out of reset
[ 71.215841] subsys-pil-tz: subsys_powerup(): pil_boot is successful from venus and waiting for error ready
[ 71.262931] msm_vidc: high: 00000001: …d: Closed video instance: 0000000000000000
[ 71.271036] msm_vidc: high: 00000001: …e: Opening video instance: 0000000000000000, 0
[ 71.281893] msm_vidc: high: 00000001: …e: Closed video instance: 0000000000000000
[ 71.289986] CAM_ERR: CAM-CPAS: cam_cpas_subdev_ioctl: 749 Invalid command -2140645888 for CPAS!
[ 71.299232] CAM_ERR: CAM-CORE: cam_subdev_ioctl: 78 Invalid command -2140645888 for cam-isp
[ 71.308152] CAM_ERR: CAM-CSIPHY: cam_csiphy_subdev_ioctl: 134 Wrong ioctl : -2140645888
[ 71.316750] CAM_ERR: CAM-CSIPHY: cam_csiphy_subdev_ioctl: 134 Wrong ioctl : -2140645888
[ 71.325230] CAM_ERR: CAM-ACTUATOR: cam_actuator_subdev_ioctl: 68 Invalid ioctl cmd: 2154321408
[ 71.334416] CAM_ERR: CAM-SENSOR: cam_sensor_subdev_ioctl: 101 Invalid ioctl cmd: -2140645888
[ 71.343318] CAM_ERR: CAM-SENSOR: cam_sensor_subdev_ioctl: 101 Invalid ioctl cmd: -2140645888
[ 71.352456] CAM_ERR: CAM-SENSOR: cam_sensor_subdev_ioctl: 101 Invalid ioctl cmd: -2140645888
[ 71.361367] CAM_ERR: CAM-FLASH: cam_flash_subdev_ioctl: 309 Invalid ioctl cmd type
[ 71.369562] CAM_ERR: CAM-CORE: cam_subdev_ioctl: 78 Invalid command -2140645888 for cam-ope
[ 71.378409] CAM_INFO: CAM-SMMU: cam_smmu_need_force_alloc_cached: 383 force_cache_allocs=0
[ 71.387235] CAM_WARN: CAM-CRM: cam_req_mgr_close: 195 release invoked associated userspace process has died, open_cnt: 1
[ 71.398244] CAM_WARN: CAM-CPAS: __cam_cpas_subdev_close: 706 device already closed, open_cnt: 0
GBM_INFO::msmgbm_mapper(160)::gbm mapper instantiated
gbm_create_device(225): Info: backend name is: msm_drm
WARNING: erroneous pipeline: could not parse caps “video/x- raw,format=NV12,width=640,height=480,framerate=30/1”

Just to give you better idea, We have flashed ‘qti-robotics-med-image’ image from ‘qcm2290_linux_r60_r004-SC206E_rl’ SDK as mentioned in the guide ‘Quectel_SC206E_Series_Linux_Compiling&Burning_Guide_V1.2’.
Also as mentioned in the “Quectel_SC206E_Series_Linux_Camera_Driver_Development_Guide_V1.1.pdf”, we are not seeing any camera probe success message or not even getting any I2C activity on the CAM_I2C lines.

[ 13.481824] CAM_INFO: CAM-SENSOR: cam_sensor_driver_cmd: 753 Probe success,slot:1,sl
ave_addr:0x20,sensor_id:0x3109

So is there any modification required in Linux Build configuration or need to send additional command to probe the camera driver?

—> No, this command can be used normally. Please try the following command again:
/ # export XDG_RUNTIME_DIR=/run/user/root
/ # gst-launch-1.0 -e qtiqmmfsrc camera=0 name=qmmf ! video/x-raw,format=NV12,width=640,height=480,framerate=30/1 ! waylandsink x=0 y=0 width=640 height=480

Hi @keven.wu-Q

Thanks for your quick response.

$ export XDG_RUNTIME_DIR=/run/user/root
$ gst-launch-1.0 -e qtiqmmfsrc camera=0 name=qmmf ! video/x-raw,format=NV12,width=640,height=480,framerate=30/1 ! waylandsink x=0 y=0 width=640 height=480

Above command is working for me.