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

Enumerate video nodes by name #11319

Merged
merged 2 commits into from
Jan 19, 2023
Merged

Enumerate video nodes by name #11319

merged 2 commits into from
Jan 19, 2023

Conversation

dmipx
Copy link
Contributor

@dmipx dmipx commented Jan 12, 2023

[ADL-P] LRS V4L2 Backend Enumerate video nodes by name [LRS-573]

rs-enum.sh:

  • Create symbolic links for video nodes and for metadata nodes - /dev/video-rs-[|-md]-[camera-index]

backend-v4l2.cpp:

  • scan for rs-enum links

Signed-off-by: Dmitry Perchanov dmitry.perchanov@intel.com

[ADL-P] LRS V4L2 Backend Enumerate video nodes by name [LRS-573]

rs-enum.sh:
 - Create symbolic links for video nodes and for metadata nodes - /dev/video-rs-[<sensor>|<sensor>-md]-[camera-index]
 - Enable ipu6 link enumeration

backend-v4l2.cpp:
 - scan for rs-enum links

Signed-off-by: Dmitry Perchanov <dmitry.perchanov@intel.com>
continue;
if (vfd)
::close(vfd);
info = info = get_info_from_mipi_device_path(video_md_path, device_md_path);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo? info=info=

@@ -838,11 +879,14 @@ namespace librealsense
{
info = get_info_from_usb_device_path(video_path, name);
}
else //video4linux devices that are not USB devices
else if(mipi_nodes.empty()) //video4linux devices that are not USB devices
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and not previously enumerated by rs links

{
info = get_info_from_mipi_device_path(video_path, name);
}

else
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment: continue as we already have mipi nodes in uvc_nodes

@@ -838,11 +879,14 @@ namespace librealsense
{
info = get_info_from_usb_device_path(video_path, name);
}
else //video4linux devices that are not USB devices
else if(mipi_nodes.empty()) //video4linux devices that are not USB devices
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change mipi_nodes to mipi_rs_enum_nodes

typedef std::pair<uvc_device_info,std::string> node_info;
std::vector<node_info> uvc_nodes,uvc_devices;
std::vector<node_info> mipi_nodes;
/* With usage of rs-enum script */
std::vector<std::string> video_sensors = {"depth", "rgb", "ir", "imu"};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change "Rgb" to "color" ?


declare -A d4xx_vc=([1]=1 [2]=3 [4]=5)
declare -A d4xx_vc_named=([depth]=1 [rgb]=3 ["motion detection"]=5 [imu]=7)
declare -A camera_names=( [depth]=depth [rgb]=rgb ["motion detection"]=ir [imu]=imu )
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change rgb to color?

@dmipx
Copy link
Contributor Author

dmipx commented Jan 16, 2023

@remibettan and @Nir-Az , please review after changes

@Nir-Az
Copy link
Collaborator

Nir-Az commented Jan 16, 2023

@dmipx please notice the CI error
image

It means that Jetson MIPI crash when questing for devices, please investigate..


// Get metadata node
// Check if file on video_md_path is exists
vfd = open(video_md_path.c_str(), O_RDONLY | O_NONBLOCK);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add this line before:

vfd = -1;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? no reason to.

rs-enum: add comments, change rgb to color.
backend-v4l2: change rgb to color, comments, try/catch for throwing module.

Signed-off-by: Dmitry Perchanov <dmitry.perchanov@intel.com>
Copy link
Collaborator

@Nir-Az Nir-Az left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Nir-Az Nir-Az merged commit 996d7b6 into IntelRealSense:adl-p Jan 19, 2023
dmipx added a commit to dmipx/librealsense that referenced this pull request Feb 5, 2023
LRS V4L2 Backend Enumerate video nodes by name [LRS-573]
rs-enum.sh:
 - Create symbolic links for video nodes and for metadata nodes - /dev/video-rs-[|-md]-[camera-index]
backend-v4l2.cpp:
 - scan for rs-enum links

Follow-by: IntelRealSense#11319

Signed-off-by: Dmitry Perchanov <dmitry.perchanov@intel.com>
dmipx added a commit to dmipx/librealsense that referenced this pull request Feb 5, 2023
LRS V4L2 Backend Enumerate video nodes by name [LRS-573]
rs-enum.sh:
 - Create symbolic links for video nodes and for metadata nodes - /dev/video-rs-[|-md]-[camera-index]
backend-v4l2.cpp:
 - scan for rs-enum links

Follow-by: IntelRealSense#11319

Signed-off-by: Dmitry Perchanov <dmitry.perchanov@intel.com>
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.

2 participants