From owner-freebsd-usb@freebsd.org Sun Dec 23 14:07:15 2018 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D3E21335408 for ; Sun, 23 Dec 2018 14:07:15 +0000 (UTC) (envelope-from dev@submerge.ch) Received: from c3po.matrixx.ch (c3po.matrixx.ch [80.74.145.109]) (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 3B4A575C2A for ; Sun, 23 Dec 2018 14:07:13 +0000 (UTC) (envelope-from dev@submerge.ch) Received: from [217.22.143.245] (port=34957 helo=z800.localnet) by c3po.matrixx.ch with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_1) (envelope-from ) id 1gb4PG-0002tt-Fh for freebsd-usb@freebsd.org; Sun, 23 Dec 2018 15:07:04 +0100 From: Florian Walpen To: freebsd-usb@freebsd.org Subject: SPL Crimson (rev 1) and snd_uaudio Date: Sun, 23 Dec 2018 15:07:02 +0100 Message-ID: <1898371.YXp4yczo3S@z800> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - c3po.matrixx.ch X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - submerge.ch X-Get-Message-Sender-Via: c3po.matrixx.ch: authenticated_id: florian.walpen@submerge.ch X-Authenticated-Sender: c3po.matrixx.ch: florian.walpen@submerge.ch X-Source: X-Source-Args: X-Source-Dir: X-Rspamd-Queue-Id: 3B4A575C2A X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of dev@submerge.ch designates 80.74.145.109 as permitted sender) smtp.mailfrom=dev@submerge.ch X-Spamd-Result: default: False [-0.54 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; HAS_X_SOURCE(0.00)[]; TO_DN_NONE(0.00)[]; MX_GOOD(-0.01)[submerge.ch]; NEURAL_HAM_SHORT(-0.77)[-0.772,0]; HAS_X_ANTIABUSE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; CTE_CASE(0.50)[]; ASN(0.00)[asn:21069, ipnet:80.74.144.0/20, country:CH]; HAS_X_AS(0.00)[florian.walpen@submerge.ch]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.50)[-0.504,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[submerge.ch]; NEURAL_SPAM_MEDIUM(0.05)[0.050,0]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-0.00)[country: CH(-0.00)]; RCVD_IN_DNSWL_NONE(0.00)[109.145.74.80.list.dnswl.org : 127.0.10.0]; HAS_X_GMSV(0.00)[florian.walpen@submerge.ch]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Dec 2018 14:07:15 -0000 Hello all, this is my first post here, so apologies if this isn't the most appropriate list - but i thought this topic is more related to USB than to multimedia. I treated myself to an SPL Crimson (rev 1), which is a well-built USB audio interface for musicians (4 in 4 out + SPDIF) that hits the second hand market here now for around 200$. See https://spl.audio/studio/crimson/?lang=en It is indeed USB 2.0 Audio Class compliant as advertised, but still made me jump quite some hurdles before i got it to work with FreeBSD. For the records: 1. This device is a shape-shifter and will present different USB descriptors to Windows and macOS. A USB 1.0 Audio Class compliant header is always there and works (2 in 2 out at 48000), but the USB 2.0 configuration is hidden in Windows and only appears in macOS. Moreover, the Crimson keeps that state between power cycles, so my solution was to plug it into macOS once and never into Windows again. 2. The USB 2.0 header is in the second USB configuration, which is easy enough to fix with a quirk added to /boot/loader.conf: hw.usb.quirk.0="0x0a4a 0xc150 0x0000 0xffff UQ_CFG_INDEX_1" 3. Still, there are no play and record channels detected and uaudio takes minutes to attach to the device. As it turns out, the Crimson chokes on the sample rate request messages, resulting in USB timeouts. The implementation in FreeBSD is somewhat simplistic in this regard, and i have a patch now for 12.0-RELEASE which mimics the more subtle behaviour of macOS. This gave me a working audio device with 6 in 6 out channels and sample rates up to 96000. Output seems to work fine, i didn't test recording yet since i don't have my gear here at home. Now my questions would be: a) What about adding the quirk permanently to FreeBSD? I'm unsure because it could make a Crimson in crippled Windows mode unusable, even though the device is not too useful in that state anyway. Maybe i should investigate what triggers the shape-shifting first, i do have USB dumps from macOS. b) Regarding the patch for issue 3., how would i post it for discussion and inclusion into FreeBSD? Should i file a PR or just post it here on the list, inline (~30 lines) or in an attachment? I couldn't find any policy on that for the mailing lists. Mimicking the behaviour of macOS could be beneficial in general, i see a lot of new class compliant audio interfaces coming out that are explicitly tested with apple software (iPad compatible). Thanks & best regards Florian Walpen