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

D405 crashes app which runs smoothly on SR300 and D435 #10967

Closed
nickelnext opened this issue Oct 5, 2022 · 11 comments
Closed

D405 crashes app which runs smoothly on SR300 and D435 #10967

nickelnext opened this issue Oct 5, 2022 · 11 comments

Comments

@nickelnext
Copy link


Required Info
Camera Model { D400 }
Firmware Version 128223070567
Operating System & Version Win 11
Platform PC
SDK Version 2.52 }
Language C#

Issue Description

Hi @MartyG-RealSense

Do you have any idea if there is some specific instruction/functions that we need to use for D405 for accessing RGB/Depth streams?

We have a reconstruction algorithm which runs smoothly with sr300 and d435, but when used with D405 the app crashes with no explanation (we are calling a C++ dll and in our C# code we have marhaling methods which run fine on those two cameras).

I believe it's either the configuration of the color/depth width/height, or maybe the rs2 methods to access the rgb camera, which do make crash our app.

In the sdk code it looks that in order to support d405 the developers have inserted some specific functions, but it's not clearly stated whether we should update also the way how we access the rs2 APIs or not

Thank you

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Oct 5, 2022

Hi @nickelnext As a starting point in discussing your issue, I note that you list your SDK version as 2.52. If you are using 2.52, that version is a pre-release that is designed for the RealSense SDK's new MIPI and GMSL support - see #10964

For your project you will likely require the dll from the 2.51.1 SDK version.

https://github.com/IntelRealSense/librealsense/releases/tag/v2.51.1

Which depth and color resolutions are you using in your app for D435 and SR300, please?

@nickelnext
Copy link
Author

Hi Marty

For Sr300 we're using 640 x 480 on depth and 1920x1080 for color
For D435 we're using 1280x800 on depth and 1920x1080 for color
For D405 we tried several resolutions but none is working.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Oct 6, 2022

The resolutions supported on the D405 model are listed below. The D405 does not have a separate RGB sensor and instead obtains RGB from the depth sensor, so 1920x1080 color is not supported.

image

1288x808 is only available for Y16 infrared. For both depth and color, the maximum supported resolution on D405 is 1280x720

image

@nickelnext
Copy link
Author

Hi. We used exactly those 2 for both depth and color.

Should we not use

rs2.enable_stream(RS2_STREAM_COLOR, this->mColorImage.width, this->mColorImage.height, RS2_FORMAT_BGRA8, 30);

or stuff like these because the colorImage is not present? or is it ok to enable the stream anyways like in any other camera?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Oct 6, 2022

The configuration looks okay, though I would recommend testing it by hard-coding the resolution values instead of substituting them in with width and height variables in order to confirm whether there is a problem with the structure of the this->mColorImage.width, this->mColorImage.height variables.

Also, have two separate definitions for depth and color streams if you do not already.

rs2.enable_stream(RS2_STREAM_DEPTH, 1280, 720, RS2_FORMAT_Z16, 30);
rs2.enable_stream(RS2_STREAM_COLOR, 1280, 720, RS2_FORMAT_BGRA8, 30);

Also, can you confirm please that you have defined 'rs2' as a custom configuration name (I would recommend using 'cfg' instead of 'rs2' to avoid confusion).

rs2 = new rs2::config();
rs2.enable_stream(RS2_STREAM_DEPTH, 1280, 720, RS2_FORMAT_Z16, 30);
rs2.enable_stream(RS2_STREAM_COLOR, 1280, 720, RS2_FORMAT_BGRA8, 30);
pipe.start(rs2);

The custom configuration name needs to be placed in the brackets of the pipeline start line or the script will ignore the custom stream configuration and apply the default stream profile of the particular camera model instead.

@nickelnext
Copy link
Author

Yep our code looks like
rs2::config cfg;
cfg.enable_stream(RS2_STREAM_COLOR, this->mColorImage.width, this->mColorImage.height, RS2_FORMAT_BGRA8, 30);
cfg.enable_stream(RS2_STREAM_DEPTH, this->mDepthImage.width, this->mDepthImage.height, RS2_FORMAT_Z16 , 30);

rs2::pipeline pipe;
rs2::pipeline_profile profile = pipe.start(cfg);

We also tried to hardcode them but it doesn't change the fact that we get an accessViolation exception, both with 2.51 and 2.52.

The same code runs with the Sr300 and d435

@MartyG-RealSense
Copy link
Collaborator

Is 1280x720 for depth and color accessible on the D405 for the RealSense Viewer or do you get an access violation with the Viewer too?

@nickelnext
Copy link
Author

From the viewer something strange happens:
I connect the d405, the first time i click "stereo module" i see myself in true colors.
If i turn it off and on again i see myself in blue/red (shades of depth)

Anyway i confirm that with 1280x720 it works perfectly with the intel viewer

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Oct 7, 2022

There was a case earlier in 2022 at #10336 where there were crashes that only occurred with the D405 model if the x86 version of the dll was used to compile a program. The issue did not occur when using the x64 dll.

Are you using the x86 dll in your project, please? That issue had a fix implemented for it in SDK 2.51.1, though there could be some aspect of your project (Windows 11, or using the dll with the C# wrapper) that could still be triggering the problem if you are using the x86 dll with SDK 2.51.1 and have crash problems.

@MartyG-RealSense
Copy link
Collaborator

Hi @nickelnext Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants