'invalid frame' error; is it camera(s) or code?

I am using an Astra S camera (with supplied USB-A cable) and an Astra Stereo S camera (with user-supplied USB-C cable to an SS port). They show up under Device Manager. The cameras are not connected to the computer at the same time, so the software sees only one at a time.

Because I did not see any further instructions with the cameras, I assume that there is not a separate power switch, and that attaching the camera to the USB cable then to the computer makes it fully powered and operational.

I am using Visual Studio 2019 downloaded as the Community version. I am attempting to use the tutorial code under ‘API How-To C++’ in the v2.1.1-version of Orbbec’s ‘AstraSDK_Doc_en.chm’ user guide file. This code uses the polling method to retrieve a frame, and I have not tried the accompanying listening-method code. Although for some of the code I get the expected “hit enter to exit program” message in the output window, I do not get any diagnostic messages from either camera.

The problem comes when the output window ‘hangs’ with just the cursor blinking after I add the two code lines:
astra::Frame frame = reader.get_latest_frame();
[and]
const auto depthFrame = frame.getastra::DepthFrame();

Using the debugging option, after adding the next suggested code line:
const int frameIndex = depthFrame.frame_index();
I get a message at line 547 of Image.hpp that it “Cannot operate on an invalid frame”. The user guide seems to not address what to do in this situation.

Is the problem with my camera(s), or with the code?

I have a similar situation on Ubuntu, with 3 sensors (a combination of Astra, Astra Pro, and Astra Stereo S U3).

Everything is fine with just one sensor, or with up to 3 if I only stream depth. As I switch to also stream color images, I get libuvc errors such as device busy.

I think one good place to start at is the MultiSensorViewer-SFML sample: it connects to up to two devices (device/sensor0 and device/sensor1) and shows color, infrared and depth images.

Even with that I get the same error and the application loses the second stream as I switch back to color after showing infrared.

In my case, one doubt one may have is whether the USB port the device is actually 3.0. This can be checked on Linux with lsusb -t, and checking if the speed is 5000M.

I can confirm the sensors are supposed to just need to be plugged in to work together.

naturalinteraction, thanks for your reply. I will try the MSV-SFML sample.