pupil-labs / pupil

Open source eye tracking
https://pupil-labs.com
GNU Lesser General Public License v3.0
1.46k stars 675 forks source link

The selected camera is already in use or blocked #1011

Closed martram closed 6 years ago

martram commented 6 years ago

Hi, I've ran into this issue while trying to use a webcam with Pupil Capture. The camera is Logitech Brio, I'm on Windows 10. Displayed in red and in the console window is the text: "The selected camera is already in use or blocked" when switching to the camera.

image

I've seen someone opened and then close a similar issue in october/november of 2017, but I don't see a fix, so I'm unsure why the issue was closed. Thanks

cpicanco commented 6 years ago

Please, what is your machine? Do you ever successfully run pupil capture in that machine with your cameras?

831 reports a problem with a notebook (potentially related to USB bandwidth). I have closed because for me it was not a blocking issue as I had another system up and running.

martram commented 6 years ago

Hi, I've never successfully had the application use any camera. I'm using a desktop computer, with an Asus motherboard, 8 core AMD CPU and Radeon R9 GPU. I have windows 10 and the logitech camera is plugged in a USB3 port (the camera is detected as an unknown device on USB2 port, but as Logitech Brio on USB3 port).

I have also tried other devices that are detected as cameras (a ps3 camera and a Samsung Odyssey VR headset with inside-out tracking), but they have the same issue.

cpicanco commented 6 years ago

In my case, I have a Logitech C615 and a another camera connected to USB3 ports of a desktop computer (intel chipset), with 4gb ddr3, running Ubuntu 16.04 LTS and it works.

cpicanco commented 6 years ago

PS.: This is a nice VR device. https://www.youtube.com/watch?v=asC-Axnjk9Q :)

martram commented 6 years ago

Was Pupil successfully tested on windows 10 with recent updates ? The creators update is known to have caused some incompatibility issues with other applications, so I'm not sure if it could affect Pupil.

as for VR, the Odyssey is very good but really heavy. 2018 is going to see yet more improvments, notably HTC Vive pro will be higher resolution than the current Vive and can go wireless.

martram commented 6 years ago

as an addition to the issue, I've updated pupils to the latest version (it wasn't), I also tried on another computer (a lenovo Y580 laptop, running on windows 10, same version). I've tried with the same camera the logitech Brio and the embedded laptop camera. All gave the same result "The selected camera is already in use or blocked"
I'm under the impression that it solidifies the theory that the application is not compatible with the latest windows 10 version

cpicanco commented 6 years ago

I am afraid that hardware issues like this are complicated and @papr @willpatera and @mkassner are very busy with other issues.

martram commented 6 years ago

@papr Why was this issue closed? it's not solved.

@cpicanco It doesn't seem to be just an hardware issue, as I have tried with multiple cameras (an old dynex webcam, an embedded lenovo laptop camera, logitech brio, ps3 camera, kinect v1, and a HMD camera detected as an hololens), 2 computers and 2 OS versions of Windows, just to see if it can work with something. Some cameras are detected as unkown, others with their proper name but they all have the previously mentionned error message saying that they are "in use or blocked". The problem is also present on windows 7, but cameras that I've tried are all detected as unknown on that OS.

How could I troubleshoot this?

papr commented 6 years ago

@martram Since you use custom hardware you will need to manually setup the drivers for your camera. Here are the instructions: https://github.com/pupil-labs/pyuvc/blob/master/WINDOWS_USER.md

Sorry for the late pointer to this reference. I have just learned about it, too.

martram commented 6 years ago

Ok, thanks for the information, I will try that as soon as I have a couple of minutes.

cpicanco commented 6 years ago

@martram , sorry, when I said "hardware", I meant "custom hardware". More precisely, those are custom hardware driver related issues.

gmierz commented 6 years ago

I am using the Pupil Labs eye tracker cameras (without the world camera) and I am getting this error also. I followed the instructions in @papr 's comment but it only helped with making the camera names change from 'unknown' to 'Pupil Cam...'.

willpatera commented 6 years ago

@gmierz please try the following for driver debugging.

