https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192755

            Bug ID: 192755
           Summary: snd_uaudio incorrect handling of version 1 audio
                    format type descriptor
           Product: Base System
           Version: 10.0-STABLE
          Hardware: amd64
                OS: Any
            Status: Needs Triage
          Severity: Affects Only Me
          Priority: ---
         Component: usb
          Assignee: freebsd-usb@FreeBSD.org
          Reporter: juanma...@ono.com

For USB audio 1.0 formats the code in uaudio.c uses the value of bBitResolution
from the descriptor directly to choose and internal audio format from the array
uaudio10_formats. It should use the value from bSubFrameSize instead.
It is clearly specified in the official USB document for audio data formats,
page 9 under the section "2.2.2 Audio Subframe" that the endpoint must be
handled using bSubFramSize*8 bits per sample from which the device will take
the number of bits it actually uses.
In my particular case I own a device reporting bBitResolution of 24 and
bSubFrameSize of 4. An unpatched driver will be sending 3-byte subframes to the
endpoint resulting in pure noise :)

For USB 2.0 formats the code already does some conversion to avoid this same
problem, using the equivalent bSubslotSize in the function
uaudio_chan_fill_info_sub:

                 /* Map 4-byte aligned 24-bit samples into 32-bit */
                        if (bBitResolution == 24 && bSubslotSize == 4)
                                bBitResolution = 32;

                        if (bBitResolution != (bSubslotSize * 8)) {
                                DPRINTF("Invalid bSubslotSize\n");
                                goto next_ep;
                        }

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"

Reply via email to