mirror of
https://github.com/seedds/nxnative.git
synced 2026-11-23 11:39:42 -10:00
host/audren: give the audio producer a real-time deadline
The in-process audio worker already requests interactive QoS, but ordinary time-sharing can still miss its 5 ms refill deadline despite fast mixing. Declare a preemptible time-constraint policy after output setup, restore standard policy before teardown, and keep playback working if the request fails. Preserve the existing 4.5 ms pacing and DM_AUDREN_RT=0 for A/B tests. Verify real Mach policy set/read/reset, intact PCM on rejection and opt-out, and ordered cadence at 44.1 kHz and 48 kHz. Mac/iPhone source compilation, renderer fixtures, ASan/UBSan and documentation checks pass. Isaac passes full real-audio checks on 48 kHz USB and 44.1 kHz speakers. BotW keeps its audio full; matched policy-off/on runs do not reproduce the full harness's screenshot-associated frame-time flag. Record the raw flag and isolation. The M6 CPU/energy samples do not establish a power saving. iOS runtime, power on the affected M4 and overlap with #2796 remain unverified. Fixes #3059 Co-authored-by: nichq50 <[email protected]>
This commit is contained in:
1 parent
ff2d3efea6
commit
2edad1828d
7 files changed
+124
-3
No files matched your search
@@ -179,6 +179,19 @@ On this Mac the background prewarm also ends before the save loads, so the step
|
||||
|
||||
`smoke.tsv` takes the outdoors save (`saves/outdoors` in the NSP folder) with frame-numbered presses, `f300:A` to `f1700:A`; the Zora's Domain save it used before is no longer on the test Mac. Link stands in a field from about 50 s; with the window on screen (M4 Pro) frame 3,000 comes at 57 s and 6,000 at 107 s, while a covered window runs at 20 fps ([covered windows](../../../docs/reference/frame-rate.md)). `regress.py capture` records frame 5000 for `regress.py replay`: noise up to about 150 pixels with 5d2bf73f; one capture at chain `a31235713eee` differed from every replay in 1,603 pixels, a rare live outcome of the depth-EQUAL variation (Frame capture and replay, under Open); later captures replay within 0 to 246 pixels. The current one (chain `f3ceca86cac5`, 2026-10-30): no replay of 8 equals the live frame, noise 122 pixels; 4 of 8 and 113 pixels in the one before. In 2 of 6 `regress.py check` runs on 2026-10-29 the game stayed at 20 fps from the start (frame 2500 not reached by 60 s: NEW-FAIL): the frame step went from 1 to 3 vsyncs at presents 12–15 on three late frames costing 0.02 vsyncs and never came back. Resolved (2026-10-30): the window was behind another one in those runs ([a game window another process starts opens behind other windows](../../../docs/reference/frame-rate.md#a-game-window-another-process-starts-opens-behind-other-windows)); every 20 fps run of 2026-10-28 and 29 had 21 to 115 display link stalls, the 60 fps runs 0 to 7. With `DM_WINDOW_TOP` the window stays in front.
|
||||
|
||||
### Audio producer scheduling validation (2026-11-20)
|
||||
|
||||
The [host audio producer's real-time policy](../../../docs/reference/audio.md#late-audio-producer-wakeups-despite-fast-rendering) was checked on an Apple M6 Mac mini (16 GB), macOS 27.2.1, Xcode 27.2 (27B52), against `74abcae5`, using the full 110-second outdoors route, Metal HUD and real 48 kHz / 240-frame USB output. All 19,592 shaders and their interfaces were unchanged; both hosts reached gameplay without red diagnostics, kept four audio blocks queued and reported zero underruns through 20,000 callbacks.
|
||||
|
||||
The full harness flagged frame p99 17.26 → 33.17 ms. The candidate's slow-frame cluster surrounded the 80-second screenshot and a short two-vsync hold; excluding the two capture intervals gave 17.244 → 17.246 ms. A matched comparison then used the same candidate binary with `DM_AUDREN_RT=0` or `1`, the prepared pipelines and identical save/keys, measuring seconds 58–108 and taking the screenshot afterward. Order: off, on, on, off.
|
||||
|
||||
| Audio policy | FPS, two runs | Frame p99, two runs | Audio |
|
||||
|---|---|---|---|
|
||||
| Off | 60.0, 58.5 | 16.97, 49.89 ms | four blocks queued, zero underruns through 20,000 callbacks each |
|
||||
| On | 59.9, 60.0 | 17.24, 17.16 ms | four blocks queued, zero underruns through 20,000 callbacks each |
|
||||
|
||||
The second off run encountered GPU/frame-pacing hitches around 99 seconds. The second on run briefly lost window visibility around 25 seconds, before its measurement window. These runs did not reproduce a policy-induced slowdown and do not establish a speedup. The original harness result remains recorded as a regression; it is interpreted alongside this isolation, not replaced with a passing result. Artifacts: `<NSP folder>/01007EF00011E000-work/regress/runs/issue3059-policy-ab/`. iOS and the affected M4 were not rerun.
|
||||
|
||||
### NVN contract validation (2026-11-17)
|
||||
|
||||
The general NVN builder, mapping and [buffer-flush contracts](../../../docs/reference/nvn-objects.md#buffer-flushes-publish-the-corresponding-pool-range) from PR #1285 passed the full 110-second outdoors route against main `2925d7af`. This game covers frequent pool/buffer mappings and explicit texture-storage flushes; the missing buffer-flush publication itself is isolated by synthetic GPU readback. All 19,592 shaders were unchanged, with no new interface failures, red diagnostics or screenshot regression. On an M4 Pro, macOS 27.2.1: 58.6 → 59.1 fps, frame p99 33.33 → 33.21 ms, peak footprint 3,179 → 3,218 MB. Both runs built all 15,767 pipeline pairs without failures (172.1 → 183.7 seconds). These results establish no regression, not a measured speedup. iOS was not rerun.
|
||||
|
||||
@@ -33,6 +33,17 @@ The build and work folders are `<NSP folder>/01009BC00C38A000_build` and `<NSP f
|
||||
|
||||
From a fresh save: A skips the opening, A on the title, A on file 1, A on New Run, A on Isaac. [`smoke.tsv`](smoke.tsv) spaces these by 120 presented frames from frame 300, then stands in the safe starting room. Left stick moves, right stick shoots, Plus pauses. Exit Game in the pause menu saves the run and returns to the main menu, where Continue is selected.
|
||||
|
||||
## Audio scheduling checks
|
||||
|
||||
2026-11-20, Apple M6 Mac mini (16 GB), macOS 27.2.1, Xcode 27.2 (27B52), base v0: full smoke checks of the [host audio producer's real-time policy](../../../docs/reference/audio.md#late-audio-producer-wakeups-despite-fast-rendering) against `74abcae5`, with real audio and the Metal HUD, passed on both outputs below. Both revisions kept four blocks queued and had zero underruns through the last reported callback checkpoint. This Mac did not reproduce the M4 Ocarina symptom.
|
||||
|
||||
| Output | Device format | Callback checkpoint | CPU time, baseline → policy | Reported CPU energy, baseline → policy |
|
||||
|---|---|---|---|---|
|
||||
| USB Audio & HID | 48 kHz / 240 frames | 8,000 | 24.0 → 23.0% of one core | 0.125 → 0.083 W |
|
||||
| Built-in speakers | 44.1 kHz / 256 frames | 6,000 | 8.5 → 12.3% of one core | 0.268 → 0.140 W |
|
||||
|
||||
CPU values are means of four steady reports at frames 1,500–2,400, one baseline/candidate pair per output. The mixed CPU-time results and small samples do not establish a power saving or quantify device power. The 44.1 kHz device requests 278–279 client frames at 48 kHz per callback, exercising device conversion and pacing; the deterministic fixture separately checks PCM order. Candidate render peaks were at most 0.45 ms across these runs. The speakers' original 48 kHz rate and 512-frame device buffer were restored after the test. iOS runtime and power remain untested.
|
||||
|
||||
## Found on this game
|
||||
|
||||
- **The blend helper's output reference on iOS:** the shared shader helper now names the `thread` address space of its output, and its compiler test covers the packing script's iOS target as well as the Mac: [reference](../../../docs/reference/shaders.md#the-blend-helpers-output-reference-on-ios).
|
||||
|
||||
@@ -340,6 +340,7 @@ Its 37 kernels that correct samples, NDSR's network among them, gave about 0.25
|
||||
- [Textures made for GPU use kept from their CPU rewrites](../../../docs/reference/nvn-objects.md#textures-made-for-gpu-use-kept-from-their-cpu-rewrites): the terrain tiles' height, blend and hole maps rewritten as tile slots are reused; flat blue holes in the ground after an hour of play.
|
||||
- [`EventFd` needs no network](../../../docs/reference/services.md#eventfd-needs-no-network)
|
||||
- [Virtual audio input streams](../../../docs/reference/audio.md#virtual-audio-input-streams-sdk-2122): enable Microphone in the Mac launcher and use the game’s Ocarina Mic Input setting for humming or playing an instrument.
|
||||
- [Late audio producer wakeups despite fast rendering](../../../docs/reference/audio.md#late-audio-producer-wakeups-despite-fast-rendering): host scheduling fix for static with output underruns ([issue #3059](https://github.com/seedds/nxnative/issues/3059)); the reporter's M4 A/B reached zero underruns on speakers and AirPods. iOS device and power validation remain open.
|
||||
- [`nn::ndve`'s movie enhancement file](../../../docs/reference/shaders.md#nnndves-movie-enhancement-file)
|
||||
- [Task and mesh shaders in BNSH, and indirect mesh draws](../../../docs/reference/shaders.md#task-and-mesh-shaders-in-bnsh-and-indirect-mesh-draws)
|
||||
- [Indirect task / mesh draws on the encode thread](../../../docs/reference/rendering.md#indirect-task--mesh-draws-on-the-encode-thread): the iOS app aborted when a save loaded.
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
// Command list format (SDK 16): header +0x04 command count, +0x08 mix buffer address, +0x10 buffer count, +0x14 samples per frame, +0x18 sample rate, commands from +0x20;
|
||||
// each command +0x00 magic 0xcafebabe, +0x04 enabled, +0x05 command ID (DeviceSink = 0x13), +0x06 size; DeviceSink +0x128 upsampler buffer, +0x130 input count, +0x134 input indices (s16).
|
||||
#include "hle.h"
|
||||
#include <mach/mach.h>
|
||||
#include <mach/mach_time.h>
|
||||
#include <mach/thread_policy.h>
|
||||
#include <math.h>
|
||||
#include <stdatomic.h>
|
||||
#include <time.h>
|
||||
@@ -134,6 +137,30 @@ static ar_t *ar_of_sys(uint8_t *sys) {
|
||||
return found;
|
||||
}
|
||||
|
||||
// QoS alone does not give this 5 ms producer a deadline: late wakeups drain the output even when mixing takes only 0.07 ms (#3059).
|
||||
// The computation is a scheduling budget, not busy time. Keep output setup/teardown outside real-time policy and preserve burst-refill pacing.
|
||||
static int render_rt(void) {
|
||||
const char *e = getenv("DM_AUDREN_RT");
|
||||
if (e && atoi(e) == 0) { LOG("audren: render thread keeps its default policy (DM_AUDREN_RT=0)"); return 0; }
|
||||
mach_timebase_info_data_t tb;
|
||||
kern_return_t kr = mach_timebase_info(&tb);
|
||||
if (kr == KERN_SUCCESS) {
|
||||
thread_time_constraint_policy_data_t p = {
|
||||
.period = (uint32_t)(5000000ull * tb.denom / tb.numer),
|
||||
.computation = (uint32_t)(1000000ull * tb.denom / tb.numer),
|
||||
.constraint = (uint32_t)(5000000ull * tb.denom / tb.numer), .preemptible = TRUE
|
||||
};
|
||||
kr = thread_policy_set(pthread_mach_thread_np(pthread_self()), THREAD_TIME_CONSTRAINT_POLICY, (thread_policy_t)&p, THREAD_TIME_CONSTRAINT_POLICY_COUNT);
|
||||
}
|
||||
LOG("%saudren: render thread time-constraint policy (requested period 5 ms, computation 1 ms) %s (%d)", kr == KERN_SUCCESS ? "" : "[RED] ",
|
||||
kr == KERN_SUCCESS ? "set" : "failed to set; keeping default policy", (int)kr);
|
||||
return kr == KERN_SUCCESS;
|
||||
}
|
||||
static void render_rt_end(void) {
|
||||
kern_return_t kr = thread_policy_set(pthread_mach_thread_np(pthread_self()), THREAD_STANDARD_POLICY, NULL, THREAD_STANDARD_POLICY_COUNT);
|
||||
if (kr != KERN_SUCCESS) LOG("[RED] audren: cannot restore render thread default policy (%d)", (int)kr);
|
||||
}
|
||||
|
||||
static void render_main(void *arg) {
|
||||
ar_t *a = arg; t_ar = a;
|
||||
void (*exec)(void *, void *) = gsym("_ZN2nn5audio29ExecuteAudioRendererRenderingENS0_19AudioRendererHandleE");
|
||||
@@ -144,6 +171,7 @@ static void render_main(void *arg) {
|
||||
LOG("audren: render thread %d started (%d buffers in flight, paced by the output)", ar_index(a), NBUF);
|
||||
uint64_t next_exec = 0;
|
||||
int prefill = NBUF;
|
||||
int rt = render_rt();
|
||||
while (atomic_load(&a->open)) {
|
||||
while (!nfree) { // wait for the output to hand a block back (silent sink / sound card, one every 5 ms); it signals each release, so the thread sleeps until then (it used to poll every 1 ms)
|
||||
aout_buf *b = dm_pcmout_released(out);
|
||||
@@ -184,6 +212,7 @@ static void render_main(void *arg) {
|
||||
if (!dm_pcmout_append(out, b)) free_list[nfree++] = b;
|
||||
else if (prefill) prefill--;
|
||||
}
|
||||
if (rt) render_rt_end();
|
||||
dm_pcmout_close(out); // the output would otherwise keep its sound card callback or silent sink running and hold one of the AudioOut slots after the renderer closes
|
||||
}
|
||||
|
||||
|
||||
@@ -5,13 +5,34 @@
|
||||
#include "../hle.h"
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <mach/mach.h>
|
||||
#include <mach/thread_policy.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
static int wait_for_render(pthread_cond_t *, pthread_mutex_t *, const struct timespec *);
|
||||
static kern_return_t render_policy_set(thread_t, thread_policy_flavor_t, thread_policy_t, mach_msg_type_number_t);
|
||||
#define pthread_cond_timedwait_relative_np wait_for_render
|
||||
#define thread_policy_set render_policy_set
|
||||
#include "../hle_audren.c"
|
||||
#undef thread_policy_set
|
||||
#undef pthread_cond_timedwait_relative_np
|
||||
|
||||
// Synthetic render loops must not promote the test runner. One short-lived pthread below exercises the real Mach boundary.
|
||||
static struct { int live, started, active, fail, sets, resets; } policy;
|
||||
static kern_return_t render_policy_set(thread_t thread, thread_policy_flavor_t flavor, thread_policy_t p, mach_msg_type_number_t n) {
|
||||
if (policy.live) return thread_policy_set(thread, flavor, p, n);
|
||||
assert(policy.started);
|
||||
if (flavor == THREAD_TIME_CONSTRAINT_POLICY) {
|
||||
assert(!policy.active); policy.sets++;
|
||||
if (policy.fail) return KERN_FAILURE;
|
||||
policy.active = 1;
|
||||
} else {
|
||||
assert(flavor == THREAD_STANDARD_POLICY && policy.active);
|
||||
policy.active = 0; policy.resets++;
|
||||
}
|
||||
return KERN_SUCCESS;
|
||||
}
|
||||
|
||||
enum { SAMPLES = 240, NMIX = 8, NCMD = 6 };
|
||||
enum { PACE_BLOCKS = 2000 };
|
||||
static struct {
|
||||
@@ -43,8 +64,8 @@ module_t *module_of(const void *p) { (void)p; return NULL; }
|
||||
void *dm_pcmout_open_sink(void) { return NULL; }
|
||||
int dm_audio_output_channels(void) { return 2; } // the stereo route; the six-channel resampler is checked directly below
|
||||
int dm_audio_route(void) { return 2; }
|
||||
void dm_pcmout_close(void *k) { (void)k; }
|
||||
void dm_pcmout_start(void *k) { (void)k; }
|
||||
void dm_pcmout_close(void *k) { (void)k; assert(!policy.active); policy.started = 0; }
|
||||
void dm_pcmout_start(void *k) { (void)k; assert(!policy.active); policy.started = 1; }
|
||||
int dm_pcmout_append(void *k, void *b) {
|
||||
(void)k;
|
||||
if (pace.rate) {
|
||||
@@ -321,6 +342,7 @@ static void blocks_exec(void *obj, void *state) {
|
||||
t_ar->frame_n = SAMPLES;
|
||||
}
|
||||
static void test_renderer_blocks(void) {
|
||||
memset(blocks_n, 0, sizeof blocks_n);
|
||||
blocks_on = 1;
|
||||
for (int r = 0; r < 2; r++) {
|
||||
ar_t *a = &g_ar[r];
|
||||
@@ -340,6 +362,40 @@ static void test_renderer_blocks(void) {
|
||||
memset(g_ar, 0, sizeof g_ar);
|
||||
}
|
||||
|
||||
static void *policy_thread(void *unused) {
|
||||
(void)unused;
|
||||
assert(!pthread_set_qos_class_self_np(QOS_CLASS_USER_INTERACTIVE, 0));
|
||||
assert(render_rt());
|
||||
thread_time_constraint_policy_data_t p = {0};
|
||||
mach_msg_type_number_t n = THREAD_TIME_CONSTRAINT_POLICY_COUNT; boolean_t def = FALSE;
|
||||
thread_t self = pthread_mach_thread_np(pthread_self());
|
||||
assert(thread_policy_get(self, THREAD_TIME_CONSTRAINT_POLICY, (thread_policy_t)&p, &n, &def) == KERN_SUCCESS && !def);
|
||||
mach_timebase_info_data_t tb; assert(mach_timebase_info(&tb) == KERN_SUCCESS);
|
||||
fprintf(stderr, "Mach audio policy readback: period %u computation %u constraint %u, timebase %u/%u\n", p.period, p.computation, p.constraint, tb.numer, tb.denom);
|
||||
assert((uint64_t)p.period * tb.numer / tb.denom == 5000000);
|
||||
// XNU may raise computation to half the constraint; the accepted budget is not guaranteed to equal the request.
|
||||
assert((uint64_t)p.computation * tb.numer / tb.denom >= 1000000 && p.computation <= p.constraint);
|
||||
assert(p.constraint == p.period && p.preemptible);
|
||||
render_rt_end();
|
||||
thread_extended_policy_data_t extended = {0}; n = THREAD_EXTENDED_POLICY_COUNT; def = FALSE;
|
||||
assert(thread_policy_get(self, THREAD_EXTENDED_POLICY, (thread_policy_t)&extended, &n, &def) == KERN_SUCCESS && !def && extended.timeshare);
|
||||
return NULL;
|
||||
}
|
||||
static void test_render_policy(void) {
|
||||
// Failure and the diagnostic opt-out must still publish every renderer's PCM, without an unmatched policy reset.
|
||||
unsetenv("DM_AUDREN_RT");
|
||||
test_renderer_blocks(); assert(policy.sets == 2 && policy.resets == 2);
|
||||
policy.fail = 1;
|
||||
test_renderer_blocks(); assert(policy.sets == 4 && policy.resets == 2);
|
||||
setenv("DM_AUDREN_RT", "0", 1);
|
||||
test_renderer_blocks(); assert(policy.sets == 4 && policy.resets == 2);
|
||||
unsetenv("DM_AUDREN_RT"); policy.fail = 0;
|
||||
policy.live = 1;
|
||||
pthread_t thread; assert(!pthread_create(&thread, NULL, policy_thread, NULL));
|
||||
assert(!pthread_join(thread, NULL)); policy.live = 0;
|
||||
puts("audren scheduling: real worker policy set/read/reset; setup/teardown outside real-time; PCM preserved on rejection and opt-out");
|
||||
}
|
||||
|
||||
// The update lock is read off Update, else off UpdateImpl; a miss keeps the caller's offset and is a red line. Built from prologues of the forms the SDKs have (`bl` into a PLT stub or straight to the function)
|
||||
enum { F_UPDATE, F_IMPL = 16, F_STUB = 32, F_TICK = 36, F_SDK_LOCK, F_OS_LOCK, F_CODE };
|
||||
static uint32_t lock_code[F_CODE];
|
||||
@@ -476,7 +532,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
test_update_lock();
|
||||
test_two_renderers();
|
||||
test_renderer_blocks();
|
||||
test_render_policy();
|
||||
if (argc == 2 && !strcmp(argv[1], "--histogram")) { test_histogram(); return 0; }
|
||||
if (argc == 2 && !strcmp(argv[1], "--malformed")) { test_malformed(16, 0); return 0; }
|
||||
test_headers();
|
||||
|
||||
@@ -621,6 +621,7 @@ One line per symptom in the [subsystem references](../reference/): what you see
|
||||
- the light limiter crashed on a null state pointer (`ApplyLightLimiterEffect`, `sdk+0x228494`). → [At least one rendered frame between two updates](../reference/audio.md#at-least-one-rendered-frame-between-two-updates)
|
||||
- the sound runs about 50 times faster than the output; the loop runs 11,000 updates a second on one core. → [A sound driver that never waits on the renderer event](../reference/audio.md#a-sound-driver-that-never-waits-on-the-renderer-event)
|
||||
- villager dialogue crackles while music and sound effects play cleanly. On a 44.1 kHz / 256-frame device, `catch-up renders so far` grows by about 277 per 2,000 renders. `DM_AUDREN_TRACE=1` shows two renders between updates or two updates 0.02 ms apart followed by an 11.6 ms gap. → [Burst renders when a device callback releases multiple blocks](../reference/audio.md#burst-renders-when-a-device-callback-releases-multiple-blocks)
|
||||
- constant static behind otherwise clean sound; the output settles near one queued block, with 12–38 underruns per 2,000 callbacks on speakers and up to 275 on AirPods, although rendering averages about 0.07 ms of each 5 ms block. → [Late audio producer wakeups despite fast rendering](../reference/audio.md#late-audio-producer-wakeups-despite-fast-rendering)
|
||||
|
||||
## Frame rate
|
||||
|
||||
|
||||
@@ -476,3 +476,13 @@ The output route decides how many channels the device takes: six when the device
|
||||
- **Fix:** after prefill, `render_main` spaces fresh renders at least 4.5 ms apart, using the output's returned blocks to set the number due. The timed wait releases the catch-up queue lock. A catch-up published during the wait takes priority over a fresh render, and its slot stays occupied until the PCM is copied into the output block.
|
||||
- **Found on:** [Animal Crossing: New Horizons](../../dm/games/01006F8002326000/README.md). The reporter confirmed clean dialogue on an M4 with 44.1 kHz Bluetooth audio using the original pacing patch. [Issue #2981](https://github.com/seedds/nxnative/issues/2981) · [PR #2983](https://github.com/seedds/nxnative/pull/2983)
|
||||
- **Check:** `t_audren_layout --cadence` publishes a catch-up from a concurrent `RequestUpdate` during the paced wait and checks 2,000 ordered PCM blocks at each of 44.1 kHz / 256 frames and 48 kHz / 512 frames. At 48 kHz / 512 frames, The Binding of Isaac: Rebirth on an M6 had one catch-up in the first 6,000 renders, down from 1,227 on main, with zero underruns in the first 2,000 device callbacks on both builds.
|
||||
|
||||
### Late audio producer wakeups despite fast rendering
|
||||
|
||||
- **Symptom:** constant static behind otherwise clean sound; the output settles near one queued block, with 12–38 underruns per 2,000 callbacks on speakers and up to 275 on AirPods, although rendering averages about 0.07 ms of each 5 ms block.
|
||||
- **Cause:** `render_main` had ordinary time-sharing policy. Its guest-thread startup already requests interactive QoS, and AudioOut already signals a host semaphore when a block is released, but neither declares the audio producer's real-time scheduling requirement. Aggregate performance-core usage in the report does not establish the render thread's core placement.
|
||||
- **Fix:** after output setup, the in-process renderer's worker requests `THREAD_TIME_CONSTRAINT_POLICY` with a 5 ms period/deadline and a requested 1 ms computation budget, and restores standard policy before teardown. A rejected request is logged and playback continues with its existing policy. `DM_AUDREN_RT=0` retains ordinary scheduling for A/B measurements. This is host-bound for every in-process renderer; the separate SDK 1 `audren:u` worker and guest-created audio threads are unchanged. The 4.5 ms fresh-render spacing remains necessary for [burst refills](#burst-renders-when-a-device-callback-releases-multiple-blocks).
|
||||
- **Found on:** [The Legend of Zelda: Ocarina of Time](../../dm/games/0400486024DEC000/README.md), [issue #3059](https://github.com/seedds/nxnative/issues/3059). Two reporters observed underruns. On an M4, macOS 27.0.1, nichq50 reported four queued blocks and zero underruns across 16,000 callbacks on speakers and AirPods after applying only the policy patch; the attached text file is the patch, not a post-fix log.
|
||||
- **Check:** `t_audren_layout` sets, reads and resets a real pthread's Mach policy, checks setup/teardown scope, and verifies intact PCM with policy rejection and opt-out. Its cadence fixtures retain 2,000 ordered blocks without simulated underruns at 44.1 kHz / 256 frames and 48 kHz / 512 frames; these do not simulate OS wakeup delay. On an M6 with macOS 27.2.1, XNU raised the requested 1 ms computation to 2.5 ms (half the constraint), consistent with [XNU's policy implementation](https://github.com/apple-oss-distributions/xnu/blob/main/osfmk/kern/thread_policy.c). This is a budget, not CPU time consumed.
|
||||
- **Live validation:** [Isaac's audio scheduling checks](../../dm/games/01009BC00C38A000/README.md#audio-scheduling-checks) cover real 48 kHz USB output and 44.1 kHz built-in speakers on an M6, including the limits of its CPU/energy samples. [Breath of the Wild's scheduling validation](../../dm/games/01007EF00011E000/README.md#audio-producer-scheduling-validation-2026-11-20) covers SDK 20 and isolates a screenshot-associated frame-time flag with a matched policy-off/on comparison.
|
||||
- **Open:** iOS device behavior and power impact, and power on the affected M4. The 44.1 kHz crackle reported in [issue #2796](https://github.com/seedds/nxnative/issues/2796#issuecomment-6998635365) lacks underrun measurements, so its overlap remains unconfirmed.
|
||||
Reference in new issue
Block a user