Add opt-in tracing for audio voice submissions and completions #1044

Open
superboynick wants to merge 3 commits from upstream-pr/1046 into main
superboynick commented 2026-11-25 17:26:31 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by superboynick on 2026-11-25T17:26:31Z.


Listening tells you something is wrong with audio but not which of three states you are in: a fragment being replayed, a feed that stopped, or completions reported too early. This adds an opt-in trace that separates them.

Per voice and per submission it records the submitted byte count, the pending compressed bytes and active buffer count on the submission path, the read and write positions, a hash over the first 64 bytes of the submission, and whether completion was reported immediately or deferred. Two submissions with the same byte count and hash point at a replay; a submission counter that stops while the queue drains points at a starved feed.

The first version of this reported the per-voice playback counters, which are only advanced by the write-ring path and read zero on the coprocessor command path this title uses. The trace now reports the queue state that path actually maintains.

Rate limited to four lines per voice per second, with a dropped-line count every five seconds. Off by default: with VICTORY_TRACE_AUDIO unset nothing is timed, hashed or printed, and the audio code path is unchanged.

Verified on local runs with audio active: several thousand trace lines, none containing buffer contents (the hash covers 64 bytes only), with non-zero queue depth visible in the output. A run without the switch emits no trace lines.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6609976509 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1046). Originally posted by [superboynick](https://github.com/superboynick) on 2026-11-25T17:26:31Z. --- Listening tells you something is wrong with audio but not which of three states you are in: a fragment being replayed, a feed that stopped, or completions reported too early. This adds an opt-in trace that separates them. Per voice and per submission it records the submitted byte count, the pending compressed bytes and active buffer count on the submission path, the read and write positions, a hash over the first 64 bytes of the submission, and whether completion was reported immediately or deferred. Two submissions with the same byte count and hash point at a replay; a submission counter that stops while the queue drains points at a starved feed. The first version of this reported the per-voice playback counters, which are only advanced by the write-ring path and read zero on the coprocessor command path this title uses. The trace now reports the queue state that path actually maintains. Rate limited to four lines per voice per second, with a dropped-line count every five seconds. Off by default: with `VICTORY_TRACE_AUDIO` unset nothing is timed, hashed or printed, and the audio code path is unchanged. Verified on local runs with audio active: several thousand trace lines, none containing buffer contents (the hash covers 64 bytes only), with non-zero queue depth visible in the output. A run without the switch emits no trace lines.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1046:upstream-pr/1046'
git switch 'upstream-pr/1046'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1046'
git switch 'upstream-pr/1046'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1046'
git switch 'upstream-pr/1046'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1046'
git switch 'main'
git merge --squash 'upstream-pr/1046'
git switch 'main'
git merge --ff-only 'upstream-pr/1046'
git switch 'main'
git merge 'upstream-pr/1046'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!1044
No description provided.