Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Aug 2014 17:24:56 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-usb@FreeBSD.org
Subject:   [Bug 192755] New: snd_uaudio incorrect handling of version 1 audio format type descriptor
Message-ID:  <bug-192755-17@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
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: juanmasf2@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.



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