From owner-freebsd-usb@freebsd.org Thu Nov 26 16:04:38 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 7F7624AF9C3 for ; Thu, 26 Nov 2020 16:04:38 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4ChjJ62RHNz4gPv for ; Thu, 26 Nov 2020 16:04:38 +0000 (UTC) (envelope-from hps@selasky.org) Received: by mailman.nyi.freebsd.org (Postfix) id 5392C4AF9C2; Thu, 26 Nov 2020 16:04:38 +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 5351A4AFAB0 for ; Thu, 26 Nov 2020 16:04:38 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 4ChjJ61KfSz4gPs for ; Thu, 26 Nov 2020 16:04:37 +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 2CC3F260393; Thu, 26 Nov 2020 17:04:36 +0100 (CET) Subject: Re: webcamd, usb and two webcams - only one works To: Thomas Steen Rasmussen Cc: usb@freebsd.org References: <9a382539-c90d-91b9-bfac-f36c0f19d3f7@selasky.org> <723be24d-b2fe-85df-4961-5483004050e8@gibfest.dk> <6c527c1f-62a6-3089-50b8-02cda74b4eb1@selasky.org> <13180470-0336-b115-ce31-bc392ff8da76@gibfest.dk> <638a1059-f8dc-59c5-21ff-aabc380cac28@selasky.org> <0330eee1-e22c-82b9-1c50-4e8c42bf9466@gibfest.dk> <18196ba8-f507-9318-6f00-46f0f55e6e20@gibfest.dk> From: Hans Petter Selasky Message-ID: <942b7c29-f132-711c-dd24-6bf5543b79e0@selasky.org> Date: Thu, 26 Nov 2020 17:04:28 +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: <18196ba8-f507-9318-6f00-46f0f55e6e20@gibfest.dk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4ChjJ61KfSz4gPs 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 16:04:38 -0000 On 11/26/20 4:36 PM, Thomas Steen Rasmussen wrote: > On 11/26/20 4:26 PM, Thomas Steen Rasmussen wrote: >> On 11/26/20 4:08 PM, Hans Petter Selasky wrote: >>> On 11/26/20 3:38 PM, Thomas Steen Rasmussen wrote: >>>> I tried swapping the webcams around, the error is always with the >>>> second webcam connected (so video2), regardless of which webcam it is. >>> >>> Hi, >>> >>> Might be a bug in the XHCI controller driver or XHCI HW, that the >>> isochronous transactions don't get scheduling time. >>> >>> Do you have the possibility to test on another computer running FreeBSD? >> >> I do actually, let me get that setup. >> > > Hello, > > That was easy, webcamd and pwcview was already installed :) > > I can confirm the same behaviour happens on an Intel NUC which has this > XHCI root hub: > > uhub0: <0x8086 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0 > > /dev/video0 is able to take a snapshot with pwcview, /dev/video2 hangs. > Hi, I have a Skylake here with XHCI and it doesn't exhibit this problem when using two differently branded HighSpeed UVC webcams simultaneously. I'm not sure what is causing this. Because your one webcam works alone it might have something to do with the xHCI bandwidth allocations, which are controlled by the ESIT and average TRB len as shown below. You may want to play with these fields in xhci.c: switch (edesc->bmAttributes & UE_XFERTYPE) { case UE_INTERRUPT: case UE_ISOCHRONOUS: temp = XHCI_EPCTX_4_MAX_ESIT_PAYLOAD_SET(max_frame_size) | XHCI_EPCTX_4_AVG_TRB_LEN_SET(MIN(XHCI_PAGE_SIZE, max_frame_size)); break; --HPS