Repository navigation
Conversation
Wine and Proton have no MSOpusDecoder.dll, so with ivall#294 XCL loads libopus from an opus.dll there. build-opus.sh downloads the official libopus 1.5.2 release, checks its SHA-256 and builds opus.dll with mingw-w64; docs/linux.md says where to put it (XCL_OPUS_DIR or next to xcl.exe) and how to tell which decoder xcl.log reports.
From ivall/xcl#294 by @simnJS, squashed.
|
Updated for head Tested
The xapu → MFT path on Windows, with the two tests below Both pass on
The 2 dropped buffers from my first run were in The tests (for
|
|
Independent static code audit of Concrete issues found
Minor safety / edge-case notes
(AI-assisted) |
Wine and Proton have no MSOpusDecoder.dll, so with ivall#294 XCL loads libopus from an opus.dll there. build-opus.sh downloads the official libopus 1.5.2 release, checks its SHA-256 and builds opus.dll with mingw-w64; docs/linux.md says where to put it (XCL_OPUS_DIR or next to xcl.exe) and how to tell which decoder xcl.log reports.
|
Ran this stacked with #300 on our machine (main 4017f8f + 9507d05 + 7535ef3, Ryzen 7 9800X3D, RTX 3060 Ti 8 GB, driver 32.0.16.1742, Windows 11, release,
The run reached the settings menus and then a solid-colour background; the log at that point shows BCPack BC1/BC5/BC7 requests refused ( AI use: GPT-6.2 Astra (API model selector) wrote this comment from our run's log; the human contributor listened and checked the numbers. |
|
Follow-up audit notes on
(AI-assisted — Gemini 4 Neon + Claude Opus/Sonnet 5.5) |
|
Thanks to all three of you – the PR is updated (force-pushed, still two commits: The biggest change came from looking further: the title reads the decoded PCM back, mixes it (its own volumes and panning) and plays its mix itself through Windows Spatial Audio on the default endpoint (
@ersinhf thanks for the Windows run and the MFT check. The dropped-buffer limit you found was in @ryosen0 thanks for running it with #300. Your run still had the raw playback ( |
Windows' MSOpusDecoder.dll (a Media Foundation MFT) does not exist under Wine or Proton, so every Opus voice was silent there. When the MFT cannot be created, opus.rs now loads libopus (BSD-3-Clause) from an opus.dll at run time, as XCL does for DXC: %XCL_OPUS_DIR% first, then next to xcl.exe. Windows keeps its own decoder; without either decoder nothing changes (silence, logged once). xcl.log says which decoder is used. The libopus decoder keeps its stream time like the MFT one (it starts at 0 and after a flush), so the check that a stream is at its start before the Ogg timing is applied stays true under Wine. A DLL that loads but lacks one of the four libopus functions is unloaded again.
…s sound) GTA VI does not use XAudio2: it sends its sound to the console's decoder (xapu), and XCL answered every command with silence, so the game was mute. Traced with the new XCL_TRACE_APU=1 (acphal / xapu / DSP commands, their structures, buffers and callers): everything is on stream 0; Activate (kind 1) gives channels at +24 and 48000 Hz at +56; each Process (kind 3) carries one raw Opus packet (80 or 160 B, CELT fullband 20 ms, mono), 960 frames, first_frame 312 on the first command (the pre-skip), into a 3840 B f32 output; Deactivate is kind 2. The title sends nothing to xapu before its menu. Activate now creates an Opus decoder for the stream, Process decodes the packet into the title's output buffer and returns the frames written. Nothing is played from here: the title reads that output back, mixes it and plays its own mix on a system audio endpoint (Windows Spatial Audio), so decoding into the buffer is all XCL has to do. A listening test with the PCM also played on a voice of XCL's own heard the sound twice. The output is decoded into a local buffer and copied byte by byte (the title's pointer is not known to be 4-byte aligned); a stream the connection does not have is not decoded (silence of the length asked for); XCL_TRACE_APU reads only the size of the command's own structure. report.json gets xapu_* counters, and xcl.log a line every 5 s.
|
Re-reviewed force-pushed head Confirmed fixed in
|
|
@ethandepstein-del thanks for the re-review. New head
Not changed: packets longer than the title's output buffer (40/60 ms) would still lose their tail; GTA's are all 20 ms / 960 frames, so I left a carry-over buffer out of this PR. |
Wine and Proton have no MSOpusDecoder.dll, so with ivall#294 XCL loads libopus from an opus.dll there. build-opus.sh downloads the official libopus 1.5.2 release, checks its SHA-256 and builds opus.dll with mingw-w64; docs/linux.md says where to put it (XCL_OPUS_DIR or next to xcl.exe) and how to tell which decoder xcl.log reports.
|
@simnJS I updated my comment above for Claude Code with Claude Opus 5.5 wrote this; the person posting it checked it. |
… where Windows has none (PR #294, simnJS) A retail game is mute under XCL: it does not use XAudio2 but sends its sound to the console's audio decoder (xapu), and XCL answered every xapu command with silence. Everything goes to stream 0 through XApuEnqueueCommand: Activate (kind 1) with the channel count and 48 kHz, Process (kind 3) with one raw Opus packet (CELT fullband 20 ms) and a float output buffer, Deactivate (kind 2). The title reads the decoded PCM back, mixes it and plays its mix itself through Windows Spatial Audio, so XCL only decodes into its buffer. - hle/acphal.rs: the first Activate of a stream makes its decoder, a later one with the same layout resets it; Process decodes into the title's output and returns the frames written; a packet that does not decode, or a stream not connected, still gets silence. report.json gets xapu counters, the log a summary every 5 s; XCL_TRACE_APU=1 traces the commands. - hle/opus.rs: when Media Foundation has no Opus decoder (Wine), libopus is loaded at run time from %XCL_OPUS_DIR% or next to xcl.exe (not distributed; THIRD_PARTY.md); Windows keeps its own decoder.
|
Merged as a squash commit on main (2b4bb43), with the game's name left out of the message and two code comments (the repository does not name it) - thanks! Checked on an RX 9070 (RDNA4) on main 2b4bb43 together with #306, #288 and #294: |
GTA VI is mute under XCL: it does not use XAudio2 but sends its sound to the console's audio decoder (xapu), and XCL answered every xapu command with silence. This decodes the Opus packets the title sends to xapu into the output buffer the title gives; the title then reads that PCM back, mixes it (its own volumes and panning) and plays its mix itself on the system's default endpoint through Windows Spatial Audio, so XCL has nothing more to play. It also gives Opus a decoder under Wine, where Windows'
MSOpusDecoder.dlldoes not exist.What the title sends (traced with the new
XCL_TRACE_APU=1, documented at the top ofhle/acphal.rs): everything goes to stream 0 throughXApuEnqueueCommand; Activate (kind 1) carries the channel count at +24 and 48000 Hz at +56; each Process (kind 3) carries one raw Opus packet (80 or 160 B, CELT fullband 20 ms, mono), 960 frames,first_frame312 on the first command (the pre-skip), into a 3840 B float output; Deactivate is kind 2. acphal gets one command at start-up; the DSP none. Nothing reaches xapu before the title's menu. The 350 "SHAPE" contexts it creates are XMA decode contexts, not a mixer; its final mix goes to anISpatialAudioClientwith two static objects (front left / right), seen withWINEDEBUG=+mmdevapi.What is in it
Opus: libopus from opus.dll where Windows has no decoder (Wine)–hle/opus.rs: when the Media Foundation MFT cannot be created, libopus (BSD-3-Clause) is loaded at run time from%XCL_OPUS_DIR%or next toxcl.exe, as for DXC (a DLL without the four symbols is freed again); its decoder keeps a stream timestamp like the MFT's and refuses an empty or malformed packet as the MFT path does; the log names the decoder actually made; Windows keeps its own decoder; with neither, silence as before (logged once).THIRD_PARTY.md: libopus, not distributed.xapu: decode the title's Opus packets into its output buffer (GTA VI's sound)–hle/acphal.rs: the first Activate of a stream creates its decoder, a later one with the same layout resets it (no new Media Foundation transform per sound), Process decodes into a local buffer, copies it into the title's output (no alignment assumed) and returns the frames written; a packet that does not decode, or a stream the title did not connect, still gets silence of the length asked, as before.report.jsongetsxapu_*counters,xcl.loga summary line every 5 s.Tested
x86_64-pc-windows-gnu, release; libopus 1.5.2 built with mingw-w64 asopus.dll(Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #257'sscripts/linux/build-opus.sh).cargo build --workspace --all-targets --locked --target x86_64-pc-windows-gnuat each commit.Opus: decoder = libopus (…opus.dll),xapu: 153 Opus packets decoded (0 errors), 144072 frames, 136590 non-zero samples. With the earlier revision's raw playback switched off – which is what this revision does – the menu sound was heard on the PC's speakers: the title's own mix is what plays.Regression run
Made with
scripts/linux/smoke.sh(#257:smoke.ps1's run and block under Wine), 50 s, on Ubuntu 26.04 / RTX 4080 SUPER, Proton Experimental 11.0's Wine, vkd3d-proton v3.1 + patch, DXVK 3.1.1,XCL_OPUS_DIRset for both runs. In both runs the account prompt was answered by hand with A and the title went to its "Brightness Level" screen; both ended by themselves (exit: 0x0). Under Wine XCL's end takes ~15 s afterXCL_RUN_SECONDS(its watchdog: suspending every thread also stops vkd3d-proton's), so the earlier 60 s blocks with a 10 s grace saidkilled.peak commitreads 0 under Wine.mainat4017f8f:This PR's head
38bbfda:Not tested
scripts/smoke.ps1(no Windows machine; see the Windows runs above).AI use