Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Every now and then there might come a need to reset a USB device, is there a way to perform the reset in software without unplugging the device itself and then pluggin it back in?

More specifically I have a webcam which gets confused when playing too much with the settings in guvcapture and then needs a reset to get back on track.

share|improve this question

You could try Benjamin Close's resetusb program to reset all devices — there are no binaries available, but compiling it is rather easy. Save the source code as resetusb.c, then run:

gcc -lusb resetusb.c -o resetusb

You can now run the tool as resetusb. Alternatively, @unhammer points to Alan Stern's single-device version (plus some hints on how to use it).

Some people have also had luck just removing and modprobe-ing the relevant modules:

modprobe -vr ehci_hcd
modprobe -v ehci_hcd

(you could of course script this)

Some distributions may also have their own tools to restart the USB subsystem; Mandrake apparently has /etc/init.d/usb.

share|improve this answer
    
askubuntu.com/questions/645/… has a similar program for resetting a single usb device – unhammer Dec 31 '13 at 14:34
    
$ sudo modprobe -vr ehci_hcd results in modprobe: FATAL: Module ehci_hcd is builtin. on kubuntu trusty. – naught101 Jun 28 '14 at 3:42
    
On my laptop with debian 8, ehci_hcd gives errors. However, rmmod ehci_pci && sleep 2 && modprobe ehci_pci works perfectly. – Bharat G Oct 12 '15 at 14:16
    
The modprobe trick did the job on CentOS 4 :-( , saved my day ! – Open SEO Jun 9 at 13:09

You can restart the hardware abstraction layer: sudo /etc/init.d/hal restart

share|improve this answer
2  
i think HAL is replaced by something else in the newest version of ubuntu.. so its depend of distrib.. – bAN Aug 17 '10 at 20:29
1  
I seriously doubt it would have worked anyway. HAL wasn't a low-level abstraction layer like the Windows component of the same name. – sourcejedi Dec 10 '12 at 12:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .