Skip to content

Show channel counts and verified speaker layouts in Song Info - #1867

Merged
cucadmuh merged 3 commits into
mainfrom
feat/1843-verified-channel-layout
Nov 16, 2026
Merged

cucadmuh merged 3 commits into
mainfrom
feat/1843-verified-channel-layout

Conversation

@cucadmuh

Copy link
Copy Markdown
Member

Summary

Fixes #1843.

  • Song Info keeps the server's channel count until playback can verify a conventional speaker grouping, then shows labels such as 5.1, 6.0 or 4.0. Layout is never guessed from the number of channels.
  • Verify native FLAC defaults/explicit masks, original WAVEFORMATEXTENSIBLE PCM/float masks, and Vorbis's codec-defined mappings. Unsupported or ambiguous evidence stays unknown. Original-file details are not relabelled using a transcoded stream's grouping.
  • Channel information is intentionally Song Info only: the queue's technical line and other player surfaces are unchanged. Track/server/generation guards prevent stale or cross-server layout updates.

Implementation and compatibility

  • Add an optional channelLayout object to the existing audio:format payload: mainChannels, lfeChannels and an explicit provenance. No commands/events are renamed or removed; existing channel counts and playback identity fields remain intact.
  • A shared, bounded read-through observer captures at most 1 MiB of bytes already read during normal stream initialization. No extra reads, seeks, server requests or event emissions; no audio-processing, downmix or output-routing changes.
  • Publish grouping only after a nonempty frame decodes and the codec/header/decoded channel counts agree. Invalid, partial, height/ambisonic/discrete, skipped, incomplete and over-budget evidence is not presented as a conventional layout.
  • No database migration, persisted-setting change, dependency update or new per-track request. Server-provided channel counts remain optional; verified original-file evidence can supply the grouping when that optional count is absent.
  • Song Info retains captured metadata ownership across server changes and does not subscribe to playback changes while closed. Cleared playback generations cannot resurrect old format/layout proof.

Validation

Independent frontend and native reviews found no remaining correctness blockers. Regression coverage includes metadata/count fallback, exact-generation redelivery, owner/canonical-key matching, original-versus-transcoded provenance, closed-modal render commits, parser limits, transparent source I/O and buffered/streaming constructor behavior.

Final frontend gates all passed: npm run lint, npm run dep:check, npm test (893 suites / 7170 tests), npm run prebuild:release-notes, npx tsc --noEmit, Vitest coverage and the frontend hot-path coverage gate (15 files, none below threshold). Commands ran inside the Nix development environment.

Native workspace tests: 2631 passed, 0 failed, 19 ignored. Workspace Clippy (-D warnings) passed.

Runtime benchmark

  • Applicability: required (native opening and shared playback metadata/UI).
  • Not run at the maintainer's explicit request for this PR: the machine is concurrently compiling, so base/head timing and CPU comparisons would not be reliable. No comparable reports or performance claims are presented. This is an explicit execution exception, not a claim that the benchmark is inapplicable.
  • No temporary baseline worktree, profile/server inspection or benchmark run was performed.

Manual verification

  1. Open Song Info for a track with a server-provided count: it keeps that count until there is authoritative playback evidence for the same original file.
  2. Play a supported multichannel FLAC, extensible WAV or Vorbis stream: verified conventional grouping appears in Song Info. Count-only/ambiguous layouts do not become a guessed 5.1.
  3. Switch tracks/servers, replay the same track, or transcode it: old or other-server proof must not relabel the source file.
  4. Confirm that the queue's technical line is unchanged. Path handling is outside this change.

Real-webview visual checks and full compressed Vorbis fixture integration were not performed in this session. Native FLAC and synthetic extensible WAV constructor paths are covered by tests.

@cucadmuh
cucadmuh merged commit fdc9f08 into main Nov 16, 2026
11 checks passed
@cucadmuh
cucadmuh deleted the feat/1843-verified-channel-layout branch November 16, 2026 13:57
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.

[Feature]:

1 participant