Closed camkisailus closed 3 months ago
Just tried running HotPlugin from the latest SDK version and got the same behavior. This problem does not happen when connecting with USB 3.0, but I'm unable to do that due to hardware restrictions.
If it helps I am running Gemini 2 FW: 1.4.92
This is because USB 3.0 has a very low probability of being recognized as USB 2.0. Therefore, there is a feature in the firmware that enables three attempts of disconnection and reconnection when it is detected as USB 2.0. If you consistently use USB 2.0, you can disable this retry feature.
First, try disabling the retry feature using OrbbecViewer and see if the firmware supports it. If it does, you can also use the property interface of the Orbbec SDK to configure this setting. /**
@zhonghong322 Thanks for the reply! I found that actually enabling OB_PROP_DEVICE_USB2_REPEAT_IDENTIFY_BOOL to true fixes the connection problems. Here is the code I added to fix my issue:
auto devList = ctx->queryDeviceList();
auto device = devList->getDeviceBySN(m_CameraConfig.camera_serial_number.c_str());
if (!device)
{
LERROR("Failed to connect to Orbbec S/N: {}", m_CameraConfig.camera_serial_number);
return false;
}
device->setBoolProperty(OBPropertyID::OB_PROP_DEVICE_USB3_REPEAT_IDENTIFY_BOOL, true);
@zhonghong322 Thanks for the reply! I found that actually enabling OB_PROP_DEVICE_USB2_REPEAT_IDENTIFY_BOOL to true fixes the connection problems. Here is the code I added to fix my issue:
auto devList = ctx->queryDeviceList(); auto device = devList->getDeviceBySN(m_CameraConfig.camera_serial_number.c_str()); if (!device) { LERROR("Failed to connect to Orbbec S/N: {}", m_CameraConfig.camera_serial_number); return false; } device->setBoolProperty(OBPropertyID::OB_PROP_DEVICE_USB3_REPEAT_IDENTIFY_BOOL, true);
yes ,you are right.
Thank you @zhonghong322. I have not seen any problems since making the change. This ticket is closed now :+1:
Hi! I am working with the Gemini 2 and trying to run the HotPlugin example. The program runs fine when the camera is plugged in to start. When I unplug and replug the camera, or start the program without a camera plugged in and then plug in a camera, the program can receive a few frames, but then the camera disconnects and ends up in a loop of disconnecting and reconnecting until I stop the program.
Here is sample output from a run where I started with a camera plugged in, unplugged it, and then reconnected it:
I am using an x86_64 machine running Ubuntu 22.04, connecting to the camera over USB 2.0, with SDK version 1.8.3. Any help is much appreciated and this is blocking any further development for me.