https://bugs.winehq.org/show_bug.cgi?id=46072
Bug ID: 46072 Summary: Freelancer: Stutter when new NPC ships spawn Product: Wine Version: 3.19 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: tom@r.je Distribution: ---
I've been trying to debug this for some time, however in the game Freelancer, when new NPC ships spawn, the game stutters. This has happened every time I've tried playing the game (First attempt last September, same issue with whatever the latest wine version was then)
Video:
https://www.youtube.com/watch?v=fLnkWDsgcpc&feature=youtu.be
It's most pronounced at 00:57 but is often worse than that and happens each time new NPCs spawn. In that video each time an NPC spawns ahead or behind the player a stutter occurs. It seems to vary from 0.1 seconds to up to about a second.
It is *always* when an NPC spawns so it seems like it's an I/O issue either loading the 3d model or the related audio.
Nothing appears in the console using the default WINEDEBUG.
These lines get repeated:
0009:fixme:d3d:debug_d3dformat Unrecognized 0x38414144 (as fourcc: DAA8) WINED3DFORMAT! 0009:fixme:d3d:wined3d_get_format Can't find format unrecognized (0x38414144) in the format lookup table.
But they do not coincide with the stutter. Running WINEDEBUG=all makes it impossible to see when the issue occurs because the game runs as a slideshow.
I have tried the following:
1) Native Microsoft Windows on the same system works fine, no stutter
2) Using lower settings. It does not appear to be GPU related.
3) Using a d3d8 -> dx11 windows wrapper and DXVK. It works as intended, forcing the d3d8 game to render using DXVK. The game still runs at 60fps except when new ships load and the stutter occurs (showing < 20fps briefly though really it's 0fps for a small amount of time)
4) Running from an SSD and NVME, no difference
5) Using the esync patches to reduce CPU/IO overhead, no difference
6) Using taskset to force the game to only use cores 1-4, no difference.
7) Disabling audio in WINE. Perhaps it's when the new NPC's engine sounds are loaded? It doesn't help but this may be because the audio is still loaded, it's just never played. It could still be an audio issue.
8) Using ALSA instead of pulse in winecfg.
9) wine-staging, no effect
System specifications:
AMD Threadripper 1950x 32gb DDR ram nvidia 980ti.
It's a shame because the game runs beautifully except for the annoying stutter every 20-30 or so seconds when new NPC ships spawn.
I can't see how it's a hardware issue as the game is from 2003 and even with the overhead of WINE should run flawlessly on a modern PC.
https://bugs.winehq.org/show_bug.cgi?id=46072
--- Comment #1 from Tom B tom@r.je --- I should also add it happens with both the nvidia and nouveau drivers though it's less noticable using nouveau as the average FPS is a lot lower but it does show that it's not driver related.
https://bugs.winehq.org/show_bug.cgi?id=46072
Béla Gyebrószki gyebro69@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gyebro69@gmail.com
--- Comment #2 from Béla Gyebrószki gyebro69@gmail.com --- Can you reproduce the problem in the demo version too? https://www.fileplanet.com/120389/120000/fileinfo/Freelancer-Demo
https://bugs.winehq.org/show_bug.cgi?id=46072
--- Comment #3 from Tom B tom@r.je --- Created attachment 62708 --> https://bugs.winehq.org/attachment.cgi?id=62708 Demo save game file - easier testing
Freelancer demo save game (avoiding 5 minutes of unskippable cutscenes) place in $PREFIX%/drive_c/users/%USERNAME%/My Documents/My Games/Freelancer Trial/Accts/SinglePlayer/ then load it from the "Load game" menu
https://bugs.winehq.org/show_bug.cgi?id=46072
--- Comment #4 from Tom B tom@r.je --- Yes, it happens in the demo exactly the same way.
For testing purposes, I've uploaded a save game file for the demo which allows you to test this without waiting through a bunch of unskippable cutscenes and having to complete the first mission.
To test: Exit the base using the "Launch to space" button then fly towards the planet in the distance, don't dock with the "trade lane", (rings) just fly down them . Press Ctrl+W to increase your speed.
To change your resolution edit the file %PREFIX%/drive_c/users/%USERNAME%/My Documents/My Games/Freelancer Trial/PerfOptions.ini and set the width/height/colour depth at the bottom. Note: Widescreen resolutions work but mess up the HUD, doesn't matter for testing purposes only that the "Launch to space" button is mostly off the top of the screen, though you can still see and press it.
https://bugs.winehq.org/show_bug.cgi?id=46072
Béla Gyebrószki gyebro69@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download URL| |https://www.fileplanet.com/ | |120389/120000/fileinfo/Free | |lancer-Demo
https://bugs.winehq.org/show_bug.cgi?id=46072
--- Comment #5 from Tom B tom@r.je --- I have narrowed this down slightly with more luck than judgement. I tried running the game on my laptop and noticed that although the average framerate was worse I didn't get the stutter.
I did, however, get a warning from the game "Failed to initialize audio, do you wish to continue without sound?". I never use my laptop for anything but work so didn't even have wine installed. This was lucky as I didn't have any lib32 audio libraries installed either.
Thanks to the warning, I tried removing the Arch Linux packages lib32-libpulse and lib32-alsa-lib.
Again, I got the same warning when starting the game, and no stutter when NPC ships loaded! It is almost certainly an audio issue. I'll see if I can tweak the audio settings for wine or the game to avoid the issue while still having audio.
It explains why my earlier attempts made no difference, however. I must be something to do with loading the NPC's related audio (I'd imagine the engine noise).
https://bugs.winehq.org/show_bug.cgi?id=46072
--- Comment #6 from Tom B tom@r.je --- In addition, using winetricks sound=alsa does not fix the stutter, it's audio related but not pulseaudio specific.
I've also played around with the game's settings with no luck. Other than volume controls the only in-game setting is "Use 3d sound" which I've tried checked and unchecked, no difference.
There are some audio related ini options in Freelancer\EXE\dacom.ini but I'm not convinced they're even used by the game:
[SoundManager] ;HEADPHONES 1, STERO 2, QUAD 7, SURROUND 8 ;speakerConfiguration = 2 ;set only if you want to override Windows setting createAll2dInSoftware = true 3D_SW_Algorithm = Light use2DHW = true use3DHW = true maxSoundChannels = 24 ; was 30. changed for Beta -psw ;pci - force HW mixing until Library default is changed FORCE_FREQ_CONTROL_TO_SW = false max3DPan = 15
Swapping the trues to falses and setting the numbers to *2, 100000, 1 or 0 makes no noticeable difference to the in-game audio and doesn't fix the stutter.
https://bugs.winehq.org/show_bug.cgi?id=46072
--- Comment #7 from Tom B tom@r.je --- Update: I modded the game to disable all NPC ship voices and engine noises, no stutter. As I suspected, it is completely audio related and I've even narrowed down the specific sounds that cause the problem. It's bizarre that other in-game sounds don't cause the same issue.
I also tried installing dsound via winetricks and setting it to native. The game definitely uses this dll but the native version made no difference.
Unfortunately I'm not sure what to try next.
https://bugs.winehq.org/show_bug.cgi?id=46072
--- Comment #8 from Tom B tom@r.je --- After installing lib32-libpulse and getting in-game audio working on my laptop the stutter occurs on there as well.
This is with the following hardware:
- Macbook Pro 15,1 (I think) - Intel i7 4870HQ - AMD Radeon M270X - 16gb RAM
This is a much more standard computer. However, this means it's not:
- The unusually high core count on my Threadripper desktop, - nvidia or amd specific - Intel or AMD CPU
On the plus side, this means that it likely affects everyone and can be easily reproduced.
https://bugs.winehq.org/show_bug.cgi?id=46072
--- Comment #9 from Tom B tom@r.je --- Schmackbolzen over at the frelancer fan site the-starport.net forums figured it out: The problem is missing msacm32.dll, winetricks msacm32 solves the problem.
I'm not sure if requiring a DLL override counts as resolved but it's certainly fixed from my perspective.
https://bugs.winehq.org/show_bug.cgi?id=46072
Matteo Bruni matteo.mystral@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |msacm32
--- Comment #10 from Matteo Bruni matteo.mystral@gmail.com --- (In reply to Tom B from comment #9)
Schmackbolzen over at the frelancer fan site the-starport.net forums figured it out: The problem is missing msacm32.dll, winetricks msacm32 solves the problem.
I'm not sure if requiring a DLL override counts as resolved but it's certainly fixed from my perspective.
No, that's okay as a workaround but that means there is a bug in Wine's msacm32. I guess you could get and attach a +msacm trace to this bug report, maybe the issue is visible there.