Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting to Jetpack 5.0.2 #134

Merged
merged 1 commit into from
Nov 8, 2022
Merged

Conversation

jnzw
Copy link
Contributor

@jnzw jnzw commented Sep 8, 2022

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

@jnzw
Copy link
Contributor Author

jnzw commented Sep 8, 2022

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
Copy link
Contributor Author

jnzw commented Sep 9, 2022

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
Copy link
Contributor

dmipx commented Sep 11, 2022

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

@dmipx dmipx changed the base branch from master to Jetpack-5.0.2 September 14, 2022 13:11
@jnzw jnzw marked this pull request as ready for review September 15, 2022 05:40
apply_patches_ext_jetpack5.0.2.sh Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@dmipx
Copy link
Contributor

dmipx commented Sep 29, 2022

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 jnzw force-pushed the porting branch 2 times, most recently from aa55a3a to f8c4c03 Compare October 20, 2022 02:34
@jnzw
Copy link
Contributor Author

jnzw commented Oct 20, 2022

Thanks to @xzhangxa :

  • the shell scripts (apply_patches.sh and build_all.sh) has been cleaned up to support both versions of JetPack via an extra parameter
  • A new script for setting up workspace has been added (setup_workspace.sh)
  • The README has been updated to reflect these changes

@jnzw jnzw force-pushed the porting branch 2 times, most recently from 94c44d8 to 877a340 Compare October 21, 2022 02:03
@jnzw
Copy link
Contributor Author

jnzw commented Oct 21, 2022

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
Copy link
Collaborator

Nir-Az commented Nov 6, 2022

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

@jnzw
Copy link
Contributor Author

jnzw commented Nov 7, 2022

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

@dmipx
Copy link
Contributor

dmipx commented Nov 7, 2022

@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
Copy link
Contributor Author

jnzw commented Nov 8, 2022

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
Copy link
Contributor Author

jnzw commented Nov 8, 2022

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
Copy link
Contributor

dmipx commented Nov 8, 2022

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 Nir-Az merged commit 668bf4b into IntelRealSense:Jetpack-5.0.2 Nov 8, 2022
@Nir-Az
Copy link
Collaborator

Nir-Az commented Nov 8, 2022

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

@Nir-Az
Copy link
Collaborator

Nir-Az commented Jan 1, 2023

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
Copy link
Collaborator

xzhangxa commented Jan 2, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants