From owner-freebsd-usb@freebsd.org Thu Nov 26 12:18:49 2020 Return-Path: Delivered-To: freebsd-usb@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 C6A274AAFED for ; Thu, 26 Nov 2020 12:18:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4ChcHY4gv6z3vnh for ; Thu, 26 Nov 2020 12:18:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: by mailman.nyi.freebsd.org (Postfix) id 9EA134AAEB9; Thu, 26 Nov 2020 12:18:49 +0000 (UTC) Delivered-To: usb@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 9E6A44AAE3E for ; Thu, 26 Nov 2020 12:18:49 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ChcHY3cQtz3w4T for ; Thu, 26 Nov 2020 12:18:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 47C1426020D; Thu, 26 Nov 2020 13:18:46 +0100 (CET) Subject: Re: webcamd, usb and two webcams - only one works To: Thomas Steen Rasmussen , usb@freebsd.org References: From: Hans Petter Selasky Message-ID: <9a382539-c90d-91b9-bfac-f36c0f19d3f7@selasky.org> Date: Thu, 26 Nov 2020 13:18:39 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4ChcHY3cQtz3w4T X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 12:18:49 -0000 On 11/26/20 1:04 PM, Thomas Steen Rasmussen via freebsd-usb wrote: > Hello USB friends :) > > I am having a hard time trying to get two webcams working simultaneously > on FreeBSD 12.2-STABLE r367109 GENERIC amd64. > > Each webcam works by itself, for example when taking a snapshot with > pwcview: > > sudo pwcview -h -c 1 -o foo.jpg -d /dev/video0 > > The webcam creates two video devices, video0 and video1. When I plug in > the second webcam video2 and video3 are created. But trying to use the > device doesn't work, pwcview hangs forever and multimedia/motion > complains about timeouts when speaking to the camera. > > If I swap the cameras around then "the other one" works, so I know both > cameras are fine. > > It seems somehow webcamd or maybe something in the usb system doesn't > like having two cameras in my setup. > Hi Thomas, Try setting the resolution or framerate down, because high resolution webcams need a lot of USB bandwidth! We currently don't have so many checks for excess bandwidth usage in the USB stack in FreeBSD, but I believe this is the root cause. Or make sure the webcams are connected to different USB host controllers. I recently bought a couple of USB 3.0 capable webcams to resolve the issue I had on my setup. USB 2.0 is only 480 MBit/s and many webcams simply send raw data :-) > Both are connected to a USB hub, but I have tried connecting one > directly to the computer, which is a pcengines APU3C4 btw. It did not > make a difference. > > What can I try to troubleshoot/debug this? Any more info needed? --HPS