Commit Graph

3 Commits

Author SHA1 Message Date
Glenn Thompson a9e8276e9a feat: End-to-end streaming working! Custom streaming-drain + fixes
Major changes:
- streaming-drain: Custom drain that captures PCM from Harmony's pack
  buffer (raw IEEE 754 floats in unsigned-byte-8 array), converts to
  signed-16 PCM via CFFI, encodes to MP3 via LAME, and writes to
  stream server's ring buffer
- Fixed ring buffer deadlock: buffer-read/buffer-write held lock then
  called buffer-available which tried to acquire same lock. Created
  internal %buffer-available/%buffer-free-space without locking.
- Fixed ring buffer zero-length guard for unbound variable in finally
- Fixed sleep duration in drain: was dividing raw byte count by
  samplerate, now correctly converts to frames first
- Added flexi-streams wrapper for bivalent HTTP socket I/O
- Exported all public API symbols from cl-streamer package
- Added test-stream.lisp end-to-end test script

Verified: Amon Tobin FLAC -> 128kbps MP3 stream at localhost:8000
  file reports: MPEG ADTS, layer III, v1, 128kbps, 44.1kHz, JntStereo
2026-03-03 17:46:55 +03:00
Glenn Thompson 6c15441a08 feat: Add MP3 and AAC encoder FFI bindings
- LAME FFI (lame-ffi.lisp) for MP3 encoding
- FDK-AAC FFI (fdkaac-ffi.lisp) for AAC encoding
- High-level encoder wrappers (encoder.lisp, aac-encoder.lisp)
- Fix compilation warnings in buffer.lisp and icy-protocol.lisp

Both encoders tested and loading successfully:
- LAME version: 3.101
- FDK-AAC: libfdk-aac.so.2

Next steps: Harmony integration for audio pipeline
2026-03-03 16:46:29 +03:00
Glenn Thompson e1be88a54a feat: Initial cl-streamer skeleton for CL-native streaming
- Architecture document outlining Icecast/Liquidsoap replacement
- Core streaming server with ICY metadata protocol support
- Thread-safe ring buffer for audio data
- Mount point abstraction with metadata updates
- Multi-client connection handling

This is experimental groundwork for integrating with Harmony/cl-mixed
and playlisp/parsector for a pure CL streaming solution.
2026-03-03 16:30:49 +03:00