Say what NX2NAVI_AUDIO_STRICT, the audio_bad log lines and the docs really do, as the review of the audio change found them overstated.

The review found six texts that claimed more than the code does. NX2NAVI_AUDIO_STRICT=1 does not bring 0.10.1 back
exactly: it also ends the process on a limiter attack or release that is not a number and on a mix in use with a
negative buffer count, which 0.10.1 let through, so the cfg.c comment, nx2navi.ini.example, the audren.h audio_bad
comment and the test's comment now say it does so for most of these values. Its FATAL line described the non-strict
outcome ("its sound passes through unchanged", "the renderer goes on") and then ended the process; it now ends with
"NX2NAVI_AUDIO_STRICT=1 ends the process here instead". The audren.c header and docs/architecture.md said nothing the
game sends ends the process, while OpenAudioRenderer's parameters and the request's buffer descriptors still do; both
now say a value in the game's RequestUpdate does not, and name the two that still do. The first log line of a kind
gave "N such values so far", but bad_count counts every update and every render pass that meets any kind, so it now
reads "N times so far for all kinds together"; the renderer_close line and the bad_count comment say the same.
docs/building.md and the test's comment called 0x5299 the one result the SDK hands back; the SDK hands back 0x5299,
0x5499 and 0x5699 and aborts on any other. Texts only: no behaviour changes.

The first commit's message says any other result than 0x5299 makes the SDK abort; it should read any result but
0x5299, 0x5499 and 0x5699. The branch's history is kept, so this message carries the correction.

audio_params_check (the strict runs still end with "FATAL: audio:" and the switch's name), cfg_rows_check (0
problems) and check_content passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 19:35:48 -05:00
parent 7e7fed639e
commit 9770d409d5
7 changed files with 27 additions and 22 deletions

View File

@@ -4,9 +4,10 @@
// service validates every section against the header, keeps server-side voice state, advances it in real time (one
// frame of sample_count / sample_rate seconds per render tick, signalling the renderer's event) and writes the output
// status the client expects. The mixer behind it is audio_mixer.c.
// What the game sends is never a reason to end the process (audio_bad): an update whose sections do not match the
// renderer is refused whole with AUDREN_R_INVALID_UPDATE, and a record, effect or sink whose values the renderer
// cannot use is left out of an update that is otherwise applied. NX2NAVI_AUDIO_STRICT=1 ends the process there instead.
// A value in the game's RequestUpdate is not a reason to end the process (audio_bad): an update whose sections do not
// match the renderer is refused whole with AUDREN_R_INVALID_UPDATE, and a record, effect or sink whose values the
// renderer cannot use is left out of an update that is otherwise applied. NX2NAVI_AUDIO_STRICT=1 ends the process there
// instead. OpenAudioRenderer's parameters (need) and the request's buffer descriptors (ipc.c ipc_guest) still end it.
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
@@ -83,9 +84,9 @@ void audio_bad(AudioRenderer *r, int kind, const char *fmt, ...) {
va_end(ap);
if (r->strict) {
ipc_backtrace(); // the game's frame chain when the game's update thread is here; nothing on the render thread
rt_fatal("audio: %s (NX2NAVI_AUDIO_STRICT=1)", what);
rt_fatal("audio: %s; NX2NAVI_AUDIO_STRICT=1 ends the process here instead", what);
}
rt_log("audio: %s; game frame %llu, %llu such values so far; logged once per kind", what,
rt_log("audio: %s; game frame %llu, %llu times so far for all kinds together; logged once per kind", what,
(unsigned long long)game_frame(), (unsigned long long)n);
}
@@ -846,8 +847,8 @@ static void renderer_close(void *p) {
kern_handle_close(r->event);
uint64_t bad = __atomic_load_n(&r->bad_count, __ATOMIC_RELAXED);
if (bad || r->refused)
rt_log("audren: renderer closed after %llu frames, %llu game audio values left out or refused (%llu updates "
"refused)", (unsigned long long)r->elapsed_frames, (unsigned long long)bad,
rt_log("audren: renderer closed after %llu frames, game audio values left out or refused %llu times (%llu "
"updates refused)", (unsigned long long)r->elapsed_frames, (unsigned long long)bad,
(unsigned long long)r->refused);
else
rt_log("audren: renderer closed after %llu frames", (unsigned long long)r->elapsed_frames);