Bug 264973

Summary: emulators/wine-proton: Issue when launching DX11 game (FFXIV)
Product: Ports & Packages Reporter: skyliegirl33
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: New ---    
Severity: Affects Only Me CC: agh, iwtcex, pi, sascha.folie, skyliegirl33, thindil
Priority: --- Flags: iwtcex: maintainer-feedback+
Version: Latest   
Hardware: amd64   
OS: Any   
See Also: https://bugs.winehq.org/show_bug.cgi?id=53297
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=157050
Attachments:
Description Flags
Output when launching FFXIV directly none

Description skyliegirl33 2022-07-01 09:47:33 UTC
When attempting to launch this game, there's an unlocalized error saying there was an unexpected issue. I noticed this from the wine log:

0140:err:dbghelp_msc:codeview_process_info Unknown CODEVIEW signature 00000000 in module L"ntdll"
0x000000017007932d ntdll+0x7932d: addb  %al,(%rax)
0128:warn:virtual:free_ranges_insert_view range 0xe30000 - 0xe50000 is already mapped
Wine-dbg>bt
Backtrace:
=>0 0x000000017007932d A_SHAFinal+0x52cad() in ntdll (0x0000000000000000)

This doesn't happen with emulators/wine and the game works okay there, albeit with no audio. It does happen with emulators/wine-devel as well. It doesn't matter if I use DXVK, WineD3D or software rendering; the same issue persists. Can provide additional logs if needed.
Comment 1 Alex S 2022-07-01 12:26:07 UTC
Since this happens with wine-devel, try reporting that issue to the upstream (https://bugs.winehq.org).
Comment 2 skyliegirl33 2022-07-01 21:51:39 UTC
(In reply to Alex S from comment #1)
Good idea, did that. I guess this can be closed then
Comment 3 Sascha Folie 2022-07-06 18:31:40 UTC
I am still on wine-devel 7.0-rc4 because 7.1 (switch to "--with-mingw") broke FFXIV for me like you describe.

A few days ago the same happend with 7.0-rc4.
It looks like the switch from gcc 10 to 11 (https://cgit.freebsd.org/ports/commit/?id=cad2f66a384d74cffa870d978722e6fd579c7d2f) broke it again.

I am compiling gcc 10 right now and will report back tomorrow if this fixed it.

I also have no audio while playing the game. I believe this is because of virtual_oss and how FFXIV opens audio devices.
Comment 4 Alex S 2022-07-06 19:43:07 UTC
FYI, I don't have access rights to set "See Also" field to https://bugs.winehq.org/show_bug.cgi?id=53297.

(In reply to Sascha Folie from comment #3)

> I also have no audio while playing the game. I believe this is because of virtual_oss and how FFXIV opens audio devices.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259719#c14?
Comment 5 Sascha Folie 2022-07-06 20:03:32 UTC
(In reply to Alex S from comment #4)

I know about that Bugreport and tried your virtual_oss command which made a few games work (for example factorio).
But FFXIV is still broken.
Comment 6 Sascha Folie 2022-07-07 17:55:34 UTC
wine-devel 7.0-rc4 works when switching gcc back from 11 to 10.

- FreeBSD Current/13.1 wine-devel 7.1+ broken (since mingw)
- FreeBSD Current/13.1 wine-devel 7.0-rc4 broken (since gcc11)

I used wine-proton at some point last year and FFXIV worked but I don't know if this is still the case.
Comment 7 skyliegirl33 2022-07-07 18:37:47 UTC
The cause seems to be vague. Is it GCC.. or MinGW? It doesn't seem to be one or the other, because if I change wine-proton 6.3 to force GCC 10, it still fails with the same error. Never seen this issue on Linux personally, so I wonder if it is a wine problem or not.
Comment 8 Sascha Folie 2022-07-07 20:03:40 UTC
wine-proton-6.3.2 works for me with gcc10.

I'm using FreeBSD 14.0-CURRENT #0 main-n256504-836d47d38e0 with nvidia-driver-470 right now.
Comment 9 skyliegirl33 2022-07-07 20:05:57 UTC
Something isn't adding up then.. because that does not work for me. I have my own branch of 5.11 DRM drivers for my AMD card, but I doubt that's a problem.
Comment 10 Bartek Jasicki 2022-07-08 05:45:48 UTC
As far I see, Valve reported that FFXIV is fixed in wine-proton 7.0_3:

https://github.com/ValveSoftware/Proton/releases/tag/proton-7.0-3

You could give a try to update wine-proton with patch from there: 

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263196

file: 6.3.2_5_to_7.0.3.patch
Comment 11 skyliegirl33 2022-07-08 05:47:18 UTC
That's the new launcher. This isn't a launcher issue, the *game itself* is erroring out. It's like it fails to create DX11 context or something.
Comment 12 Bartek Jasicki 2022-07-08 06:20:16 UTC
From time to time, Wine broke something between versions. Other options to test are different versions of DXVK or the graphic card driver. The last can be a problem too, an example with Nvidia driver: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263475

Another try: different version of DirectX? I see FF XIV allows to change it via command line.

The sound maybe will work after installing xaudio via Winetricks.

Also, what output it gives when runs with WINEDEBUG=warn environment variable? It may be more useful than winedbg, which usually isn't too helpful thing. Especially on FreeBSD.
Comment 13 skyliegirl33 2022-07-08 06:22:57 UTC
I'll see if I can add output for that when I reboot into FreeBSD. DirectX version doesn't make a difference, the error is only slightly changed, but it still fails. DXVK versions don't make a difference either, nor does WineD3D. I do agree that drivers could be an issue, yes, but considering other games seem to function just fine, it seems odd to me.
Comment 14 skyliegirl33 2022-07-08 12:04:52 UTC
Created attachment 235124 [details]
Output when launching FFXIV directly
Comment 15 Bartek Jasicki 2022-07-08 17:08:55 UTC
If I guess correctly, it has some problems with some driver, just question is: which one. :) I have some ideas to check:

1. If it is possible, could you run the game with disabled sound system? It is usually done by command line parameters, like -nosound /nosnd, etc. I don't know if FFXIV allows that.

2. Maybe try to recreate wine prefix? Sometimes it can mess everything around, especially after playing with different Wine versions.

3. I'm not sure if I read correctly, but it looks like you are trying to run the 32-bit version of the game. Perhaps, if it is possible, try to run 64-bit?
Comment 16 skyliegirl33 2022-07-08 21:20:59 UTC
1) Not possible with FFXIV to my knowledge, and sound isn't the problem here. I was able to launch the game with emulators/wine (6.0.4). Had no sound until I recompiled wine with pulse support.

2) I've done that several times, it makes no difference.

3) No, this is a 64-bit game, but wine will correctly use wine64 when needed. Directly using wine64 makes no difference, anyway.
Comment 17 Bartek Jasicki 2022-07-09 06:14:35 UTC
I see. But now I think that the sound is the problem. ;) If the game works only with PulseAudio, it means it is perhaps a victim of the bug mentioned here: https://bugs.winehq.org/show_bug.cgi?id=50214

Which isn't a bug in Wine, but in FreeBSD: lack of some features in FreeBSD OSS implementation.

The workaround with PulseAudio can work with some versions of Wine, but not all.

More advanced thing to test: compile the kernel with disabled sound module and replace it with *oss* module from ports: https://www.freshports.org/audio/oss/
Comment 18 skyliegirl33 2022-07-21 08:18:53 UTC
Unfortunately, that's not really worth testing for me. The issue is not sound as I said, because even without a working audio driver for Wine, it *does* launch on emulators/wine. I did a bit of reverse engineering of the game using Ghidra, and the error is used for several things, but it seems to be DirectX failing to initialize, which is what I thought.
Comment 19 Lynn Davenport 2024-03-26 07:24:09 UTC
MARKED AS SPAM