intel / icamerasrc

icamerasrc
24 stars 35 forks source link

Unable to run gst-launch on Arch (XPS 9340) #49

Open hazimimdnazri opened 1 month ago

hazimimdnazri commented 1 month ago

Hi I have a laptop Dell XPS 9340 and on arch linux. I managed to install everything, but when trying to run this command

sudo -E gst-launch-1.0 icamerasrc buffer-count=7 ! video/x-raw,format=NV12,width=1280,height=720 ! videoconvert ! ximagesink

it fails. It says can't link camerasrc0 to videoconvert0.

brmarkus commented 1 month ago

Are you familiar with creating a DOT graph of a gstreamer pipeline (during the different states of pipeline probing)?

You might have a look under e.g. "https://embeddedartistry.com/blog/2018/02/22/generating-gstreamer-pipeline-graphs/" and try to visualize the pipelines during the different stages.

This should allow to analyze the color formats between the source and the sink (and between each plugin).

You might also increase the verbose log level - there might be something obvious in the logs (in addition or alternative to the pipeline graphs), see e.g. "https://gstreamer.freedesktop.org/documentation/tutorials/basic/debugging-tools.html?gi-language=c", setting the env variable GST_DEBUG to a log level (e.g. export GST_DEBUG=2).

No idea which camera(s), which sensor(s) your mentioned laptop has...

hazimimdnazri commented 1 month ago

Tried enabling the debug for GST. This is the full error.

0:00:00.023484809 2184 0x5b27b9fd4a90 ERROR GST_PIPELINE subprojects/gstreamer/gst/parse/grammar.y:1127:gst_parse_perform_link: could not link camerasrc0 to videoconvert0, camerasrc0 can't handle caps video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720 WARNING: erroneous pipeline: could not link camerasrc0 to videoconvert0, camerasrc0 can't handle caps video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720

My laptop using ipu6 camera with ov02c10

brmarkus commented 1 month ago

Have you changed something in the config files? Are you sure your camera sensor provides NV12 format (and/or the given width and height)?

Do you see the camera working using any other tool, just for consistency check?

Can you check the system log messages (e.g. with a separate console window calling sudo dmesg -w keeps the system log messages printed to console) whether the kernel modules and HAL detect the device and initialize it properly? Watch out for "ipu" and "hal" like:

[ 13.067581] intel-ipu6 intel-ipu: enabling device (0000 -> 0002) [ 13.067695] intel-ipu6 intel-ipu: Device 0x465d (rev: 0x2) [ 13.067707] intel-ipu6 intel-ipu: physical base address 0x603e000000 [ 13.067708] intel-ipu6 intel-ipu: mapped as: 0x00000000ee78802f

or

[07-17 23:40:55.533] CamHAL[INF] aiqb file name ov01a10.aiqb [07-17 23:40:55.534] CamHAL[INF] aiqb file name ov01a10.aiqb [07-17 23:40:55.534] CamHAL[INF] aiqb file name ov01a10.aiqb

hazimimdnazri commented 1 month ago

No I didn't change anything. Just followed the steps mentioned in the intel/ipu6-drviers. Here are the logs from dmesg.

    4.427135] intel_ipu6: loading out-of-tree module taints kernel.
[    4.427148] intel_ipu6: module verification failed: signature and/or required key missing - tainting kernel
[    4.456110] intel-ipu6 0000:00:05.0: enabling device (0000 -> 0002)
[    4.456691] intel-ipu6 0000:00:05.0: Device 0x7d19 (rev: 0x4)
[    4.456713] intel-ipu6 0000:00:05.0: physical base address 0x5019000000
[    4.456715] intel-ipu6 0000:00:05.0: mapped as: 0x0000000067fa0d36
[    4.456796] intel-ipu6 0000:00:05.0: IPU in secure mode
[    4.456798] intel-ipu6 0000:00:05.0: IPU secure touch = 0x80000000
[    4.456800] intel-ipu6 0000:00:05.0: IPU camera mask = 0x0
[    4.464625] intel-ipu6 0000:00:05.0: IPC reset done
[    4.468799] intel-ipu6 0000:00:05.0: FW version: 20230925
[    4.470847] intel-ipu6 0000:00:05.0: Sending BOOT_LOAD to CSE
[    4.514939] intel-ipu6 0000:00:05.0: Sending AUTHENTICATE_RUN to CSE
[    4.567631] intel-ipu6 0000:00:05.0: CSE authenticate_run done
[    4.567680] intel-ipu6 0000:00:05.0: IPU6-v4 driver version 1.0
[    4.698989] intel-ipu6-psys intel-ipu6-psys0: pkg_dir entry count:8
[    4.699364] intel-ipu6-psys intel-ipu6-psys0: psys probe minor: 0
[    4.808202] intel-ipu6-isys intel-ipu6-isys0: no subdev found in graph
brmarkus commented 1 month ago

Can you capture the system log messages (from the startup/loading the IPU&HAL modules) as well as when trying to run the gstreamer command line, please?

hazimimdnazri commented 1 month ago

Is it in the dmesg? That's all regarding the ipu6. I can't find any regarding HAL.

brmarkus commented 1 month ago

The log-level, verbosity and where the log-messages should go to can be controlled via ENV environment variables.

Try something like this:

export logSink=SYSLOG
export cameraDebug=1

(there are different log-levels, 1 to 2^10?) (there are different log sinks, like it could be written into /run/camera/hal_logs.txt, but path and filename could be changed via ENV variable FILE_LOG_PATH)

(this is from searching the code for logging words and e.g. searching for getenv, I don't see this documented??)