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

L515 - Keep USB power on when multiple HWM calls made #8593

Merged
merged 12 commits into from Mar 18, 2021

Conversation

Nir-Az
Copy link
Collaborator

@Nir-Az Nir-Az commented Mar 16, 2021

Reduce L515 device creation and sensor open/start calls time by keeping the USB power on when multiple access are made

Tracked on [RS5-8208]

_owner->_hw_monitor->send(cmdTprocThresholdEp5);

// Keep the USB power on while triggering multiple calls on it.
_owner->get_raw_depth_sensor().invoke_powered([&](platform::uvc_device& dev) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't like manual access to _owner->get_raw_depth_sensor() -- it might change, and we might want to do other stuff in the future.

I think we should add a utility function that inside will know how to raise power... group_hw_monitor_calls or something along those lines.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

to_string() << "Failed to get raw depth sensor from serializable device" );


return l500_uvc_sensor->invoke_powered([&](platform::uvc_device& dev) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Indentation off?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

auto l500_uvc_sensor = std::dynamic_pointer_cast<uvc_sensor>(_depth_sensor.get_raw_sensor());
if (!l500_uvc_sensor)
throw invalid_value_exception(
to_string() << "Failed to get raw depth sensor from serializable device" );
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the exception isn't needed -- just don't call invoke_powered?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Up to you

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That also mean that we don't do the action, invoke power get the inner code and run it

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can call the lambda manually.
But up to you.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This code was removed

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.

For internal review. please do not merge yet

dev = test.find_first_device_or_exit()

product_line = "Unknown"
if dev.supports(rs.camera_info.product_line):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can pretty much require that the device supports a product line, no? I think you can just skip this test...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed

// therefore can be overridden automatically according to gain
if( preset == RS2_L500_VISUAL_PRESET_AUTOMATIC )
{
auto curr_preset = ( rs2_l500_visual_preset )(int)_preset->query();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't actually go to the FW... the grouping can happen only inside reset_hw_controls?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wrapped the whole function because there are several call to the FW, right after _preset->query();

change_gain
change_alt_ir
set_preset_controls_to_defaults
change_laser_power

@maloel maloel merged commit 4fd2ac9 into IntelRealSense:development Mar 18, 2021
@Nir-Az Nir-Az deleted the make_pipeline_faster branch April 8, 2021 16:27
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.

None yet

3 participants