pupil-labs / pyuvc

python binding to libuvc
Other
123 stars 51 forks source link

Cannot acquire images from dual cameras #26

Open PRNV7 opened 7 years ago

PRNV7 commented 7 years ago

Hi, I'm using your pyuvc python module to get images from two cameras. I set bandwidth_factor=2. The code is working fine when I run it for 5 times. After again I tried run, it is showing the below error: I checked the uvc.pyx code line mentioned below and the line 547 says "isochronous stream error". One camera is working fine but I'm not able to acquire images from another.How to solve this error?

Traceback (most recent call last): File "eff2.py", line 54, in frame = cap.get_frame_robust() File "uvc.pyx", line 572, in uvc.Capture.get_frame_robust (uvc.c:15904) File "uvc.pyx", line 588, in uvc.Capture.get_frame (uvc.c:16341) File "uvc.pyx", line 547, in uvc.Capture._start (uvc.c:15455) uvc.InitError

I appreciate your help. Thanks.

willpatera commented 7 years ago

@PRNV7 - could you specify the following:

PRNV7 commented 7 years ago

@willpatera My OS is Ubuntu 16.04 on Odroid XU4. ELP Cameras. Python2.7 Before running the code "lsusb -t" result is below: | Port 1: Dev 3, If 0, Class=Video, Driver=uvcvideo, 480M | Port 1: Dev 3, If 1, Class=Video, Driver=uvcvideo, 480M After five times I ran the code, after it shown the error in question, "lsusb -t" result is below("Driver= " missing) : | Port 1: Dev 2, If 0, Class=Video, Driver=uvcvideo, 480M | Port 1: Dev 2, If 1, Class=Video, Driver=, 480M

The below error was thrown by the command="dmesg | grep -i video" after five times I ran the code. 1713.103074] [c2] uvcvideo: No streaming interface found for terminal 5.

I've installed libuvc and pyuvc from your git only. I think, somehow, it is not-recognizing/deleting either of two cameras.

PRNV7 commented 7 years ago

@willpatera I'm using ARM based processor. Should I change udev rules for ARM machine or the given rules applicable for any kind of processor?

PRNV7 commented 7 years ago

@willpatera @mkassner Does this pyuvc module depends on kernel version too? Please..Let me know.

mtee commented 7 years ago

Not sure if I'd have created a new issue, but I also cannot acquire images from dual sensor (it's the stereo edition of the pupil eye tracker by the way). The initializing part works fine, i.e. after

self.uvc_capture_left = uvc.Capture(uid_left)
self.uvc_capture_right = uvc.Capture(uid_right)

both objects are initialized without errors, however when I afterwards try

frame_left = self.uvc_capture_left.get_frame(0.05)
frame_right = self.uvc_capture_right.get_frame(0.05)

I get

Traceback (most recent call last):
  File "<...>/uvc_backend_stereo.py", line 283, in recent_events
    frame_right = self.uvc_capture_right.get_frame(0.05)
  File "uvc.pyx", line 594, in uvc.Capture.get_frame (uvc.c:16481)
uvc.StreamError

If i comment either of the get_frame lines, I receive no stream errors, mono capturing works fine from the respective sensor - both left and right, but not simultaneously.

I am on Linux Mint and here is lsusb -d 05a3: Bus 001 Device 020: ID 05a3:9230 ARC International Bus 001 Device 018: ID 05a3:9231 ARC International Bus 001 Device 017: ID 05a3:9230 ARC International Bus 001 Device 016: ID 05a3:9230 ARC International

[UPDATE] could resolve it by setting all settings for the both capture objects identical: same frame size, same frame rate.