Ubuntu 16.04 (Xenial Xerus)
sudo apt install tlp
sudo lsusb
Find the USB device's input id - it should look like 1234:5678
.
Edit the file sudo vi /etc/default/tlp
and add your device's input ID to USB_BLACKLIST
by adding the following line with your device's input id like so:
USB_BLACKLIST="1234:5678"
Ubuntu 14.04 (Trusty Tahr)
As mentioned here at hecticgeek.com, the trick consists of two parts:
Using lsusb
to ascertain the device IDs of the USB devices you wish to disable autosuspend for.
And then adding them to AUTOSUSPEND_USBID_BLACKLIST
in the /etc/laptop-mode/conf.d/runtime-pm.conf
(usb-autosuspend.conf
until Ubuntu 14.04) configuration file (details are well documented in there as well).
The answer is: it's not actually your problem.
Some logitech cameras have usb bandwidth allocation bug. Lets see if that's the case.
cat /sys/kernel/debug/usb/devices | grep "B: "
will give you current bandwidth allocation of all usb hubs, output will be something like this:
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
B: Alloc= 35/900 us ( 4%), #Int= 3, #Iso= 0
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0
B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0
As you can see, I currently have 35 mbps allocated of my usb3 hub. The problem with some logitech cameras, though, is that they will always allocate as much as they can get (480 mbps), disregarding of mode. And so it's down to simple arithmetic as 480 + 480 > 900 and second camera just "won't fit".
As long as your cameras are plugged in the same hardware usb hub, you will have that problem.
Also bear in mind, that webcamera usually allocates 128mbps in MJPEG and 424mbps in uncompressed mode for 640x480.
Best Answer
To solve this problem on 12.04 and continue using laptop-mode-tools edit the file:
/etc/laptop-mode/conf.d/usb-autosuspend.conf
And look for the line:
Replace with:
This will automatically disable USB autosuspend if you have ANY mouse and even USB drives plugged in.