startup-runtime: audio produces no output #1138
Open
opened 2026-11-24 01:45:34 +00:00 by denn0x
·
26 comments
No Branch/Tag specified
main
codex/indirect-large-backed-views
codex/word3-preflight-check
codex/vertex-table-two-records
codex/live-index-alias
codex/copied-vertex-buffer-srv
codex/windows-stage-test-output
codex/preserve-live-srv-retirement
codex/share-render-target-tracking
codex/sgd5-negative-offset-fixture
coverage-dashboard
codex/mesh-loose-root
codex/mesh86-cache-padding
codex/xmem-scatter-preflight
codex/mesh-depth-ps
codex/indirect-dispatch-refresh
codex/compute-container-index
codex/startup-compute-formatted-load
codex/compute-indirect-producer
codex/compute-atomic-soffset
codex/mesh-dual-handoff
codex/startup-run-sh-watcher-control
codex/queue31-page-alias
codex/indexed-indirect-compute-root
codex/typed-buffer-view-metadata
codex/translated-indexed-address-alias
codex/fixed-mesh-create-result
codex/xmem-section-lease
codex/startup-slot86-mesh-cache
codex/restore-mesh-barrier-iteration
codex/translated-indirect-upload-index
codex/xapu-completion-opt-in
codex/translated-indexed-rect
codex/translated-indexed-indirect
codex/startup-mesh-lds-integration
codex/startup-console-ms24
codex/startup-slot57-mesh-request
codex/indirect-copy-provenance
codex/present-color-producer-trace
codex/compute-dispatch-binding-trace
codex/translated-indirect-table-buffers
codex/indirect-copy-provenance-base
codex/mix-half-literal-source
codex/translated-indirect-draw
codex/xmem-scatter-diagnostics
codex/slot148-recording-upload
codex/slot70-loading-art-verified
codex/command-list-upload-arena
codex/recover-failed-command-list
codex/startup-heap-timing-notes
codex/align-audio-input-timeline
codex/synthetic-depth-export-control
codex/startup-texture1d-on-windows
codex/1629-packed-position-fixture
codex/cpu-srv-refresh
codex/stream-root-srv-draw
codex/audio-mixer-timer
codex/startup-reload-published-shader
codex/priority-integrate-1284
codex/guest-sixteen-page-record
codex/aot-placed-dxr-batch
codex/guest-directory-selection
codex/gamesave-enumerate-read
codex/readme-archive-to-pixels
codex/pe-placed-view-draw
codex/archive-directory-gpu
codex/slot133-dxr-build
codex/materialize-placed-vertex-view
codex/dstorage-directory-offsets
codex/xg-nine-bc-copy
codex/xg-slot10-bc64-arrays
codex/dxr-guest-address-readback
codex/gpu-va-high-bits
codex/clarify-diagnostic-startup-scope
codex/xg-six-levels
codex/typed-derived-blend
codex/english-legal-text-progress
codex/address-bc-4ks
codex/dstorage-bounded-file-read
codex/wide-srv-offsets-menu
codex/startup-memory-srv
codex/bound-view-tail
codex/language-selector-readback
codex/setup-menu-progress
codex/cpu-plane-refresh
codex/startup-ubyte-vertex
codex/presenter-window-selection
codex/startup-uniform-buffer-lane
codex/intro-loop-timing
codex/static-clzero-loops
codex/document-rtx-intro
codex/startup-insertq
codex/nv12-startup-texture
codex/stream-stage-draw
codex/startup-null-uav-format
codex/startup-draw-capture
codex/shorten-windows-checks
codex/dstorage-rfc1950
codex/startup-dump-fence
codex/pr1135-review-base
codex/startup-stream-requests
codex/startup-chroma-view
codex/readme-graphics-pipeline-streams
codex/static-crt-free-tls
codex/arc-140t-rtx-5080-laptop-gpu-reports
codex/main-startup-progress-entry
codex/signed-dxil-catalogue
codex/reloc-free-preferred-base
codex/quad-dpp-bit-mask
codex/raw-srv-bounds
codex/rx9070-31044-hardware-report
codex/gpu-page-source-provenance
codex/runtime-placeholder-interior
codex/gpu-copy-queue-tile-order
codex/pe-pin-external-providers
codex/xmem-placeholder-reservations
codex/xmem-shared-physical-pages
codex/pe-package-startup
codex/xmem-tools-memory-query
codex/cpu-stack-output-import
codex/pe-load-security-cookie
codex/record-three-bvh-retests
codex/cpu-rbp-frame-anchor
codex/xmem-default-startup
codex/record-rtx-3050-ti-9597
codex/docs-readme-start-here
codex/check-compute-mad24-truncation
codex/docs-discord-community
codex/bound-rcx-branch-mutants
codex/rtx5060ti-bvh-62114
codex/837-neutral-readme-disclaimer
codex/record-rtx-3070-ti
codex/title-neutral-public-wording
codex/exe-shadow-frame-submissions
codex/exe-shadow-runtime-chain
codex/readme-polish
codex/gpu-coverage-nov23
codex/spirv-minlod
codex/shadow-shim-device
codex/exe-two-shadow-frames
codex/shim-dispatch-cleanup
codex/fix-spirv-cache-probe
codex/sampler-use
codex/ballot-bit-extract
codex/packed-fma-release
codex/cpu-packed-fma-o2
codex/publish-coverage-dashboard
codex/mesh-cbv-binding-order
codex/spirv-window-fixture
codex/ps-e32-float-uint
codex/ps-cbuffer-reads
codex/fixed-profile-rescan
codex/shim-compute-integration
codex/readme-visible-coverage
codex/readme-research-navigation
codex/integrate-pr-256
codex/indexed-mesh
codex/sampled-coverage
codex/first-ms
codex/dual-ps
codex/ps-attribute
codex/compute-first
codex/ps-export
codex/readme-research-status
codex/ps-layout
codex/blast-window
codex/chart-caption
codex/reviewer-roles
codex/blast-aot
codex/archive-program
codex/crc-stream-program
codex/exe-image-data-chain
codex/local-cpu-fixture-coverage
codex/exe-bound-frame-chain
codex/exe-mapped-comparison
codex/contribution-dependencies
codex/exe-entry-aot
codex/bink-frame-heap-integration
docs/hardware-seven-reports
codex/bink-custom-heap
codex/bink-heap-callers
codex/discussions-entry-points
codex/gpu-community-batch-64
codex/ffx-scratch-writers
codex/generic-project-documentation
codex/ffx-dispatch-rcas
codex/four-windows-gpu-reports
codex/title-neutral-project-wording
codex/community-coverage-provenance
codex/rcas-packed-texels
codex/community-gpu-retests
codex/community-build-and-gpu-reports
codex/ffx-provider-loop
codex/ffx-recurrent-views
codex/ffx-recurrent-resource
codex/amd-wave64-reports
codex/ffx-backend-slots
codex/upscaler-device-init
codex/ffx-context-lifecycle
codex/ffx-version-query
codex/ffx-provider-contract
codex/typed-object-callback
codex/cpu-ordinal-import
codex/chained-cpu-ranges
codex/cpu-import-call
codex/cpu-direct-call
codex/cpu-leaf-aot
codex/community-project-status
codex/script-state-path-replay
codex/script-state-evidence
codex/bc7-resident-tail
codex/bcpack-mip-tail
codex/bc7-texture-draw
codex/asset-ranges
codex/pixel-constants
codex/pixel-aot
codex/pre-exe-workloads
codex/root-signature-device-coverage
engineering/packed-bvh-leaves
engineering/bvh-build-and-update
engineering/intake-root-roundtrip
community/gpu-check-release
community/english-contributor-entry
gpu-check-v0.1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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
R0Y00/Xbox2Windows#1138
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-24T01:45:34Z.
Problem
With
X2W_AUDIO_PERMISSIVE=1the 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.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T04:16:49Z.
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.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T05:24:30Z.
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.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T05:59:39Z.
The source-built WASAPI sink is on main via #1250 (
3c7b78fb). 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.
Imported from R0Y00/Xbox2Windows. Originally posted by NinosTech on 2026-11-24T09:15:44Z.
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.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T09:16:01Z.
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.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T09:18:36Z.
@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.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T09:26:51Z.
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.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T10:12:57Z.
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 #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.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T10:25:09Z.
#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.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T10:27:43Z.
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.Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T10:30:59Z.
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.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T12:08:14Z.
The mixer timer change landed in #1448. Independent Windows Release check at
e8003928with 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.Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T13:11:49Z.
Requesting permission for a different kind of slice than the ones already landed here.
Why I want to stop measuring and change the path
The measurements so far are sound, but they share one property: none of them sits on the title's audible path. On my runs the title loads the real
XAudio2_9.dlland a realAudioSes.dllsession, so what plays is Windows mixing the title's own submissions. Meanwhile:AcpHal::submitis never called;XApuGetResultCountis polled fewer than 500 times in a 130 s run, and the APU stand-in never produces results;That means our audio stack is not in the chain that produces the stutter. #1368's steady-versus-bursty control and #1399's diagnostic provider both characterise a sink we own — they establish that our boundary can report pacing faithfully, which is why they were worth doing — but they cannot move the title's audio, because the title never reaches that boundary. The mixer-timer work in #1448 is the same shape: real and verified, but on the desktop mixer, not on the console submission path.
So if the goal of this issue is eventually "the title's audio comes out of our runtime predictably", continuing to measure the sink will not get there. The question is whether we are allowed to put our own path in the chain on purpose.
What I am asking to build
A first real desktop submission path that the runtime owns end to end, rather than a measurement of someone else's:
XAudio2provider arm we own — same shape as #1399's diagnostic/system pair, but instead of measuring, it becomes the actual playback path: our sink (#1250) is the consumer, with a submit queue whose clock is derived from frames consumed, so pacing is ours to get right rather than the system's to interpret. BehindX2W_AUDIO_OWN=1; with the variable unset, the real DLL is used exactly as today.AcpHal::submitandXApuEnqueueCommandare called with an advancing command cursor; I would record their call shape (type, counts, cadence — no audio bytes) and, if the payload layout cannot be established safely, keep synthesising silence from the shape rather than inventing a PCM layout for a queue whose format we do not know. #1071's warning about not claiming a buffer layout stands.What I am explicitly not asking to do
The scope question I want your answer on
Replacing the real
XAudio2_9.dllpath with an arm we own is a bigger step than the sink work, and it decides whether this issue becomes "validate the desktop's output" or "own the audio output". If you would rather keep the real DLL and only validate what it produces (capture-path verification of the tone), say so and I will take that slice instead — it is narrower and it keeps the system mixer in the chain. My preference is our own arm, because the stutter is a pacing question and pacing is the thing the system mixer hides from us.I will not start until you pick one. AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T13:18:59Z.
While the path question above is open, one piece of it does not depend on your answer: #1508 adds pacing error against the ideal cadence to the existing control.
The reasoning: #1368 reports gaps, drained interval and recovery, which shows that a feed starved. It cannot express drift — how far each submission landed from where it should have been — and "stutters" is precisely a drift statement. Measured on this machine's endpoint:
The steady bound comes from the host's measured Sleep tick (three ticks), not a fixed number, matching what #1448 found here; the fixture fails unless the bursty feed drifts further than the steady one, so the metric has to be sensitive to pass rather than merely non-zero.
This is deliberately not the path-level work. It sharpens the same sink boundary and cannot locate the title's stutter, which is why #1145 stays open for your direction on the two options in my previous comment. AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T13:23:30Z.
Please take the narrower output-validation slice first and keep the real XAudio2 provider in the launch path. Use a source-built caller and an isolated test endpoint with a known tone, intentional silence, then a drain-and-resume sequence. Report only aggregate output timing, tone/silence classification and recovery relative to the sample clock. Keep all audio bytes local and avoid changing the ability to run with the existing provider. A decoder or a replacement provider can be evaluated separately after this establishes which pacing error reaches the endpoint.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T13:27:37Z.
Taking the output-validation slice, keeping the real XAudio2 provider in the launch path. One constraint to settle before I build, because it decides what "isolated test endpoint" can mean on this machine.
What is physically available
Windows does not let a process create an audio endpoint; endpoints come from drivers. On this host
IMMDeviceEnumeratorhas the usual render devices (no virtual cable installed). So there are two ways to observe real output, and neither is a separate endpoint:AUDCLNT_STREAMFLAGS_LOOPBACK). This sees the post-mix output, so it validates the real path end to end — including the realXAudio2— but the capture is of the shared endpoint, and other processes could mix into it.AUDCLNT_SHAREMODE_EXCLUSIVE): our stream owns the endpoint, so nothing else can mix — that is the closest thing to isolation available without a driver — but exclusive mode frequently refuses a format, and it rules out loopback capture at the same time.What I propose to build
A source-built caller that uses the real XAudio2 provider (unchanged
XAudio2Createpath, same asstartup_audio_provider.cpp) with the plan you specified: known tone → intentional silence → drain-and-resume. The observer is loopback capture of the endpoint the provider renders to, and the fixture reports which isolation it actually got rather than assuming:IAudioClient2/IAudioClienton the provider's endpoint; try exclusive first, fall back to shared and reportisolation=exclusiveorisolation=shared;IAudioClock::GetPosition), drained interval, recovery after resubmission;The two questions
exclusivevsshared), or do you want the fixture to require exclusive isolation and skip otherwise? The latter is cleaner evidence but will skip on more machines.I will start with the caller plan and the classifier, which are the same either way, and land the endpoint decision after your answer. AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T13:45:12Z.
The output-validation slice is up as #1536, with the caller driving the real XAudio2 provider and WASAPI loopback classifying what the endpoint produced.
Measured here (shared-mode endpoint, 48 kHz float, 2 ch, buffer 48000 frames ≈ 1000 ms):
Three things had to be fixed before these numbers meant anything, and they are the reason I did not post earlier with a "passing" run:
GetBufferSize.Per your direction, the report is aggregate only — no audio bytes are stored or printed — and I assert the structure (tone → silence of the planned length → tone) rather than absolute latencies, because this machine's endpoint start latency ranges 60–775 ms and that is a property of the machine, not of the plan.
Two limits worth stating plainly:
isolation=shared, reported per run. Windows cannot create an audio endpoint without a driver, so a genuinely separate test endpoint is an environment prerequisite (a virtual device on the host) rather than something the fixture can arrange. That is the point I raised earlier and it still stands.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T13:56:09Z.
Please use WASAPI process loopback scoped to the source-built test process on supported Windows versions. That arm can retain the real XAudio2 provider and the tone/silence/drain sequence without a separate device or a system-wide recording. Aggregate in memory and publish the timing and classification only. Report a capability skip if process loopback is unavailable. Microsoft documents that exclusive mode cannot do loopback. https://github.com/microsoft/Windows-classic-samples/blob/main/Samples/ApplicationLoopback/README.md https://learn.microsoft.com/en-us/windows/win32/coreaudio/loopback-recording
Imported from R0Y00/Xbox2Windows. Originally posted by NiiRoZz on 2026-11-24T21:58:58Z.
Proposing a roadmap for replacing
X2W_AUDIO_PERMISSIVEwith a real implementation, so that the remaining slices here and on #1887 have an agreed order. Nothing below is implemented. Please redirect anything that conflicts with an existing track; I will claim individual slices here before starting any of them.Draft, 2026-11-24, against upstream
mainat2a27507a. This is a plan, not a measurement. Every"seen" below is one local observation unless a PR or issue is cited; layouts are observations, not
facts.
Goal and definition of done
X2W_AUDIO_PERMISSIVEmakes the three console audio stand-ins (AcpHal.dll,xapu.dll,chad.dll) accept calls they cannot serve, so startup continues with no console audio. The goal isto replace that with a real implementation. The flag is gone when all of these hold:
permissive()branch is left inacphal.cpp,xapu.cpporchad.cpp, andrun.ps1nolonger sets the flag.
or returns a documented failure. For a documented failure, a run must show the title handles it.
An export the title never reaches still traps.
shows non-silent audio in windows known to be audible. The #1508 pacing metric shows no stutter.
(see Phase 6). No test is weakened or deleted.
What the flag does today (upstream
main)AcpHal.dllApuCreateHeap, first-fitApuAlloc/ApuFree, address map and validity. XMA shape contexts are allocated and cleared; other context types returnE_NOTIMPL. The HAL object's slot 0 (connect) and slot 2 (submit) returnS_OKand write nothing; other slots trap.xapu.dllXApuEnqueueCommandqueues one completion.XApuDequeueResultreturns an all-zero 0x58-byte placeholder result. The 16-byte output ofXApuConnectis never written. A 1 ms timer is held while connected (#1448).chad.dllXDspActivateclears its outputs and returnsXDSP_E_NO_DEVICE_RESOURCES; submit refuses unknown handles (#1907). Deactivate and disconnect return 0 for any handle.AcpHalReleaseShapeContextstraps in both modes. Nothing in the console path produces samples. TheWASAPI sink (
audio_sink.{h,cpp}, #1250) exists, but nothing feeds it.What is known about the title's audio path
the title loads the system
XAudio2_9.dlland anAudioSes.dllsession. Speech is audible butstutters. The local video DLL also imports
XAudio2_9.dllordinal 1(experiments.md).
ApuCreateHeapwith about 455 MiB cached and 2.2 MiB non-cached.0,0,0,0,350,0, so only XMA contexts are requested (350 × 64 bytes).XApuConnect, then type 1 and type 2 commands. The type 1 command holds48000at +0x38and pointers. The fifth argument (
r9) of the type 2 commands advances by about 0x100 per call.208,896 floats. This was a local branch build; on
main, activation is refused.first_calls(calls, 24)), so thecommand-type list is incomplete.
AcpHal::submitnever called and fewer than 500XApuGetResultCountpolls in 130 s. The local run saw 48 submits. The builds or stages probablydiffer; this needs a recorded commit for each run.
silent today. The title asks for 350 XMA contexts, so this is likely most of the missing audio.
Open questions (Phase 0 answers these)
XDSP_E_NO_DEVICE_RESOURCES, does the title fall back cleanly (dry signal, no reverb) or lose sound? Partly answered: in one local run without a debugger, on a build with #1907's refusal, 8 activations were refused, no submit followed, there was no crash, and the title stayed alive several minutes into the main load. What it does with the sound is unmeasured.Phases
Phase 0: Evidence (blocks everything)
startup, menus and gameplay, plus the commit and build of the run. Do this locally and publish
aggregates only.
writes, and the XAudio2
CreateSourceVoiceformat arguments. Keep this local, with no dumps inissues or PRs.
#1399 measurement and asked for explicit providers. Raise this on #1145 before building anything.
Phase 1: Stand-ins that do not lie (rest of #1887)
The remaining rows of #1887, one narrow PR each, each with a source-built caller and a negative
control that fails when the old behaviour returns:
XApuConnect16-byte output: write it if the caller reads it, otherwise document that it doesnot (Q3).
XApuDequeueResult: replace the zero placeholder with measured fields, or fail.XDspDeactivateandXDspDisconnect: refuse null and unknown handles.#1902 is open on
acphal.cpp. Wait for it to land or rebase on it.Phase 2: Audible-path pacing (#1145, triggered02's track)
Find the stutter's root cause on the XAudio2 path with the existing controls (#1368, #1508, #1536).
Fix the cause, not the buffer size. This phase does not touch the flag but blocks item 3 of the
definition of done.
Phase 3: XMA decode
AcpHal: a worker processes the XMA contexts at the hardware framecadence. It reads packets from the APU heap, writes PCM to the output buffers and posts
completions to the HAL message queue.
provider in the XAudio2 path. They asked to keep the real provider and to evaluate a decoder or
replacement provider separately.
named in #870 is GPL. The options are a clean-room MIT decoder or an optional, separately loaded
provider.
FFmpeg on a generated stream; ask how that stream was produced and under what licence.
Phase 4: XApu command queue
Implement the commands decoded in Q3. Results carry measured fields and complete at a measured
cadence, driven by the audio clock (
IAudioClockconsumption) rather than at enqueue time. If XApucarries final PCM, route it to
audio_sink. Otherwise it stays a control channel.Phase 5: XDsp convolution
If Q4 shows a clean fallback, refusal can stay as the permanent, documented behaviour. If it does
not, implement CPU convolution: uniformly partitioned FFT overlap-save with 1024-frame blocks,
behind the documented
XDspActivate/XDspSubmitCommand/status-block contract. A dry pass-throughis a stopgap, not done.
Phase 6: Remove the flag
The touch list:
src/startup_stubs/{acphal,xapu,chad}.cpptests/startup_acphal_apu_free.cpp,tests/startup_xapu_queue_check.cpp,tests/startup_chad_check.cpptools/startup/run.ps1docs/wine.mddocs/startup-runtime.md: the switch table, "Audio output" and "APU heapstand-in"
Each test's "flag unset → trap" arm becomes an "export not reached or not implemented → trap" arm,
for example
AcpHalReleaseShapeContexts. Each test's implemented-path checks keep their ownnegative control.
Coordination
acphal.cpp; avoid conflicting edits.The owner assigns narrow, source-built, evidence-backed slices. Claim one on the issue before
starting it.
Suggested order
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by NiiRoZz on 2026-11-24T22:52:08Z.
Correction to my roadmap comment above, after a local static read of the main executable's imports, strings and call sites. Nothing here is a run measurement unless stated.
Wrong in the roadmap:
r9) ofXApuEnqueueCommandare not fields. The title callsXApuEnqueueCommand(handle, command, 0)with three arguments. Its commands are 12 to 64 bytes long, so the logged bytes past them and ther9value were stack and register leftovers.XAudio2_9.dlland contains no XAudio2 string, in ASCII or UTF-16. Of the modules in the package, only the video DLL imports it (ordinal 1). XAudio2 output during a run is therefore most likely movie audio, not the game engine's.New findings:
The main executable contains the GUIDs (from the Windows SDK 10.0.26100 headers) of these interfaces, and not
IAudioRenderClient:MMDeviceEnumerator,IMMDeviceEnumeratorandIMMNotificationClientIAudioClientISpatialAudioClientandISpatialAudioObjectRenderStreamThe engine most likely renders through Windows spatial audio, which also exists on desktop. A run has not confirmed this yet.
XApu, read from the command builders, is a decoder-slot queue.
Results drive a per-slot state machine. The title's result handler reads a type at +0, a slot at +4 and a value at +0x34. A slot advances only when the result type matches the command it waits on. The current all-zero placeholder result (type 0) matches no case, so no slot should become ready and no type 3 command should be sent. That is an inference from code: the earlier logs were capped at 24 calls, and an uncapped capture is in progress to check it.
Roadmap changes:
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by NiiRoZz on 2026-11-25T00:46:31Z.
@R0Y00 Proper audio, as opposed to
X2W_AUDIO_PERMISSIVE, needs two decoders. Both raise a licence question that is yours to decide, so I'm asking before opening any PR.Where things stand. These are local prototypes on top of
mainat2a27507a, not submitted.{type, slot}. It returns the shared buffer fromXApuConnect(an #1887 row) and decodes with libopus.xma2decoder.What has to be decided. The project is MIT.
Opus: libopus, BSD-3-Clause, compatible with MIT. How should it enter the build?
COPYING, under a third-party folder.FetchContentwith a pinned URL and SHA-256. This needs network access at configure time.find_package(Opus), so the decode is compiled only when libopus is installed (for example from vcpkg) and the default build and CI are unchanged.Tests need no binary fixtures: they can encode known tones with libopus at test time, which is what the prototype's check does.
XMA: no permissively licensed XMA2 decoder that I know of.
There is no public XMA encoder, so a repository test can only cover the context state machine unless a licensed XMA sample is available.
My suggestion: 1(c) and 2(a), both off by default, so the default build and CI stay unchanged. Then land small slices:
X2W_AUDIO_PERMISSIVEonce every path it covers is real.Which options would you accept?
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T00:52:19Z.
For Opus, go with 1(c): an explicitly enabled optional system dependency discovered by CMake (
find_package). Keep the default configure and current CI independent of libopus. Start with the connect buffer and slot lifecycle as its own PR, then test actual decoding in the optional build with generated tones, exact decoded byte counts, a malformed packet, and a guard that verifies untouched output on refusal. Document the tested libopus version and preserve its notices. Report the audible prototype as a local observation. Opus licenseFor XMA, accept the source-built context state machine first, behind an internal decoder boundary with a test provider. Keep libavcodec out of the in-tree build and distribution for this slice. If the state-machine evidence holds, 2(c) is the integration direction: a separate opt-in provider reviewed with its own licensing, version and provenance. FFmpeg's license depends on its build options, so dynamic loading alone isn't enough information to settle a distribution decision. Use only generated or appropriately licensed sample data for decoder tests. Keep the existing permissive mode until the real paths have separate coverage. FFmpeg licensing notes
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T12:47:42Z.
#2326 landed at
eda7cc3c. The optional build with libopus 1.5.2 passed both source-built tests in Windows Release, and the default build without libopus passed the queue regression. The new controls confirmed that malformed input and insufficient output capacity leave the output and completion queue unchanged on an active slot. The next packet matched the reference stream.The next evidence for this issue is a playback run with the merged build. Record the build SHA, decoded completion count and accepted desktop audio submissions over a short reproducible window. This issue remains open for application output and the separate XMA path. Test command and result
Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-27T00:07:25Z.
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
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T04:12:30Z.
#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.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T15:25:59Z.
Proposal: log the
XDspActivateparameter block before choosing between the refusal and a CPU convolution (Phase 5)On
mainat5de0b114,XDspActivate(src/startup_stubs/chad.cpp) clears both outputs and returnsXDSP_E_NO_DEVICE_RESOURCES(0x8AC810A2). It logs the two output pointers but not the activation parameters (second argument), so a run onmaindoes not show which effects the application requests.One long local run with
X2W_AUDIO_PERMISSIVE=1, read from the stand-in log lines:XDspActivatewas called 6 times, from one call site, with identical arguments each time.XDspSubmitCommand,XDspDeactivateorXDspDisconnectfollowed.This is the same pattern as the Q4 note in the roadmap (refused activations, no submit, no stop), with a different count: 6 here, 8 there. The effect types and sizes requested are not visible in this log.
Proposed change, diagnostic only:
XDspActivate, log a hex dump of a fixed number of bytes at the parameter pointer, probed withx2w_local::readablefirst; logunreadablefor a bad pointer.tests/startup_chad_check.cpp: a sentinel parameter block whose bytes must appear in the log line, a bad parameter pointer that must log without faulting, and the existing return-code and cleared-output checks kept.Not covered: the parameter layout is not interpreted, no convolution, and Q4 (what the application does with the sound after the refusal) stays open. Dumps from an application run stay local; only aggregates would be reported here.
@NiiRoZz your roadmap mentions a local branch that captured the activation parameters (type 1, 1024-frame blocks, mono, impulse-response sizes). Does that capture already cover this, or do you plan to submit it? I will only open this PR if you are not doing it.