cv2.VideoCapture.read() prevent hidapi from receiving more data
I have a usb2 video camera and an hid usb device connected on the same board.
I can read data from the hid device using hidapi and it works fine.
However, as soon as I do:
success, frame = video_capture.read()
hid.read()
will never return anything anymore. Freezes there forever (if I use a timeout of 0).
Any idea why it would do this? Does the read()
function do anything to reserve the usb bus or anything?
EDIT1:
Some more info:
If I do video_capture.release()
then I can read from hid again. Until I do video_capture.read()
which re-freezes hid.
Also the video_capture.read()
will block hid reads even if 2 different python scripts.
- I start a first script that reads from hid in a loop first and it does it's thing reading and printing the result.
- Then I start a second script that reads from the webcam.
Once the webcam script is started, the hid script freeze at read(). The webcam script is fine.
I'm running
- Language => Python 3.8.3
- OpenCV => 4.3.0
- Operating System / Platform => Debian GNU/Linux 10 on armv7l