Uninstall all Pupil Cam1 Drivers on Windows 10

  1. Unplug Pupil Headset from your computer and keep unplugged until the last step
  2. Open Device Manager
    1. Click View > Show Hidden Devices
    2. Expand the libUSBK devices category and expand the Imaging Devices category within the Device Manager
    3. Uninstall and delete drivers for all Pupil Cam 1 ID0, Pupil Cam 1 ID1, and Pupil Cam 1 ID2 devices within both libUSBK and Imaging Devices Category
  3. Restart Computer
  4. Start the latest version of Pupil Capture (ensure that you have admin privileges on your machine)
    1. General Menu > Restart with default settings
  5. Plug in Pupil Headset after Pupil Capture relaunches - Please wait, drivers should install automatically. You may need to close/cancel automatic Windows driver installation

Manual libusbK driver install (if above does not work)

Uninstall all drivers Step 1-3 above. Follow steps 1-7 from https://github.com/pupil-labs/pyuvc/blob/master/WINDOWS_USER.md (as @papr notes)

@gmierz what device category do the cameras show up under in your Device Manager?

martram commented 6 years ago

I followed the guide given by @papr and the camera is now detected and "used" for tracking. It's not working properly though, the camera seems to freeze for a couple of seconds and reset every 5 or 10 seconds at the lowest resolution/framerate combinations, and freezes all the time at higher resolution/framerate. after it complains about exposure time, white balance temperature and a premature end of jpeg file. here's an overview of the dialog window: (in this exemple I set both world and eye detection 0 to the same camera, it only freezes on eye detection though, not if the camera is just used in world)

Estimated / selected altsetting bandwith : 597 / 640. !!!!Packets per transfer = 32 frameInterval = 166666 world - [WARNING] video_capture.uvc_backend: Capture failed to provide frames. Attempting to reinit. eye0 - [WARNING] video_capture.uvc_backend: Capture failed to provide frames. Attempting to reinit. world - [INFO] video_capture.uvc_backend: Found device. Logitech BRIO. eye0 - [INFO] video_capture.uvc_backend: Found device. Logitech BRIO. world - [WARNING] camera_models: Loading dummy calibration world - [WARNING] uvc: Could not set Value. 'Absolute Exposure Time'. eye0 - [INFO] camera_models: No user calibration found for camera Logitech BRIO at resolution (640, 480) eye0 - [INFO] camera_models: No pre-recorded calibration available eye0 - [WARNING] camera_models: Loading dummy calibration eye0 - [WARNING] uvc: Could not set Value. 'Absolute Exposure Time'. world - [WARNING] uvc: Could not set Value. 'White Balance temperature'. Estimated / selected altsetting bandwith : 309 / 384. eye0 - [WARNING] uvc: Could not set Value. 'White Balance temperature'. world - [WARNING] uvc: Turbojpeg jpeg2yuv: b'Premature end of JPEG file'


Also, totally unrelated, but the menu disappeared in pupil capture, and I can't get it back even if I delete and put back the files. Is there a special python module needed for it?

willpatera commented 6 years ago

@martram can you share the specs of your computer (CPU, RAM) and OS?

gmierz commented 6 years ago

@willpatera Your instructions worked, thank you very much! I think the problem may have been that I was using a very old version of pupil capture. Also, originally, the cameras were under the 'Cameras' and 'libUSBK' categories. There was nothing under the 'Imaging Devices' category.

One thing I noticed though is that the confidence measurements at the top of the world camera view are now missing (I don't have a world camera). Do I need something new to get the confidence measurements?

papr commented 6 years ago

@martram

world - [INFO] video_capture.uvc_backend: Found device. Logitech BRIO. eye0 - [INFO] video_capture.uvc_backend: Found device. Logitech BRIO.

The eye and the world process are both trying to connect to the same camera. Please select the correct cameras in the UVC Backend Manager plugin. Select the Pupil Cam1 ID0/1 as eye cameras in the eye window and the Logitech BRIO in the world window.

Deleting the correct settings will definitively reset the Pupil Capture collapse issue.

martram commented 6 years ago

@willpatera my OS is windows 10.0.16299 GPU Radeon R9 280 CPU AMD FX-8320 8-core, 3500Mhz RAM 16 gig

@papr deleting the pupil_capture_settings fixed the menu collapse issue. thanks

As for the camera, what I'm trying to achieve is to use the brio as an "eye camera" since it potentially has good hardware capabilities. I can use video for the world, but the same issue persists for the logitech brio. if you can provide any information that can get me this setup to work it would be very appreciated. thanks a lot