Skip to content

xioctl(VIDIOC_S_FMT) failed Last Error: Device or resource busy #1828

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

Closed
anshulvj opened this issue Jun 4, 2018 · 10 comments
Closed

xioctl(VIDIOC_S_FMT) failed Last Error: Device or resource busy #1828

anshulvj opened this issue Jun 4, 2018 · 10 comments
Assignees

Comments

@anshulvj
Copy link

anshulvj commented Jun 4, 2018

Camera mode: RS415
OS: Ubuntu 16.04 64-bit
Language: Using librealsense python wrapper for data acquisition and processing.

I am trying to debug my Python code that is retrieving point cloud information from realsense D415 sensor. The sensor usually works fine but during debug if I have to quit debugging and restart the debug process it says:

xioctl(VIDIOC_S_FMT) failed Last Error: Device or resource busy
Process finished with exit code 0

For proprietary issues I cannot put my code here but essentially it's acquiring x,y,z information from the sensor and computing various things on that data.

This usually happens during debugging the code. Has anyone faced similar issue before?

Any help is appreciated. Please let me know if you need further information.

@xufeifeiWHU
Copy link

This problem occurs when the device is really busy now, I means that there are several occasions it will be busy:
1.if you run/debug your codes in a python IDE (ie.pycharm..) and have creat a pipline then use the frame you get, but have you realse your camera in your codes ? or did your project exit/stop normally?
2.Please check carefully if there are another project was using your camera
3.If you run your .py file in command line, the python3.5/2.7 will help you release camera but please keep in mind Please release your camera mannually, you can find such demo codes in the wrapper/examples.

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
@anshulvj
does the suggestion provided by @xufeifeiWHU work for you?

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
assuming the issue is solved, close the issue first, if you have related problem, please reopen it or create new issue.

@lchop
Copy link

lchop commented Aug 27, 2018

Hello,

I have the same error. How do you release se the camera ?
Best regards

@eyildiz-ugoe
Copy link

I had the same problem as I was running the ROS node for realsense, as I terminated it, the problem was gone.

@jebasamuel
Copy link

@anshulvj @lchop @eyildiz-ugoe
The probem is kernel prevents this dynamic resolution setting for same device from different application.However, if both application have same resolution setting, this can be relaxed. buf, if the streaming is already happening, you will get this error.

This can be solved by applying this kernel patch.

https://patchwork.kernel.org/patch/11179557/

@locdoan12121997
Copy link

@jebasamuel
Hi, I have apply the kernel patch but still not work. What I did to apply the patch was:
Download patch https://patchwork.kernel.org/patch/11179557/
Then find the file name hantro_v4l2.c, which appear to be in ~//librealsense/ubuntu-bionic-5/drivers/staging/media/hantro/hantro_v4l2.c, and direct to the directory
Then, patch < media-hantro-relax-s_fmt-out-busy-error.patch
But I still have the same xioctl error

@jebasamuel
Copy link

@locdoan12121997
You need to apply the patch for correct v4l2 driver code. Check your v4l2 driver. it may not be necessary same as the hantro.

@dmoham1476
Copy link

I am seeing this issue on jetson with realsense especially when the client pings a realsense server repeatedly. I followed instructions to install realsense on jetpack using this blog - https://lieuzhenghong.com/how_to_install_librealsense_on_the_jetson_nx/
How can I apply the patch?

@bjarnekvae
Copy link

Had the same problem myself, what solved it for my was to set "VIDIOC_S_FMT" before setting up the buffers (VIDIOC_REQBUFS).

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

No branches or pull requests

9 participants