Ubuntu – How to change the default webcam

webcam

I'm using ubuntu 18.10, and my laptop's (ThinkPad 25) built-in webcam image is distorted and pink. I tried in google hangouts and in cheese, and they both show the same kind of image.

Screenshot of cheese showing webcam image, which is distorted and pink.

Cheese doesn't show any errors on command line, just says this:

(cheese:5930): Gtk-WARNING **: 09:00:44.808: Theme parsing error: cheese.css:7:35: The style property GtkScrollbar:min-slider-length is deprecated and shouldn't be used anymore. It will be removed in a future version

which I imagine is not relevant(?).

I found this page: https://help.ubuntu.com/community/Webcam/Troubleshooting but it is very old and talks about Skype, and starting Skype with different options, but I can't use Skype, I need Google Hangouts to work.

I believe this may be what my webcam is:

product: Integrated Camera [4F2:B5AB]
vendor: SunplusIT Inc [4F2]
bus info: usb@1:8
version: 0.10
capabilities:
    USB 2.0
configuration:
    driver: uvcvideo
    maxpower: 500mA
    speed: 480Mbit/s

Any ideas what to do? Thanks!


Edit.
Ok, it appears that my laptop actually has 2 different webcams, and the camera that is showing the bad image is actually named Integrated IR Camera.
I found a webpage about it, too: https://blogs.gnome.org/jamesh/2017/10/22/thinkpad-infrared-camera/

I was randomly clicking on buttons in cheese, and there is a button that changes which camera it is using, and the other camera is showing picture just fine. The default camera seems to be the infrared camera — how do I get rid of it in all programs, since it is not doing anything useful?

Best Answer

The OPs solution didn't work for me, but has given me a push to the right direction. Indeed, if the IR cam is separate from the main one, it can be detached by removing power from it.

Quick google for "ubuntu disable usb device" has shown this page - https://karlcode.owtelse.com/blog/2017/01/09/disabling-usb-ports-on-linux/

In short - find the USB port to which the camera is connected (1-1.6 in the example below, but it for 1-5 for my laptop):

$ for device in $(ls /sys/bus/usb/devices/*/product); do echo $device;cat $device;done
/sys/bus/usb/devices/1-1.2/product
Dell USB Entry Keyboard
/sys/bus/usb/devices/1-1.6/product
Webcam SC-13HDL11624N
/sys/bus/usb/devices/2-1/product
Amazon Kindle
/sys/bus/usb/devices/2-2/product
USB Receiver
/sys/bus/usb/devices/usb1/product
EHCI Host Controller
/sys/bus/usb/devices/usb2/product
xHCI Host Controller
/sys/bus/usb/devices/usb3/product
xHCI Host Controller

Then power it down:

echo '1-1.6' | sudo tee /sys/bus/usb/drivers/usb/unbind

Or do this on reboot via cron:

sudo crontab -e

and add the following there:

@reboot echo '1-1.6' > /sys/bus/usb/drivers/usb/unbind

(of course, replacing "1-1.6" with "1-5" or whatever port your camera is connected)

Similar question and solution is - Is it possible to turn off a specific USB port so it doesn't accept any device?

Related Question