- Broadcast buffer: single-producer multi-consumer ring buffer with per-client read cursors. 32KB burst-on-connect for fast playback. Never blocks producer (overwrites old data for slow clients). - Sequential playlist: play-list runs tracks one at a time using Harmony's on-end callback + condition variable for completion. - ICY metadata: set-now-playing called on each track change. - Fixed string vs pathname bug in harmony:play (etypecase mismatch). - Debug logging for client disconnect diagnosis. Verified: browser plays shuffled FLAC playlist via 128kbps MP3 stream. |
||
|---|---|---|
| .. | ||
| README.org | ||
| aac-encoder.lisp | ||
| buffer.lisp | ||
| cl-streamer.asd | ||
| cl-streamer.lisp | ||
| conditions.lisp | ||
| encoder.lisp | ||
| fdkaac-ffi.lisp | ||
| harmony-backend.lisp | ||
| icy-protocol.lisp | ||
| lame-ffi.lisp | ||
| package.lisp | ||
| stream-server.lisp | ||
| test-stream.lisp | ||
README.org
CL-Streamer
Overview
CL-Streamer is a Common Lisp audio streaming server designed to replace Icecast and Liquidsoap in the Asteroid Radio project.
Status
EXPERIMENTAL - This is an early proof-of-concept.
Features
- HTTP streaming with ICY metadata protocol
- Multiple mount points
- Thread-safe ring buffers for audio data
- Listener statistics
Dependencies
- alexandria
- bordeaux-threads
- usocket
- flexi-streams
- chunga
- log4cl
- split-sequence
Optional (for audio backend):
- harmony
- cl-mixed
- cl-mixed-mpg123
Quick Start
(ql:quickload :cl-streamer)
;; Create and start server
(cl-streamer:start :port 8000)
;; Add a mount point
(cl-streamer:add-mount cl-streamer:*server* "/stream.mp3"
:content-type "audio/mpeg"
:bitrate 128
:name "Asteroid Radio")
;; Update now-playing metadata
(cl-streamer:set-now-playing "/stream.mp3" "Artist - Track Title")
;; Write audio data (from encoder)
(cl-streamer:write-audio-data "/stream.mp3" encoded-mp3-bytes)
;; Check listeners
(cl-streamer:get-listener-count)
;; Stop server
(cl-streamer:stop)
Architecture
See docs/CL-STREAMING-ARCHITECTURE.org for the full design document.
License
AGPL-3.0