Coming back to share the solution.
I didn’t have any experience with working with camera sensors before now so I figured it would be good to share with others who might have similar issues & is similarly confused.
Updating dts/dto files
I was developing on a Jetson Orin Nano devkit with Jetpack 5.1. The IMX538 camera sensor was outputting approx 60fps at a little over 1,920 x 1,080 resolution.
To answer to the original question of how to modify device trees; I needed to install
dtc, find the related
*.dtbo in my case) files.
To find the
*.dtbo files, I ran a
find command to search for files with this extension from
find . -iname "*.dtbo" -print 2>/dev/null
Then I used dtc to get the dts file from the dto file and see what values were set.
dtc -I dtb -O dts <filepath>.dtbo
From there I could use dtc to update the values in the dtbo file, with the dts as reference. I had 4 connectors, J5 through J8, so I updated each gmsl + mipi dtbo with the values I calculated after referencing the thread linked in the original post.
The Ubuntu man page for dtc has more information on working with device trees.
Next, for the issue itself.
Resolving nvarguscamerasrc dmabuf_fd -1 mapped entry NOT found
I was seeing the same issue as @chakibdace, with the exact same exceptions, stack-traces, etc.
For me, I only saw the issue with
nvarguscamerasrc when I set the camera sensor up with mipi over gmsl.
- If I used v4l with mipi over gmsl, it worked fine.
- If I used nvarguscamerasrc with mipi only, it worked fine.
- I also had a pre-compiled program called
argus_camera which worked over mipi over gmsl, so it didn’t seem like it was an issue with libargus specifically.
The only difference is restarting
nvargus-daemon did not fix the problem for me temporarily.
I tried to compute and then adjust the deskew calibration, adjusting both
serdes_pix_clk_hz. Maybe I didn’t calculate it properly or reduce it enough but it did not solve the problem for me.
I tried compiling the jetpack-multimedia-samples found on the device. It took me a long time to find these as I didn’t realize the sources were on the OS. I tried pulling them from a few different github repos and such, and could never compile them that way.
I tried running nvarguscamerasrc with an infinite timeout, same issue.
I had to use the jetpack samples on the device already. As of Jetpack 5.1, they are found in
Note, the links below are to an unrelated repo which have older versions of these sources. Merely linking here as I do not know how to link to the official sources directly like this.
For me, I needed to look at 09_camera_jpeg_capture, 10_camera_recording and 13_multi_camera.
I compiled 09 and 10 and neither worked, with the error somewhat swallowed by the program. Then I compiled and tried 13, and it worked! Reading over the source for 13, I noticed there was no timeout. I increased the timeouts in the 09 sample by a factor of 10 and it started working as well.
Then I downloaded the source for
nvarguscamerasrc from https://developer.nvidia.com/embedded/jetson-linux-r3531, downloading the “Driver Package (BSP) Sources”. Once I had extracted the folder, I put the
nvarguscamerasrc folder beside the other samples found in
/usr/src/jetson_multimedia_api, updated the
/usr/src/jetson_multimedia_api to include
nvarguscamerasrc as a target, and ran
nvarguscamerasrc overtop the shipped one. So I was good to try and patch this at this point.
I edited the two timeouts in the source for this to be10x what were set in the source by default and it started working without issue.
static const uint64_t WAIT_FOR_EVENT_TIMEOUT = 30000000000; // previously 3000000000
static const uint64_t ACQUIRE_FRAME_TIMEOUT = 50000000000; // previously 5000000000
I still have to test to see how much I need to increase the timeouts in
nvarguscamerasrc in order to avoid the problem. I might only need to adjust one of them as well.
Anyways this is what worked for me. I don’t know if there was an easier way or if I missed something, but this is how I got mipi + gmsl working with nvarguscamerasrc for our camera sensor.