Repository navigation
Description
Commit or build
Upstream main at 8c82879.
Summary
With X2W_AUDIO_PERMISSIVE=1, several exports of the audio stand-ins return success without writing the outputs their callers pass. One of them is confirmed to end a run (the DSP activation); the others have the same shape and have not been checked against their callers. This issue lists them so they can be checked one by one.
Reproduction
# Any source-built probe that loads chad.dll with X2W_AUDIO_PERMISSIVE=1 and calls
# XDspActivate(client, ¶ms, &status, &stream)
# with status and stream preset to a sentinel gets 0 back and both outputs untouched.
# Read from the source at 8c82879f: src/startup_stubs/chad.cpp, accept() returns 0 for
# XDspActivate, XDspSubmitCommand, XDspDeactivate and XDspDisconnect and writes nothing.Expected behavior
An export either writes outputs that are valid for what the caller does next, or returns a failure the caller can handle. The public XDspAudio.h reference documents XDspActivate(client, XDspActivationParameters*, XDspStatus** status, XDspStreamHandle* stream), XDspSubmitCommand(stream, XDspCommand*, uint32_t* commandSequence), the status block {lastSubmittedCommandSequence, lastProcessedCommandSequence, firstFailedCommandSequence, HRESULT result} and failure codes such as XDSP_E_NO_DEVICE_RESOURCES.
Observed behavior
Confirmed case, XDspActivate (chad.cpp): returns 0, writes neither the status pointer nor the stream handle. Limited observation from one local startup run, repeated once without and once under the startup debugger: after six activations the executable called XDspSubmitCommand six times with a null stream handle (also answered with 0), then read through the null status pointer at offset 0xC, which is the offset of result in the documented status block, and stopped with an access violation. The values were read from the stand-in log lines (x2w-audio) and from the debugger's stop report; no package data is involved.
Same shape, callers not checked:
| Export | File | What it does today | Status |
|---|---|---|---|
XDspActivate |
chad.cpp | 0, no outputs written | ends a run (above) |
XDspSubmitCommand |
chad.cpp | 0 for any handle including null, sequence not written | reached with a null handle in the same run |
XDspDeactivate, XDspDisconnect |
chad.cpp | 0 for any handle | not checked |
XDspConnectWithMaximumStreamLimit |
chad.cpp | 0 even when the handle pointer is null or not writable | #1871 addresses this one |
XApuConnect |
xapu.cpp | writes the handle (third argument) but never the 16-byte second argument it logs as output(before) |
not checked whether the caller reads it |
XApuDequeueResult |
xapu.cpp | S_OK with an all-zero 0x58-byte result | already documented as a placeholder in docs/startup-runtime.md |
| AcpHal slot 0 (connect), slot 2 (submit) | acphal.cpp | S_OK, nothing written | at one submit call site read locally the pointer argument is not read back; others not checked |
Related
- runtime: validate chad permissive out-handle and add lifecycle checks #1871 validates the connect out-handle and adds
startup_chad_check. As I read its diff, that test requiresXDspActivateandXDspSubmitCommandto return S_OK (it calls activation with plain integers in the two output positions), which would pin the behavior in the first two rows. - startup-runtime: audio produces no output #1145 and its draft PR concern audible output through XAudio2; they do not cover these entry points.
A local fixture for the XDsp rows exists (activation refused with the documented code and both outputs set to null; null and unknown handles refused; negative control: success without outputs must fail). It is not submitted because it conflicts with the test in #1871; the direction for those two rows is the maintainers' call.
Environment
Windows 11 build 26300, MSVC 19.44 x64. No GPU involved.
Checklist
- I reproduced this on a source-built input. (The stand-in behavior; the run-ending consequence is a local observation as described.)
- I did not include game files, dumps, distribution links or credentials.
AI-assisted (Claude Code): the source reading, the fixture and the local observation were produced with AI agents.
Activity
R0Y00 commentedon Nov 24, 2026
Please open the narrow failure-only XDsp slice using the source-built fixture you already have. If there is no usable stream provider in permissive mode, validate both output pointers before writing; for valid output locations, clear them and return XDSP_E_NO_DEVICE_RESOURCES. Refuse null and unknown stream handles on submit without returning a sequence; preserve the caller's sequence output on failure. Keep the strict trap coverage and #1871's connect out-handle checks. Update the placeholder-success assertions for the two exports whose behavior changes.
Acceptance is a synthetic caller that gates its first submit on activation success, checks initialized outputs and unchanged failed-submission sequence, and fails when the old successful no-output behavior is restored. Keep the real provider, XApu and audible XAudio2 output on their existing tracks.
Microsoft XDSP error codes.
ChazY11 commentedon Nov 24, 2026
Opened #1907 as the narrow failure-only slice you described:
XDspActivatevalidates and clears both outputs then returnsXDSP_E_NO_DEVICE_RESOURCES(0x8AC810A2, from the GDK error list rather than assumed),XDspSubmitCommandrefuses nulland unknown handles without writing the sequence and still preserves it on the known-handle failure, and #1871's connect
out-handle checks stay as they are.
The fixture is built from source in the PR: the synthetic caller gates its first submit on activation success and never
reaches submit, and restoring the old successful-no-output behaviour fails the run.
One detail from the negative controls worth recording here: the explicit
!status_outnull checks are equivalent, notuntested —
x2w_local::accessible()already rejects addresses below 0x10000, sowritable(nullptr, ...)is false. I keptthem for intent and said so in the PR instead of claiming they are pinned.
startup: fail XDspActivate and XDspSubmitCommand instead of succeedin…
R0Y00 commentedon Nov 24, 2026
The failure-only XDsp fix #1907 is on main at 87f280f. The source-built activation caller now receives cleared outputs and XDSP_E_NO_DEVICE_RESOURCES and does not submit a command. The strict trap and connect controls still pass. Keeping this issue open for the remaining out-parameter cases. This test does not establish an audible provider or application audio.
R0Y00 commentedon Nov 24, 2026
#1967 is on main at 34472a5. Native Windows Release
startup_xapu_queuepassed. A fresh or drained XApu queue now reports XAPU_E_PENDING_RESULTS and leaves every byte of the supplied result buffer intact. The remaining output-field checks and application audio work stay open here.roansystemlabs commentedon Nov 25, 2026
I'd like to take two of the remaining rows that nobody has checked yet: XDspDeactivate and XDspDisconnect, and the 16-byte second argument of XApuConnect. If someone already has it in progress, I'll step back and review.
I'm leaving the AcpHal slots 0 and 2 out for now, since #1902 is open on
src/startup_stubs/acphal.cpp; I can take them after it lands if they are still open.Scope: one PR per stand-in. For each export, either write outputs that are valid for the documented next call, or return a documented failure with the outputs cleared, following the shape of #1907. No change to the permissive switch itself or to #2107's counters.
Evidence: a source-built caller per export with sentinel-filled outputs and null/unknown handles; a negative control that fails when the export returns success without writing. Windows Release, MSVC. No GPU, no application input.
AI-assisted.
startup: bound XApu queue capacity and clean up queue check
startup: populate XApuDequeueResult type and slot fields (#2242)
R0Y00 commentedon Nov 25, 2026
The XApu completion fields landed in #2242 (ef2e014). Independent Windows Release checks passed for the production FIFO and the source-built native/mapped caller, including full-queue refusal and the existing wrong-order and invalid-handle controls. The result now reports the queued type and slot. Decoded bytes remain zero, and the existing XApuConnect/XDsp observations remain open.
lukaslw-lab commentedon Nov 25, 2026
#2242 (
ef2e0143) stops the startup run here shortly after the title screen. With #2242 reverted on the same build, the run continues.maine94e14ff(includes #2242)All three builds also carry a local timing-only change in the present path (QueryPerformanceCounter around its parts); it does not touch audio.
xapu.dllframes on the stack. The last audio calls logged before it areXApuEnqueueCommand(type 1) and the firstXApuDequeueResult.Setup: Windows 10 19045, RTX 3080 Ti, Release,
tools/startup/run.ps1 -Render -Translate -FakeUser -GpuMirror -HostCpu -StartupBelow40(which setsX2W_AUDIO_PERMISSIVE=1). Counts only; logs stay local.AI-assisted (Claude Code).
JB2WIN commentedon Nov 25, 2026
Same stop on a second host, and the local revert clears it here as well.
main540a9615(includes #2242)xapu.dllframe on the stack-MemoryGiB 20instead of 14ef2e0143(onlyxapu.dllrebuilt)In both stopping runs the title read the first A press about 0.4 s before the stop, and the last audio calls logged were
XApuEnqueueCommand(type 1) and the firstXApuDequeueResult, as in the report above. I have not traced the copy either.Setup: Windows 11 Pro 26200, i5-13600K, RTX 3080 (driver 32.0.16.2124), Release,
tools/startup/run.ps1 -Render -Translate -FakeUser -GpuMirror -HostCpu -ContinueAsserts 1000 -InputScript "4@70" -StoragePath <dir>. Counts only; logs stay local.AI-assisted (Claude Code).
R0Y00 commentedon Nov 25, 2026
The two independent matched reverts are enough to prioritize this regression. #2268 restores zeroed permissive results by default and keeps the typed queue as an explicit experiment. The source-built test catches the original default behavior and still exercises the typed FIFO.
For the exact PR build, please repeat the same startup sequence with
X2W_XAPU_TYPED_COMPLETIONSunset. Record whether it passes the first A press and the first dequeue, the next stopping point, and the Windows build. The consumer-side output needed for typed completions is still open in this thread.startup: return the shared buffer from XApuConnect (#2288)
R0Y00 commentedon Nov 25, 2026
The XApuConnect shared-buffer change is on
mainin #2288. The source-built Windows check passed for zeroed, writable storage on two separate connections and for invalid calls leaving the outputs alone. The buffer is returned with permissive audio; typed completions are still opt-in.For the two prior reports, the focused A/B is one build with permissive audio and the same first A press, first with
X2W_XAPU_TYPED_COMPLETIONSunset and then with it set to1. Please report the commit, Windows build, whether each run reaches the first dequeue and passes the prior stop, and the next stopping point if any. The fixture establishes the connection buffer contract; this replay is the outstanding evidence for the caller's copy.