Skip to content

Sleep timer, per-speaker sound, and the known-speakers list with reports - #66

Merged
AirPlr merged 14 commits into
mainfrom
claude/eloquent-bohr-s3ekgl
Nov 27, 2026
Merged

AirPlr merged 14 commits into
mainfrom
claude/eloquent-bohr-s3ekgl

Conversation

@AirPlr

@AirPlr AirPlr commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Sound

  • Sleep timer on Now Playing (15–90 min) with a 30 s fade-out, plus a 1 s fade-in at the start of every cast. One MasterGain stage sits ahead of the audio bus, so it applies to every protocol and source.
  • Per speaker: bass, treble and level (−12..+12 dB) and a loudness leveler, applied per sink without touching the shared frames. They are saved per speaker, and so is the sync delay now.

Known speakers

  • The list lives in AriaCast/known-speakers, not in the app. The app ships no copy: it downloads speakers.json at most once a day (HTTPS only, no redirects, size limit, validated, only a higher version replaces the one in use), and caches it. Settings → Known speakers shows the list and can refresh it or turn the download off.
  • Three statuses: supported, supported with quirks, unsupported. An entry can carry notes for the connection doctor (in the user's language) and settings (default delay, play after SetURI on DLNA, metadata off…).
  • Matching: a speaker is matched by its model, never by the name its owner gave it. The app and the repository's bot use the same rule, and matching-cases.json is run by both test suites. DLNA discovery now reads manufacturer and model.

Reports

  • Asking: after a minute of casting to a speaker for the first time (AirPlay, AirPlay 2, DLNA, Google Cast), the app asks once "Does it work?". It asks too when a cast to a new speaker fails. Software receivers (AriaCast, Snapcast, VBAN, Sendspin) are never asked about.
  • Report speaker: in a speaker's menu, this opens the repository's issue form pre-filled with protocol, maker, model, what the user saw, and that speaker's log. The bot counts it, or adds the speaker.
  • Share log: the speaker's own log is now kept per device (400 lines each), so a report carries only that speaker's lines.
  • Other devices: Settings → Known speakers can scan the network for devices AriaCast cannot play to (mDNS and SSDP) and report one with what the scan found.

Debugging

  • More logging per speaker: DLNA SOAP calls and transport state, Cast player state changes, and which list entry applied.
  • Crash screen: debug builds show a crash screen with the stack trace and a Share button, in a separate process.
  • StartupSmokeTest: Robolectric starts the whole app on Android 10 and 14 with the real cast service bound. It runs once after the setup, and once while finishing the setup with one speaker per protocol listed. Any uncaught exception fails it. Android 15+ would need Java 21 in Robolectric, and the CI runs Java 17.

Checked

  • 296 unit tests pass locally (testGithubDebugUnitTest). The release build (R8) and lint passed at 4a0a736.
  • Not checked on a phone. A debug build of 4a0a736 was reported to crash after the setup. I could not reproduce it: the startup test passes on Android 10, 12, 14, 15 and 16, and a clean build of e3c213e (with the crash screen) went out for testing. If it still crashes, the crash screen will say where.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XZTMETapPkNvc9xdPLcfZu

- Sleep timer on Now Playing (15-90 min) with a 30 s fade-out, plus a
  1 s fade-in at the start of every cast. One MasterGain stage sits ahead
  of the audio bus, so it applies to every protocol and source.
- Per-speaker bass/treble/level (-12..+12 dB) and a loudness leveler,
  applied per sink without touching the shared frames, and saved per
  speaker. Per-speaker sync delay is now saved and restored too.
- DeviceQuirks: connection doctor notes for WiiM over DLNA and
  shairport-sync over AirPlay 2, and the speaker's manufacturer/model in
  the copied report. DLNA discovery now reads manufacturer and modelName.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZTMETapPkNvc9xdPLcfZu
- DeviceQuirks becomes a table of known speakers (works / works with a
  catch / does not work) with symptoms, what to do, version and evidence.
  Only behavior with evidence is listed.
- docs/SPEAKERS.md is generated from that table; a unit test fails when
  they drift (UPDATE_SPEAKERS_DOC=1 regenerates it).
- PacketLogger lines can carry the speaker's host, and the per-speaker
  cast logs now do.
- "Report speaker" (long-press in the Send tab, and in the connection
  doctor) shares who the speaker is, what is known about it, the cast
  state, its settings and its log lines, with addresses shortened.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZTMETapPkNvc9xdPLcfZu
- PacketLogger tags each line with the speaker it is about, by default from
  the coroutine it runs in (DeviceContext), and keeps a history per speaker
  (400 lines, up to 32 speakers) beside the global 500, so a chatty speaker
  cannot evict another's. Report speaker reads from it.
- Session start and end lines, with the speaker's identity and how it ended.
- DLNA: status and timing of Stop/SetAVTransportURI/Play/SetVolume, the UPnP
  fault when refused, who fetches the stream and for how long, and the
  renderer's transport state after Play and on every change.
- Google Cast: player state changes with the idle reason.
- AriaCast: the receiver's handshake, connection lifetime, reconnects and the
  receiver's underrun/overrun counts. Volume failures that were swallowed are
  now logged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZTMETapPkNvc9xdPLcfZu
@github-actions github-actions Bot added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 27, 2026
- data/speakers.json is the single source: shipped as an asset, published as
  docs/SPEAKERS.md (generated, with a test that fails on drift), and read from
  GitHub once a day by the app (opt-out, HTTPS only, no redirects, size-limited,
  must validate and have a higher version).
- The file is treated as untrusted: a bad file is refused whole, a bad entry is
  skipped, every entry needs words to match so it cannot apply to everything, and
  the only settings it can change are five known ones within fixed limits.
- Those settings are wired in: DLNA Play after SetAVTransportURI, DLNA initial
  Stop, DLNA stream content type, a starting delay, and whether metadata is sent.
- Settings -> Known speakers shows the list, by verdict, with symptoms, what to
  do and evidence. Adds a "not supported" verdict (e.g. Echo Show 5 and Hub).
- The doctor's notes come from the list, in the user's language.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZTMETapPkNvc9xdPLcfZu
…entries from it

- "Report speaker" opens the Speaker report issue form pre-filled (speaker,
  protocol, details, version) and copies the log for the user to paste;
  "Share log" keeps the old share sheet. The form's options and the app's
  protocol names are checked against each other by a test.
- scripts/speaker_report.py turns a report into a proposed entry for
  data/speakers.json. The issue text is untrusted: it is cut into fields,
  validated by the same rules the app applies, and written by a JSON
  serializer; the log is never stored, and config can never come from an issue.
- The workflow opens a pull request for review, passes the issue to the script
  only through environment variables, and runs on a GitHub-hosted runner.
- A golden file ties the script to the app: the script's tests check it
  produces exactly scripts/testdata/generated-sample.json, and the app's tests
  check it parses that file with no skipped entries.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZTMETapPkNvc9xdPLcfZu
A repository of its own (AriaCast/known-speakers) means a report, however many,
never triggers a build of the app. The bot, the report form, the generated README
and the list's rules now live there.

- The app reads speakers.json from that repository and ships no copy: the list is
  empty until the first download, then kept on the phone.
- Three statuses (Supported, Supported with quirks, Unsupported) replace the four
  verdicts; entries carry how many reports were counted per status and whether a
  maintainer locked them. Schema 2; a file of another schema is refused whole.
- Report speaker opens the known-speakers form, pre-filled.
- Tests read a snapshot of the list, the bot's sample output and the form from the
  test resources. scripts/e2e is untouched.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZTMETapPkNvc9xdPLcfZu
After 60 seconds of casting to a speaker it has not been asked about, the cast
service asks once: a dialog over the app if it is on screen, a notification with
the two answers if not. "It works" is recorded on the phone and offered for the
public list only if the list does not already say the speaker is supported.
"There's a problem" asks whether it plays with something wrong or not at all, and
what happens, then opens the pre-filled known-speakers report with the status and
the note filled in.

The rules (what counts as the same speaker, when to ask, when to offer sharing)
are in SpeakerFeedback and are unit-tested; the answers live in a small ledger on
the phone and are never sent anywhere by themselves.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZTMETapPkNvc9xdPLcfZu
If casting to a single speaker fails within the first minute, ask once whether to report
it, with "doesn't work" already chosen, instead of waiting for a minute that never comes.
With several speakers a failure does not say which one it was, so nothing is asked. The
report made from the dialog now carries the cast's state and last error, which it lacked
because the dialog is not bound to the service.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZTMETapPkNvc9xdPLcfZu
…he scan found

A scan the user starts (about eight seconds) sends a UPnP search and listens for a list
of mDNS service types, reads a device's description only from the address that answered
(no redirects, size-limited) and shows what is neither a DLNA renderer nor already listed
as a speaker. Tapping a result opens a pre-filled report with no protocol, a default
symptom in English, and a fingerprint of what the scan learned, addresses shortened.

The reading and grouping is pure and unit-tested; the network part is not. The list of
mDNS types is best effort: a type nobody announces just finds nothing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZTMETapPkNvc9xdPLcfZu
…st in the README

- The doctor read StateFlow.value in composition for its "Report" rows, so they never
  updated; it now collects the state. The doctor's language no longer comes from the
  context's configuration.
- README: the known-speakers list, the "does it work?" question and the report flow.

A release build (R8) succeeds and keeps the serializers the list needs. Lint still
reports MissingTranslation for the new strings, which exist in English and Italian
only; the project already had six of these and leaves the rest to Weblate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZTMETapPkNvc9xdPLcfZu
In a debug build, an uncaught crash opens a screen with the stack trace and a Share button,
so a tester without a computer can say why the app stopped. The screen runs in a process of
its own (":crash"), which is what lets it stay up while the main process dies, and the app
skips its start-up in that process so nothing starts twice. Release builds are untouched.

The report's text is unit-tested. Compiled but not run on a device: whether the screen
actually appears after a real crash is not yet verified.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZTMETapPkNvc9xdPLcfZu
Run against the real list, the bot (and the app's report form) treated almost every report
as a new speaker: the form proposed the name the owner had given the device ("Studio"), and
the bot looked for an entry's word as an exact match. The app and the bot now share one rule
(a word of the entry found in the device's name, model or maker; the longest word found in
the name or model wins, a maker's word counts 1), and the same file of cases is run by both
sides' tests (resources/matching-cases.json).

- The report form no longer proposes the user-given name: with no brand and model the
  Speaker field is left empty for the reporter.
- Only speakers are asked about or reported. AriaCast receivers, Snapcast, VBAN and Sendspin
  are software, and have no popup and no "Report speaker".
- "Works" no longer copies the log; "there's a problem" and the menu still do.
- Offering the list after "it works" looks at the entry the report would be counted in.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZTMETapPkNvc9xdPLcfZu
Robolectric launches MainActivity with the real cast service bound, on
Android 10 and 16: once after the setup, and once while finishing the
setup with one speaker per protocol in the list. Any uncaught exception,
on the main thread or a background one, fails the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZTMETapPkNvc9xdPLcfZu
…n Java 17

The CI uses Java 17, and Robolectric needs Java 21 for Android 15 and later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZTMETapPkNvc9xdPLcfZu
@AirPlr AirPlr changed the title Add sleep timer, per-speaker sound and known-speaker notes Sleep timer, per-speaker sound, and the known-speakers list with reports Nov 27, 2026
@AirPlr
AirPlr merged commit 3c2bb64 into main Nov 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants