IntelRealSense / realsense_mipi_platform_driver

Intel® RealSense™ camera driver for GMSL* interface
GNU General Public License v2.0
15 stars 12 forks source link

Porting to Jetpack 5.0.2 #134

Closed jnzw closed 1 year ago

jnzw commented 2 years ago

Signed-off-by: Junze Wu junze.wu@intel.com

jnzw commented 1 year ago

Still work in progress. Currently d4xx driver probes, and streaming using v4l2-ctl works for all 4 sensors (depth, rgb, y8, imu). I also tested with streamApp/rs_viewer, and the captured videos look good to me. I temporarily disabled our modifications related to embedded metadata (if enabled, those changes would cause kernel panic) so there is no metadata /dev/video node for depth and rgb for now.

jnzw commented 1 year ago

The metadata-related kernel panic issue has been fixed.

junzewu@flexbj-jetson:~$ uname -a
Linux flexbj-jetson 5.10.104-tegra #34 SMP PREEMPT Fri Sep 9 17:40:31 CST 2022 aarch64 aarch64 aarch64 GNU/Linux
junzewu@flexbj-jetson:~$ ls /dev/video*
/dev/video0  /dev/video1  /dev/video2  /dev/video3  /dev/video4  /dev/video5
dmipx commented 1 year ago

@ev-mp can we extract d4xx.c from patches to source file?

dmipx commented 1 year ago

Note: flex and bison is extra necessary packages that should be installed on build machine Got an error: scripts/Kconfig.include:39: compiler '/home/dima/l4t-gcc/bin/aarch64-buildroot-linux-gnu-gcc' not found In file build_all_jetpack5.0.2.sh - This should change from: export CROSS_COMPILE=$HOME/l4t-gcc/bin/aarch64-buildroot-linux-gnu- To: export CROSS_COMPILE=aarch64-linux-gnu-

jnzw commented 1 year ago

Thanks to @xzhangxa :

jnzw commented 1 year ago

I've rebased and incorporated the changes introduced by patches numbered 0073 and 0074 (which are intentended for JetPack 4.6.1) into the new patch: 0001-Porting-driver-patches-to-jetpack-5.0.2.patch

Nir-Az commented 1 year ago

Hi guys, Short question: Is this for supporting USB or MIPI on JP 5? (Or both?) Thanks

jnzw commented 1 year ago

Hi @Nir-Az this is for MIPI/GMSL. USB hasn't been tested.

dmipx commented 1 year ago

@jnzw There is critical difference between JP4 and JP5 on VIDIOC_G_PARM misc control. JP5:

nvidia@ubuntu:~$ v4l2-ctl -d /dev/video2 -P
VIDIOC_G_PARM: failed: Invalid argument
nvidia@ubuntu:~$ uname -a
Linux ubuntu 5.10.104-tegra #1 SMP PREEMPT Thu Sep 29 10:44:24 IDT 2022 aarch64 aarch64 aarch64 GNU/Linux

JP4:

nvidia@ubuntu:~$ v4l2-ctl -d /dev/video2 -P
Streaming Parameters Video Capture:
Frames per second: 30.000 (30/1)
Read buffers : 0
nvidia@ubuntu:~$ uname -a
Linux ubuntu 4.9.253-tegra #119 SMP PREEMPT Wed Sep 14 17:36:42 IDT 2022 aarch64 aarch64 aarch64 GNU/Linux

Tracking by [DSO-18588] can you assist as we are short in time..

jnzw commented 1 year ago

For Jetpack 5.0.2, -EINVAL is returned by v4l2_subdev_call(sd, video, g_frame_interval, &interval); in __tegra_channel_get_parm in tegra/camera/vi/channel.c I'll debug further when I have time.

jnzw commented 1 year ago

Actually it looks like the macro v4l2_subdev_call adds some extra checks in the new kernel that are unnecessary. The error is gone if replacing call to ret = v4l2_subdev_call(sd, video, g_frame_interval, &interval); with simply ret = sd->ops->video->g_frame_interval(sd, &interval); @dmipx could you verify please?

Here's my log:

junzewu@flexbj-jetson:~$ v4l2-ctl -d 2 -P
Streaming Parameters Video Capture:
        Capabilities     : timeperframe
        Frames per second: 30.000 (30/1)
        Read buffers     : 0
junzewu@flexbj-jetson:~$ uname -a
Linux flexbj-jetson 5.10.104-d457 #71 SMP PREEMPT Tue Nov 8 14:33:18 CST 2022 aarch64 aarch64 aarch64 GNU/Linux
dmipx commented 1 year ago

For Jetpack 5.0.2, -EINVAL is returned by v4l2_subdev_call(sd, video, g_frame_interval, &interval); in __tegra_channel_get_parm in tegra/camera/vi/channel.c I'll debug further when I have time.

You are correct, it worked nvidia@ubuntu:~$ v4l2-ctl -d /dev/video2 -P Streaming Parameters Video Capture: Frames per second: 30.000 (30/1) Read buffers : 0

Nir-Az commented 1 year ago

@jnzw thanks for your effort! we will add this change to the merged branch.

Nir-Az commented 1 year ago

Now that we have the JP5 porting in a dedicated branch (https://github.com/IntelRealSense/perc_hw_ds5u_android-jetson_tx2/tree/Jetpack-5.0.2) Can you please verify you took all of master branch features inside? new video formats, XU commands... I think those branch's were developed in parallel.

xzhangxa commented 1 year ago

Now that we have the JP5 porting in a dedicated branch (https://github.com/IntelRealSense/perc_hw_ds5u_android-jetson_tx2/tree/Jetpack-5.0.2) Can you please verify you took all of master branch features inside? new video formats, XU commands... I think those branch's were developed in parallel.

8 commits behind master (https://github.com/IntelRealSense/perc_hw_ds5u_android-jetson_tx2/tree/Jetpack-5.0.2), it seems some were not included when Jetpack-5.0.2 branching out and some were created after this PR. A new PR to include these 8 commits should be created.