Ramp a changed volume across the audio frame instead of applying it at once.

The mixer applied each voice's mix volume and each splitter destination's
volume to a whole 5 ms frame as one constant, so the level jumped at the
frame's first sample whenever the game moved a volume, which is heard as a
click. It now keeps what each voice and each splitter destination was mixed
with in the frame before and goes from there to the new value in equal steps
across the frame's samples, as the console's renderer does. An unchanged
volume stays on the constant path.

A voice that has just started, one that was silent in the frame before or was
moved to another mix or splitter, a destination that is new or was moved, and
the first frame after the renderer starts take the new volume at once.

NX2NAVI_AUDIO_RAMP=0 turns the ramps off. The audio statistics line counts the
render passes that ramped a volume. tests/audio_mixer_check.py builds the
mixer with the rest of the runtime stubbed and checks the ramps and the cases
that must not ramp.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-12 15:10:29 -05:00
parent 202fd47ceb
commit 42d16e7f0b
8 changed files with 476 additions and 10 deletions

View File

@@ -5,7 +5,8 @@
//
// Per 5 ms frame the render thread (audren.c, renderer lock held) decodes every started voice (PCM8/16/24/32, float,
// DSP-ADPCM) along the sample path the voice clock consumes, resamples it linearly, runs the voice biquads, scales it
// into its destination mix, folds the submixes, runs the mix effects and writes the device sink's mix (stereo, or 5.1
// into its destination mix (a volume the game changed is reached in equal steps across the frame's samples,
// accumulate_ramp), folds the submixes, runs the mix effects and writes the device sink's mix (stereo, or 5.1
// with NX2NAVI_AUDIO_CHANNELS, output_channels) into a single-producer single-consumer ring. The SDL audio thread drains
// that ring without taking any lock: an empty ring
// plays silence and never blocks the render thread or the guest. NX2NAVI_AUDIO=none (or NX2NAVI_AUDIO_OFF) mixes without a
@@ -41,8 +42,15 @@
#define SPLITTER_UNUSED 0xffffffffu
#define dm_guest_write_prepare(p, n) ((void)(p), (void)(n)) // guest memory is plain host memory on Windows
typedef struct { float vol[24]; int32_t dest; uint8_t used; AudrenBiquadFloat biquads[2]; float state[2][2]; } SplitDest;
typedef struct {
float vol[24]; int32_t dest; uint8_t used; AudrenBiquadFloat biquads[2]; float state[2][2];
// volume ramps (audio_mixer_render): the volumes it had in the render pass before, the mix it went to and how many
// of that mix's buffers; prev_ok 0 when that pass did not use it
float prev[24]; int32_t prev_dest, prev_buffers; uint8_t prev_ok;
} SplitDest;
typedef struct { int32_t ndest; int32_t *ids; } SplitInfo;
// volume ramps: a mix in the render pass before: its volume, the splitter it went to, its buffer count, whether in use
typedef struct { float volume; uint32_t splitter; int32_t buffers; uint8_t ok; } MixPrev;
typedef struct {
Reverb3d *reverb; Reverb3dParam param; int pending;
float *delay, detector[6], compression[6], peak[6], minimum[6]; int position[6], delay_max, channels;
@@ -73,6 +81,10 @@ typedef struct Mixer {
double level_sum, level_peak; uint64_t level_count, level_frames; int first_sound_logged;
double input_sum[6]; // NX2NAVI_TRACE=audio: the device sink's inputs, squared and summed
int prefill; // render blocks
int ramp; // NX2NAVI_AUDIO_RAMP: volumes ramp across a frame (accumulate_ramp)
int snap; // the next pass has no pass before it to ramp from (open, start)
MixPrev *mix_prev; // each mix in the pass before
uint64_t ramps, ramp_passes; // ramps made; render passes with at least one (audio_mixer_ramp_stats)
uint64_t trace_pass, trace_seen[1024]; // NX2NAVI_TRACE=audio: render passes; the pass each voice was last mixed in
uint64_t trace_buf[1024]; // and the wave buffer address it read in that pass
uint64_t trace_pair[1024]; // the last shared-buffer pair logged for each voice (other voice, address)
@@ -571,7 +583,8 @@ void audio_mixer_open(AudioRenderer *r) {
m->ndest = r->param.splitter_destination_count;
m->split = calloc((size_t)(m->nsplit ? m->nsplit : 1), sizeof *m->split);
m->dest = calloc((size_t)(m->ndest ? m->ndest : 1), sizeof *m->dest);
if (!m->buf || !m->offset || !m->split || !m->dest) rt_fatal("audio mixer tables");
m->mix_prev = calloc((size_t)r->param.submix_count + 1, sizeof *m->mix_prev);
if (!m->buf || !m->offset || !m->split || !m->dest || !m->mix_prev) rt_fatal("audio mixer tables");
m->effect = calloc((size_t)(r->param.effect_count ? r->param.effect_count : 1), sizeof *m->effect);
m->effect_order = calloc((size_t)(r->param.effect_count ? r->param.effect_count : 1), sizeof *m->effect_order);
if (!m->effect || !m->effect_order) rt_fatal("audio effect tables");
@@ -590,6 +603,10 @@ void audio_mixer_open(AudioRenderer *r) {
m->prefill = PREFILL_DEFAULT_MS / 5;
}
m->channels = output_channels();
m->ramp = cfg_bool("NX2NAVI_AUDIO_RAMP");
m->snap = 1;
rt_log("audio: NX2NAVI_AUDIO_RAMP=%d: a changed volume %s", m->ramp,
m->ramp ? "is reached in equal steps across the frame" : "applies to the whole frame at once");
r->mixer = m;
atomic_store(&m->playing, r->state == 0);
output_open(m, r->param.sample_rate);
@@ -601,6 +618,8 @@ void audio_mixer_set_running(AudioRenderer *r, int running) {
if (!running) {
atomic_store_explicit(&m->flush_until, atomic_load_explicit(&m->wr, memory_order_acquire), memory_order_release);
atomic_fetch_add_explicit(&m->stop_epoch, 1, memory_order_release);
} else {
m->snap = 1; // what was mixed before the stop is not the sample before the next pass's first
}
atomic_store_explicit(&m->playing, running, memory_order_release);
}
@@ -627,6 +646,7 @@ void audio_mixer_close(AudioRenderer *r) {
free(m->effect_order);
free(m->buf);
free(m->offset);
free(m->mix_prev);
free(m->split);
free(m->dest);
free(m);
@@ -844,6 +864,29 @@ static void accumulate(Mixer *m, int buffer, const float *src, float vol, int fr
if (vol == 0 || buffer < 0 || buffer >= m->nbuf) return;
float *d = mixbuf(m, buffer); for (int k = 0; k < frames; k++) d[k] += src[k] * vol;
}
// Volume ramps (NX2NAVI_AUDIO_RAMP, default 1). The game sets volumes once per audio update, and a volume applied to a
// whole frame as one constant makes the level jump at the frame's first sample whenever the game moves it (a fade, a
// pan, a sound going past the camera): a step in the waveform, heard as a click. The console's renderer goes from the
// volume of the frame before to the new one across the frame's samples, and so does this: `from` is the gain the same
// source went into this buffer with in the render pass before, sample k gets from + k (to - from) / frames, and the
// next pass, which starts at `to`, continues the line. Equal gains take accumulate's constant path, and so does a gain
// that is not a finite number (NaN also marks "no gain in the pass before").
static void accumulate_ramp(Mixer *m, int buffer, const float *src, float from, float to, int frames) {
if (from == to || !isfinite(from) || !isfinite(to)) { accumulate(m, buffer, src, to, frames); return; }
if (buffer < 0 || buffer >= m->nbuf) return;
const float step = (to - from) / (float)frames;
float *d = mixbuf(m, buffer), gain = from;
for (int k = 0; k < frames; k++) { d[k] += src[k] * gain; gain += step; }
m->ramps++;
}
// A splitter destination ramps when the pass before used it and sent it to the same mix: one that is new or was moved
// starts at its new volumes.
static int dest_ramps(const SplitDest *d) { return d->prev_ok && d->prev_dest == d->dest; }
void audio_mixer_ramp_stats(const AudioRenderer *r, uint64_t *passes, uint64_t *ramps) {
const Mixer *m = r->mixer;
*passes = m ? m->ramp_passes : 0;
*ramps = m ? m->ramps : 0;
}
static int mix_valid(AudioRenderer *r, int32_t id) { return id >= 0 && id <= r->param.submix_count && r->mixes[id].in_use; }
static int mix_depth(AudioRenderer *r, int id) {
int d = 0;
@@ -1046,6 +1089,10 @@ void audio_mixer_render(AudioRenderer *r, double seconds) {
float (*vs)[MAX_FRAME]=m->voice_scratch,*filtered=m->filter_scratch;
m->trace_pass++;
// A pass ramps from the pass before it. The first one after the mixer opened or the renderer started has none.
const int ramp = m->ramp && !m->snap;
const uint64_t ramps_before = m->ramps;
m->snap = 0;
for (int i = 0; i < r->param.voice_count; i++) {
ServerVoice *v = &r->voices[i];
if (!v->in.in_use || v->state != SV_STARTED || !v->in.sample_rate || !v->valid[v->index]) continue;
@@ -1089,21 +1136,50 @@ void audio_mixer_render(AudioRenderer *r, double seconds) {
}
}
}
// The voice ramps when the pass before mixed it, with as many channels and into the same mix or splitter. One
// that has just started (voice_reset in audren.c; or stopped, paused or out of wave buffers in that pass) and
// one the game moved to another destination start at their new volumes.
const int vramp = ramp && v->ramp_pass == r->elapsed_frames && v->ramp_channels == (uint32_t)cc &&
v->ramp_mix == v->in.mix_id && v->ramp_splitter == v->in.splitter_id;
int routed = 0;
if (v->in.splitter_id != SPLITTER_UNUSED && v->in.splitter_id < (uint32_t)m->nsplit) {
const SplitInfo *s = &m->split[v->in.splitter_id];
for (int c = 0; c < cc; c++) for (int k = c; k < s->ndest; k += cc) {
SplitDest *d = &m->dest[s->ids[k]];
if (!d->used || !mix_valid(r, d->dest)) continue;
const float *source=splitter_filter(d,vs[c],filtered,frames);
for (int b = 0; b < r->mixes[d->dest].buffer_count && b < 24; b++) accumulate(m, m->offset[d->dest] + b, source, d->vol[b] * v->in.volume, frames);
// from the destination's volumes and the voice's volume of the pass before, whose product is the gain
// that pass mixed with (the destination's are kept once per pass: other voices may feed it too)
const int from_prev = vramp && dest_ramps(d);
for (int b = 0; b < r->mixes[d->dest].buffer_count && b < 24; b++) {
const float to = d->vol[b] * v->in.volume;
accumulate_ramp(m, m->offset[d->dest] + b, source, from_prev && b < d->prev_buffers ? d->prev[b] * v->ramp_volume : to, to, frames);
}
}
routed = 1;
} else if (mix_valid(r, v->in.mix_id)) {
const int nb = r->mixes[v->in.mix_id].buffer_count < 24 ? r->mixes[v->in.mix_id].buffer_count : 24;
for (int c = 0; c < cc; c++) {
int32_t id = v->in.channel_ids[c]; if (id < 0 || id >= r->param.voice_count * 6) continue;
int32_t id = v->in.channel_ids[c];
if (id < 0 || id >= r->param.voice_count * 6) { // nothing goes in: no gain for the next pass to ramp from
for (int b = 0; b < nb; b++) v->ramp_gain[c][b] = NAN;
continue;
}
const AudrenChannelIn *ch = &r->channels[id];
for (int b = 0; b < r->mixes[v->in.mix_id].buffer_count && b < 24; b++) accumulate(m, m->offset[v->in.mix_id] + b, vs[c], ch->mix[b] * v->in.volume, frames);
for (int b = 0; b < nb; b++) {
const float to = ch->mix[b] * v->in.volume;
accumulate_ramp(m, m->offset[v->in.mix_id] + b, vs[c], vramp && b < v->ramp_buffers ? v->ramp_gain[c][b] : to, to, frames);
v->ramp_gain[c][b] = to;
}
}
v->ramp_buffers = nb;
routed = 1;
}
v->ramp_pass = routed ? r->elapsed_frames + 1 : 0; // audren.c render_thread counts the pass after this render
v->ramp_channels = (uint32_t)cc;
v->ramp_mix = v->in.mix_id;
v->ramp_splitter = v->in.splitter_id;
v->ramp_volume = v->in.volume;
}
if (rt_trace & RT_TRACE_AUDIO) {
// Voices mixed in the last pass and not in this one, and why; then voices that read the same wave buffer memory
@@ -1139,17 +1215,38 @@ void audio_mixer_render(AudioRenderer *r, double seconds) {
const AudrenMixIn *x = &r->mixes[order[a]]; int src = m->offset[order[a]];
if (x->dest_splitter_id != SPLITTER_UNUSED && x->dest_splitter_id < (uint32_t)m->nsplit) {
const SplitInfo *s = &m->split[x->dest_splitter_id];
// a mix into a splitter ramps like a voice into one: from the destination's volumes and the mix's volume
// of the pass before, when that pass had the mix with as many buffers on the same splitter
const MixPrev *xp = &m->mix_prev[order[a]];
const int xramp = ramp && xp->ok && xp->splitter == x->dest_splitter_id && xp->buffers == x->buffer_count;
for (int c = 0; c < x->buffer_count && c < 24; c++) for (int k = c; k < s->ndest; k += x->buffer_count) {
SplitDest *d = &m->dest[s->ids[k]];
if (!d->used || !mix_valid(r, d->dest)) continue;
const float *source=splitter_filter(d,mixbuf(m,src+c),filtered,frames);
for (int b = 0; b < r->mixes[d->dest].buffer_count && b < 24; b++) accumulate(m, m->offset[d->dest] + b, source, d->vol[b] * x->volume, frames);
const int from_prev = xramp && dest_ramps(d);
for (int b = 0; b < r->mixes[d->dest].buffer_count && b < 24; b++) {
const float to = d->vol[b] * x->volume;
accumulate_ramp(m, m->offset[d->dest] + b, source, from_prev && b < d->prev_buffers ? d->prev[b] * xp->volume : to, to, frames);
}
}
} else if (mix_valid(r, x->dest_mix_id)) {
for (int c = 0; c < x->buffer_count && c < 24; c++)
for (int b = 0; b < r->mixes[x->dest_mix_id].buffer_count && b < 24; b++) accumulate(m, m->offset[x->dest_mix_id] + b, mixbuf(m, src + c), x->mix[c][b] * x->volume, frames);
}
}
// What every splitter destination and every mix went in with, for the next pass's ramps: kept here, once per pass,
// after every voice and mix that feeds a destination has read the values of the pass before.
for (int i = 0; i < m->ndest; i++) {
SplitDest *d = &m->dest[i];
d->prev_ok = d->used && mix_valid(r, d->dest);
if (!d->prev_ok) continue;
memcpy(d->prev, d->vol, sizeof d->prev);
d->prev_dest = d->dest;
d->prev_buffers = r->mixes[d->dest].buffer_count;
}
for (int i = 1; i < mc; i++)
m->mix_prev[i] = (MixPrev){r->mixes[i].volume, r->mixes[i].dest_splitter_id, r->mixes[i].buffer_count, r->mixes[i].in_use != 0};
if (m->ramps != ramps_before) m->ramp_passes++;
if (r->mixes[0].in_use) mix_effects(r, 0);
/* device sink */
const AudrenSinkIn *sink = NULL;int circular=0;

View File

@@ -47,6 +47,7 @@ typedef struct AudrenStats {
upd_hold_max_ns;
// voices (under the lock)
uint64_t dry, late[3], late_max; // next buffer late by 1-2 passes, 3-8, 9-AS_LATE_PASSES
uint64_t ramp_passes, ramps; // the mixer's volume ramp counts at the window's start (audio_mixer_ramp_stats)
int events;
uint64_t voices_ns; // the game's update (under the lock): the last voice census line
int voices_most; // the most voices in use a census found
@@ -132,6 +133,7 @@ static void voice_reset(ServerVoice *v) {
memset(&v->adpcm, 0, sizeof v->adpcm);
memset(v->biquad_state, 0, sizeof v->biquad_state);
v->dry_pass = 0;
v->ramp_pass = 0; // a new voice starts at its volumes: no ramp from what the slot's last voice was mixed with
}
static void update_voice(AudioRenderer *r, const AudrenVoiceIn *in) {
@@ -471,7 +473,9 @@ static void stats_report(AudioRenderer *r, uint64_t now, uint64_t lock_ns, uint6
int dev = audio_mixer_out_stats(r, &o);
char event[320] = "";
int window = 0;
uint64_t ramp_passes, ramps;
plat_mutex_lock(&r->lock);
audio_mixer_ramp_stats(r, &ramp_passes, &ramps);
if (dev && o.pull_gap_max_ns > st->pull_gap_max_ns) st->pull_gap_max_ns = o.pull_gap_max_ns;
if (dev && o.underruns > st->seen_underruns) {
if (st->events < AS_EVENTS) {
@@ -490,6 +494,7 @@ static void stats_report(AudioRenderer *r, uint64_t now, uint64_t lock_ns, uint6
st->window_ns = now;
st->out_underruns = o.underruns, st->out_missing = o.missing_frames, st->out_skipped = o.skipped_frames;
st->out_overruns = o.overruns;
st->ramp_passes = ramp_passes, st->ramps = ramps;
}
if (now - st->window_ns >= AS_WINDOW_NS) {
snap = *st;
@@ -500,6 +505,7 @@ static void stats_report(AudioRenderer *r, uint64_t now, uint64_t lock_ns, uint6
st->queue_min = UINT64_MAX;
st->out_underruns = o.underruns, st->out_missing = o.missing_frames, st->out_skipped = o.skipped_frames;
st->out_overruns = o.overruns;
st->ramp_passes = ramp_passes, st->ramps = ramps;
st->upd_n = 0; // upd_last_ns and upd_pass_last stay: the next gap is measured from the last update
st->upd_gap_max_ns = st->upd_gap_frame = st->upd_gaps_over = st->upd_passes_max = st->upd_hold_max_ns = 0;
st->dry = st->late[0] = st->late[1] = st->late[2] = st->late_max = 0;
@@ -516,7 +522,8 @@ static void stats_report(AudioRenderer *r, uint64_t now, uint64_t lock_ns, uint6
"frames %llu, ring at least %.1f ms, longest device request gap %.1f ms; render passes %llu, gaps over %llu "
"ms %llu (longest %.1f ms), lock waits over %llu ms %llu (longest %.2f ms); game updates %llu, gaps over "
"%llu ms %llu (longest %.1f ms at game frame %llu, %llu passes), longest held the lock %.2f ms; voices ran "
"dry %llu, next buffer late by 1-2 passes %llu, 3-8 %llu, 9-%d %llu (most %llu)",
"dry %llu, next buffer late by 1-2 passes %llu, 3-8 %llu, 9-%d %llu (most %llu); render passes that ramped a "
"volume %llu (%llu ramps)",
(now - snap.window_ns) / 1e9, (unsigned long long)game_frame(), (unsigned long long)under,
(o.missing_frames - snap.out_missing) * 1000.0 / rate, (o.skipped_frames - snap.out_skipped) * 1000.0 / rate,
(unsigned long long)(o.overruns - snap.out_overruns),
@@ -527,7 +534,8 @@ static void stats_report(AudioRenderer *r, uint64_t now, uint64_t lock_ns, uint6
(unsigned long long)snap.upd_gaps_over, snap.upd_gap_max_ns / 1e6, (unsigned long long)snap.upd_gap_frame,
(unsigned long long)snap.upd_passes_max, snap.upd_hold_max_ns / 1e6, (unsigned long long)snap.dry,
(unsigned long long)snap.late[0], (unsigned long long)snap.late[1], AS_LATE_PASSES,
(unsigned long long)snap.late[2], (unsigned long long)snap.late_max);
(unsigned long long)snap.late[2], (unsigned long long)snap.late_max,
(unsigned long long)(ramp_passes - snap.ramp_passes), (unsigned long long)(ramps - snap.ramps));
}
static void render_thread(void *p) {

View File

@@ -147,6 +147,15 @@ typedef struct {
float biquad_state[2][6][2]; // filter, channel: transposed direct-form II delays
uint64_t dry_pass; // NX2NAVI_AUDIO_STATS: 1 + the render pass in which the voice ran out of queued
// buffers before its end of stream (audren.c advance_voice), 0 otherwise
// Volume ramps (audio_mixer.c audio_mixer_render): what the voice was mixed with in its last render pass. The pass
// after it starts every gain there and reaches the new volumes at its end; voice_reset (audren.c) forgets it.
uint64_t ramp_pass; // 1 + the render pass the voice was last mixed in, 0 when it has none to ramp from
int32_t ramp_mix; // the mix and
uint32_t ramp_splitter; // the splitter it went to then, and
uint32_t ramp_channels; // its channel count: a pass with another of these starts at the new volumes
int32_t ramp_buffers; // into a mix: how many of the mix's buffers ramp_gain holds
float ramp_volume; // into a splitter: the voice's volume then (the destinations keep their own)
float ramp_gain[6][24]; // into a mix: the gain channel c went into buffer b with (NaN: nothing went in)
} ServerVoice;
enum { SV_STOPPED, SV_STARTED, SV_PAUSED, SV_STOPPING };
@@ -191,6 +200,9 @@ int64_t audio_mixer_pace_ns(AudioRenderer *r, uint64_t now);
// the last call (which starts that measure again). False without a device.
typedef struct { uint64_t underruns, missing_frames, skipped_frames, overruns, queued_frames, pull_gap_max_ns; } AudioOutStats;
int audio_mixer_out_stats(AudioRenderer *r, AudioOutStats *o);
// NX2NAVI_AUDIO_STATS: the render passes in which at least one volume was ramped (NX2NAVI_AUDIO_RAMP), and the ramps (one
// source channel into one mix buffer), since the mixer opened.
void audio_mixer_ramp_stats(const AudioRenderer *r, uint64_t *passes, uint64_t *ramps);
uint64_t audio_voice_consumed(const AudioRenderer *r, ServerVoice *v, int frames); // source samples over one frame; advances v->fraction
int audio_buffer_empty(const AudrenWaveBuffer *b); // no samples to decode: played as soon as it is reached
void audio_device_handler(IpcSession *s, const IpcRequest *rq, IpcResponse *rs); // IAudioDevice

View File

@@ -35,7 +35,7 @@ static int save_ok = 1; // the last cfg_save_to wrote (o
// logged as unknown. A new variable goes here too, or its ini key logs a harmless "unknown key" line.
static const char *const known[] = {
"CORES", "TM_DISPATCH", "NVN2_CS_TABLE", "SKIP_SHADERS", "MOVIE_DEBAND", "MOVIE_FPS", "MOVIE_SKIP", "MOVIE_OVERLAY", "MOVIES", "NPLN", "NVN2_PROGRAMS", "NVN_TRAP", "OCARINA_REALTIME", "ONESHOT_BUDGET", "ONESHOT_WAIT_MS", "OCARINA_STEP", "PHYSICS_STEPS", "PICKUP_COUNT", "STEP_STEADY", "VI_HZ", "VI_VRR", "TIME_DUMP", "SHADER_DUMP", "SHOT_AFTER", "SHOT_DIR", "SHOT_EVERY", // Switch 2 port: movie skip (romfs.c), NVN2 proc traps (nvn_procs.c)
"AA", "AA_LOG", "AB", "AMIIBO_DIR", "ANISO", "APP_POOL", "ASPECT", "ASPECT_PATCH", "ASSUME_FOCUS", "ASTC", "ASTC_BC", "ASTC_TIME", "ASYNC_PREEMPT", "AUDIO", "AUDIO_CHANNELS", "AUDIO_DEVICE", "AUDIO_GAME_PRIO", "AUDIO_OFF", "AUDIO_PREFILL_MS", "AUDIO_STATS",
"AA", "AA_LOG", "AB", "AMIIBO_DIR", "ANISO", "APP_POOL", "ASPECT", "ASPECT_PATCH", "ASSUME_FOCUS", "ASTC", "ASTC_BC", "ASTC_TIME", "ASYNC_PREEMPT", "AUDIO", "AUDIO_CHANNELS", "AUDIO_DEVICE", "AUDIO_GAME_PRIO", "AUDIO_OFF", "AUDIO_PREFILL_MS", "AUDIO_RAMP", "AUDIO_STATS",
"BARRIER_GAME", "MESH_AHEAD", "MESH_FALLBACK", "MESH_FALLBACK_MB", "MESH_FALLBACK_WORKERS", "PROBE_MESHFB_DIR",
"BACKGROUND_WINDOW", "BIND_A", "BIND_B", "BIND_DOWN", "BIND_L", "BIND_LCLICK", "BIND_LEFT", "BIND_LSTICK_DOWN", "BIND_LSTICK_LEFT",
"BIND_LSTICK_RIGHT", "BIND_LSTICK_UP", "BIND_MINUS",
@@ -121,6 +121,7 @@ static const struct { const char *key, *section; } sections[] = {
{"MODS_DIR", "mods"}, {"MODS_ORDER", "mods"}, {"MODS_DISABLED", "mods"}, {"MODS_REBUILD", "mods"},
{"MENU_LANG", "language"}, {"LANG", "language"}, {"OPERATION_MODE", "language"},
{"VOLUME", "audio"}, {"AUDIO_CHANNELS", "audio"}, {"AUDIO_DEVICE", "audio"}, {"MICROPHONE", "audio"}, {"MENU_SOUND_VOLUME", "audio"},
{"AUDIO_RAMP", "audio"},
{"MOTION", "input"}, {"RUMBLE_STRENGTH", "input"}, {"RUMBLE_CURVE", "input"}, {"RUMBLE_TRIGGERS", "input"}, {"DS3", "input"},
{"PAD_LAYOUT", "input"}, {"PROMPTS", "input"}, {"STICK_DEADZONE", "input"}, {"LSTICK_DEADZONE", "input"}, {"RSTICK_DEADZONE", "input"},
{"STICK_SENS", "input"}, {"DEBUG_MENU", "input"},
@@ -231,6 +232,7 @@ static const CfgMeta metas[] = {
{"VOLUME", "100", "0..100", LIVE}, {"MENU_SOUND_VOLUME", "80", "0..100", LIVE}, {"AUDIO_CHANNELS", "stereo", "auto|stereo|5.1", LIVE}, // audio_mixer.c audio_channels_live
{"AUDIO_DEVICE", "default", NULL, RESTART}, // default|<1-based index>|<part of a device name> (audio_mixer.c resolve_audio_device)
{"MICROPHONE", "1", "0|1", RESTART}, // ov_audio_input.c mic_on: 0 refuses the game's input streams
{"AUDIO_RAMP", "1", "0|1", RESTART}, // audio_mixer.c accumulate_ramp: a changed volume is reached across the frame
{"MOTION", "1", "0|1", LIVE}, {"RUMBLE_STRENGTH", "130", "0..300", LIVE}, {"RUMBLE_CURVE", "0.6", "0.2..1.5", LIVE},
{"RUMBLE_TRIGGERS", "0", "0|1", LIVE}, {"PAD_LAYOUT", "nintendo", "auto|nintendo|xbox|playstation", LIVE},
{"DS3", "0", "0|1", LIVE}, // input_ds3_win.c ds3_read: read a DualShock 3 directly; off: no HID scan