From 086ab62d955217fb647d7123a27819714dc53714 Mon Sep 17 00:00:00 2001 From: Yusheng Hsu Date: Thu, 3 Nov 2022 16:25:22 -0700 Subject: [PATCH 1/2] Enable Multile D457 Support --- src/linux/backend-v4l2.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/linux/backend-v4l2.cpp b/src/linux/backend-v4l2.cpp index 6b8e7b113c..4a4633afb8 100644 --- a/src/linux/backend-v4l2.cpp +++ b/src/linux/backend-v4l2.cpp @@ -761,11 +761,12 @@ namespace librealsense // next several lines permit to use D457 even if a usb device has already "taken" the video0,1,2 (for example) // further development is needed to permit use of several mipi devices static int first_video_index = ind; - if (ind == first_video_index || ind == first_video_index + 2 || ind == first_video_index + 4) + ind = (ind - first_video_index) % 6; // yhsu - offset from first mipi video node and assume 6 nodes per mipi camera + if (ind == 0 || ind == 2 || ind == 4) mi = 0; - else if (ind == first_video_index + 1 | ind == first_video_index + 3) + else if (ind == 1 | ind == 3) mi = 3; - else if (ind == first_video_index + 5) + else if (ind == 5) mi = 4; else { @@ -785,6 +786,7 @@ namespace librealsense // TODO - find a way to assign unique id for mipi // maybe using bus_info and card params (see above in this method) //info.unique_id = busnum + "-" + devpath + "-" + devnum; + info.unique_id = bus_info + "-" + std::to_string(ind/6); // yhsu - use bus info and first video node of each mipi camera info.conn_spec = usb_specification; info.uvc_capabilities = get_dev_capabilities(dev_name); From 1a1492c73ab5f78ed8c7f3c94739c5250983c5ef Mon Sep 17 00:00:00 2001 From: hsuys <30935677+hsuys@users.noreply.github.com> Date: Fri, 4 Nov 2022 10:41:08 -0700 Subject: [PATCH 2/2] Remove node id. Use bus_info for D457 unique id --- src/linux/backend-v4l2.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/linux/backend-v4l2.cpp b/src/linux/backend-v4l2.cpp index 4a4633afb8..cd4ac9d777 100644 --- a/src/linux/backend-v4l2.cpp +++ b/src/linux/backend-v4l2.cpp @@ -761,7 +761,7 @@ namespace librealsense // next several lines permit to use D457 even if a usb device has already "taken" the video0,1,2 (for example) // further development is needed to permit use of several mipi devices static int first_video_index = ind; - ind = (ind - first_video_index) % 6; // yhsu - offset from first mipi video node and assume 6 nodes per mipi camera + ind = (ind - first_video_index) % 6; // offset from first mipi video node and assume 6 nodes per mipi camera if (ind == 0 || ind == 2 || ind == 4) mi = 0; else if (ind == 1 | ind == 3) @@ -785,8 +785,7 @@ namespace librealsense // are not available via mipi // TODO - find a way to assign unique id for mipi // maybe using bus_info and card params (see above in this method) - //info.unique_id = busnum + "-" + devpath + "-" + devnum; - info.unique_id = bus_info + "-" + std::to_string(ind/6); // yhsu - use bus info and first video node of each mipi camera + info.unique_id = bus_info; // use bus_info as per camera unique id for mipi info.conn_spec = usb_specification; info.uvc_capabilities = get_dev_capabilities(dev_name);