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

W10 support #3715

Merged
merged 4 commits into from
Apr 15, 2019
Merged

W10 support #3715

merged 4 commits into from
Apr 15, 2019

Conversation

matkatz
Copy link
Contributor

@matkatz matkatz commented Apr 9, 2019

The new W10 stream profile allows to stream IR and Depth streams with different resolutions and same frame rate.
Using wild cards is currently limited when streaming combinations of IR and Depth.
If both IR and Depth are required, both profiles should be configured without wildcards.

For example the following configuration will fail:

    cfg.enable_stream(RS2_STREAM_DEPTH);
    cfg.enable_stream(RS2_STREAM_INFRARED, 1, 1920, 1080, RS2_FORMAT_Y10BPACK, 30);

While this configuration is valid:

    cfg.enable_stream(RS2_STREAM_DEPTH, 0, 640, 480, RS2_FORMAT_Z16, 30);
    cfg.enable_stream(RS2_STREAM_INFRARED, 1, 1920, 1080, RS2_FORMAT_Y10BPACK, 30);

The Color sensor as no limitations and the following configuration is also valid:

    cfg.enable_stream(RS2_STREAM_COLOR);
    cfg.enable_stream(RS2_STREAM_DEPTH, 0, 640, 480, RS2_FORMAT_Z16, 30);
    cfg.enable_stream(RS2_STREAM_INFRARED, 1, 1920, 1080, RS2_FORMAT_Y10BPACK, 30);

If only IR is configured (on the Depth sensor) any wildcard is valid:

    cfg.enable_stream(RS2_STREAM_COLOR);
    cfg.enable_stream(RS2_STREAM_INFRARED, RS2_FORMAT_Y10BPACK);

@matkatz matkatz requested a review from ev-mp April 9, 2019 06:49
Copy link
Collaborator

@ev-mp ev-mp left a comment

Choose a reason for hiding this comment

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

Need to be tested with DQT.
We also need dedicated unit-test to verify the match/contradict change is not affected:

  • W10 + Depth with different resolutions is picked up properly. Also with wildcards.
    Negative tests:
  • Depth/IR with different resolutions
  • IR1/IR2 with different formats

Metadata/UVC format patch - can be handled in a separate PR.

@@ -1280,6 +1280,9 @@ namespace rs2
}
break;
}
case RS2_FORMAT_Y10BPACK:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Check indentation

@@ -74,6 +74,7 @@ typedef enum rs2_format
RS2_FORMAT_GPIO_RAW , /**< Raw data from the external sensors hooked to one of the GPIO's */
RS2_FORMAT_6DOF , /**< Pose data packed as floats array, containing translation vector, rotation quaternion and prediction velocities and accelerations vectors */
RS2_FORMAT_DISPARITY32 , /**< 32-bit float-point disparity values. Depth->Disparity conversion : Disparity = Baseline*FocalLength/Depth */
RS2_FORMAT_Y10BPACK , /**< 16-bit per-pixel grayscale image unpacked from 10 bits per pixel packed grey-scale image. The data is unpacked to LSB and padded with 6 zero bits */
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 the packed format description [8:8:8:8:2222] or [10:10:10:10] to RW10 and Y10BPACK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we should define how raw10 is packed

@@ -263,6 +263,8 @@ namespace librealsense
virtual void tag_profiles(stream_profiles profiles) const = 0;

virtual bool compress_while_record() const = 0;

virtual bool contradicts(stream_profile_interface* a, const std::vector<stream_profile>& others) = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

make stream_profile_interface* a const
an the function itself const

src/device.cpp Outdated
return true;
}

for (auto request : others)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Both cases can be evaluated in a single for (auto request : others)


for (auto request : others)
{
// Patch for DS5U_S that allows different resolutions on multi-pin device
Copy link
Collaborator

Choose a reason for hiding this comment

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

PLs drop the comment

auto usb_spec = get_usb_spec();
if (usb_spec >= platform::usb3_type || usb_spec == platform::usb_undefined)
{
tags.push_back({ RS2_STREAM_DEPTH, -1, 720, 720, RS2_FORMAT_Z16, 30, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't it be RS2_FORMAT_Y10BPACK instead of RS2_FORMAT_RAW10 ?

{
if (auto vid_a = dynamic_cast<video_stream_profile_interface*>(a))
{
for (auto request : others)
Copy link
Collaborator

Choose a reason for hiding this comment

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

PLs check if those two can be merged as in comment above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its probably not required anymore, the only limitation now is matching FPS, will remove

@@ -37,6 +37,7 @@ namespace librealsense
// RS400 rolling-shutter Skus allow to get low-quality color image from the same viewport as the depth
get_depth_sensor().register_pixel_format(pf_uyvyl);
get_depth_sensor().register_pixel_format(pf_rgb888);
get_depth_sensor().register_pixel_format(pf_w10);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pls check whether this should be propagated to D415/D410

@@ -16,7 +16,7 @@ namespace librealsense
{
std::lock_guard<std::mutex> lock(_mtx);
_resolved_profile.reset();
_stream_requests[{stream, index}] = { stream, index, width, height, format, fps };
_stream_requests[{stream, index}] = { stream, index, width, height, fps, format };
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it a bug fix ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed struct request_type and replaced it with stream_profile. the fps and format are in different locations.

@@ -84,11 +75,11 @@ namespace librealsense
return true;
}

static bool match(stream_profile_interface* a, const request_type& b)
static bool match(stream_profile_interface* a, const stream_profile& b)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pls make the func and params const

@matkatz matkatz requested a review from ev-mp April 14, 2019 15:01
Copy link
Collaborator

@ev-mp ev-mp left a comment

Choose a reason for hiding this comment

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

Please validate W10 with D416

@ev-mp ev-mp merged commit 3e91600 into IntelRealSense:development Apr 15, 2019
@matkatz matkatz deleted the raw10-support branch April 16, 2019 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants