-
Notifications
You must be signed in to change notification settings - Fork 905
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
Windows: Retry open_device if it fails with ERROR_ACCESS_DENIED #44
base: master
Are you sure you want to change the base?
Conversation
Done. I swapped the semantics of the parameter so there wasn't a strange double-negative like |
Can you combine these patches so they are one patch? Use git rebase -i and git push (you'll need to do --force, but it's ok since I haven't pulled from you yet, unless someone else is tracking this branch, in which case put it on a separate branch for me). Thanks! Alan. |
(Ref. "Why do I receive 'Access denied' when attempting to access my HID?" http://www.lvr.com/hidfaq.htm) Swap semantics on open_device()'s second parameter to make sense with new usage.
On my windows 8 64bit machine instead of ERROR_ACCESS_DENIED I get ERROR_SHARING_VIOLATION. I'm trying to open a Audio Class device that, like keyboards and mice, windows claims read and write access too. I believe the firmware on the device already has a feature report for remote wakeup and stall endpoint but so far all my attempts to get or send a feature report result in "Incorrect function". What I want to do is add a couple of feature reports to communicate with the device while still using it as a windows sound device. |
Your audio software probably has the device open already. I'm not sure what you mean by "if I use this condition." Can you explain further or post a patch snippet? |
I'm a little new to github, hopefully this is the preferred way to link in a patch. https://gist.github.com/cactrot/7242364 I know windows has the device open for read and write as a system audio device. I have read several places that it is still possible to send feature reports if you don't request read/write access. I have DSP chip from TI ( C5535 ) and I want to use it as a USB sound card but I also want to be able to control the DSP from an application. I'm not sure of the "Incorrect function" means the report has been sent and the device is not responding or if windows is giving the error. I suppose that is mostly what I need to figure out at the moment. |
Modern Windows implementations don't allow opening HID devices in READ/WRITE mode if they are claimed by the system. Examples of such devices include keyboards and mice. However, these devices can be opened without READ/WRITE permissions, in order to allow sending and receiving feature reports. If open_device() fails, retry without requesting READ/WRITE permissions. This inverts the logic of the parameter to open_device(). It is a refactor of signal11#44 by @pqu. Signed-off-by: Sean Cross <sean@xobs.io>
Modern Windows implementations don't allow opening HID devices in READ/WRITE mode if they are claimed by the system. Examples of such devices include keyboards and mice. However, these devices can be opened without READ/WRITE permissions, in order to allow sending and receiving feature reports. If open_device() fails, retry without requesting READ/WRITE permissions. This inverts the logic of the parameter to open_device(). It is a refactor of signal11#44 by @pqu. Signed-off-by: Sean Cross <sean@xobs.io> Signed-off-by: Kubicz, Filip <filip.kubicz@nordicsemi.no>
EDIT: You should rather use #335 Rebased patch (makes my application able to send/receive feature reports on Windows): (also adjusted the link in the commit message to archive.org as the link is dead)
|
Modern Windows implementations don't allow opening HID devices in READ/WRITE mode if they are claimed by the system. Examples of such devices include keyboards and mice. However, these devices can be opened without READ/WRITE permissions, in order to allow sending and receiving feature reports. If open_device() fails, retry without requesting READ/WRITE permissions. This inverts the logic of the parameter to open_device(). It is a refactor of signal11#44 by @pqu. Signed-off-by: Sean Cross <sean@xobs.io>
Windows opens system mice/keyboards for exclusive access. They can still be sent feature reports, but neither read nor write access can be requested when the handle is opened.