You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With X2W_AUDIO_PERMISSIVE=1 the audio HAL and APU stand-ins accept their calls but produce no output.
Done when
A minimal path renders the submitted buffers through WASAPI or XAudio2 on desktop, starting with a source-built
fixture that submits a known tone.
Context: docs/startup-runtime.md (#1135). Do not attach game files, dumps or logs that contain addresses or names from an executable; describe results in terms of the component tested.
Open for one contributor to claim. Please reply here with your chosen desktop API (WASAPI or XAudio2) and the submission boundary you will instrument. This is the first implementation slice of #1145. The startup team will handle the application retest with your build.
On one Windows run the movie advanced through all 450 frames. During playback all 1,200 peak readings from the sampled process audio session were zero. The cause of the reported stutter remains open. #1071 already covers a source-built XApu caller and a recording provider. Its queue payload is a fixture convention and does not establish a PCM buffer layout.
Please deliver a source-built Windows fixture and the first real desktop buffer submission from the runtime path it exercises. Feed a short sequence of distinguishable PCM blocks, including a silent block, and record the first accepted block, sample format, submitted frame counts and actual consumption/completion. Use the selected API's clock, padding or voice completion events to identify consumption. Verify the generated tone on a dedicated or process-isolated capture path when available. Record endpoint capability skips separately.
Please exercise three cases in the same test: no submission; a continuously supplied stream including intentional silence; and deliberately withholding the next block until the playing queue drains, then resuming. Report the drained interval and recovery separately from any hardware/driver glitch count. These cases distinguish absent output, valid silent samples and producer starvation.
Suggested new CTest name: startup_audio_output. Proposed acceptance command: ctest --preset release --no-tests=error -R '^startup_audio_output$' -V. Include adapter/endpoint, Windows build, commit and per-case counters in your PR. Share only source-built fixtures and aggregate results.
API: WASAPI shared mode (IMMDeviceEnumerator, IAudioClient, IAudioRenderClient, IAudioClock), mix format taken from GetMixFormat, blocks converted to it only when it is plain float or 16-bit PCM. Consumption is read from GetCurrentPadding and IAudioClock::GetPosition. A machine with no render endpoint (or one that refuses to initialise) reports a capability skip (exit 77), counted separately from pass and fail.
Submission boundary: a small desktop render sink under src/startup_stubs/ with one call, submit(format, frame count, bytes), which copies the block into the endpoint buffer and records the first accepted block, the format, the submitted frame counts and the consumed frames. I will not claim a PCM buffer layout for the console command queue: the XApuEnqueueCommand payload is still unknown (as noted for #1071), so xapu.cpp is not decoded in this slice. The source-built fixture drives the sink directly.
Fixture startup_audio_output: three cases in one test: no submission; a continuous stream of distinguishable blocks including an intentional silent block; and a producer that deliberately withholds the next block until the queue drains, then resumes. The drained interval and the recovery are reported separately from the glitch count. A capture-path check of the tone is not part of this slice. Draft PR to follow.
The source-built WASAPI sink is on main via #1250 (3c7b78f). Windows Release passed on a real shared-mode endpoint (44.1 kHz, eight-channel float mix). No submission registered zero frames; the eight-block stream, including silence, submitted and consumed 14,112 frames; the starvation case recorded a 307 ms drain and visible recovery 15 ms after resubmission.
This validates desktop submission and consumption from generated buffers. The console command payload, its integration with the sink, capture-path output and application audio remain open here.
A shared-ring test gave us an oracle for separating source decoding from desktop audio output. In a generated mono 48 kHz case, the first enable produced 2,048 PCM samples that matched FFmpeg byte for byte. Advancing the reader produced the next 512 samples, preserved the 1,536 unread samples and left a 256-byte guard intact. With enable omitted, both the context and the ring retained their sentinels. The same guest passed on our XCL build and VIctory d2a4bae1. This complements the proposed known-tone WASAPI/XAudio2 sink test. We have no Xbox2Windows pass or latency measurement for this fixture. AI-assisted report.
May I claim the next slice here, in place of the inactive contributor?
Context on why I am asking rather than just starting: tedin7 claimed the first slice at 05:24 and it landed as #1250 at 05:58; I see no activity from them in this issue since. NinosTech posted the source-built control at 09:15, so that part is moving. If the remaining work is still meant to be single-owner and tedin7 is coming back, say so and I will stay off it — I do not want to duplicate a slice someone is mid-way through.
If it is open, I would take the playback timing slice rather than another sink.
Why that slice is the actionable one now. The title boots to the first-run UI on current main, and audio is no longer silent for two separate people: speech is audible but stutters — choppy chunks, pitch/delay wobble, sound arriving late and then catching up. That is not "no output", it is unstable pacing, so it points at the submission boundary and the clock, not at endpoint format support.
What I already measured on my own run (so this is not a cold start):
The title loads the realXAudio2_9.dll and a real AudioSes.dll session, so what plays is Windows audio, not our code.
Our stand-ins are involved earlier in the chain (AcpHal submit, XApuEnqueueCommand, XDspConnectWithMaximumStreamLimit), but AcpHal::submit is never called and XApuGetResultCount is polled fewer than 500 times in a 130 s run. So the APU stand-in is not the feeding path for the audible stream.
XApuEnqueueCommand is called with type 1/2 commands whose r9 steps by 0x100 per call, i.e. an advancing cursor, and the APU stand-in never produces results.
The process uses about one core of twelve (8.6%) at Normal priority with 98 threads, so this is not CPU starvation or a job-object CPU cap — I checked both.
Proposed scope for the slice: instrument the submission boundary that the audible stream actually crosses (which call feeds the XAudio2 voice, and at what cadence), produce a source-built control that distinguishes "steady 10 ms blocks" from "bursty blocks with gaps", and record the observed cadence and pacing error. I would report the cadence numbers with the control, not a pass/fail.
If you would rather I take a different slice (for example the XMA decode path in xapu/AcpHal, or supporting SQ_RSRC_IMG_2D_ARRAY in the shader translation, which is also blocking right now), tell me which and I will take that instead.
@triggered02 Please take the playback-timing measurement as a separate slice. Keep #1250's sink and NinosTech's decode oracle as independent controls. On the actual audible path, record the first submission, frame count, clock/timestamps, underrun gaps and recovery against a source-built steady-versus-bursty input. Keep the provider behavior unchanged while measuring. An audible report and CPU utilization alone do not identify the stutter's source.
Taken as a separate slice, with #1250's sink and NinosTech's decode oracle left as independent controls. First piece is up as #1368: a source-built steady-versus-bursty control that uses the existing sink and endpoint unchanged and records exactly the fields you listed.
Measured on this machine's shared-mode endpoint (float32, 2 ch, 48 kHz, 24000-frame buffer):
So the control distinguishes the two: bursty feed produces a 740.6 ms drained interval the steady feed does not, and recovers in 16 ms. That is the sensitivity check the measurement needed before anything can be concluded about the title's own pacing — a control that could not tell steady from bursty would not be evidence.
Next step is the audible path itself: record the same fields (first submission, frame count, clock/timestamps, underrun gaps, recovery) at the submission boundary the title's audible stream actually crosses, with provider behaviour unchanged while measuring. From the title's side I have so far: the real XAudio2_9.dll and AudioSes.dll are what produce sound, AcpHal::submit is never called, and XApuGetResultCount is polled fewer than 500 times in 130 s — so the boundary to instrument is the one feeding the XAudio2 voice, not the APU stub. I will confirm where that lands before changing anything.
One limit worth stating up front: if the title's audible path turns out to be entirely inside system XAudio2 with no call of ours in between, the instrumentation needs a logging-only proxy for that import rather than a stand-in change. I will bring that as its own proposal rather than slipping it into this PR.
Proposal for the second half of the slice: a logging-only XAudio2 tap, so the pacing numbers come from the title's audible path instead of from my sink. Nothing is implemented yet; this is the design I would build, so you can redirect it before I spend the effort.
Boundary. The title imports XAudio2Create from XAudio2_9.dll (real system DLL; AudioSes.dll appears later as the WASAPI session). There is no call of ours in that path — AcpHal::submit is never called and XApuGetResultCount is polled under 500 times in 130 s. So the only way to see submissions is to sit between the title and that import.
Mechanism (reuses an in-tree pattern rather than inventing one): runtime_proxy.cpp already walks the main module's import directory and rewrites the IAT slot for GetProcAddress. The tap does the same for the XAudio2Create slot, forwards to the real export, and returns a wrapper object whose vtable dispatches through the same template <int N> forward(...) pattern that file already uses for provider objects, so every method forwards unchanged and only the ones I log are touched.
What I would record, matching the fields you listed:
IXAudio2CreateSourceVoice / CreateMasteringVoice / CreateSubmixVoice: the WAVEFORMATEX (rate, channels, bits, tag) — this alone would show a rate or channel mismatch between the title's blocks and the endpoint;
IXAudio2SourceVoice::SubmitSourceBuffer: monotonic timestamp, AudioBytes, PlayBegin/PlayLength, Flags, and the running block index — the raw material for first submission, block cadence, and gaps;
Start/Stop/Discontinuity and GetState (XAUDIO2_VOICE_STATE: BuffersQueued, SamplesPlayed) — sampled rather than polled hard, to give underrun and recovery without changing timing;
Constraints I would hold to, because a tap that perturbs what it measures is worse than no tap:
off unless X2W_AUDIO_TAP=1;
logging only: no return value, argument or buffer is altered; the wrapper forwards before doing anything that could fail;
no allocation, no locking on the audio thread — a preallocated ring filled with plain stores, drained by a background writer;
timestamps from QueryPerformanceCounter taken at entry, nothing else;
the tap reports its own overhead (calls tapped, writer drops) so the measurements can be discounted if the writer falls behind.
What it would settle. If the title submits 10 ms blocks steadily and the endpoint still stutters, the fault is downstream of the title and the tap exonerates the producer. If submissions arrive in bursts with 100 ms gaps — which is what "stutters like 10 fps" sounds like — the numbers point back at the title's mixer, and the buffer sizes and voice state say whether it is starved or simply late.
Risks I want to name. The wrapper has to survive a vtable whose layout I only know from the public headers, so a wrong slot count would be a crash rather than a wrong number; the tap is per-process and cannot see system-side mixing; and if the title creates voices through an ordinal import instead of by name, the IAT walk needs the ordinal path too. I would verify the wrapper against the public IXAudio2 declaration before wiring it into a run.
Two alternatives, if you prefer a different boundary: tap the AudioSes/WASAPI layer instead (closer to the endpoint, further from the producer), or keep everything in the fixture and only accept numbers from my own sink (#1368 as it stands, which cannot speak for the title). My preference is the XAudio2 tap because it is the boundary where a producer-side stutter is visible.
#1368 is merged and gives us a timing control for the desktop sink. For the next slice, use a source-built client with an explicit diagnostic XAudio2 provider or factory. First verify that the same voice lifecycle, buffer arguments, callbacks and results are observed with diagnostics enabled and disabled. Record timestamps, frame counts, queue depth, drop counts and clock progress without recording audio bytes or user data. Keep the steady/bursty comparison and show that the disabled path calls the system provider directly. A steady submission stream would narrow the investigation to what happens after submission, but would leave voice state, queued playback and endpoint scheduling to verify.
Understood — not an IAT tap. I will take your formulation: a source-built client with an explicit diagnostic XAudio2 provider/factory, with the system provider as the other arm of the same client, so the comparison is between two explicit providers rather than between an intercepted and an untouched process.
Concretely, the shape I will build:
a small provider interface the client owns (create_voice(format), submit(buffer), start/stop, flush, state), with two implementations: a diagnostic provider that records the lifecycle and arguments, and a system provider that calls XAudio2Create and the real IXAudio2 directly — no import patching anywhere, so "the disabled path calls the system provider directly" is true by construction and visible in the code;
one client driving steady and bursty submission plans through whichever provider it is given, so the two arms differ only in the provider;
a per-arm trace of: voice lifecycle events (create → start → stop → destroy), buffer arguments (frames, flags, play region — no audio bytes and no user data), callbacks received, and results; plus timestamps, frame counts, queue depth, drop counts and clock progress.
The first check is the one you set as a precondition: diagnostics enabled and disabled must observe the same voice lifecycle, buffer arguments, callbacks and results. If they do not agree, the diagnostic arm is not a faithful window and any number from it is worthless — so the fixture fails on divergence before it compares pacing at all.
Then the steady/bursty comparison runs in both arms and reports the same quantities as #1368, so the earlier control stays directly comparable.
I am also recording your caveat as the interpretation limit, not as a footnote: a steady submission stream would narrow the fault to after submission — voice state, queued playback and endpoint scheduling would remain unverified by this slice. I will not claim the stutter is located until those are checked separately.
One question of scope, so I do not overbuild: I will keep the diagnostic provider to the lifecycle the client actually uses (source voice, buffer submission, callbacks, state) rather than mirroring all of IXAudio2. If you want a specific call in the diagnostic arm — for example GetState sampling as well as callbacks — say which and I will include it; otherwise I will include both and report which one disagrees first if they do.
Built as directed: #1399 — a source-built client with an explicit diagnostic provider, and the system provider as the other arm of the same client. No intercepting tap and no import patching anywhere; the diagnostics-disabled arm calls XAudio2Create and the real IXAudio2 directly in plain sight.
The precondition first. The fixture verifies both arms observe the same voice lifecycle, buffer arguments, callbacks and results for the same plan, and fails on divergence with the first differing event — before it reports any timing. That check earned its place immediately: it caught that my diagnostic arm did not advance its clock during withholding gaps, which made the bursty arm unfaithful by construction (divergence at event 3). Fixed, both arms are now faithful.
Timestamp, frame count, queue depth, drop count and clock progress are all recorded per arm; no audio bytes and no user data are recorded or stored — the system arm submits silence.
I took the narrower reading of the scope you left open: the diagnostic provider covers the lifecycle the client uses (create, submit, start/stop, callbacks, state) rather than mirroring all of IXAudio2, and it samples GetState as well as counting callbacks so you can see which disagrees first if they do.
Your caveat is restated in the PR as a limit, not a footnote: a steady submission stream would narrow the fault to after submission and would still leave voice state, queued playback and endpoint scheduling to verify. I am not claiming this locates the stutter.
Ready for your review; if you want the diagnostic arm extended to a specific call before this is useful, name it and I will add it here rather than in a follow-up.
The mixer timer change landed in #1448. Independent Windows Release check at e800392 with a source-built caller: median Sleep(2) was 15.54 ms before connecting, 2.44 ms with two connections, 2.51 ms after one disconnect, and 15.42 ms after the last disconnect. The existing startup_stubs test also passed. This confirms the timer lifetime and refill timing on this host. Keep the independent buffer-submit and output validation tracked here.
Playback run on main6ee878d8, built with -DX2W_WITH_OPUS=ON (libopus 1.5.2) and X2W_XAPU_TYPED_COMPLETIONS=1, on the test PC (RTX 4070 Ti).
Type-3 Opus completions succeed. The logged burst is 48 kHz, 960 frames, mono float (3840-byte output). The first 24 enqueue calls (one type-1 open, then 23 type-3 packets, all slot 0) all returned S_OK, with 0 opus errors. Enqueue logging is capped at 24 calls, so a full-run decoded completion count is not available from this log. Audio is audible through the title's real XAudio2_9. The desktop WASAPI sink is not on that path, so there are no accepted submissions from that sink to report.
Speech stutters, and it drifts from the subtitles.
At the scene where the title starts XMA / AcpHal type-5 submits and XDspActivate is refused (XDSP_E_NO_DEVICE_RESOURCES), the picture also drops to 2–8 fps. The same drop appears on this SHA without Opus. XMA and XDSP are still missing.
#2107 is on main at dbb1c9aa. The opt-in X2W_AUDIO_PERMISSIVE=1 plus X2W_AUDIO_ACTIVITY=1 path now reports XMA context transitions and XApu command counts. Native Windows source-built checks passed in Release with the default build and in Debug and Release with libopus 1.5.2. The Opus control detects an uncounted short type-3 command; turning the opt-in off preserves the guest-facing results.
This leaves #1145 open. The new evidence is from stand-in fixtures. For a later matched startup measurement, report the aggregated audio counts and whether playback was observed. Verification and exact commands.
Activity
R0Y00 commentedon Nov 24, 2026
Open for one contributor to claim. Please reply here with your chosen desktop API (WASAPI or XAudio2) and the submission boundary you will instrument. This is the first implementation slice of #1145. The startup team will handle the application retest with your build.
On one Windows run the movie advanced through all 450 frames. During playback all 1,200 peak readings from the sampled process audio session were zero. The cause of the reported stutter remains open. #1071 already covers a source-built XApu caller and a recording provider. Its queue payload is a fixture convention and does not establish a PCM buffer layout.
Please deliver a source-built Windows fixture and the first real desktop buffer submission from the runtime path it exercises. Feed a short sequence of distinguishable PCM blocks, including a silent block, and record the first accepted block, sample format, submitted frame counts and actual consumption/completion. Use the selected API's clock, padding or voice completion events to identify consumption. Verify the generated tone on a dedicated or process-isolated capture path when available. Record endpoint capability skips separately.
Please exercise three cases in the same test: no submission; a continuously supplied stream including intentional silence; and deliberately withholding the next block until the playing queue drains, then resuming. Report the drained interval and recovery separately from any hardware/driver glitch count. These cases distinguish absent output, valid silent samples and producer starvation.
Suggested new CTest name:
startup_audio_output. Proposed acceptance command:ctest --preset release --no-tests=error -R '^startup_audio_output$' -V. Include adapter/endpoint, Windows build, commit and per-case counters in your PR. Share only source-built fixtures and aggregate results.tedin7 commentedon Nov 24, 2026
Claiming the first slice.
API: WASAPI shared mode (IMMDeviceEnumerator, IAudioClient, IAudioRenderClient, IAudioClock), mix format taken from
GetMixFormat, blocks converted to it only when it is plain float or 16-bit PCM. Consumption is read fromGetCurrentPaddingandIAudioClock::GetPosition. A machine with no render endpoint (or one that refuses to initialise) reports a capability skip (exit 77), counted separately from pass and fail.Submission boundary: a small desktop render sink under
src/startup_stubs/with one call, submit(format, frame count, bytes), which copies the block into the endpoint buffer and records the first accepted block, the format, the submitted frame counts and the consumed frames. I will not claim a PCM buffer layout for the console command queue: theXApuEnqueueCommandpayload is still unknown (as noted for #1071), soxapu.cppis not decoded in this slice. The source-built fixture drives the sink directly.Fixture
startup_audio_output: three cases in one test: no submission; a continuous stream of distinguishable blocks including an intentional silent block; and a producer that deliberately withholds the next block until the queue drains, then resumes. The drained interval and the recovery are reported separately from the glitch count. A capture-path check of the tone is not part of this slice. Draft PR to follow.startup: add a WASAPI render sink and the startup_audio_output fixture
R0Y00 commentedon Nov 24, 2026
The source-built WASAPI sink is on main via #1250 (3c7b78f). Windows Release passed on a real shared-mode endpoint (44.1 kHz, eight-channel float mix). No submission registered zero frames; the eight-block stream, including silence, submitted and consumed 14,112 frames; the starvation case recorded a 307 ms drain and visible recovery 15 ms after resubmission.
This validates desktop submission and consumption from generated buffers. The console command payload, its integration with the sink, capture-path output and application audio remain open here.
NinosTech commentedon Nov 24, 2026
Source-built control for the audio HAL
A shared-ring test gave us an oracle for separating source decoding from desktop audio output. In a generated mono 48 kHz case, the first enable produced 2,048 PCM samples that matched FFmpeg byte for byte. Advancing the reader produced the next 512 samples, preserved the 1,536 unread samples and left a 256-byte guard intact. With enable omitted, both the context and the ring retained their sentinels. The same guest passed on our XCL build and VIctory d2a4bae1. This complements the proposed known-tone WASAPI/XAudio2 sink test. We have no Xbox2Windows pass or latency measurement for this fixture. AI-assisted report.
Full test record and revisions.
triggered02 commentedon Nov 24, 2026
May I claim the next slice here, in place of the inactive contributor?
Context on why I am asking rather than just starting: tedin7 claimed the first slice at 05:24 and it landed as #1250 at 05:58; I see no activity from them in this issue since. NinosTech posted the source-built control at 09:15, so that part is moving. If the remaining work is still meant to be single-owner and tedin7 is coming back, say so and I will stay off it — I do not want to duplicate a slice someone is mid-way through.
If it is open, I would take the playback timing slice rather than another sink.
Why that slice is the actionable one now. The title boots to the first-run UI on current main, and audio is no longer silent for two separate people: speech is audible but stutters — choppy chunks, pitch/delay wobble, sound arriving late and then catching up. That is not "no output", it is unstable pacing, so it points at the submission boundary and the clock, not at endpoint format support.
What I already measured on my own run (so this is not a cold start):
XAudio2_9.dlland a realAudioSes.dllsession, so what plays is Windows audio, not our code.AcpHalsubmit,XApuEnqueueCommand,XDspConnectWithMaximumStreamLimit), butAcpHal::submitis never called andXApuGetResultCountis polled fewer than 500 times in a 130 s run. So the APU stand-in is not the feeding path for the audible stream.XApuEnqueueCommandis called with type 1/2 commands whoser9steps by0x100per call, i.e. an advancing cursor, and the APU stand-in never produces results.Proposed scope for the slice: instrument the submission boundary that the audible stream actually crosses (which call feeds the XAudio2 voice, and at what cadence), produce a source-built control that distinguishes "steady 10 ms blocks" from "bursty blocks with gaps", and record the observed cadence and pacing error. I would report the cadence numbers with the control, not a pass/fail.
If you would rather I take a different slice (for example the XMA decode path in
xapu/AcpHal, or supportingSQ_RSRC_IMG_2D_ARRAYin the shader translation, which is also blocking right now), tell me which and I will take that instead.R0Y00 commentedon Nov 24, 2026
@triggered02 Please take the playback-timing measurement as a separate slice. Keep #1250's sink and NinosTech's decode oracle as independent controls. On the actual audible path, record the first submission, frame count, clock/timestamps, underrun gaps and recovery against a source-built steady-versus-bursty input. Keep the provider behavior unchanged while measuring. An audible report and CPU utilization alone do not identify the stutter's source.
triggered02 commentedon Nov 24, 2026
Taken as a separate slice, with #1250's sink and NinosTech's decode oracle left as independent controls. First piece is up as #1368: a source-built steady-versus-bursty control that uses the existing sink and endpoint unchanged and records exactly the fields you listed.
Measured on this machine's shared-mode endpoint (float32, 2 ch, 48 kHz, 24000-frame buffer):
So the control distinguishes the two: bursty feed produces a 740.6 ms drained interval the steady feed does not, and recovers in 16 ms. That is the sensitivity check the measurement needed before anything can be concluded about the title's own pacing — a control that could not tell steady from bursty would not be evidence.
Next step is the audible path itself: record the same fields (first submission, frame count, clock/timestamps, underrun gaps, recovery) at the submission boundary the title's audible stream actually crosses, with provider behaviour unchanged while measuring. From the title's side I have so far: the real
XAudio2_9.dllandAudioSes.dllare what produce sound,AcpHal::submitis never called, andXApuGetResultCountis polled fewer than 500 times in 130 s — so the boundary to instrument is the one feeding the XAudio2 voice, not the APU stub. I will confirm where that lands before changing anything.One limit worth stating up front: if the title's audible path turns out to be entirely inside system XAudio2 with no call of ours in between, the instrumentation needs a logging-only proxy for that import rather than a stand-in change. I will bring that as its own proposal rather than slipping it into this PR.
startup: add a steady-versus-bursty playback-timing control
triggered02 commentedon Nov 24, 2026
Proposal for the second half of the slice: a logging-only XAudio2 tap, so the pacing numbers come from the title's audible path instead of from my sink. Nothing is implemented yet; this is the design I would build, so you can redirect it before I spend the effort.
Boundary. The title imports
XAudio2CreatefromXAudio2_9.dll(real system DLL;AudioSes.dllappears later as the WASAPI session). There is no call of ours in that path —AcpHal::submitis never called andXApuGetResultCountis polled under 500 times in 130 s. So the only way to see submissions is to sit between the title and that import.Mechanism (reuses an in-tree pattern rather than inventing one):
runtime_proxy.cppalready walks the main module's import directory and rewrites the IAT slot forGetProcAddress. The tap does the same for theXAudio2Createslot, forwards to the real export, and returns a wrapper object whose vtable dispatches through the sametemplate <int N> forward(...)pattern that file already uses for provider objects, so every method forwards unchanged and only the ones I log are touched.What I would record, matching the fields you listed:
IXAudio2CreateSourceVoice/CreateMasteringVoice/CreateSubmixVoice: theWAVEFORMATEX(rate, channels, bits, tag) — this alone would show a rate or channel mismatch between the title's blocks and the endpoint;IXAudio2SourceVoice::SubmitSourceBuffer: monotonic timestamp,AudioBytes,PlayBegin/PlayLength,Flags, and the running block index — the raw material for first submission, block cadence, and gaps;Start/Stop/DiscontinuityandGetState(XAUDIO2_VOICE_STATE:BuffersQueued,SamplesPlayed) — sampled rather than polled hard, to give underrun and recovery without changing timing;startup_audio_pacingmetrics computed from those numbers, so steady and bursty are reported in the same units as startup: add a steady-versus-bursty playback-timing control #1368.Constraints I would hold to, because a tap that perturbs what it measures is worse than no tap:
X2W_AUDIO_TAP=1;QueryPerformanceCountertaken at entry, nothing else;What it would settle. If the title submits 10 ms blocks steadily and the endpoint still stutters, the fault is downstream of the title and the tap exonerates the producer. If submissions arrive in bursts with 100 ms gaps — which is what "stutters like 10 fps" sounds like — the numbers point back at the title's mixer, and the buffer sizes and voice state say whether it is starved or simply late.
Risks I want to name. The wrapper has to survive a vtable whose layout I only know from the public headers, so a wrong slot count would be a crash rather than a wrong number; the tap is per-process and cannot see system-side mixing; and if the title creates voices through an ordinal import instead of by name, the IAT walk needs the ordinal path too. I would verify the wrapper against the public
IXAudio2declaration before wiring it into a run.Two alternatives, if you prefer a different boundary: tap the
AudioSes/WASAPI layer instead (closer to the endpoint, further from the producer), or keep everything in the fixture and only accept numbers from my own sink (#1368 as it stands, which cannot speak for the title). My preference is the XAudio2 tap because it is the boundary where a producer-side stutter is visible.R0Y00 commentedon Nov 24, 2026
#1368 is merged and gives us a timing control for the desktop sink. For the next slice, use a source-built client with an explicit diagnostic XAudio2 provider or factory. First verify that the same voice lifecycle, buffer arguments, callbacks and results are observed with diagnostics enabled and disabled. Record timestamps, frame counts, queue depth, drop counts and clock progress without recording audio bytes or user data. Keep the steady/bursty comparison and show that the disabled path calls the system provider directly. A steady submission stream would narrow the investigation to what happens after submission, but would leave voice state, queued playback and endpoint scheduling to verify.
triggered02 commentedon Nov 24, 2026
Understood — not an IAT tap. I will take your formulation: a source-built client with an explicit diagnostic XAudio2 provider/factory, with the system provider as the other arm of the same client, so the comparison is between two explicit providers rather than between an intercepted and an untouched process.
Concretely, the shape I will build:
create_voice(format),submit(buffer),start/stop,flush,state), with two implementations: a diagnostic provider that records the lifecycle and arguments, and a system provider that callsXAudio2Createand the realIXAudio2directly — no import patching anywhere, so "the disabled path calls the system provider directly" is true by construction and visible in the code;The first check is the one you set as a precondition: diagnostics enabled and disabled must observe the same voice lifecycle, buffer arguments, callbacks and results. If they do not agree, the diagnostic arm is not a faithful window and any number from it is worthless — so the fixture fails on divergence before it compares pacing at all.
Then the steady/bursty comparison runs in both arms and reports the same quantities as #1368, so the earlier control stays directly comparable.
I am also recording your caveat as the interpretation limit, not as a footnote: a steady submission stream would narrow the fault to after submission — voice state, queued playback and endpoint scheduling would remain unverified by this slice. I will not claim the stutter is located until those are checked separately.
One question of scope, so I do not overbuild: I will keep the diagnostic provider to the lifecycle the client actually uses (source voice, buffer submission, callbacks, state) rather than mirroring all of
IXAudio2. If you want a specific call in the diagnostic arm — for exampleGetStatesampling as well as callbacks — say which and I will include it; otherwise I will include both and report which one disagrees first if they do.triggered02 commentedon Nov 24, 2026
Built as directed: #1399 — a source-built client with an explicit diagnostic provider, and the system provider as the other arm of the same client. No intercepting tap and no import patching anywhere; the diagnostics-disabled arm calls
XAudio2Createand the realIXAudio2directly in plain sight.The precondition first. The fixture verifies both arms observe the same voice lifecycle, buffer arguments, callbacks and results for the same plan, and fails on divergence with the first differing event — before it reports any timing. That check earned its place immediately: it caught that my diagnostic arm did not advance its clock during withholding gaps, which made the bursty arm unfaithful by construction (divergence at event 3). Fixed, both arms are now faithful.
Measured (48 kHz stereo 16-bit, 120 blocks of 10 ms, shared-mode endpoint):
Timestamp, frame count, queue depth, drop count and clock progress are all recorded per arm; no audio bytes and no user data are recorded or stored — the system arm submits silence.
I took the narrower reading of the scope you left open: the diagnostic provider covers the lifecycle the client uses (create, submit, start/stop, callbacks, state) rather than mirroring all of
IXAudio2, and it samplesGetStateas well as counting callbacks so you can see which disagrees first if they do.Your caveat is restated in the PR as a limit, not a footnote: a steady submission stream would narrow the fault to after submission and would still leave voice state, queued playback and endpoint scheduling to verify. I am not claiming this locates the stutter.
Ready for your review; if you want the diagnostic arm extended to a specific call before this is useful, name it and I will add it here rather than in a follow-up.
startup: add a voice-lifecycle control with explicit diagnostic and …
R0Y00 commentedon Nov 24, 2026
The mixer timer change landed in #1448. Independent Windows Release check at e800392 with a source-built caller: median Sleep(2) was 15.54 ms before connecting, 2.44 ms with two connections, 2.51 ms after one disconnect, and 15.42 ms after the last disconnect. The existing startup_stubs test also passed. This confirms the timer lifetime and refill timing on this host. Keep the independent buffer-submit and output validation tracked here.
21 remaining items
gh R0Y00#1145 atom 1: count XMA context and XApu command activity in …
gh R0Y00#1145 atom 2: add startup_acphal_xma_activity
gh R0Y00#1145 atom 3: document the audio activity counter
gh R0Y00#1145 review round 1: assert block reuse, share expectations,…
gh R0Y00#1145 review round 2107-1: observe activity inside calls, no …
gh R0Y00#1145 review round 2107-2: start the line interval at the las…
gh R0Y00#1145 rebase: give the fixture's XApuConnect a nonzero buffer…
audio: validate what the real XAudio2 provider actually puts on the …
audio: validate what the real XAudio2 provider actually puts on the …
audio: validate what the real XAudio2 provider actually puts on the …
audio: validate what the real XAudio2 provider actually puts on the …
audio: validate what the real XAudio2 provider actually puts on the …
SimSalabimse commentedon Nov 27, 2026
Playback run on
main6ee878d8, built with-DX2W_WITH_OPUS=ON(libopus 1.5.2) andX2W_XAPU_TYPED_COMPLETIONS=1, on the test PC (RTX 4070 Ti).Type-3 Opus completions succeed. The logged burst is 48 kHz, 960 frames, mono float (3840-byte output). The first 24 enqueue calls (one type-1 open, then 23 type-3 packets, all slot 0) all returned
S_OK, with 0 opus errors. Enqueue logging is capped at 24 calls, so a full-run decoded completion count is not available from this log. Audio is audible through the title's realXAudio2_9. The desktop WASAPI sink is not on that path, so there are no accepted submissions from that sink to report.Speech stutters, and it drifts from the subtitles.
At the scene where the title starts XMA / AcpHal type-5 submits and
XDspActivateis refused (XDSP_E_NO_DEVICE_RESOURCES), the picture also drops to 2–8 fps. The same drop appears on this SHA without Opus. XMA and XDSP are still missing.AI-Assisted
runtime: count XMA context and XApu command activity in the audio sta…
R0Y00 commentedon Nov 28, 2026
#2107 is on main at
dbb1c9aa. The opt-inX2W_AUDIO_PERMISSIVE=1plusX2W_AUDIO_ACTIVITY=1path now reports XMA context transitions and XApu command counts. Native Windows source-built checks passed in Release with the default build and in Debug and Release with libopus 1.5.2. The Opus control detects an uncounted short type-3 command; turning the opt-in off preserves the guest-facing results.This leaves #1145 open. The new evidence is from stand-in fixtures. For a later matched startup measurement, report the aggregated audio counts and whether playback was observed. Verification and exact commands.