CSI test pattern generator (tpg) crash

I want to use TPG, i.e., follow these steps:

  1. install TPG
    sudo insmod /lib/modules/5.10.104-tegra/kernel/drivers/media/platform/tegra/tpg/nvhost-vi-tpg.ko

  2. check /dev/videox
    ls /dev/video*
    Result: create /dev/video0 ~ /dev/video35

  3. capture data by v4l2-ctl
    v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=“RG10” --device=/dev/video1 --stream-count=10 --stream-mmap --stream-to=tpg .raw
    Result: Kernel crashes, hangs for ~30 seconds, then reboots the system and the raw file does not exist.

I don’t know how this error happened?
Can you tell me the solution?
Thanks!

hello shawn_huang,

could you please share the details kernel failures for reference,
BTW, may I know which JetPack release you’re working with, what’s the actual use-case for testing with TPG?

1 Like

Hi JerryChang:

JetPack release :
cat /etc/nv_tegra_release

R35 (release), REVISION: 1.0, GCID: 31346300, BOARD: t186ref, EABI: aarch64, DATE: Thu Aug 25 18:41:45 UTC 2022

v4l2-ctl message:
Because system crash not print any message, there use --verbose print some message.

v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --device=/dev/video1 --stream-count=10 --stream-mmap --stream-to=tpg.raw --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
Width/Height : 1920/1080
Pixel Format : ‘RG10’ (10-bit Bayer RGRG/GBGB)
Field : None
Bytes per Line : 3840
Size Image : 4147200
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)

what’s the actual use-case for testing with TPG?
Testing the TPG when the all camera driver removed, only install the TPG driver.

there’re different TPG kernel modules,
please load nvhost-vi-tpg-t19x.ko since you’re running with AGX Orin,
for example,
/usr/lib/modules/5.10.104-tegra/kernel/drivers/media/platform/tegra/tpg/nvhost-vi-tpg.ko
/usr/lib/modules/5.10.104-tegra/kernel/drivers/media/platform/tegra/tpg/nvhost-vi-tpg-t19x.ko

and… it’s by default to create 36 channels.
please revise num-tpg-channels = <1> in sensor device tree, tegra234-p3737-camera-modules.dtsi to reduce the channels in case accessing to the correct node.

please have another testing, thanks

Hi JerryChang:

I want to load nvhost-vi-tpg-t19x.ko, but can’t insert module
sudo insmod /lib/modules/5.10.104-tegra/kernel/drivers/media/platform/tegra/tpg/nvhost-vi-tpg-t19x.ko
insmod: ERROR: could not insert module /lib/modules/5.10.104-tegra/kernel/drivers/media/platform/tegra/tpg/nvhost-vi-tpg-t19x.ko: No such device

may I know what’s $ sudo find / -name nvhost-vi-tpg*.ko looks like?

sudo find / -name nvhost-vi-tpg*.ko
/usr/lib/modules/5.10.104-tegra/kernel/drivers/media/platform/tegra/tpg/nvhost-vi-tpg-t19x.ko
/usr/lib/modules/5.10.104-tegra/kernel/drivers/media/platform/tegra/tpg/nvhost-vi-tpg.ko

cd /lib
sudo find ./ -name nvhost-vi-tpg*.ko
./modules/5.10.104-tegra/kernel/drivers/media/platform/tegra/tpg/nvhost-vi-tpg-t19x.ko
./modules/5.10.104-tegra/kernel/drivers/media/platform/tegra/tpg/nvhost-vi-tpg.ko

hello shawn_huang,

it’s weird you cannot insert the module, had you reboot the system for retry?
let me also arrange device to test this locally.

Hi JerryChang:

reboot the system & retry insmod same cannot insert

hello shawn_huang,

please moving to the latest Jetpack release version,
we’ve verified TPG works normally on AGX-Orin + r35.3.1.
$ sudo insmod /lib/modules/5.10.104-tegra/kernel/drivers/media/platform/tegra/tpg/nvhost-vi-tpg-t19x.ko
$ v4l2-ctl -d /dev/video28 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=10

Hi JerryChang:

I rebuild image for Jetpack R35.3.1,
then agx orin boot failed.

Using same flow in Jetpack R35.1 can success, but not in Jetpack R35.3.1.
Can you tell me the solution?
Thanks!

may I know how you rebuild the image? it looks the failure during installation.

Hi JerryChang:

Rebuild image flow
rebuild flow.txt (3.2 KB)

hello shawn_huang,

do you see any error reported with below step?
5. cd /mnt/work_disk/nvidia/nvidia_sdk/JetPack_5.1.1_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra/
sudo ./apply_binaries.sh

BTW,
we’ve tested with JetPack 5.1.1 directly to verify TPG.

Hi JerryChang:

The step of apply_binaries not any error reported, and log file to you.
apply_binaries log.txt (11.8 KB)

Hi JerryChang:

I success boot and verify TPG works on AGX-Orin + r35.3.

Thank your solution.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.