Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions docker/pipewire/10-virtual.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Declarative virtual audio devices for the headless StreamLib container.
#
# StreamLib's Linux audio is cpal -> ALSA (packages/audio), and the container
# bridges ALSA -> PipeWire via `pipewire-alsa`. This drop-in declares a virtual
# null sink (plus its recordable `.monitor` source) at PipeWire startup so the
# devices exist with no hardware, no `/dev/snd`, and no imperative `pactl` race.
# StreamLib reaches this daemon directly: its backend chain dlopen's
# libpipewire, falling back to libasound and then to the null backend. This
# drop-in declares a virtual null sink (plus its recordable `.monitor` source)
# at PipeWire startup so the devices exist with no hardware, no `/dev/snd`, and
# no imperative `pactl` race.
#
# Loaded from /etc/pipewire/pipewire.conf.d/ — keys are UNQUOTED, string values
# ARE quoted; a syntax error silently drops the section.
Expand Down
6 changes: 5 additions & 1 deletion runtime/streamlib-engine/src/core/context/audio_clock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ impl AudioClockConfig {
/// Context passed to audio clock tick callbacks.
#[derive(Debug, Clone, Copy)]
pub struct AudioTickContext {
/// Machine monotonic timestamp in nanoseconds, the epoch a frame timestamp carries.
/// Machine monotonic timestamp in nanoseconds, the epoch a frame timestamp
/// carries. It is the wake time rather than the expiration the tick was
/// scheduled for, and a catch-up burst may hand every tick the same one, so
/// a block's instant derives from an anchor plus samples already delivered
/// — never from one tick's stamp.
pub timestamp_ns: i64,
/// Number of samples to produce this tick (per channel).
pub samples_needed: usize,
Expand Down
2 changes: 0 additions & 2 deletions runtime/streamlib-engine/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ pub mod processors;
pub mod pubsub;
pub mod rhi;
pub mod runtime;
pub mod sync;
pub mod texture;
pub mod utils;
// Linux-only: winit is a Linux-target engine dependency, and the window seam
Expand All @@ -60,7 +59,6 @@ pub use graph_snapshot::*;
pub use processors::*;
pub use rhi::{GlContext, GlTextureBinding, NativeTextureHandle, RhiBackend, gl_constants};
pub use runtime::*;
pub use sync::*;
pub use texture::*;
pub use utils::*;

Expand Down
16 changes: 0 additions & 16 deletions runtime/streamlib-engine/src/core/observability/perception.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,6 @@ pub struct SampledFrame {
pub timestamp_ns: i64,
}

/// A sampled audio buffer for AI perception.
#[derive(Debug, Clone)]
pub struct SampledAudio {
/// Audio samples (f32 interleaved).
pub samples: Vec<f32>,
/// Sample rate in Hz.
pub sample_rate: u32,
/// Number of channels.
pub channels: u32,
/// Duration in milliseconds.
pub duration_ms: u32,
}

/// Current status of a processor.
#[derive(Debug, Clone)]
pub struct ProcessorStatus {
Expand All @@ -68,9 +55,6 @@ pub trait AgentPerception: Send + Sync {
/// Sample a video frame from a processor's output.
fn sample_video(&self, id: &ProcessorId, config: SampleConfig) -> Option<SampledFrame>;

/// Sample audio from a processor's output.
fn sample_audio(&self, id: &ProcessorId, duration_ms: u32) -> Option<SampledAudio>;

/// Get current status of a processor.
fn processor_status(&self, id: &ProcessorId) -> Option<ProcessorStatus>;

Expand Down
104 changes: 0 additions & 104 deletions runtime/streamlib-engine/src/core/sync.rs

This file was deleted.

8 changes: 4 additions & 4 deletions runtime/streamlib-engine/src/iceoryx2/delivery_profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ pub enum DeliveryProfile {
/// stale sample has no value once a fresher one exists.
Latest,
/// FIFO with a bounded backlog: read next in order, evict + count the
/// oldest under sustained overrun, deeper ring. Sample streams — audio,
/// encoded frames — where order matters but the producer must never block.
/// oldest under sustained overrun, deeper ring. Sample streams — encoded
/// frames — where order matters but the producer must never block.
EverySample,
/// Lossless FIFO: read next in order, the producer blocks rather than
/// drop, deeper ring. File writers, muxers, loggers where every sample
/// must be delivered.
/// drop, deeper ring. Audio, file writers, muxers, loggers where every
/// sample must be delivered.
///
/// What this configures is the *publisher's* policy, and that is as far as
/// it reaches today: the consumer's host mailbox
Expand Down
9 changes: 4 additions & 5 deletions runtime/streamlib-engine/src/iceoryx2/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,10 @@ impl Iceoryx2Node {
/// [`crate::iceoryx2::delivery_profile_for_input_port`].
///
/// `enable_safe_overflow` derives from that same profile's overflow policy.
/// When `true` (the realtime default — `Overflow::DropOldest`), the subscriber
/// buffer auto-evicts the oldest sample on overflow and the publisher's
/// `send()` never blocks. When `false` (`Overflow::Block`, the `lossless`
/// profile), the producer blocks until the consumer drains a slot — reserve
/// for muxers / file writers that need every sample in order.
/// When `true` (`Overflow::DropOldest`), the subscriber buffer auto-evicts
/// the oldest sample on overflow and the publisher's `send()` never blocks.
/// When `false` (`Overflow::Block`, the `lossless` profile), the producer
/// blocks until the consumer drains a slot.
pub fn open_or_create_service(
&self,
service_name: &str,
Expand Down
14 changes: 6 additions & 8 deletions runtime/streamlib-engine/src/iceoryx2/overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum Overflow {
/// Buffer evicts oldest sample to make room; publisher never blocks.
/// The realtime-media default — producer represents real-world
/// time advancing and must not be made to wait. Glitches on the
/// consumer side beat freezing the whole pipeline.
/// Buffer evicts oldest sample to make room; publisher never blocks — a
/// producer that represents real-world time advancing must not be made to
/// wait, and glitches on the consumer side beat freezing the whole pipeline.
#[default]
DropOldest,
/// Producer blocks until the consumer drains a slot. Use only when
/// every sample must be delivered in order — file writers, muxers,
/// loggers — and the consumer's mailbox `buffer_size` is sized for
/// the expected hiccup envelope.
/// Producer blocks until the consumer drains a slot. Use only where every
/// sample must be delivered in order and the consumer's mailbox
/// `buffer_size` is sized for the expected hiccup envelope.
Block,
}

Expand Down
4 changes: 0 additions & 4 deletions runtime/streamlib-engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ pub use core::{
ConnectionDefinition,
// Processor traits (mode-specific)
ContinuousProcessor,
DEFAULT_SYNC_TOLERANCE_MS,
Error,
GlContext,
GlTextureBinding,
Expand All @@ -128,13 +127,11 @@ pub use core::{
TexturePoolDescriptor,
TextureUsages,
TimeContext,
are_synchronized,
gl_constants,
// Port marker traits and helpers for compile-time safe connections
input,
media_clock::MediaClock,
output,
timestamp_delta_ms,
};

// GPU Backends - Metal and Vulkan
Expand Down Expand Up @@ -288,7 +285,6 @@ pub mod sdk {
pub use crate::core::prelude;
pub use crate::core::rhi;
pub use crate::core::runtime;
pub use crate::core::sync;
pub use crate::core::texture;
pub use crate::core::utils;

Expand Down
8 changes: 0 additions & 8 deletions runtime/streamlib-engine/src/linux/audio_clock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,6 @@ fn run_timerfd_loop(
return Err(Error::Runtime(format!("timerfd read failed: {}", err)));
}

// FIXME(audio-backend): one read stamps every tick in a catch-up burst, so
// N blocks of samples claim the same instant, and the value is the wake
// time rather than the expiration the timerfd was programmed for. Both
// follow from the timer's own absolute schedule. Deferred because a
// free-running clock's tick time is meaningless until a device paces it:
// the audio backend is OPEN (docs/plan/ARCHITECTURE.md §Media I/O), and it
// also owns the capture path's discarded driver stamp
// (cpal `InputCallbackInfo::timestamp().capture`).
let timestamp_ns = MediaClock::now().as_nanos() as i64;

if expirations > 1 {
Expand Down
1 change: 0 additions & 1 deletion sdk/streamlib-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ pub mod sdk {

#[cfg(target_os = "linux")]
pub use streamlib_engine::core::processor_owned_window;
pub use streamlib_engine::core::sync;
pub use streamlib_engine::core::texture;
#[cfg(target_os = "linux")]
pub use streamlib_engine::core::window_event_pump;
Expand Down
Loading