Source-backed device compatibility#
DacConfig.quirk_policy defaults to VerifiedOnly, preserving the existing shipped compatibility tier. SourceBacked additionally selects implemented factual rules from the pinned Linux v7.3 source. Source-backed admission does not establish hardware verification. Library bit-perfect checks describe the observed sample and clock path.
The transport reads VID, PID and bcdDevice through the opened USB fd. Caller product names and claimed revisions cannot activate imported source rules. Exact identity rows with no upstream revision bounds apply to all revisions; no revision interval is invented. Native Amanero word-order rules additionally require their exact documented revision. Vendor-wide and manufacturer-string-disambiguated flag rows are retained as reference data and do not activate automatically. One row counted as exact is vendor-wide in Linux: Luxman D-10X 3255:0000. Linux treats a stored product ID of zero as matching every product of the vendor, so it applies the row's flags to any Luxman device. usbdac matches the row literally: its mapped 20 ms control-message delay applies only to a device that reports product ID 0000, and a Luxman with another product ID gets nothing from this row. Its ITF_USB_DSD_DAC flag has no mapping in either case. Widening the match would be a separate source-backed policy decision that needs the device's real IDs. Luxman row, product-zero matcher.
The flag facts contain 168 exact device rows, 30 vendor rows and two string rows, with a pinned source link for every row. Typed public SOURCE_QUIRKS metadata exposes flags and their applicability. An exact rule can have implemented and open flags; selecting it applies only the implemented subset and logs each flag's status. AlsaQuirkFlag::behavior() maps 17 of the 33 flags to a runtime rule: CTL_MSG_DELAY, CTL_MSG_DELAY_1M, CTL_MSG_DELAY_5M, IFACE_DELAY, SET_IFACE_FIRST, PLAYBACK_URB_FIXUP, GET_SAMPLE_RATE, SKIP_IMPLICIT_FB, MIXER_PLAYBACK_MIN_MUTE, MIXER_PLAYBACK_LINEAR_VOL, DSD_RAW, FIXED_RATE, IFB_SILENCE_ON_EMPTY, SKIP_CLOCK_SELECTOR, IGNORE_CTL_ERROR, TX_LENGTH and PLAYBACK_FIRST. The other 16 have no per-device behaviour, so selecting a row never changes anything for them; 46 of the 168 selectable rows carry only such flags. Some of the 16 name something the driver already does on every device, partly or in full, and some name something it does not support; the table below says which. No flag silently authorizes a vendor mode write or fabricates clock/volume evidence.
The descriptor facts account for 162 literal USB identity match sites in quirks-table.h, with original match scope, quirk categories and source lines. Macro-generated identities remain explicitly linked to the pinned source. Those registration/descriptor plans are reference-only; their MIDI, composite, endpoint and fixed-format behavior is not claimed implemented. Independently justified standard descriptor corrections are implemented separately: UAC1 AudioTrak Optoplay 0a92:0053 omits Sampling Frequency Control, while Creative Audigy 2 NX 041e:3020 and M-Audio Audiophile USB 0763:2003 require that standard control despite the absent descriptor bit. The correction preserves exact selected endpoint/rate checks and never turns SET acknowledgment into readback proof. Pinned source.
Exact native-DSD alternate/word-order facts already represented in the driver are selectable in the source-backed tier after complete descriptor checks. The special Amanero revisions remain exact. A known native-only alternate is excluded from PCM/DoP admission even when its original descriptor spells the format PCM. Exact RAW_DATA flag rows require an unambiguous stereo UAC2 RAW_DATA alternate with four-byte words and use the source-defined big-endian word order. Vendor-wide RAW_DATA matches, legacy Playback Designs carrier inference and ITF mode transactions remain inactive. ALSA adds a native DSD format to the last alternate of flagged ITF devices; that alone does not prove the alternate is invalid for PCM. ALSA also switches the vendor mode for PCM or DoP as well as native DSD. This library does not perform those mode writes or establish their state and restoration, so the flag does not guarantee mode selection on those devices. Upstream format rule, alternate rule, mode switch. Pinned layout and RAW_DATA facts.
On the iBasso DC04 Ultra (0661:0883, bcdDevice=0x0001), the captured UAC2 descriptor reports stereo RAW_DATA with four-byte slots on interface 2, alternate 4. The format bit identifies a candidate and leaves its encoding and byte order unspecified. ALSA's exact device entry enables DSD_U32_BE for this alternate. The Android validator verified native USB delivery through DSD512 at 22.5792 MHz with source-backed mode enabled on this device revision. The SMSL USB AUDIO (152a:85dd, bcdDevice=0x0315) delivered DSD64 through DSD512 the same way, on interface 1, alternate 3. Both are USB transport results from the validator runs. ALSA's DC04U patch.
Playback minimum-is-mute and linear-amplitude quirks retain raw range lattices, exact readback and raw hand-back. Linear amplitude maps the verified minimum to silence and maximum to unity; startup protection rounds down on the actual lattice so it cannot exceed its ceiling. Silence is represented as negative infinity in Rust and the explicit string "-Infinity" on the JSON bridge. Capture volume controls do not currently have an equivalent public control surface.
The 33 distinct flags comprise 17 mapped to library quirk behaviors and 16 unmapped; mapping is not proof of full ALSA parity or hardware verification. Linux treats the Luxman 3255:0000 entry as vendor-wide because product zero is a wildcard. This library retains the literal imported identity and matches PID zero exactly; it does not activate that entry for other Luxman products.
Flag coverage#
| Source flag | Behavior or remaining scope |
|---|---|
GET_SAMPLE_RATE |
UAC1-only source-backed opt-in; an unusable reply may permit an explicitly unverified tier, not proof of rate |
SHARE_MEDIA_DEVICE |
Linux kernel media-controller ownership; no equivalent in this userspace driver |
ALIGN_TRANSFER |
not mapped; partial-frame capture is unsupported. Linux keeps the whole length of a capture packet that holds whole samples but not a whole channel frame, so the frame continues in the next packet (txfr_quirk); usbdac requires whole frames and rejects such a packet |
TX_LENGTH |
implemented for exact Zoom standard UAC1 PCM playback interface1: four-byte LE audio-length prefix, capacity and loss exclude header |
PLAYBACK_FIRST |
implemented only with a proven implicit PCM IN/OUT pair; bounded existing nominal-silence bootstrap |
SKIP_CLOCK_SELECTOR |
implemented, stricter than Linux: selector reads keep the current pin, an unchanged pin is not rewritten, and any write that would change the route is refused. Linux skips only the rewrite of the current pin; when the current source is invalid, its autoclock recovery can still select another pin (clock.c) |
IGNORE_CLOCK_SOURCE |
Denon154e:500e requires the fixed8ch packed24/48k composite descriptor replacement in quirks-table.h2447-2499; no matching replacement owner, so arbitrary broken-clock bypass is forbidden |
ITF_USB_DSD_DAC |
DSD alternate interpretation and PCM/DSD vendor mode writes are unsupported; restoration ownership required |
CTL_MSG_DELAY |
implemented; source-backed opt-in, hardware unverified |
CTL_MSG_DELAY_1M |
implemented; source-backed opt-in, hardware unverified |
CTL_MSG_DELAY_5M |
implemented; source-backed opt-in, hardware unverified |
IFACE_DELAY |
implemented; source-backed opt-in, hardware unverified |
VALIDATE_RATES |
not mapped; the kernel's per-rate probe is absent. With the flag, Linux selects alternate 0, sets each listed rate and keeps the rates for which the Valid Alternate Settings control accepts the alternate (format.c). usbdac keeps discovery read-only: descriptor and RANGE checks, exact readback and the read-only Valid Alternate Settings check at activation apply to every device. The only v7.3 row is the MOTU vendor row, which is reference-only here |
DISABLE_AUTOSUSPEND |
Linux kernel runtime-PM policy; app cannot disable kernel autosuspend through audio-class controls |
IGNORE_CTL_ERROR |
implemented only for optional mixer discovery; mandatory attenuation, rate, SET and live readback failures remain visible |
DSD_RAW |
implemented only for exact identity, unambiguous stereo UAC2 RAW_DATA and 4-byte words; no vendor-wide activation |
SET_IFACE_FIRST |
implemented for PCM routes without implicit feedback: the alternate is selected before the rate is set, as Linux does for every route of a flagged device (endpoint.c). Implicit-feedback, DoP and native DSD routes keep the normal order; the two exact rows give no evidence for those. The pre-alternate original-clock rollback snapshot is skipped for flagged devices. Source-backed opt-in, hardware unverified |
GENERIC_IMPLICIT_FB |
common proof-backed subset only: the following AudioStreaming interface at the same alternate is considered when topology and cadence prove a source; vendor-class and preceding-interface fallbacks are unsupported |
SKIP_IMPLICIT_FB |
implemented; source-backed opt-in, hardware unverified |
IFACE_SKIP_CLOSE |
not implemented: alternate hand-back requires a device-specific lease contract |
FORCE_IFACE_RESET |
not mapped; partly covered on every device. Each negotiation and stream open sets alternate 0 before the selected alternate, and a pause keeps the endpoint running with silence. Linux re-prepares the playback interface after every stop of the endpoint (endpoint.c); usbdac does the same only at a stream boundary |
FIXED_RATE |
implemented only with fixed descriptor and exact live frequency/validity proof; never an ACK substitute |
MIC_RES_16 |
Mic Capture Volume mixer step=16 raw 1/256dB units (mixer.c1079-1085); this driver exposes no capture mixer volume route |
MIC_RES_384 |
Mic Capture Volume mixer step=384 raw 1/256dB units (mixer.c1073-1078); this driver exposes no capture mixer volume route |
MIXER_PLAYBACK_MIN_MUTE |
implemented: raw minimum reports silence; raw hand-back preserved |
MIXER_CAPTURE_MIN_MUTE |
capture mixer minimum means silence (mixer_quirks.c4791-4796); no public capture mixer control owner exists, and playback must not inherit this rule |
SKIP_IFACE_SETUP |
not mapped; the setup it skips does not exist here. Linux skips its probe-time alternate, pitch and rate setup (stream.c). Opening a session and reading capabilities set no alternate and program no clock on any device; negotiation and stream activation still reset to alternate 0 and set the rate |
MIXER_PLAYBACK_LINEAR_VOL |
implemented: verified raw lattice mapped as linear amplitude, safety ceiling rounded down |
MIXER_CAPTURE_LINEAR_VOL |
capture mixer linear-amplitude TLV (mixer_quirks.c4805-4811); no public capture mixer control owner exists, and playback must not inherit this rule |
IFB_SILENCE_ON_EMPTY |
implemented, narrower than Linux: after proven lock, one empty IN completion is answered with one measured-cadence silence pattern; lock drops, the source lease is not renewed, and another empty completion before lock is proven again ends the stream. Linux queues a zero-size pattern for every empty source URB, subject to FIFO capacity and xrun handling (endpoint.c), so a device that sends repeated empty URBs can play on Linux and fail here |
MIXER_GET_CUR_OK |
not mapped; nothing to undo. Linux uses the flag to clear the verdict of its sticky-GET_CUR probe, which writes the minimum and maximum and reads them back (mixer.c). usbdac has no such probe: it reads live GET_CUR and verifies each write by readback on every device, so a control whose GET_CUR really is stuck fails verification instead of being served from a cache |
PLAYBACK_URB_FIXUP |
implemented as a deeper start, not Linux's exact pool: on routes without implicit feedback the queue settings are raised to at least 48 ms and 12 transfers, the 255-packet cap still applies (at 125 us that gives 12 x 21 packets, 31.5 ms), and adaptive growth is off for that geometry. Linux forces MAX_URBS (12) URBs on the same playback routes and sets URB_ISO_ASAP (endpoint.c); libusb 1.0.27 already sets the usbfs ISO-ASAP flag on every isochronous submit. Source-backed opt-in, hardware unverified |
ALWAYS_SET_RATE |
not mapped; covered on every device for UAC 2.0 playback clocks: apply_sampling_frequency issues SET_CUR even when the current rate already matches, except under the FIXED_RATE rule with live proof. Linux skips the write when the current rate matches unless this flag is set (clock.c) |
Transport evidence and limits#
Supported ERROR/TIMEOUT/OVERFLOW/STALL packet statuses on completed OUT transfers can be charged in full when submitted geometry is valid. Reported bytes from failed packets are unconfirmed and never credited; a neighboring legal packet cannot erase the charge. Malformed descriptors, removal, cancellation and unsupported statuses remain terminal. Whole-transfer timeout accounting retains its existing separate conservative contract. Existing loss budgets and first-loss bit-perfect clearing remain unchanged.
Adaptive queuing changes the active URB count after a loss-bearing OUT completion (including coalesced callbacks, with at most one growth per worker batch) and lowers it after thirty quiet seconds. It preserves packets per URB, the 255-packet ceiling, sixteen-slot ceiling and 64 ms queue ceiling. At the default 2 ms transfers the packet ceiling binds first at 125 us (15 slots, 30 ms) and the slot ceiling elsewhere (16 slots, 32 ms); the 64 ms term never binds. Each growth step adds up to two slots, and each quiet 30 s removes one. Adaptation runs only with the default queue settings. Paired implicit-feedback pools retain their proven fixed geometry. The PLAYBACK_URB_FIXUP source rule requests a deeper twelve-URB starting geometry while retaining all caps. TX_LENGTH is limited to the exact Zoom standard UAC1 PCM playback profile on interface 1: each packet has a four-byte little-endian audio-byte-count prefix, reserved in wire capacity and excluded from payload audit, played frames and loss budgets. One bounded implicit silence pattern may reuse a previously measured, locked cadence; it consumes no application frames, contributes no rate evidence and never renews source health. Fresh source proof is required before another concealment. Source-backed PLAYBACK_FIRST uses the existing bounded OUT-silence bootstrap only for a proven implicit PCM source pair.
Feedback accepts 7/8 through 3/2 nominal before endpoint capacity checks. Direct fractional timing is the default; explicit FeedbackSmoothing::Ewma retains the legacy alpha-0.2 filter. Unit rediscovery requires an exact post-alt clock cross-check and three new completions. Diagnostics retain unsmoothed min/max/mean/population variance; opt-in trace observations separately record the policy and actual applied scheduler rate. The audible smoothing trade-off has not been measured.
A narrow default nominal tier admits full-speed UAC1 PCM without a feedback pipe. The stream always reports UNSYNCHRONIZED_ASYNC. A topped-up host ring is normal and never causes failure. Sustained empty-ring observations report producer starvation without claiming DAC FIFO drift: the host ring cannot measure that FIFO. No inserted/dropped samples conceal drift.
Clock fallback requires a successful SET and unusable readback under host policy. Positive mismatches, failed SET, multiplied routes and DSD retain strict proof. Three unusable replies are learned only for the current opened device session and exact control interface/clock entity; later attempts still read GET_CUR and readable values clear the suggestion. No learned rule survives close.
Worker 10 ms and 50 ms counters and maxWorkerGapUs record gaps outside the event pump. maxWorkerLoopGapUs records observed loop elapsed time, maxEventPumpElapsedUs measures pump duration, and maxEventPumpTimeoutOverrunUs measures pump time beyond the requested wait. None alone attributes a delay to OS scheduling. No screen-off, Doze or OEM hardware claim follows from host tests.
Successful compatibility admission emits typed CompatibilityFallback
notifications after the first healthy OUT submission: nominal_async for a
feedback-free asynchronous pipe and unverified_clock for acknowledged SET
with unusable readback. The event reaches DAC and stream listeners through
the existing deduplicating path; strict failures emit no admission event.
Opt-in support traces retain this admission and a bounded, exact
interface/entity three-strike clock suggestion. See
compatibility admission diagnostics.
The imported GET_SAMPLE_RATE exception is UAC1-only. Separately, an explicit host require_verified_rate = false policy can admit an unusable readback on other protocols including UAC2, still marked unverified; the default requires verification. A positive mismatch or failed SET is not proof.