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

RealSense error calling: failed Last Error: Protocol error #9931

Closed
zxl5344 opened this issue Nov 7, 2021 · 32 comments
Closed

RealSense error calling: failed Last Error: Protocol error #9931

zxl5344 opened this issue Nov 7, 2021 · 32 comments
Labels

Comments

@zxl5344
Copy link

zxl5344 commented Nov 7, 2021


Required Info
Camera Model L515
Firmware Version 01.05.08.01
Operating System & Version Linux (Ubuntu 20.04.3 LTS)
Kernel Version (Linux Only) 5.11.0-38-generic
Platform Dell Laptop
SDK Version { legacy / 2.<29>.<0> }
Language {C/python/ }
Segment Robot

Issue Description

When I turn on L500 depth sensor, I got error:

Backend in rs2_get_option(options:0x564c57dc0bd0, option:Receiver Gain):
get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Protocol error

How do I solve it?

@MartyG-RealSense
Copy link
Collaborator

Hi @zxl5344 Could you unplug the micro sized end of the USB cable from the base of the camera, turn the connector around the opposite way and re-insert it into the base of the camera, please (USB Type-C cables are two way insertion at the micro sized end). Does the error still occur after doing so?

@zxl5344
Copy link
Author

zxl5344 commented Nov 8, 2021

I turn the USB Type-C and re-insert it into the base. I still get same error

Backend in rs2_get_option(options:0x7f8d94001060, option:Receiver Gain):
set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Protocol error

I tried different cable and I get this error

Backend in rs2_get_option(options:0x55ffe077d720, option:Confidence
Threshold):
set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Protocol error

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 8, 2021

There was a previous case in IntelRealSense/realsense-ros#1844 where the prootcol error occurred with an L515 when using the camera in a Docker container. Are you using Docker, please?

@zxl5344
Copy link
Author

zxl5344 commented Nov 8, 2021

I don't think so. My laptop only installed Ubuntu.

@MartyG-RealSense
Copy link
Collaborator

Error messages involving xioctl(UVCIOC_CTRL_QUERY) tend to be related to a conflict with the kernel. The RealSense SDK does not yet officially support kernel 5.11 (the newest supported is currently 5.8 at the time of writing this) and so although the SDK can work with newer unsupported kernels, there may be unpredictable consequences in terms of stability.

image

Which method did you use to build the RealSense SDK on Linux, please? If you could build the SDK from source code using the RSUSB backend method then this would help to confirm or eliminate the possibility of the problem being caused by a kernel issue. This is because an RSUSB build is not dependent on Linux versions or kernel versions and does not require patching.

@zxl5344
Copy link
Author

zxl5344 commented Nov 8, 2021

I follow the distribution_linux.md in this repo to build the SDK. Do you have tutorial for RSUSB backend method?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 9, 2021

The procedure below requires an active internet connection.

  1. Obtain the source code for the librealsense SDK. You can do this by going to the 'Assets' file list at the bottom of the listing for each version on the SDK Releases page and left-clicking on the
    to download it as a zipped file.

https://github.com/IntelRealSense/librealsense/releases

image

  1. Extract the zipped file to obtain the librealsense SDK folder and go to the folder's 'root' directory. This is the one with a list of files and folders in, and will typically be at the folder location librealsense > librealsense

image

  1. From this root directory with the CMakeLists.txt file in, input the command mkdir build && cd build to create a sub-directory called 'build' and automatically navigate to it.

  2. Now that you are in the 'build' directory, input the command below to use CMake to build the librealsense SDK from source code with example programs and tools such as the RealSense Viewer included.

cmake ../ -DFORCE_RSUSB_BACKEND=true -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true

  1. Finally, input the command below.

sudo make uninstall && make clean && make -j8 && sudo make install

@zxl5344
Copy link
Author

zxl5344 commented Nov 9, 2021

I followed your procedure @MartyG-RealSense. After step 5, I tried to run realsense-viewer but I got: bash: /usr/bin/realsense-viewer: No such file or directory. How to run it?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 9, 2021

On Linux, realsense-viewer and also the other example programs and tools should be located in the usr/local/bin directory if they have been installed successfully. Do you have realsense-viewer in this folder, please?

@zxl5344
Copy link
Author

zxl5344 commented Nov 9, 2021

Yes, I have realsense-viewer in this folder. What is the next step?

@MartyG-RealSense
Copy link
Collaborator

If you have navigated to this folder, are you able to launch realsense-viewer from there?

@zxl5344
Copy link
Author

zxl5344 commented Nov 9, 2021

No. I cd /usr/local/bin first and run realsense-viewer. I still got error:

bash: /usr/bin/realsense-viewer: No such file or directory

@MartyG-RealSense
Copy link
Collaborator

Have you rebooted your computer since you completed installation of the SDK? If not and you perform a reboot, is realsense-viewer still inaccessible after reboot?

