Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Apr 2013 21:20:34 -0400
From:      Ed Maste <emaste@freebsd.org>
To:        freebsd-usb@freebsd.org
Subject:   snd_uaudio 2.0 class support for 24-bit samples with bSubslotSize=4
Message-ID:  <CAPyFy2DoZP9MXXNpte16Cm6Kqh_1s-M4j1XG8vQ4gPF95cNdsQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
I have a Focusrite Scarlett 2i2 USB recording interface.  It's a USB
audio 2.0 class device but unfortunately doesn't work with snd_uaudio.
 As it turns out, it's a 24-bit device (as reported in bBitResolution)
but uses 4 bytes per sample (bSubslotSize) and thus falls to the
"Invalid bSubslotSize" case in uaudio_chan_fill_info_sub().  I'm not
sure how common this is, but it is allowed by the spec.

With the hackish patch below the device works well for playback (I
haven't tested recording), with the side effect of falsely claiming to
be a 32-bit device in dmesg and elsewhere.

Index: uaudio.c
===================================================================
--- uaudio.c    (revision 249781)
+++ uaudio.c    (working copy)
@@ -1413,9 +1414,12 @@
                        bChannels = asid.v2->bNrChannels;
                        bBitResolution = asf1d.v2->bBitResolution;
                        bSubslotSize = asf1d.v2->bSubslotSize;
+                        if (bBitResolution == 24 && bSubslotSize == 4)
+                               bBitResolution = 32;

                        if (bBitResolution != (bSubslotSize * 8)) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPyFy2DoZP9MXXNpte16Cm6Kqh_1s-M4j1XG8vQ4gPF95cNdsQ>