1

I'm on 12.04LTS. I have an external USB HD cam that I run as default (preferably). To do this, after every reboot I have to run

sudo su -c 'echo "0" > /sys/bus/usb/devices/1-1.4/bConfigurationValue'

(1-1.4 is my laptop cam) This disables my laptop cam.

Then in GUVCview I get:

screenshot

Which is easily fixed by simply unplugging, and plugging the external cam's usb into port. Then my external cam works great,and is my default selection, and the only one listed in devices under GUVCview, and is marked as default in Multimedia selector.

Everytime I reboot Ubuntu, I have to go through this little process. Not a terrible problem, but is there a way to make my 1-1.4 value stay at "0" ?

EDIT:

EDIT 2:

Open Terminal

cd /etc
sudo nano rc.local

Edit File by placing command Before " Exit 0"

Press CTRL - X

Y to save

!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
echo "0" > /sys/bus/usb/devices/1-1.4/bConfigurationValue
exit 0
5th Wheel
  • 643
  • 5
  • 15
  • 29

2 Answers2

0

Try adding the echo "0" > /sys/bus/usb/... command you mentioned in your question to the rc.local file.

Do this by running sudo nano /etc/rc.local, and then adding the command echo "0" > /sys/bus/usb/... before the exit 0 line. You can then save it with Ctrl+O.

On using rc.local, see here. It basically runs the command on boot, so might disable the camera, on boot.

To get it to work, make it executable with chmod +x rc.local.

If you need to stop rc.local running on boot, use chmod -x rc.local. If you want to re-enable the camera without rebooting, you might be able to use echo "1" > /sys/bus/usb/... - note the 1 value..

Wilf
  • 30,194
  • 17
  • 108
  • 164
  • Is the above (edit) code correct for terminal? Will that execute? – 5th Wheel Jan 10 '14 at 21:34
  • Not sure what I'm missing on this line. I'm running the top line to see if it's executable, but something is off. – 5th Wheel Jan 10 '14 at 21:44
  • No you add the line to the file rc.local - you don't just make it executable :-) – Wilf Jan 10 '14 at 22:24
  • 1
    Ok thanks. I eventually found this same resolution in another forum post (slightly different, but same results) I posted in edit 2 above. My whole problem with learning linux commands or Ubuntu in general is figuring out the right search terms or keywords in my query. By doing the above, I still have to unplug and replug my USB of external cam to get GUVCview to recognize it. – 5th Wheel Jan 10 '14 at 23:26
  • find the id of the external camera, unbind it and rebind it. should be approximate the same, unless the hw need a hard reset. http://lwn.net/Articles/143397/ – Anders F. U. Kiær Jan 10 '14 at 23:44
  • blacklist the id of your internal cam in the udev rules. – Anders F. U. Kiær Jan 10 '14 at 23:45
0

Blacklist video

gksu gedit /etc/modprobe.d/blacklist.conf
  • add the following line at the end of that page

    blacklist uvcvideo
    
  • restart

  • delete the line and restart for enabling cam

Danatela
  • 13,243
  • 11
  • 45
  • 72
Daniel
  • 27
  • 2