Skip to main content

sim_lib_stream_alsa/
lib.rs

1#![forbid(unsafe_code)]
2#![deny(missing_docs)]
3//! Modeled ALSA stream-host adapter (in-process simulation).
4//!
5//! Modeled tier, no native I/O. This crate is a pure-Rust, in-process MODEL of
6//! an ALSA backend, not a binding to `libasound`. The workspace forbids
7//! `unsafe` and the crate carries no `-sys`/FFI dependency, so it performs no
8//! real Linux PCM I/O -- it serves deterministic, provider-reported fake
9//! devices. The modeled tier is flagged by the default-on `model` feature; a
10//! native provider would live behind a separate FFI binding outside this repo.
11//!
12//! This crate keeps validation independent of an ALSA development package or
13//! local sound hardware. It models provider-reported ALSA PCM devices, supports
14//! `default`, `hw:*`, and `plughw:*` names, exposes host inventory/open plans,
15//! bridges playback callbacks into `ProcessBlock`, and records capture buffers
16//! as PCM stream packets. A future native provider can populate the same model
17//! from `snd_pcm_*` enumeration. ALSA sequencer MIDI is intentionally left as a
18//! follow-up for a MIDI-specific adapter so this crate remains focused on PCM.
19
20mod backend;
21mod bridge;
22mod model;
23mod runtime;
24mod site;
25
26pub use backend::{AlsaBackend, alsa_backend_symbol, alsa_transport_symbol};
27pub use bridge::{AlsaCaptureBridge, AlsaPlaybackBridge};
28pub use model::{AlsaPcmDevice, AlsaPcmName, AlsaPcmNameKind};
29pub use runtime::{AlsaLib, install_stream_alsa_lib};
30pub use site::default_modeled_alsa_site;
31
32#[cfg(test)]
33mod tests;