Search Unity

Bug Editor doesn't close webcam correctly

Discussion in 'Linux' started by abforce, Dec 2, 2016.

  1. abforce

    abforce

    Joined:
    Dec 3, 2015
    Posts:
    2
    I'm using Unity 5.5.0xb5Linux on Ubuntu 16.10. It seems that there's a problem in closing the webcam device in Linux editors. In the both of the following cases, webcam will be left in an unstable state which can't be opened anymore.

    Case I:
    Using `WebCamTexture`, everything works fine but when I run and stop the game multiple times, suddenly it says that webcam can't be open. (also other programs can't open it like cheese on Ubuntu)

    Case II:
    Creating a native plugin which uses OpenCV's `VideoCapture` to open the webcam and sends back frame data in a byte array. I tested my plugin (.so file) with other programs, and it works pretty fine. For instance, I've created a Qt app which uses my native plugin to show the webcam preview. But in Unity Editor, only the first time my plugin works correctly and other times it tells that it couldn't open the camera.

    When the camera is left unclosed, `lsmod | grep uvcvideo` shows `1`, even though my webcam is off (its LED is off).
     
  2. ma1onso

    ma1onso

    Joined:
    Jun 17, 2014
    Posts:
    79
    Install latest build 5.5xf3