Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64080

CameraBin error: "Cannot identify device '/dev/video0'."

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.10.0
    • 5.7.1, 5.10
    • Multimedia
    • None
    • OS: Gentoo

      Two UVC cameras

    Description

      First of all I have a patch for this (attached) 

      What's wrong?

      Suppose I have a QML Camera object and two web cams connected to the PC. First I initialise the camera object with default one: 

      Camera {
          id : myCamera
          deviceId : QtMultimedia.defaultCamera.deviceId
          cameraState : Camera.LoadedState
      }

      Then I unplug the default camera and reassign myCamera to the default device (which is the other camera now). 

      function enumerateCallbackOrWhatever() {
          myCamera.deviceId = QtMultimedia.defaultCamera.deviceId
      }

      Then I see the error 

      CameraBin error: "Cannot identify device '/dev/video0'." 

      and myCamera.cameraStatus never gets out from Camera.LoadingStatus.

        

      Steps to reproduce:

      I've written a little reproducer project following the design of QDeclarativeCamera class from  ./imports/multimedia/qdeclarativecamera.cpp which you can use to make this bug emerge.

      1. Connect two cameras to the PC. Figure out which one will be considered by QtMultimedia as the default (I guess it should likely be /dev/video0)
      2. Run the reproducer. You should see messages like "status: 2" and "status: 4". This is the values of QCamera::status() of the default Camera.
      3. When you see "Please unplug the DEFAULT camera within 10 seconds" message please do that and wait a little bit
      4. The program will unload the camera, change it to the default device and will try to load it. As the result you should see the status changing from 3 to 1, then to 2 and finally you should see the error message I was talking about earlier and then nothing

      If you don't see the error and the camera has again gone to status 4 then, most likely, you unplugged the wrong camera. Try the other one.

      Attachments

        1. qt.patch
          2 kB
        2. reproducer.tar.gz
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            valentyn.doroshchuk Valentyn Doroshchuk
            krokoziabla Vitaliy Kirsanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes