Repository navigation
v0.9.0: Phase 7 Wave 5 -- Multimedia Framework
v0.9.0: Phase 7 Wave 5 -- Multimedia Framework
Phase 7 Wave 5 adds a complete audio subsystem and video framework to VeridianOS. The audio stack uses fixed-point 16.16 integer math for mixing (no floating-point in kernel), lock-free SPSC ring buffers for transport, and targets VirtIO-Sound hardware. The video framework provides image decoding (TGA, QOI), frame scaling, color space conversion, and a media player with tick-based timing. 18 files changed, ~3,900 new lines (13 new, 5 modified).
Audio Subsystem (Sprints A-1 through A-5)
- Audio mixer (
audio/mixer.rs): Fixed-point 16.16 arithmetic with saturation, multi-channel mixing with per-channel volume (AtomicU32) and mute (AtomicBool), master volume control - Ring buffer transport (
audio/buffer.rs): Lock-free SPSC ring buffer with AtomicU32 read/write positions, typedwrite_samples(&[i16])/read_samples(&mut [i16])interface - WAV parser (
audio/wav.rs): RIFF/WAVE chunk iteration, 8/16/24/32-bit PCM with conversion utilities - Output pipeline (
audio/pipeline.rs): Mixer-to-output buffering with underrun tracking and drain support - VirtIO-Sound driver (
audio/virtio_sound.rs): PCI scan for 0x1AF4:0x1059, MMIO register access, PCM stream configuration (set_params/prepare/start/stop) - Audio client API (
audio/client.rs): Stream lifecycle (create/play/pause/stop/set_volume), automatic mixer channel registration - Audio syscall stubs: 8 syscalls (AudioOpen=320 through AudioPause=327)
- Shell commands:
play <file.wav>(WAV parse + PCM queue),volume [0-100] [stream_id]
Video Framework (Sprints V-1 through V-3)
- Pixel formats (
video/mod.rs): XRGB8888, ARGB8888, RGB888, RGB565, BGR888, BGRX8888, Gray8 with full conversion - Scaling and color (
video/framebuffer.rs): Nearest-neighbor + bilinear (fixed-point 8.8 interpolation), BT.601 YUV/RGB integer conversion, alpha blending - Image decoders (
video/decode.rs): TGA (uncompressed + RLE, 24/32-bit BGR/BGRA), QOI (full spec: INDEX/DIFF/LUMA/RUN/RGB/RGBA) - Media player (
video/player.rs):RawVideoStreamwith tick-based frame timing, playback state machine (Stopped/Playing/Paused/Finished) - Image viewer (
desktop/image_viewer.rs): TGA and QOI support alongside existing PPM/BMP
Documentation
- New:
docs/AUDIO-SUBSYSTEM.md-- audio architecture, mixer, ring buffer, VirtIO-Sound, pipeline - New:
docs/VIDEO-FRAMEWORK.md-- pixel formats, scaling, decoders, media player
Build & Testing
- All 3 architectures: zero warnings, zero errors
- 29/29 boot tests passing on x86_64, AArch64, RISC-V
- 33+ new unit tests for mixer, ring buffer, WAV parser, pipeline, pixel formats, scaling, decoders, player