pub struct DacConfig {Show 26 fields
pub buffer_target_ms: u32,
pub buffer_capacity_ms: u32,
pub start_threshold_ms: u32,
pub processing_buffer_target_ms: u32,
pub require_verified_rate: bool,
pub clock_settle_delay_ms: Option<u64>,
pub dsd_big_endian: Option<bool>,
pub dsd_subslot: Option<u8>,
pub padded_24bit: Option<bool>,
pub quirks: Vec<QuirkOverride>,
pub quirk_policy: QuirkPolicy,
pub allow_unsynchronized_async: bool,
pub async_fallback_policy: AsyncFallbackPolicy,
pub clock_readback_policy: ClockReadbackPolicy,
pub adaptive_queue: bool,
pub disable_feedback: bool,
pub feedback_smoothing: FeedbackSmoothing,
pub capture_feedback_trace: bool,
pub realtime_priority: bool,
pub hand_back: HandBack,
pub bus_queue_ms: u32,
pub transfers_in_flight: u32,
pub transfer_period_us: Option<u32>,
pub cancel_in_flight_on_flush: bool,
pub startup_volume: StartupVolume,
pub require_hardware_volume: bool,
}Expand description
Every tunable of a session. DacConfig::default() is what the library was
tuned with.
Fields§
§buffer_target_ms: u32Depth the host should keep the ring at: DacStream::writable_bytes
reports room up to this much. Absorbs a stall upstream (storage,
network, scheduling) shorter than this. Default 250 ms.
buffer_capacity_ms: u32Hard capacity of the ring; write never accepts more. Default 500 ms.
start_threshold_ms: u32How much audio the ring must hold before the stream starts, and before a flushed ring resumes. Never above the target. Default 100 ms.
processing_buffer_target_ms: u32The recommended ring depth while software gain is not 1.0, so a host that processes audio itself sees changes sooner. Default 100 ms.
require_verified_rate: boolRefuse to stream unless the DAC confirms the sampling frequency it was
told. Default true. Turning it off lets a DAC with a broken clock
readback play, but the stream is then never reported bit-perfect.
clock_settle_delay_ms: Option<u64>Wait after programming the clock. None uses the device’s quirk value,
else 20 ms.
dsd_big_endian: Option<bool>Native DSD byte order on the wire. None follows the device quirk
(little-endian when there is none).
dsd_subslot: Option<u8>Subslot size (1, 2 or 4) for native DSD alternate settings. None
follows the device quirk, else the descriptor.
padded_24bit: Option<bool>Prefer the 4-byte subslot for 24-bit PCM. None follows the device
quirk (off when there is none).
quirks: Vec<QuirkOverride>Quirks added to the built-in table for this session.
quirk_policy: QuirkPolicyApply supported exact-identity ALSA facts only when explicitly selected.
allow_unsynchronized_async: boolAllow streaming an asynchronous endpoint that has no explicit feedback
source, beyond the narrow default AsyncFallbackPolicy tier.
Otherwise negotiate and open_stream refuse it with
Error::ImplicitFeedbackUnsupported. Allowed, it streams at the nominal
rate, host-paced, and any drift between the DAC’s clock and the host’s
timing ends in underruns or overruns on the DAC; the stream is never
bit-perfect (DacStream::bit_perfect_blocker says why). Default false.
async_fallback_policy: AsyncFallbackPolicyNarrow default fallback; never bit-perfect.
clock_readback_policy: ClockReadbackPolicyPermit the unverified clock tier only after an acknowledged SET.
adaptive_queue: boolAdapt active URB count to loss, bounded by 64 ms and 255 packets.
disable_feedback: boolDisable explicit and implicit feedback for diagnosis. Default false.
Asynchronous nominal playback still requires allow_unsynchronized_async.
feedback_smoothing: FeedbackSmoothingExplicit feedback timing policy. Direct by default; implicit cadence vectors and nominal pacing are unaffected. Applied when a stream opens.
capture_feedback_trace: boolRetain a bounded USB feedback support trace, including raw explicit feedback bytes. Ask the listener to enable it before opening a session.
realtime_priority: boolAsk for SCHED_FIFO (nice -16 as a fallback) on the output thread.
Android only; ignored elsewhere. Default true.
hand_back: HandBackWhat to do with the hardware volume level on close.
bus_queue_ms: u32How much audio, in milliseconds, is kept queued on the USB bus: the
transfers in flight together carry about this much. The same for every
service interval and encoding. It is what a pause or a flush still plays
out, and the headroom against a late output thread. 4 to 64, default 16. A transfer carries
bus_queue_ms / transfers_in_flight of audio (2 ms by default), at most
32 packets, and the packets in flight never reach 256 (255 at most):
when the configured depth would, that cap wins and less is queued.
transfers_in_flight: u32How many isochronous transfers are in flight at once. 2 to 16,
default 8. See bus_queue_ms.
transfer_period_us: Option<u32>Optional target for one transfer in microseconds. 125 to 32,000.
When set, the worker rounds down to whole USB service intervals (at
least one), derives the slot count from the bus queue target and uses
transfers_in_flight as a ceiling. Keep two slots even when one service
interval exceeds the requested period. None uses the fixed slot count.
cancel_in_flight_on_flush: boolCancel the transfers already on the bus when the stream is flushed, so
the audio of the old position is not heard after a seek or a track
change. The output thread cancels them, waits for the host controller to
hand every one back, and resumes with wire-correct silence until the
ring has refilled. Cancelled transfers are not lost audio, not
underruns, do not clear bit-perfect, and their music is not counted as
played. pause never cancels. false lets the queue play out (up to
bus_queue_ms). Default true.
startup_volume: StartupVolumeWhat Dac::open does with the DAC’s hardware volume before any stream
can start. Default: lower it to at most -40 dB.
require_hardware_volume: boolopen_stream fails with Error::VolumeUnavailable when the DAC has no
usable hardware volume control, so the host can ask the user to allow
fixed-level output and open the DAC again with this off. negotiate and
capabilities work either way. Default true.
Implementations§
Source§impl DacConfig
impl DacConfig
Sourcepub fn with_usb_queue_profile(self, profile: UsbQueueProfile) -> Self
pub fn with_usb_queue_profile(self, profile: UsbQueueProfile) -> Self
Apply the USB queue profile. All other session settings are retained.