3

I've just recently noticed that video from my webcam does not always work in a programme, so long as something else is accessing it.

Let's explain this with some usage examples:

  1. I'm running uTox (a tox instant messaging client) in the background so that I can receive secure messages from friends and clients, and suddenly I get a Skype call. Skype cannot access the webcam because uTox has a hold on the device.

  2. uTox is running and I want to check the video output from my webcam using Cheese. I receive an error: There was an error playing video from the webcam and get no video output.

In both of these cases, uTox does not trigger the webcam light on my laptop, and it should not be actively using the webcam (it just has a hold on the device for whatever reason). To bypass this, I'd like to know if there's anything I can do to let multiple programmes access the camera at the same time (or for anyone familiar with the client, how do I remove the hold on the video from uTox?), as I generally need to have uTox running in the background. Killing the process so I can take a Skype call is very inconvenient.

Is there any way I can allow multiple programmes to access the same video device at the same time?


Error upon running Cheese:

$ cheese &
...
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy

(cheese:8259): cheese-WARNING **: Device '/dev/video0' is busy: gstv4l2object.c(2838): gst_v4l2_object_set_format (): /GstCameraBin:camerabin/GstWrapperCameraBinSrc:camera_source/GstBin:bin18/GstV4l2Src:video_source:
Call to S_FMT failed for YU12 @ 1280x720: Device or resource busy

System info:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 15.04
Release:    15.04
Codename:   vivid

# lshw -short
H/W path         Device     Class          Description
======================================================
                            system         Computer
/0                          bus            Motherboard
/0/0                        memory         7873MiB System memory
/0/1                        processor      Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz
/0/100                      bridge         3rd Gen Core processor DRAM Controller
/0/100/2                    display        3rd Gen Core processor Graphics Controller
/0/100/14                   bus            7 Series/C210 Series Chipset Family USB xHCI Host Controller
/0/100/14/0      usb2       bus            xHCI Host Controller
/0/100/14/1      usb1       bus            xHCI Host Controller
/0/100/16                   communication  7 Series/C210 Series Chipset Family MEI Controller #1
/0/100/1a                   bus            7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2
/0/100/1a/1      usb3       bus            EHCI Host Controller
/0/100/1a/1/1               bus            Integrated Rate Matching Hub
/0/100/1a/1/1/1             communication  Bluetooth wireless interface
/0/100/1a/1/1/3             multimedia     HD WebCam
/0/100/1b                   multimedia     7 Series/C210 Series Chipset Family High Definition Audio Controller
/0/100/1c                   bridge         7 Series/C210 Series Chipset Family PCI Express Root Port 1
/0/100/1c/0      eth0       network        NetXtreme BCM57786 Gigabit Ethernet PCIe
/0/100/1c/0.1               generic        BCM57765/57785 SDXC/MMC Card Reader
/0/100/1c.1                 bridge         7 Series/C210 Series Chipset Family PCI Express Root Port 2
/0/100/1c.1/0    wlan0      network        QCA9565 / AR9565 Wireless Network Adapter
/0/100/1d                   bus            7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1
/0/100/1d/1      usb4       bus            EHCI Host Controller
/0/100/1d/1/1               bus            Integrated Rate Matching Hub
/0/100/1f                   bridge         HM77 Express Chipset LPC Controller
/0/100/1f.2                 storage        7 Series Chipset Family 6-port SATA Controller [AHCI mode]
/0/100/1f.3                 bus            7 Series/C210 Series Chipset Family SMBus Controller
...

Note that the video device in concern here is the 'HD Webcam' referred to by lshw located at /dev/video0

0 Answers0