Public references#
Every source the design decisions cite, with what it was used for and a short excerpt from the page. The original links were fetched on 2026-11-26; the UAC3 format reference was added on 2026-11-27, and the UAC 2.0 formats document and the USB 2.0 pipe clause on 2026-11-27 from local text copies of the USB-IF PDFs. The USB 3.2 entry was added for 0.1.5 without fetching the document and has no excerpt. Every other excerpt was found in the fetched text; a source that did not say what a claim needed is listed under what the sources do not say. The Linux files are cited on the master branch of the mainline tree, which moves; the function names are the stable part.
Standards#
USB 2.0 specification#
usb.org document library (the archive usb_20_20250603.zip holds usb_20.pdf).
- Feedback format, section 5.12.4.2. A full-speed endpoint reports "an unsigned 10.10 (K=10) format" left-justified in three bytes "so that it has a 10.14 format"; a high-speed endpoint "an unsigned 12.13 (K=13) format which fits into four bytes", aligned "so that it has a 16.16 format". The lower 4 (full speed) and 3 (high speed) bits are optional extra precision.
- Pipes, section 4.7 (p. 20). "In general, data movement though one pipe is independent from the data flow in any other pipe", while control transfers can be used for "control of other pipes on the device". This is general independence. It promises nothing about host scheduling or error handling for streams that share a clock, a transfer owner or a feedback dependency.
- No retry, section 5.6 and 8.5.5. "In the case of a delivery failure due to error, no retrying of the attempt to deliver the data"; "Isochronous transactions do not support a handshake phase or retry capability."
- Used in decisions 1, 3, 7 and 8.
USB 3.2 specification#
usb.org document library, USB 3.2 Revision 1.1.
- Enhanced SuperSpeed feedback, section 4.4.8.4.1. An eight-byte report, read by usbdac as an unsigned Q32.32 count of samples per 125 microsecond bus interval. The endpoint companion descriptor (section 9.6.7) gives the bytes per service interval that usbdac uses as packet capacity.
- These section numbers are the ones the code comments and the implementation ledger give. This page's text was not fetched for this guide.
- Used in decision 7.
USB Audio Class 1.0#
- Feedback, section 3.7.2.2. "These three bytes contain the Ff value in a 10.14 format."
- Sampling frequency on the endpoint, section 5.2.3.2.3.1, with the control selector
SAMPLING_FREQ_CONTROL(3 bytes). - Volume, section 5.2.2.4.3.2. CUR, MIN, MAX and RES attributes in steps of 1/256 dB.
- Used in decisions 6, 7, 9 and 18.
USB Audio Class 2.0#
Audio2_with_Errata_and_ECN_through_Sep_14_2026.pdf.
- Clock entities. "A Clock Selector Entity represents a multi-input source selector, capable of selecting among a number of clock signals" (section 5.2.5.2.1); the Sampling Frequency Control of a Clock Source "is the only way provided by this specification to change the sampling clock" (section 3.13.11.1); the control selector is
CS_SAM_FREQ_CONTROL. - Volume, section 5.2.5.7.2. The volume attribute can "range from +127.9961 dB (0x7FFF) down to -127.9961 dB (0x8001) in steps of 1/256 dB", with CUR and RANGE requests.
- The document refers the feedback format to the USB 2.0 specification, which is why that is the source above.
- Used in decisions 6, 9, 11 and 18.
USB Audio Class 2.0 audio data formats#
Frmts20 final.pdf, Release 2.0, May 31, 2006, in the USB-IF Audio 2.0 archive.
- Packet sizes, section 2.3.1.1 (pp. 13-14). "If the sampling rate is a constant, the allowable variation on ni is limited to one audio slot", so every packet carries "INT(nav) audio slots (small VFP) or INT(nav) + 1 (large VFP)". When the average is a whole number, "ni may vary between INT(nav) - 1 (small VFP), INT(nav) (medium VFP) and INT(nav) + 1 (large VFP)". "The sink must be capable to accept a large VFP at all times." This, not the USB 2.0 specification, is the source of the one-frame packet rule.
- Type I Raw Data, section 2.3.1.7.5 (p. 17). Data "in the form of PCM-like audio slots when the actual format or even the meaning of the transported data is unknown"; it "can never be interpreted inside the audio function". The format bit therefore names a candidate, not a DSD layout.
- Used in decisions 5 and 7 and what usbdac improves.
USB Audio Class 3.0 audio data formats#
Frmts30.pdf, USB-IF Release 3.0, mirrored copy.
- DSD format, section 2.3.1.6.5. Native DSD uses 64-bit subslots (
bBitResolution = 64,bSubslotSize = 8) at one sixty-fourth of the DSD sampling rate. This is a standard format, distinct from legacy device-specific DSD layouts. - Type I format bitmap, Table A-2. PCM and DSD have distinct format bits. A PCM DoP carrier therefore uses PCM framing, including on UAC3.
- The current USB-IF audio specification archive makes the little-endian 64-bit DSD word convention explicit: D0 is newest, hence D63 is oldest. The SDK accepts chronological, MSB-first interleaved bytes and packs them accordingly.
- Section numbers are those of the linked initial release. In the April 2019 errata release (
Frmts30-Errata), DSD Format is section 2.3.1.7.5 (p. 14) and PCM Format section 2.3.1.7.1 (p. 13). - Used in decision 5 and bit-perfect output.
DSD over PCM (DoP) open standard 1.1#
DoP_openStandard_1v1.pdf from dsd-guide.com.
- "The 8 most significant bits are used for the DSD marker and alternate with each sample between 0x05 and 0xFA"; the carrier is 24-bit PCM at 176.4 kHz for a 64fs (2.8224 MHz) DSD stream.
- Used in decision 5.
The Linux kernel's USB audio driver#
These are the mainline snd-usb-audio sources. They show what a mature driver does for the same problems.
Feedback handling#
sound/usb/endpoint.c.
snd_usb_handle_sync_urb describes the standard full-speed and high-speed
units, then infers a power-of-two shift by comparing the first usable report
with the nominal rate. It applies the shift to subsequent reports and
range-checks the result before storing it. Used in decision 7.
Clock walk#
sound/usb/clock.c. __uac_clock_find_source follows selectors (it reads the current pin, one-based) and multipliers to the clock source; a comment says "FIXME: multipliers only act as pass-thru element for now". The sample rate is then set on that source. Used in decision 6.
Queue limits#
sound/usb/card.h: MAX_PACKS 6 per URB, MAX_PACKS_HS (MAX_PACKS * 8), MAX_URBS 12, and MAX_QUEUE 18 /* try not to exceed this queue length, in ms */. MAX_QUEUE is a soft limit measured in milliseconds; the limit on URBs is MAX_URBS. Used in decisions 1 and 2.
Implicit feedback#
sound/usb/implicit.c ("Special handling for implicit feedback mode") pairs an asynchronous playback endpoint with an adjacent capture endpoint or a UAC 2.0 implicit-feedback data endpoint. The ALSA configuration guide documents the implicit_fb option of snd-usb-audio: "When this is set and the playback stream sync mode is ASYNC, the driver tries to tie an adjacent ASYNC capture stream as the implicit feedback source." Used in decision 8.
Native DSD quirks#
sound/usb/quirks.c, snd_usb_interface_dsd_format_quirks, identifies legacy native DSD devices and their byte order (DSD_U32_BE or DSD_U32_LE). Its comment about the absence of a designated format bit applies to those legacy paths; UAC3 defines a standard DSD format separately. Used in decision 5.
xHCI ring segments#
drivers/usb/host/xhci.h sets TRBS_PER_SEGMENT 256; xhci-mem.c (xhci_set_link_trb) makes the last TRB of a segment a Link TRB, which leaves 255 usable. The 2015 patch that raised the size from 64 to 256 gives its reason as keeping the event ring from filling. These establish the numbers only. They say nothing about audio queue depth, and the connection to the 256-packet stall in decision 1 is a hypothesis of Flick PR #400, not something the source shows.
Android#
USB host#
USB host overview (permission, requestPermission, claimInterface), UsbDeviceConnection (claimInterface(intf, force): "true to disconnect kernel driver if necessary"; getFileDescriptor(): "intended for passing to native code") and UsbConstants, where USB_ENDPOINT_XFER_ISOC is "Isochronous endpoint type (currently not supported)". That is why isochronous audio needs usbfs through libusb. Used in decisions 16 and 18.
Bit-perfect mixer and preferred mixer attributes#
AudioMixerAttributes (API 34; MIXER_BEHAVIOR_BIT_PERFECT), AudioManager (setPreferredMixerAttributes, getSupportedMixerAttributes), and the AOSP page preferred mixer attributes: "The bit-perfect mode enables playback for master quality authenticated (MQA) and direct stream digital (DSD) formats on compatible digital to analog converters (DACs)." The attribute is optional in the audio HAL, and the platform currently allows it for USB devices and media usage only. Used in decisions 14 and 17.
AAudio#
AAudio guide: AAUDIO_SHARING_MODE_EXCLUSIVE "has exclusive access to its audio device"; "it might not be possible for the stream to have exclusive access". The NDK reference says for AAudioStreamBuilder_setSharingMode that the requested mode "may not be available" and the app can query the actual mode. Used in decisions 13 and 17.
PCM encodings#
AudioFormat: ENCODING_PCM_24BIT_PACKED and ENCODING_PCM_32BIT are API 31 and "not guaranteed to be supported by devices". Used in decision 17 and the managed output.
Remote volume#
VolumeProvider, MediaSession.setPlaybackToRemote and the AndroidX VolumeProviderCompat (marked deprecated since androidx.media 1.8.0). VOLUME_CONTROL_ABSOLUTE lets the system panel set the DAC's level directly. Used in decision 12.
Media3 AudioSink#
AudioSink: configure, handleBuffer, play, pause, flush, getCurrentPositionUs. Used in decision 4 and the Media3 page.
libusb#
Asynchronous device I/O: for isochronous transfers "the actual_length field of the transfer is meaningless" and each packet's own actual_length and status must be read; libusb_cancel_transfer is asynchronous and "freeing the transfer after it has been cancelled but before cancellation has completed will result in undefined behaviour". libusb_wrap_sys_device wraps a file descriptor, and LIBUSB_OPTION_NO_DEVICE_DISCOVERY is "typically needed on Android". Used in decisions 1, 3, 4, 16 and 18.
Signal processing#
Resampling#
Julius O. Smith, The Digital Audio Resampling Home Page (CCRMA, Stanford): band-limited interpolation with a windowed sinc, as a table of filter phases. The word "polyphase" is used in the same author's Spectral Audio Signal Processing, which says "the downsampler outputs ... are called polyphase signals". Used in decision 15.
Dither#
Lipshitz, Wannamaker and Vanderkooy, Quantization and Dither: A Theoretical Survey, J. Audio Eng. Soc. 40(5), 1992 (a university copy): "triangular-pdf dither of 2-LSB peak-to-peak amplitude is unique and optimal in the sense that it renders the first and second moments of the total error input independent". It does not make the error independent of the input in every moment. Used in decision 15.
MQA#
Master Quality Authenticated (Wikipedia; there is no primary source here). "distributed as a single 24-bit stream, with the most significant bits occupied by PCM audio compatible with non-MQA playback equipment ... with the lower-order bits rendered as noise by equipment without an MQA decoder." Used in decision 14.
Records in the three drivers' repositories#
These are the project records the decisions quote. They are evidence of what the authors saw and said, with the authors' own caveats, and not independent measurements.
Flick pull request #400#
moss-apps/Flick#400: the interface claim, and the geometry sweep with its CPU cost table. Its commits include 49ceb71e, 8e722749 and 69cb3c50.
Flick pull request #406#
moss-apps/Flick#406: legal packet sizes, timeout resubmission, exact loss accounting, and the fault-injection table. Its loss-accounting commit is e39794ac.
Flick pull requests #414 to #418#
#414 (pause, resume and seek; merged), #415 (volume on the stream's handle), #416 (live slider with a floor), #417 (volume keys) and #418 (idle release). The last four were open when this page was written.
Commits on Flick's own branch#
On feat/usb-dac-unified of johnneerdael/Flick: 1a183a52 (follow clock selectors and multipliers), 3d864cea (a quarter second of buffer), 0fbfbfe9 (live DSP stays responsive), ce5f4a7d (report what the DAC played), 4d23976a (lost audio is not bit-perfect) and 86ffa87f, the extraction point named in NOTICE.
Mornye commits and README#
mornyeapp/Mornye at af9a4d642: the USB code is in rust_backend/crates/mobile/src/usb_audio/ with its README. Commits quoted: 09ff115ef and its revert 580a9bbfe (transfers in flight), 30ec85296 (queue length), b98f81046 (clock selector), da608a663 (clock range), 208bd7569 and 4b47a0745 (resampling and dither), and 7447af0ee (idle release).
BitChord issue #1485#
kushagrasinghx/BitChord#1485: a user's report and patch on a Poco F9 Ultra, with the transfer counts and the attenuation left after a fallback.
BitChord port commits#
06628ed1 (the direct USB driver, "Phase 3 of porting Mornye's bit-perfect output paths") and ea2df7e4 (restore the DAC's level on close). The transport and volume code is under app/src/main/cpp/bitperfect/ and app/src/main/java/com/music/bitchord/playback/audio/bitperfect/.
usbdac#
The usbdac commits behind the decisions, such as eada7d7 (the same 16 ms on the bus at every interval), are in the repository.
What the sources do not say#
- The Android docs do not say "fall back to shared". They say an exclusive stream may not be available and that the app should query the mode it got. The fall-back is usbdac's reading.
- The USB Audio 2.0 text does not state the feedback format. It sends the reader to the USB 2.0 specification (section 5.12.4.2).
- The MQA article does not say where the signalling is. usbdac makes no claim about it.
- The xHCI sources do not explain the 256-packet stall. The explanation is a hypothesis.
- The USB 3.2 section numbers are not checked against the PDF. They come from the code and the ledger.
- The Dither paper supports "first and second moments independent", not "fully independent".
- The UAC 2.0 RAW_DATA format does not say what the data is. The formats document defines it as uninterpreted PCM-like slots, so legacy native DSD layouts are cited through the Linux quirks; standard UAC3 DSD is cited through
Frmts30.pdfabove. - USB 2.0 section 4.7 does not make streams on one device independent in failure. It describes pipes in general; whether one direction survives a fault in the other is usbdac's own rule.
- A third-party mirror of Alan Stern's
snd-usb-audioURB rework, cited in Flick PR #400, redirected to a sign-in page and was not used.
The UAC1 §4.3.2.3 source spans pp. 40–41. The 2019 UAC3 errata numbers PCM Format as §2.3.1.7.1, p. 13. The DSF source is Version 1.01; BS.1770-5 inter-sample figures appear in Attachment 1 to Annex 2, p. 20.