Skip to content

feat(ui): show the bitrate the PAD takes, default PAD 40 for new services - #55

Merged
DABodr merged 1 commit into
mainfrom
feat/pad-bitrate-hint
Nov 16, 2026
Merged

DABodr merged 1 commit into
mainfrom
feat/pad-bitrate-hint

Conversation

@DABodr

@DABodr DABodr commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Why

The PAD is reserved in every AU, so it is taken from the audio bitrate. With the old default of 58 bytes:

Service PAD bitrate Share
HE-AAC, 88 kbps, 48 kHz 11.6 kbps 13 %
HE-AAC v2, 56 kbps, 48 kHz 11.6 kbps 21 %
"AAC-LC", 96 kbps, 48 kHz 23.2 kbps 24 %

These figures were checked in the DAB+ superframes produced by odr-audioenc 3.6.0: 25 AU/s for HE-AAC at 48 kHz, 16.7 AU/s at 32 kHz, 50 AU/s for AAC-LC. A bench on 4 live sources (72 to 96 kbps, HE-AAC v1, slideshow running) measured the perceptual distortion compared with PAD 58: −6 to −11 % with PAD 40, and −9 to −15 % with PAD 32. With PAD 40, a 15 kB cover goes out in about 16 s, against 11 s with PAD 58.

What changes (frontend only)

  • PAD hint: shows the PAD bitrate, its share of the service bitrate and what is left for the audio, then the slide send times. The times now use the real AU rate; the old hint assumed 24 AU/s whatever the codec. The hint turns yellow above 20 % and updates when the bitrate, codec or sample rate changes. For "AAC-LC" (no flag passed), it follows odr-audioenc's own choice: HE-AAC v2 below 56 kbps, HE-AAC from 56 to 80, AAC-LC from 88.
  • Default PAD 40 for new services only. Existing services keep their value. The server-side fallback (appState.js) and commandBuilder.js still use 58, so old presets are untouched.
  • PAD 0 is explained: odr-audioenc then disables the PAD (no DLS, no slides) and the audio is bit-identical to an encode without PAD. The field now accepts 0 (min="0").
  • Invalid sizes are refused on save: odr-padenc accepts only 6 or 8 to 196 bytes and exits on any other size (1–5, 7, >196). An empty field still saves 58, as before.

Safety

  • web/app.js + web/index.html only. No change to the server, the preset format, /api/state, the ODR command lines or anything ON AIR.
  • appState.js still estimates the logo rotation timing with 24 AU/s. That is a separate subsystem and is left unchanged on purpose.
  • All 304 server tests pass. Checked on a test instance (port 9091, copy of the data without runtime/) next to production.

🤖 Generated with Claude Code

…ices

The PAD is reserved in every AU, so its cost depends on the codec and the
sample rate: HE-AAC = 25 AU/s at 48 kHz (16.7 at 32 kHz), AAC-LC = twice
that. With the old default of 58 bytes, an 88 kbps HE-AAC service lost
11.6 kbps (13 %) to the PAD, and an AAC-LC service at 96 kbps lost 23 kbps.

- The hint beside the PAD field now shows the PAD bitrate, its share of the
  service bitrate and what is left for the audio, then the slide send times.
  These are computed with the real AU rate (the old hint assumed 24 AU/s).
  It turns yellow above 20 % and follows bitrate / codec / sample rate changes.
- New services get PAD 40 bytes (a 15 kB cover still goes out in ~16 s).
  Existing services and the server-side fallback keep 58.
- PAD 0 is explained (odr-audioenc then sends no DLS and no slides).
- Sizes odr-padenc rejects (1-5, 7, >196) are refused on save: odr-padenc
  exits on them.

Frontend only: no server, preset or ODR command change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T22:47:29.915999Z 396ccee PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DABodr
DABodr merged commit 5eacd64 into main Nov 16, 2026
1 check passed
@DABodr
DABodr deleted the feat/pad-bitrate-hint branch November 16, 2026 23:08
@DABodr
DABodr restored the feat/pad-bitrate-hint branch November 16, 2026 23:09
@DABodr
DABodr deleted the feat/pad-bitrate-hint branch November 16, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant