Custom resolution on CSI Jetson platforms

I’m working on Jetson platforms (Nano, Xavier NX) to get a dynamic customizable resolution CSI capture. My goal is to acquire from a CMOS sensor with a custom resolution, different from standard. This resolution could be configurable runtime so I can’t provide all possible combinations to DTB file (example, 128x1920, 640x640, 256x256…). I want a script that I could start/stop (without rebooting all) and acquire at a desidered resolution without cropping but enabling all the fps that sensor could send

  1. Capturing with V4L2: I just modified the kernel module to pass the resolution with “module_param”. These resolution parameters (height and width) are used to populate the first entry in the “frmfmt_table”. The chain of settings (as I could see from the files) are _probe → tegracam_device_register. Inside tegracam_device_register the datas are used and taken in account. In this way, when I run the command “media-ctl -p -d /dev/media0” and I’m able to read the resolution on the pad. As for my tests, the capture is going well (I tried a lot of resolutions). What I need to do is removing and reinserting the module with the desired resolution passed. The “tegracam_device_register” seems to not use the boot settings inside DTS, even if it reads the “mode0” settings (camera_common_initialize ->camera_common_parse_general_properties ->sensor_common_parse_signal_props).

  2. Capturing with libargus: this is not working. It seems that libargus works with the configuration of DTB latched at boot time and not with the one changed with the sensor module (as before). How could I manage this? What is the driver to change for re-reading “mode0” from settings? In “libgstnvarguscamerasrc” I see that there is a function called “camProps->getAllSensorModes(&modes);”. Where this function reads the modes?

Thanks for any suggestions

Argus absolutely didn’t working due the the size less than 640x480 and yes those resolution need define in the dts for Argsu too.

thanks for replies. For resolution, thanks for explain, I take 640x480 in account as minimum. Regarding the resolutions modes, could you share any information about “when” the library reads the modes and what is the package involved? Also, what happen if I change gst library “libgstnvarguscamerasrc” and set my resolution instead of “getAllSensorModes”. Did the remain chain works or there are other checks inside the library? At the end, who really reads the modes from DTS?


Suppose that couldn’t work even modify the libgstnvarguscamerasrc, still have none public low level code to parser sensor mode in device tree directly.

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