Skip to content

Enumerate video nodes by name - #11319

Merged
Nir-Az merged 2 commits into
realsenseai:adl-pfrom
dmipx:adl-p
Jan 19, 2023
Merged

Nir-Az merged 2 commits into
realsenseai:adl-pfrom
dmipx:adl-p

Conversation

@dmipx

@dmipx dmipx commented Jan 12, 2023

Copy link
Copy Markdown

[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

@dmipx
dmipx requested review from Nir-Az, ev-mp and remibettan January 12, 2023 15:29
[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>
Comment thread src/linux/backend-v4l2.cpp Resolved
Comment thread src/linux/backend-v4l2.cpp Outdated
continue;
if (vfd)
::close(vfd);
info = info = get_info_from_mipi_device_path(video_md_path, device_md_path);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

typo? info=info=

Comment thread src/linux/backend-v4l2.cpp Resolved
Comment thread src/linux/backend-v4l2.cpp Outdated
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
Copy Markdown
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

Comment thread src/linux/backend-v4l2.cpp Outdated
info = get_info_from_mipi_device_path(video_path, name);
}

else

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

Comment thread src/linux/backend-v4l2.cpp Outdated
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
Copy Markdown
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

Comment thread src/linux/backend-v4l2.cpp Outdated
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
Copy Markdown
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" ?

Comment thread scripts/rs-enum.sh Outdated

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
Copy Markdown
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?

Comment thread scripts/rs-enum.sh Resolved
@dmipx

dmipx commented Jan 16, 2023

Copy link
Copy Markdown
Author

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

@Nir-Az

Nir-Az commented Jan 16, 2023

Copy link
Copy Markdown
Collaborator

@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
Copy Markdown
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
Copy Markdown
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>

@Nir-Az Nir-Az left a comment

Copy link
Copy Markdown
Collaborator

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 realsenseai:adl-p Jan 19, 2023
dmipx pushed 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: realsenseai#11319

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