apu: warn when the host has no audio output device #222

Open
github-bot wants to merge 1 commit from github-bot/gh-222 into main AGit
Owner

@⁠a55uka on GitHub · 2026-11-24 01:35 UTC · original
a55uka:fix/warn-no-audio-output → main · +26 −0 · 3 files · 1 commits · open

On Linux, if Wine has no sound driver, the game stops about 15 seconds in. It always stops at its own int3 assert at title+0x4dcbc9d, in the loading-screen loop (title+0x5ab12e0), and nothing in the crash report mentions audio.

Cause: with no output device, the game's audio never empties its command buffer. Each pass of the loading loop adds about 1.7 KB to a 96 KB buffer until the next write doesn't fit, and the game asserts. Fedora ships Wine's sound drivers as separate packages (wine-pulseaudio, wine-alsa), and installing wine alone doesn't pull them in, so this is easy to hit.

Tested:

  • Fedora with Wine 11.21 Staging and PipeWire, on an i7-12700K with an RTX 4070.
  • Audio driver off in the prefix: the warning is logged, then the assert at +0x4dcbc9d.
  • With winepulse: no warning, no assert, and the game runs past the loading screen.
  • Not tested on Windows, where it has nothing to warn about when a sound device is present.
**@⁠a55uka** on GitHub · 2026-11-24 01:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/222) `a55uka:fix/warn-no-audio-output` → `main` · +26 −0 · 3 files · 1 commits · open On Linux, if Wine has no sound driver, the game stops about 15 seconds in. It always stops at its own int3 assert at title+0x4dcbc9d, in the loading-screen loop (title+0x5ab12e0), and nothing in the crash report mentions audio. Cause: with no output device, the game's audio never empties its command buffer. Each pass of the loading loop adds about 1.7 KB to a 96 KB buffer until the next write doesn't fit, and the game asserts. Fedora ships Wine's sound drivers as separate packages (wine-pulseaudio, wine-alsa), and installing wine alone doesn't pull them in, so this is easy to hit. Tested: - Fedora with Wine 11.21 Staging and PipeWire, on an i7-12700K with an RTX 4070. - Audio driver off in the prefix: the warning is logged, then the assert at +0x4dcbc9d. - With winepulse: no warning, no assert, and the game runs past the loading screen. - Not tested on Windows, where it has nothing to warn about when a sound device is present.
Under Wine without a sound driver, Grand Theft Auto VI stops about 15 s
in on an int3 assert of its own (title+0x4dcbc9d), in its loading-screen
loop. With no output device the title's audio never drains its command
buffer; the loop adds about 1.7 KB a pass to a 96 KB buffer until a
write no longer fits. Nothing in the assert points at audio.

When the audio decoder connects, count the host's output devices once
(waveOutGetNumDevs) and warn if there are none. The README notes that
Fedora ships Wine's sound driver apart from Wine, as wine-pulseaudio.

Tested: Linux (Wine 11.21 Staging, PipeWire), i7-12700K, RTX 4070. With
the prefix's audio driver disabled the warning is logged and the title
stops at the assert; with winepulse it logs nothing new and runs past
the loading screen.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:55:27 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-24 05:19 UTC · original

Thanks @⁠a55uka for adding a once-only warning when the host reports no audio output devices.

I tested commit 9a77707b01c040e7c4480fb96b2c6e17b79b04d8 with:

cargo test --locked -p victory-hle --lib decodes_opus_as_the_title_drives_it -- --test-threads=1

The targeted test passed (1 passed, 0 failed; 85 filtered). decodes_opus_as_the_title_drives_it connects through XApuConnect, which calls the new once-only output-device check, then continues through the title-shaped Opus command flow.

This confirms the connection path still succeeds with the check in place. The test does not force the no-device branch or assert the warning event/text, and it does not exercise the documented host audio-driver setup.

**@⁠jeremygold02** on GitHub · 2026-11-24 05:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/222#issuecomment-7122833473) Thanks @⁠a55uka for adding a once-only warning when the host reports no audio output devices. I tested commit `9a77707b01c040e7c4480fb96b2c6e17b79b04d8` with: ``` cargo test --locked -p victory-hle --lib decodes_opus_as_the_title_drives_it -- --test-threads=1 ``` The targeted test passed (1 passed, 0 failed; 85 filtered). [`decodes_opus_as_the_title_drives_it`](https://github.com/Marvisak/VIctory/blob/9a77707b01c040e7c4480fb96b2c6e17b79b04d8/crates/victory-hle/src/modules/apu.rs#L435) connects through `XApuConnect`, which calls the new [once-only output-device check](https://github.com/Marvisak/VIctory/blob/9a77707b01c040e7c4480fb96b2c6e17b79b04d8/crates/victory-hle/src/modules/apu.rs#L39), then continues through the title-shaped Opus command flow. This confirms the connection path still succeeds with the check in place. The test does not force the no-device branch or assert the warning event/text, and it does not exercise the documented host audio-driver setup.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:21 UTC · original

Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: README.md.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/222#issuecomment-7148419908) <!-- victory-triage v1 head=9a77707b01c040e7c4480fb96b2c6e17b79b04d8 verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `README.md`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • README.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/222/head:github-bot/gh-222'
git switch 'github-bot/gh-222'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-222'
git switch 'github-bot/gh-222'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-222'
git switch 'github-bot/gh-222'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-222'
git switch 'main'
git merge --squash 'github-bot/gh-222'
git switch 'main'
git merge --ff-only 'github-bot/gh-222'
git switch 'main'
git merge 'github-bot/gh-222'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!222
No description provided.