Skip to content

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

Merged
maloel merged 12 commits into
realsenseai:developmentfrom
Nir-Az:make_pipeline_faster
Mar 18, 2021
Merged

L515 - Keep USB power on when multiple HWM calls made#8593
maloel merged 12 commits into
realsenseai:developmentfrom
Nir-Az:make_pipeline_faster

Conversation

@Nir-Az

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

Copy link
Copy Markdown
Collaborator

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]

@Nir-Az
Nir-Az force-pushed the make_pipeline_faster branch from 288bbd0 to 92e977c Compare March 16, 2021 09:07
@Nir-Az
Nir-Az force-pushed the make_pipeline_faster branch from 92e977c to 571b0ee Compare March 16, 2021 09:08
Comment thread src/l500/l500-depth.cpp
Comment thread src/l500/l500-color.cpp Outdated
_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
Copy Markdown
Contributor

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
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

Comment thread src/l500/l500-serializable.cpp Outdated
to_string() << "Failed to get raw depth sensor from serializable device" );


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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Indentation off?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

Comment thread src/l500/l500-serializable.cpp Outdated
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
Copy Markdown
Contributor

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

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

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

Comment thread unit-tests/func/frames/test_first_frame_delay.py Outdated
Comment thread unit-tests/func/frames/test_first_frame_delay.py Outdated
Comment thread unit-tests/func/frames/test_first_frame_delay.py Outdated

@ev-mp ev-mp left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread src/l500/l500-options.cpp
dev = test.find_first_device_or_exit()

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

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Changed

Comment thread src/l500/l500-options.cpp
// 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
Copy Markdown
Contributor

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
Copy Markdown
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 realsenseai: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.

3 participants