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

Power on UVC sensors after creation to speed initialization #12897

Merged
merged 1 commit into from
May 9, 2024

Conversation

OhadMeir
Copy link
Contributor

@OhadMeir OhadMeir commented May 5, 2024

At initialization phase there are many HWM and other commands that need the sensor to be in powered on (D0) state.
Keeping it on for a short time instead of turning it on and off (D3) can speed up the initialization.

Testing with a D500 device it reduced pipeline time to first frame by an average of 90 milliseconds.

{
std::this_thread::sleep_for( timeout );
if( auto strong = weak.lock() )
strong->release_power();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please make sure release_power(); cannot throw.
Even if today it can't might be better to wrap with try/catch as an exception here will crash the application

Copy link
Contributor Author

Choose a reason for hiding this comment

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

release_power catches set_power_state exceptions.
Theoretically there might be an exception from locking a mutex, but I don't think we need to guard against it. If locking a mutex fails here will probably be the least of our problems.

@Nir-Az Nir-Az merged commit cac91e2 into IntelRealSense:development May 9, 2024
17 checks passed
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