From owner-freebsd-multimedia@freebsd.org Wed Mar 25 16:01:36 2020 Return-Path: Delivered-To: freebsd-multimedia@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A15832A4ECB for ; Wed, 25 Mar 2020 16:01:36 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48nXsz0kPnz4Llt for ; Wed, 25 Mar 2020 16:01:26 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 195582600E0; Wed, 25 Mar 2020 17:01:11 +0100 (CET) Subject: Re: Logitech HD Pro Webcam C920 To: "Russell L. Carter" , freebsd-multimedia@freebsd.org References: <104d42cb-43f4-573c-9a0f-f1892ca40e2f@pinyon.org> From: Hans Petter Selasky Message-ID: <4b25e28c-d9c8-2806-d905-926853bf3395@selasky.org> Date: Wed, 25 Mar 2020 16:59:31 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48nXsz0kPnz4Llt X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-4.97 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; IP_SCORE(-2.67)[ip: (-9.20), ipnet: 2a01:4f8::/29(-2.58), asn: 24940(-1.55), country: DE(-0.02)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Mar 2020 16:01:36 -0000 On 2020-03-25 16:48, Russell L. Carter wrote: > On 2020-03-25 01:02, Hans Petter Selasky wrote: >> On 2020-03-24 21:10, Russell L. Carter wrote: >>> Greetings, >>> >>> I have a shiny new Logitech C920S USB webcam which identifies as a >>> [-d ugen5.9] vendor-0x046d-HD-Pro-Webcam-C920 -S E0E2DC0F >>> when running webcamd as root.  I can't get /dev/video0 created. >>> >>> I have put in the mandatory 4 hours or so on my own with google and >>> the man pages as my helpers, and I think I'm close, but so far >>> no joy. >>> >>> I can get it specifically matched with devd via >>> /usr/local/etc/devd/webcamd.conf (though no actions work). >>> >>> So for example, if I run, as root: >>> root@feyerabend> webcamd -d ugen5.9 -N >>> vendor-0x046d-HD-Pro-Webcam-C920 -S E0E2DC0F -M 0 >>> webcamd: Cannot find USB device >>> >>> Alternatively: >>> >>> root@feyerabend> /usr/local/etc/rc.d/webcamd start ugen5.9 >>> Attached to ugen5.9[0] >>> root@feyerabend> >>> >>> But no /dev/video0 creation, no running webcamd, nothing in >>> /var/log/messages etc. >>> >>> When I plug in the cam, I get the following in /var/log/messages: >>> Mar 24 13:07:56 feyerabend kernel: ugen5.9: >> Webcam C920> at usbus5 (disconnected) >>> Mar 24 13:08:23 feyerabend kernel: usb_alloc_device: Failure >>> selecting configuration index 0:USB_ERR_TIMEOUT, port 4, addr 8 >>> (ignored) >>> Mar 24 13:08:23 feyerabend kernel: ugen5.9: >> Webcam C920> at usbus5 >>> >>> Not sure if that long timeout is significant. >>> >>> Any help is much appreciated. >>> >> >> Try: >> >> usbconfig -d 5.9 set_config 0 > > Did this, and I tried a variety of combinations, eg: > $ webcamd -d 5.11 -N vendor-0x046d-HD-Pro-Webcam-C920 -S E0E2DC0F -M 0 > webcamd: Cannot find USB device > > (It's at 5.11 now) > >> >> The error message above means your webcam is not working properly. Can >> you also show the output from usbconfig. > > root@feyerabend> usbconfig ugen5.11 dump_all_desc > ugen5.11: at usbus5, cfg=255 md=HOST > spd=HIGH (480Mbps) pwr=ON (100mA) > As long as it says cfg=255, the device won't work. It should say cfg=0. Try to search for: idVendor = 0x046d idProduct = 0x0892 On the internet. I think I recall that this specific device had some known problems. You can also try another USB port and/or USB HUB. Seem to be the same like: https://forums.freebsd.org/threads/webcam-not-working.72746/ Looking at Linux, these devices are all quirked: https://lore.kernel.org/patchwork/patch/864784/ We don't have this quirk type yet in the kernel. Try to play with these sysctls: hw.usb.timings.extra_power_up_time: 20 hw.usb.timings.resume_recovery: 50 hw.usb.timings.resume_wait: 50 hw.usb.timings.resume_delay: 250 hw.usb.timings.set_address_settle: 10 hw.usb.timings.port_resume_delay: 40 hw.usb.timings.port_powerup_delay: 300 hw.usb.timings.port_reset_recovery: 250 hw.usb.timings.port_root_reset_delay: 200 hw.usb.timings.port_reset_delay: 50 sysctl hw.usb.timings.set_address_settle=1000 Then re-plug the device. --HPS