Repository navigation
Radio and Video apps (v0.7.0) - #1
Draft
storagebits wants to merge 7 commits into
Draft
storagebits wants to merge 7 commits into
storagebits wants to merge 7 commits into
Conversation
kg_http_request() generalises the toolbox's GET: http://host:port/path URLs, up to three redirects (relative ones included), SHOUTcast's "ICY 200" status line, extra request headers, response headers through a callback, an idle timeout for endless streams and an optional total one. kg_http_get() is now a thin wrapper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BHBYox5ENEx9Hdd9LiBx8a
kg_media: portable loops shared by the watch and the simulator. - Radio: MP3 over HTTP into a single-producer / single-consumer ring buffer, ICY metadata stripped for the song title (UTF-8 or Latin-1), minimp3 decoding to mono with a quadratic volume; prebuffering, rebuffering after an underrun, reconnection. - Video: JPEG images cut out of an MJPEG stream (or a snapshot URL polled every second), decoded by TJpgDec, scaled and centred into 240 × 240 RGB565, triple-buffered. - Vendored in src/third_party with their licences: minimp3 (CC0; its 16 KB scratch can come from the caller, "Kronograf patch") and TJpgDec R0.03 (RGB565, 32-bit fast decode). - Tests: ICY stripping across chunk boundaries, ring wrap-around, a 1 s 440 Hz MP3 decoded end to end (879 zero crossings for 880), two JPEGs extracted from a multipart stream and decoded with the right SMPTE colours. Fixtures generated with ffmpeg. - tests/net_probe.c plays real stations and MJPEG streams without sound: the five built-in stations decode without underruns, redirects included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BHBYox5ENEx9Hdd9LiBx8a
- Watch (media.cpp): radio in two tasks on core 0 (network, decoder) with buffers in
PSRAM, Wi-Fi kept on while it plays (net_keep), screen off included; video in one task
under the app's Wi-Fi lease. URLs and volume in NVS ("kgmedia").
- Speaker (feedback.cpp): a 16-bit mono stream at the station's rate; one user at a time,
tones are dropped while the radio plays.
- Console: radio [play <n> | stop | vol <n> | url <u>], video [play | stop | url <u>].
- Simulator: demo data for screenshots (KG_RADIO, KG_VIDEO_URL, a test card decoded by
TJpgDec); with KG_NET_REAL=1 the real loops, the radio through SDL audio.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BHBYox5ENEx9Hdd9LiBx8a
- Radio: station and genre, scrolling song title, stream state, previous / play-stop / next (switches station while playing), volume; long-press the station for a custom URL. - Video: full-screen camera picture, a status overlay for the first seconds or on tap (frame rate, source size, bit rate), URL entry on the watch. - The launcher's second page: Network, Radio, Video, Remote, System, Settings. - README (features, console, simulator, development workflow), DECISIONS D57–D59, and the overview's last row: world clock, sun & moon, radio, video. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BHBYox5ENEx9Hdd9LiBx8a
A tag such as v0.7.0-beta.1 or v0.7.0-rc.1 is published as a GitHub pre-release with a note that it is a testing build, never as "Latest". Plain vX.Y.Z tags are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BHBYox5ENEx9Hdd9LiBx8a
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BHBYox5ENEx9Hdd9LiBx8a
Measured on the watch with beta.1: - The radio's network task peaked at 5.9 of its 6 KB of stack (DNS, redirects): it gets 7 KB, and its 1.5 KB staging buffer moves into the session (PSRAM). The decoder used 1.5 of 6 KB: 3.5 KB now. Six I²S DMA buffers instead of eight. The console's "radio" shows the stacks' free space while playing. - Results: no underruns with Bluetooth on, ~24 % internal RAM free while playing (31 % once stopped); video at 5–6 fps, 27 % free. - tools/mjpeg_test_server.py replaces the ffmpeg-only script, whose built-in server takes a single client and stayed stuck on a stale connection; it also serves /snapshot.jpg. Version 0.7.0-beta.2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BHBYox5ENEx9Hdd9LiBx8a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two media apps, and the first feature to follow the branch → pre-release → main workflow.
What's new
http://stream. Song titles from ICY metadata, volume, keeps playing with the screen off.src/data/kg_media.c); minimp3 and TJpgDec vendored insrc/third_party/with their licences.v0.7.0-beta.1) publish pre-releases.Checked so far
tools/mjpeg_test_server.sh.Before merging — on the watch
tools/mjpeg_test_server.shon a computer of the same network).🤖 Generated with Claude Code
https://claude.ai/code/session_01BHBYox5ENEx9Hdd9LiBx8a