-
Notifications
You must be signed in to change notification settings - Fork 90
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
Device or resource busy #14
Comments
Update: Cross Compiling from mac has the same issue. |
Can you specify which 'old' version was working for you? |
Unfortunately I only have the binary saved from it... I have been going back through the commits to see if I can recognize when it was built. I believe at the time there were still some C files included. Probably just before the project was converted to fully go. (sorry I know that's not very helpful). |
Okay I'm on to something now. It seems that the os.OpenFile is not adhering to the flag for I can get the camera to work without write blocking by specifically defining Therefore the
This might be usable considering the whole library requires linux anyways and unix is defined elsewhere. EDIT: I have added a pull request bellow to compare the changes. |
The Pull Request has an error where Temporarily this would work, however it seems that Also as per golang.org/pkg/unsafe the Ioctl unsafe.pointer should be converted in the parameters of the Syscall function so the garbage collector knows to not move or delete anything until the Syscall is completed. Probably not a large issue, but I can try to refactor that while I'm changing fd anyways.
If this seems correct I can update the PR #15 soon with these changes. |
Thanks for merging |
Error:
When:
Any time the service tries to write to the camera (ioctl.Ioctl executions)
Example:
If I use the stdout_streamer.go the camera opens properly and is supported (I've successfully used an older version of this library also). Read events works fine such as
cam.GetSupportedFormats()
andcam.GetSupportedFrameSizes(format)
but as soon as the first write event occurscam.SetImageFormat(format, uint32(size.MaxWidth), uint32(size.MaxHeight))
the system panics with "device or resource busy".Thoughts:
I've had no luck tracking down the source of this issue. My old build of this library still runs fine so I'm certain that my setup is correct. I'm guessing that something with
os.OpenFile(path, unix.O_RDWR|unix.O_NONBLOCK, 0666)
is blocking and only allowing read access.PS: I am cross compiling from a windows machine (previously I was cross compiling from a mac). I will test today if this is the source of the issue.
Thanks
The text was updated successfully, but these errors were encountered: