From nobody Wed Aug 17 17:08:57 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M7Dy46x7Mz4YhHV for ; Wed, 17 Aug 2022 17:09:00 +0000 (UTC) (envelope-from daniel.engberg.lists@pyret.net) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4M7Dy40294z3vWt for ; Wed, 17 Aug 2022 17:08:59 +0000 (UTC) (envelope-from daniel.engberg.lists@pyret.net) Received: (Authenticated sender: daniel.engberg@pyret.net) by mail.gandi.net (Postfix) with ESMTPA id 8EA251BF203; Wed, 17 Aug 2022 17:08:57 +0000 (UTC) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Date: Wed, 17 Aug 2022 19:08:57 +0200 From: Daniel Engberg To: Harris Snyder Cc: freebsd-hackers@freebsd.org Subject: Re: Strange behavior of USB PCIe add-in cards In-Reply-To: References: Message-ID: <2c108a487ff68d38f448dc5e001faad2@FreeBSD.org> X-Sender: daniel.engberg.lists@pyret.net Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4M7Dy40294z3vWt X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of daniel.engberg.lists@pyret.net designates 2001:4b98:dc4:8::228 as permitted sender) smtp.mailfrom=daniel.engberg.lists@pyret.net X-Spamd-Result: default: False [-3.40 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_SPF_ALLOW(-0.20)[+ip6:2001:4b98:dc4:8::/64]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[2001:4b98:dc4:8::228:from]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:203476, ipnet:2001:4b98:dc4::/48, country:FR]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DMARC_NA(0.00)[pyret.net]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 2022-08-12 22:34, Harris Snyder wrote: > Hello everyone, > > I have two USB3 PCIe cards (different chipset vendors) that are both > exhibiting the same symptoms: > - They are detected and attached to the xhci driver. > - They sort of work (a usb stick seems to work for file IO) > - When an interactive device (e.g. USB sound card, mouse, or keyboard) > is connected, they seem to drop the overwhelming majority of input > events. For example, the mouse moves jerkily, at intervals of several > seconds. Most keypresses on a keyboard are missed, and occasionally a > "key up" event seems to be missed and the same key is typed > repeatedly. A USB sound card has stutters and hitches in the audio > output. > > Does anybody recognize this behaviour or know of a solution? I have > tried: > - A different PCIe slot > - Two different PCIe USB3 cards from different vendors (and different > chipset vendors - VIA and ASMedia). One of the cards uses the VIA > VL806, which some users on the FreeBSD forum have reported working... > > I'm using CURRENT, but about 2 weeks behind... > > Thanks, > Harris Hi, Early USB 3 controllers were quite unstable and unreliable so unless you're on very old hardware I'd suggest that you look for a decent USB hub instead if you need more ports. In my experience VIA (Labs) VL817 works very well in general, one device that uses it is ORICO MH4U-U3 or at least used to. You might want to go for the newer VL822 controller however finding out what chipset is used can be a bit hard but according to the product images this one uses it for example https://www.amazon.com/HOYOKI-Powered-Adapter-Slippter-Keyboard/dp/B098D7H5XD . I've also used one hub based on ASMedia ASM1074 which worked fine for my use case but the quality of the product was very questionable, this controller doesn't seem to be very common and if you find one it's usually a very poorly made product overall. There are other vendors too such as Cypress, Fresco Logic, Genesys Logic etc but when I looked they're either very rare (Cypress and Fresco Logic) or people have very mixed experiences (Genesys Logic) however their newer ones might be better such as GL3590. But if you want to give the USB PCIe cards a go the VIA one your mentioned is very old so I would highly suggest that you try to update the firmware. Unforunately that usually requires you to search various forums etc to find the flashing utility and firmware. Having a quick look this page ( https://github.com/jpmorrison/VL805 ) seems to be relevent and the other ones it links too. Do keep in mind that you may brick your card if you flash using wrong firmware or if it process hangs for whatever reason. This is also true for your ASMedia card, some controllers even include "easter eggs". See https://github.com/smx-smx/ASMTool , https://github.com/cyrozap/asmedia-xhc-re for more information. In some BIOSes you have a toggle for "PCI Timer Latency" option, usually you want to keep this at 32 or 64 which usually is the default may also be a cause. Regarding your peripherals, are they known to be working and/or have your tried using the motherboard chipset controller instead? There are also reports of stuttering using Ryzen systems which may be what you're using (search the mailing lists for more information). Providing what hardware (mainboard, cpu) are you using and arch (i386, amd64) would also be helpful in trying to debug your issue. Best regards, Daniel