# [Partly Solved]logitech webcam not working after suspend

## superbrain666

I bought a new Logitech Webcam C310 HD webcam. It is working fine, but after my PC is going to suspend its video part is not working any more.

The cam is still recognized by Skype but no video is showing up and the LED keeps black.

If i disconnect and reconnect the cam it works fine again. But that is very annoying.

#lsusb for the webcam:

```
Bus 001 Device 002: ID 046d:081b Logitech, Inc. Webcam C310

```

guvcview shows:

```
Adding control for Pan (relative)

UVCIOC_CTRL_ADD - Error: Die Datei existiert bereits # German for: File exists already

checking format: 1448695129

libv4l2: error setting pixformat: Das Gerät oder die Ressource ist belegt # German for: device or resource is busy

VIDIOC_S_FORMAT - Unable to set format: Das Gerät oder die Ressource ist belegt  # German for: device or resource is busy

Init v4L2 failed !! 

ERROR: Minimum Setup Failed.

 Exiting...

VIDIOC_REQBUFS - Failed to delete buffers: Das Argument ist ungültig (errno 22) # Argument is invalid

```

Is there a possibility to disconnect a usb devce with a shell command? That would ease my pain, already. 

But i think it is a driver bug.

My System:

#emerge --info

```

Portage 2.1.10.3 (default/linux/amd64/10.0/desktop/kde, gcc-4.5.2, glibc-2.13-r2, 2.6.39-gentoo x86_64)

=================================================================

System uname: Linux-2.6.39-gentoo-x86_64-AMD_Phenom-tm-_II_X6_1055T_Processor-with-gentoo-2.0.3

Timestamp of tree: Fri, 01 Jul 2011 06:30:01 +0000

ccache version 3.1.5 [enabled]

app-shells/bash:          4.2_p10

dev-java/java-config:     2.1.11-r3

dev-lang/python:          2.7.2, 3.2

dev-util/ccache:          3.1.5

dev-util/cmake:           2.8.4-r1

dev-util/pkgconfig:       0.26

sys-apps/baselayout:      2.0.3

sys-apps/openrc:          0.8.3-r1

sys-apps/sandbox:         2.5

sys-devel/autoconf:       2.13, 2.68

sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1-r1

sys-devel/binutils:       2.21.1

sys-devel/gcc:            4.5.2

sys-devel/gcc-config:     1.4.1-r1

sys-devel/libtool:        2.4-r1

sys-devel/make:           3.82-r1

sys-kernel/linux-headers: 2.6.38 (virtual/os-headers)

sys-libs/glibc:           2.13-r2

Repositories: gentoo mozilla

ACCEPT_KEYWORDS="amd64 ~amd64"

ACCEPT_LICENSE="*"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=amdfam10 -O2 -mabm -msse4a"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"

CXXFLAGS="-march=amdfam10 -O2 -mabm -msse4a"

DISTDIR="/usr/portage/distfiles"

FEATURES="assume-digests binpkg-logs buildpkg ccache distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"

FFLAGS=""

GENTOO_MIRRORS="http://de-mirror.org/distro/gentoo/ http://gentoo.mneisen.org/ http://gentoo.wheel.sk/ http://gentoo.supp.name/ http://gentoo.mirror.pw.edu.pl/"

LANG="de_DE.UTF-8"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

LINGUAS="de en"

MAKEOPTS="-j7"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/var/lib/layman/mozilla"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="#dv 3dnow 3dnowext X a52 aac aalib accessibility acpi alsa amd64 apm asf atm automount avahi bash-completion berkdb bidi bluetooth bogofilter branding btrfs bzip2 cairo caps cdda cdr cgi cjk clamav cli consolekit cpudetection cracklib css ctype cxx dbus declarative dillo divx divx4linux djbfft djvu dlna dri dts dv dvb dvd dvdr dvdread dynamicplugin emboss encode exif extra facebook fam fat fbcondecor fbdev fbsplash ffmpeg firefox firefox3 flac fontconfig fontforge fortran gd gdbm gdu gecko-sdk gif glibc-omitfp gmedia gnutls gpm graphviz gstreamer gtk gtk2 h323 hbci httpd iconv imagemagick imap ipv6 jack java jfs jingle jpeg kde kerberos kipi kontact kpathsea lcms ldap libnotify libwww live lm_sensors lzma mad mail-wrapper matroska mdadm mmx mmxext mng modplug modules mono mozilla mp3 mp4 mpeg mplayer msn mudflap multilib musicbrainz mysql mysqli nas nautilus ncurses nepomuk network nls nptl nptlonly nsplugin ntfs nvidia oav ogg opengl openmp pam pango pch pcre pda pdf perl phonon phyton plasma pmu png policykit postgres ppds pppd publishers pulseaudio python qt qt3support qt4 readline realmedia reiserfs rtc rtsp samba science sdl semantic-desktop session simplexml skype sms spamassassin spell sql sqlite sse sse2 ssl ssse3 startup-notification stream svg swat sysfs taglib tcpd tex4ht theora threads threadsafe thunderbird tiff tk tkinter truetype udev unicode upnp usb v4l v4l2 vaapi vcd vdpau video visualization vlm vorbis wmp wxwidgets wxwindows x264 xcb xcomposite xetex xfs xine xinerama xml xorg xscreensaver xulrunner xv xvid xvmc yv12 zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de en" LIRC_DEVICES="bte" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" SANE_BACKENDS="plustek" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

```

#lspci

```
00:00.0 Host bridge: Advanced Micro Devices [AMD] RS780 Host Bridge Alternate

00:02.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (ext gfx port 0)

00:0a.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 5)

00:11.0 SATA controller: ATI Technologies Inc SB700/SB800 SATA Controller [AHCI mode] (rev 40)

00:12.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller

00:12.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller

00:13.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller

00:13.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller

00:14.0 SMBus: ATI Technologies Inc SBx00 SMBus Controller (rev 41)

00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia (Intel HDA) (rev 40)

00:14.3 ISA bridge: ATI Technologies Inc SB700/SB800 LPC host controller (rev 40)

00:14.4 PCI bridge: ATI Technologies Inc SBx00 PCI to PCI Bridge (rev 40)

00:14.5 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI2 Controller

00:15.0 PCI bridge: ATI Technologies Inc Device 43a0

00:15.1 PCI bridge: ATI Technologies Inc Device 43a1

00:16.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller

00:16.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller

00:18.0 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] HyperTransport Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] DRAM Controller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Miscellaneous Control

00:18.4 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Link Control

01:00.0 VGA compatible controller: nVidia Corporation G94 [GeForce 9600 GT] (rev a1)

02:00.0 SATA controller: JMicron Technology Corp. JMB361 AHCI/IDE (rev 02)

02:00.1 IDE interface: JMicron Technology Corp. JMB361 AHCI/IDE (rev 02)

03:07.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6306 Fire II IEEE 1394 OHCI Link Layer Controller (rev c0)

04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)

05:00.0 USB Controller: NEC Corporation Device 0194 (rev 03)

```

Last edited by superbrain666 on Sat Jul 09, 2011 7:55 am; edited 1 time in total

----------

## superbrain666

I found that the follwing value was wrong:

```

#cat /sys/bus/usb/devices/1-2/power/persist

1

```

the documentation reads that it can be dangerous! 

http://www.mjmwired.net/kernel/Documentation/ABI/testing/sysfs-bus-usb

so i was partly solving the problem by:

```

echo 0 > /sys/bus/usb/devices/1-2/power/persist

```

How can i make this permanent?

Can i write a udev rule? Or should i file a bug?

----------

