forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on a3e9dc2d50d8a2595e06b8d5fbcde7eeb078b2bcFiltered to crates/engine-audio/src/lib.rsClear filter

2026-08-10

🔊 feat(audio): volume and mute for the monitoring outputAhmet Kaan Gümüş · bb07bdc
🔊 feat(audio): volume and mute for the monitoring output

One knob down the stack: `ao_set_volume(handle, gain)` scales the samples
in the RT callback, and mute is a gain of 0.0. Not the stream's PipeWire
volume control -- WirePlumber persists every Props change into its restore
state (measured on this box: the bucket gains `mute:true` ~2 s later), so
a mute keypress would have become "edith has no sound" in tomorrow's
system mixer, which is the bug 9ab4ebd just finished removing.

Volume and mute stay independent: turning the level down while muted must
not be what makes sound come out. The button says both at once.

Mute is not pause -- the frames are still consumed, so the device clock,
and with it the picture, runs straight through.

The keybindings card's row list now scrolls inside a cap, which is the
upgrade path its own ponytail named: three more actions no longer fit a
360 px window, and now no number of them can stop fitting.

2026-08-09

🐛 fix(audio): drop MEDIA_ROLE, escape shared WirePlumber mute bucketAhmet Kaan Gümüş · 3daab1a
🐛 fix(audio): drop MEDIA_ROLE, escape shared WirePlumber mute bucket

media.role=Movie keyed edith's volume/mute restore to the shared
Output/Audio:media.role:Movie bucket — muted once by any video app,
edith inherits Mute:yes on every launch. Private media.name bucket
starts unmuted at 100% and still persists per-app volume.
🐛 fix(audio): stop the pause leaking into the playback clockAhmet Kaan Gümüş · bffc034
🐛 fix(audio): stop the pause leaking into the playback clock

The graph clock keeps ticking while our stream is inactive, so the first
process callback after a resume reported a position a whole pause ahead
of what the device had played -- and the master clock jumped by exactly
that much. Measured on test_av.mp4: a 300 ms pause moved the timeline
+0.32 s, a 1000 ms pause +1.045 s, linear, with the audio itself carrying
on from where it stopped. Video then raced to catch a clock the ear could
not follow.

Fold the inactive stretch into a skew instead of the position, so
ao_position keeps meaning "samples actually played" across a pause -- the
comparison `played_out` already assumed.

This is what tests/playback.rs:88 audio_video_plays_at_real_speed has
been red on: a true positive, not a load-sensitive margin. It fails 2/3
at --test-threads=1 as well; whether it lands under the 0.7 s bound was
decided by how much the audio clock lagged in the first 2 s (1.79 s ->
pass, 1.98 s -> fail), which offsets the constant jump.
🐛 fix(engine-audio): paused seek ate 1.49s of post-seek audioAhmet Kaan Gümüş · e259516
🐛 fix(engine-audio): paused seek ate 1.49s of post-seek audio

S6 verifier finding: ao_flush is consumed only by the next RT
callback; while paused there are none, so the new feeder filled the
ring behind the pending flag and the first post-resume callback
drained the new stream's head (measured 151 underruns = 1.49s = ring
capacity, audio then 1.5s ahead of picture).

ao_write now refuses samples while a flush is pending (accept()
mirrors consume(); feeder's retry loop parks until the RT thread
takes the flag). Probe re-run: paused seek 86 underruns = no-drop
baseline; mid-play unchanged at 130.
✨ feat(engine): seek primitives — video open_at, ao_flush, audio open_atAhmet Kaan Gümüş · 96ae365
✨ feat(engine): seek primitives — video open_at, ao_flush, audio open_at

Lane 1 of the seek slice; PlaybackSession orchestration comes next.

- demux/decode: stss sync lookup, DecodeSession::open_at decodes from
  the keyframe and discards to the target; Frame.index stays absolute.
  HW plugin ABI: vh_open renamed vh_open_at(path, target) — discards
  skip the vaGetImage readback; measured seek cost 65ms HW / 222ms SW
- engine-audio: ao_flush drains the ring consumer-side in the RT
  callback (one-shot atomic), stale PCM unplayable even when paused;
  played-position atomics untouched so clock math survives
- audio: open_at walks stts, 2-packet AAC pre-roll (MDCT overlap
  reconstructed exactly — verified 0-diff before the first PNS band),
  sample-exact trim; priming skip and seek discard unified. AAC seek
  is deliberately not bit-exact: symphonia's PNS noise LCG state
  depends on packet history; bounded <1e-3 by test instead
✨ feat(engine): audio decode, PipeWire output plugin, playback clockAhmet Kaan Gümüş · 229a569
✨ feat(engine): audio decode, PipeWire output plugin, playback clock

Wave 1 of the audio slice — three independent modules, app wiring
comes next:

- audio.rs: AAC-LC via standalone symphonia AacDecoder over the
  existing mp4 demuxer; priming trim read from the container elst
  (verified against ffprobe); channel identity pinned by
  zero-crossing tests on the 440/880 Hz fixture
- engine-audio: dlopen'd PipeWire cdylib (ao_* C ABI). App binary
  keeps zero libpipewire linkage; daemon absent fails open() in ~1ms.
  Fill capped at 1024 frames/callback: uncapped, PipeWire hands the
  sink-sized buffer and the position clock steps 256ms at a time.
  Stream time rate is 1/48000 regardless of stream rate — position
  is rescaled or the clock runs 8.8% fast on 44.1k content
- clock.rs: PlaybackClock, audio-driven with wall fallback; audio
  positions relative to last re-anchor so restarted streams re-sync;
  paused == frozen exactly, all re-anchoring through one path