https://bugs.winehq.org/show_bug.cgi?id=53799
Bug ID: 53799 Summary: FFXIV Endwalker Benchmark no audio and crashes in xaudio2_7 on exit Product: Wine Version: 7.19 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: xaudio2 Assignee: wine-bugs@winehq.org Reporter: nospam@kota.moe Distribution: ---
Created attachment 73297 --> https://bugs.winehq.org/attachment.cgi?id=73297 Console output (including crash info)
The application in question can be downloaded from https://jp.finalfantasyxiv.com/benchmark/download/ (Direct link: https://download.finalfantasyxiv.com/ys8glaimvmykn88p/ffxiv-endwalker-bench....)
It can be executed with the following command line (not enough arguments to fully configure the benchmark, but enough to demonstrate the problem): wine game/ffxiv_dx11.exe SYS.Language=1
When the application is running, no audio is heard when there should be audio. And when it exits (such as closing the window, pressing ESC, or letting it finish), it will segfault in xaudio2_7 with the following backtrace (full output in attachment):
=>0 0x00000242e0aeac FAudio_AudioClientThread+0xcc(user=00000000010301B0) [Z:\tmp\wine-src\libs\faudio\src\FAudio_platform_win32.c:190] in xaudio2_7 (0000000000000000) 1 0x0000007b629109 BaseThreadInitThunk+0x9(unknown=<internal error>, entry=<internal error>, arg=<internal error>) [Z:\tmp\wine-src\dlls\kernel32\thread.c:61] in kernel32 (0000000000000000) 2 0x0000017005eda3 __wine_pop_frame(entry=0000000242E0ADE0, arg=00000000010301B0) [Z:\tmp\wine-src\include\wine\exception.h:277] in ntdll (0000000000000000) 3 0x0000017005eda3 RtlUserThreadStart+0x83(entry=[<register RSP not accessible in this frame>, arg=[<register RSP not accessible in this frame>) [Z:\tmp\wine-src\dlls\ntdll\thread.c:240] in ntdll (0000000000000000) 0x00000242e0aeac FAudio_AudioClientThread+0xcc [Z:\tmp\wine-src\libs\faudio\src\FAudio_platform_win32.c:190] in xaudio2_7: movq (%rcx),%rax 190 FAudio_assert(!FAILED(hr) && "Failed to stop IAudioClient!");
This was run in a clean WINEPREFIX with wine-7.19 freshly built from source.
If I use winetricks to install xact_x64, the crash goes away, but there is still no audio output
https://bugs.winehq.org/show_bug.cgi?id=53799
--- Comment #1 from nospam@kota.moe --- Also reported to FAudio in case it's not a wine problem: https://github.com/FNA-XNA/FAudio/issues/300
https://bugs.winehq.org/show_bug.cgi?id=53799
Yao Mitachi yaomtc@protonmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |yaomtc@protonmail.com
--- Comment #2 from Yao Mitachi yaomtc@protonmail.com --- Tested in a fresh prefix after updating to 7.19 on Arch. Benchmark did not crash and audio worked. What type of audio are you using: USB, onboard analog, HDMI/DP? Does it also happen with a different type of audio output?
https://bugs.winehq.org/show_bug.cgi?id=53799
--- Comment #3 from nospam@kota.moe --- Created attachment 73299 --> https://bugs.winehq.org/attachment.cgi?id=73299 `pactl list sinks` output
Wine autodetects PulseAudio and uses it, which is connected to a JACK sound server, which ultimately outputs over a M-Audio Profire 610. (Audio works fine when I test it in winecfg) See "Name: jack_out" in the attached sink list.
If I configure PulseAudio to instead output to "Name: alsa_output.usb-Generic_USB_Audio-00.HiFi__hw_ALC1220VBDT_2__sink", the benchmark still crashes, but in a different way. It still segfaults like before, but no longer produces a backtrace:
...same as before... 0198:fixme:d3d_shader:shader_glsl_handle_instruction Backend can't handle opcode dcl_stream. 0198:err:d3d:resource_unload Resource 000000000B3A97C0 is being unloaded while mapped. 0198:err:d3d:wined3d_context_gl_reacquire Acquired context 000000000AE17690 instead of 0000000017A5D8D0. 0198:err:d3d:wined3d_allocator_chunk_cleanup Chunk 0000000039267740 is not empty. 0198:err:d3d:wined3d_allocator_chunk_cleanup Chunk 0000000038835100 is not empty. 0198:err:d3d:wined3d_debug_callback 000000000AE17690: "GL_INVALID_OPERATION in glFramebufferTexture2D(window-system framebuffer)". ...repeats 9 times... Segmentation fault
But if I run the benchmark under winedbg, instead of the segfault I get the following messages, with no opportunity to backtrace: wine client error:1bc: write: Bad file descriptor Process of pid=00cc has terminated
https://bugs.winehq.org/show_bug.cgi?id=53799
--- Comment #4 from nospam@kota.moe --- Actually I noticed another difference between the console outputs. Specifically, when using "Name: jack_out", there's these extra log lines:
0024:fixme:pulse:get_channel_mask Unknown speaker configuration: 10 0024:err:pulse:pulse_spec_from_waveformat Invalid channel mask: 0/10 and 0(0) 0024:err:pulse:pulse_spec_from_waveformat Invalid format! Channel spec valid: 0, format: 5
This seems to indicate that wine doesn't know how to handle 10 output channels (= number of output channels on the Profire 610). But why does the winecfg audio test work?
If I force PulseAudio to use fewer output channels on the JACK sink with:
pactl unload-module module-jack-sink pactl load-module module-jack-sink connect=false channels=6
...I now encounter the same symptom as when I set the PulseAudio output to "Name: alsa_output.usb-Generic_USB_Audio-00.HiFi__hw_ALC1220VBDT_2__sink". I.E., segfault without a backtrace.
(I can now hear the benchmark audio with the channels=6 limit, but I'm still interested in fixing the crash-on-exit)
https://bugs.winehq.org/show_bug.cgi?id=53799
Jordan Banasik woovie+winehq@woovie.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |woovie+winehq@woovie.net
--- Comment #5 from Jordan Banasik woovie+winehq@woovie.net --- I have a repeatable crash environment for several games due to the amount of audio channels and this thread seems like the best place to post. I can crash Hitman 3 the instant it boots, and Snowrunner as soon as it gets to the 3D environment in the menu which plays sounds.
Presently, I have to work around this by creating a new virtual device with PipeWire which
pactl load-module module-null-sink media.class=Audio/Sink sink_name=too-many-ch pactl set-default-sink too-many-ch pw-link too-many-ch:monitor_FL alsa_output.usb-Focusrite_Scarlett_18i20_USB_P9300TH0181184-00.multichannel-output:playback_AUX0 pw-link too-many-ch:monitor_FR alsa_output.usb-Focusrite_Scarlett_18i20_USB_P9300TH0181184-00.multichannel-output:playback_AUX1
Attaching a log from Proton that has relevant errors and information. Here's a relevant snippet, there's a stack trace as well in the file:
11809.731:0164:0174:fixme:pulse:get_channel_mask Unknown speaker configuration: 20 11809.731:0164:0174:err:pulse:pulse_spec_from_waveformat Invalid channel mask: 0/20 and 0(0) 11809.731:0164:0174:err:pulse:pulse_spec_from_waveformat Invalid format! Channel spec valid: 0, format: 5
https://bugs.winehq.org/show_bug.cgi?id=53799
--- Comment #6 from Jordan Banasik woovie+winehq@woovie.net --- Created attachment 76412 --> https://bugs.winehq.org/attachment.cgi?id=76412 Hitman 3 Steam Launch, Wine Pulse Crash
https://bugs.winehq.org/show_bug.cgi?id=53799
--- Comment #7 from Jordan Banasik woovie+winehq@woovie.net --- There's some relevant information from https://github.com/geoffreybennett/alsa-scarlett-gui/issues/118 where I was initially asking for help due to a lack of fully grasping the error.
It appears this issue stems from here: https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/winepulse.drv/pulse.c...
If you have more than 8 channels, it just fails. Perhaps it would be best to throw a warning and default to 2 channel stereo on channels 0 and 1 instead if greater than 8?
https://bugs.winehq.org/show_bug.cgi?id=53799
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|xaudio2 |winepulse.drv