@zxl5344
Copy link
Author

zxl5344 commented Nov 9, 2021

I reboot my laptop. And now realsense-viewer is working. But when I turn on L500 depth sensor, I got error:

UNKNOWN in rs2_get_option(options:0x7fdec00473a0, option:Pre Processing
Sharpening):
usb device disconnected

When I turn on RGB camera first and then turn on L500 depth sensor, I got error:

UNKNOWN in rs2_get_option(options:0x56531cdc81c0, option:Laser Power):
usb device disconnected

I turned the USB Type-C and I still got same error. Everytime I got error, system said L515 is disconnected and then connected again.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 9, 2021

After having gone through the diagnostic process during this case and considered all of the information, it is likely that there is a hardware fault in your L515 camera and it should be returned to the retailer that you purchased it from using the Return Material Authorization (RMA) returns procedure of that particular retailer.

@zxl5344
Copy link
Author

zxl5344 commented Nov 9, 2021

Thanks for your help.

@zxl5344 zxl5344 closed this as completed Nov 9, 2021
@zxl5344 zxl5344 reopened this Nov 9, 2021
@zxl5344
Copy link
Author

zxl5344 commented Nov 9, 2021

Sorry for reopen it. One of my lab mate use this camera previously on a windows laptop. And it is working well. So I think it should be a software issues. What are the possible reason that L515 is working on windows but not Linux?

@MartyG-RealSense
Copy link
Collaborator

It could be an issue with the USB port hardware on the Linux computer. Not all USB ports are created equally, and a camera that works fine on one computer may have problems with some or all of the ports on a different make / model of computer. Different computers may use USB controllers by different providers that may have a bearing on how well the camera works with it. You could test whether it is an issue with the controller on the Linux computer by attaching the camera to a USB hub if it is not already, as the hub's ports will have their own independent USB controller separate from the computer's ports.

@zxl5344
Copy link
Author

zxl5344 commented Nov 10, 2021

I directly connect my camera on laptop without a hub and now I can turn on L500 sensor. Connection changed from USB 3.2 to USB 2.1.
But I continuous get this warning when I turn on L500:

09:16:50 [Warn] /home/zxl5344/Realsense SDK/librealsense-2.49.0/src/libusb/messenger-libusb.cpp:42 - control_transfer returned error, index: 768, error: No data available, number: 61

How to solve it? I got same error when I use roslunch to lunch camera

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 10, 2021

If you can access the camera in the RealSense Viewer, does it make a difference if you reset the camera from within the Viewer by going to the More option in the options side-panel and selecting Hardware Reset from its drop-down menu.

Also, does the USB connection type beside the camera name change to '3.2' instead of '2.1' after a reset?

image

@zxl5344
Copy link
Author

zxl5344 commented Nov 10, 2021

No and No. I still get same error and USB 2.1

@MartyG-RealSense
Copy link
Collaborator

In the Viewer, does the number of control_transfer returned errors reduce if you set the Preset to Short Range instead of the default Max Range?

@zxl5344
Copy link
Author

zxl5344 commented Nov 11, 2021

No, I feel like the frequency of control_transfer returned errors are almost same.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 11, 2021

RealSense SDK version 2.50.0 is now available. Would it be possible to test whether the issues that you have been experiencing in librealsense 2.49.0 are also present in 2.50.0 please?

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

As you are also a ROS user and there is currently only a ROS2 wrapper released for 2.50.0 at the time of writing this, I can appreciate that upgrading to 2.50.0 may not be suitable for you yet if you are a ROS1 user though.

@zxl5344
Copy link
Author

zxl5344 commented Nov 11, 2021

All my codes and repo are based on ROS noetic so I don't want to upgrade to 2.50.0. Sorry about it.

My laptop only have type C port so I am using a type C to type C data cable now. Is it possible that my error and usb 2.1 is caused by data cable?

Also I plan to set up my camera a little far from my laptop. Do you have any recommendation for a long cable, approximately 10 ft?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 11, 2021

It's fine, I totally understand why using 2.50.0 with the current ROS1 wrapper designed for 2.48.0 would be impractical for you.

When choosing your own USB cable there is a risk that it can lead to reduced performance or disconnections if it is not a high quality cable (for example, if it is a cable designed for device charging instead of high volume data transfer). This is because of the high volume of data that RealSense cameras send through the cable. It is also important to make sure that it is a USB 3 cable, as using a USB 2 cable would likely cause the camera to be detected as USB 2 (as USB 2 cables lack internal wires that enable the USB port to identify it as USB 3).

The company Newnex offer high quality USB cables that are validated for use with RealSense. They have been featured in the official Intel data sheet document for the 400 Series cameras as a recommended supply source for USB cables for RealSense.

https://www.newnex.com/realsense-3d-camera-connectivity.php

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

No branches or pull requests

2 participants