elishacloud / Silent-Hill-2-Enhancements

A project designed to enhance Silent Hill 2 (SH2) graphics and audio for the PC. It also includes scripts to build or modify SH2 audio files (SFX, BGM and Dialog).
http://www.enhanced.townofsilenthill.com/SH2/
zlib License
589 stars 41 forks source link

Linux/Proton/Wine Troubleshooting Thread #557

Open HexagonSun2077 opened 2 years ago

HexagonSun2077 commented 2 years ago

Hello fellow SH2 fans! As the title suggests, I'm currently running the game and project under Linux and Wine 7.x. I was successfully able to install the base game and then the Enhanced Edition packages using the new setup tool. (Little aside here; whoever coded the wine auto-detection in the new setup tool... thank you! You're a god and it's greatly appreciated to have a team spend this much time to try and make this work on an alternative OS. The real test will be getting this to run on BSD, lol) However, I've come across several issues and fixes; I'll be attaching plenty of the d3d8 logs and video footage of the errors and fixes. This IS my first GitHub post, so If I make any mistakes or errors in appropriately writing out this issue request, just let me know!

First and foremost, after doing the fresh install, I left the Shader options and DirectX9 enabled; this causes the game to crash:

https://user-images.githubusercontent.com/108823132/177611536-b0694ab0-dfb1-4b79-a492-8b4d3b93e7da.mov

Upon fiddling around with the display settings, I discovered that by setting the display mode to windowed with a border, the game did not crash, but instead, loaded an entirely gray screen with the noise effect:

sh2_directx9_enabled_WindowBorder (1).webm

Here is the d3d8 log for that scenario: d3d8.log

The next thing I tried to do was to disable the shaders, IE the Color Temp and Brightness ones; the result was a slightly faster load time, but still, I received the same gray canvas like screen with the noise effect. So I bit the bullet... and disabled DirectX9 entirely. This resulted in being able to play the game, however, it featured a weird glitch with 'windowed mode with border' enabled. The game would cache frames and display them at random times, especially when entering the pause menu, where it would display an image from your gameplay several seconds before; I even had the Konami logo, Team Silent and Creature Labs logo appear... weird I know:

sh2_directx9_disabled_WindowedBorder_CacheGlitch (1).webm (pardon the low resolution... GitHub caps file size at 10mb...)

Here is the d3d8 log for that scenario: d3d8.log

Lastly, I ran the game with the following parameters with great results! With DirectX9 disabled, shaders disabled, Fullscreen mode enabled and windows borders disabled, the game loaded correctly, it didn't crash and didn't go directly to a grey screen, and the odd frame caching issue from above was non-present!

DirectX8_Fullscreen_NoShaders.webm (Again, sorry for having to crop and downgrade the video... darn file sizes...)

Here is the d3d8 log for that scenario: d3d8.log

All in all, I hope this issue thread helps to some degree. I still have no audio what-so-ever, with no clue really as to how to fix it...

My system specs are listed below; if anyone has any questions regarding this issue thread, feel free to let me know! Keep up the amazing work you guys! I am in no way trying to drag you through the mud for this being a hassle on Linux; its impressive enough that you've modified a game from 2001 and it works at all.

System Specs: CPU: i5-10400 GPU: RX 6600 (non-xt) RAM: 32gb DDR4 DISK: 500gb m.2 ssd Linux Distro: EndeavourOS Linux Kernel: 5.18.9-arch1-1

elishacloud commented 2 years ago

First and foremost, after doing the fresh install, I left the Shader options and DirectX9 enabled; this causes the game to crash:

This might be related to this issue here. I am hoping we can get to the bottom of this one.

This resulted in being able to play the game, however, it featured a weird glitch with 'windowed mode with border' enabled. The game would cache frames and display them at random times, especially when entering the pause menu, where it would display an image from your gameplay several seconds before; I even had the Konami logo, Team Silent and Creature Labs logo appear

These two issues are related to how front buffer data is collected. If you change the game to using DirextX for this it should solve the issue. I am not sure if there is much we can do about this. Linux users will just need to use DriectX for this option. It is mentioned in the notes for this feature that Linux users may need to use DirectX here.

image

HexagonSun2077 commented 2 years ago

First and foremost, after doing the fresh install, I left the Shader options and DirectX9 enabled; this causes the game to crash:

This might be related to this issue here. I am hoping we can get to the bottom of this one.

This resulted in being able to play the game, however, it featured a weird glitch with 'windowed mode with border' enabled. The game would cache frames and display them at random times, especially when entering the pause menu, where it would display an image from your gameplay several seconds before; I even had the Konami logo, Team Silent and Creature Labs logo appear

These two issues are related to how front buffer data is collected. If you change the game to using DirextX for this it should solve the issue. I am not sure if there is much we can do about this. Linux users will just need to use DriectX for this option. It is mentioned in the notes for this feature that Linux users may need to use DirectX here.

image

Awesome! I'll try the frame buffer suggestion soon here. Any ideas regarding the lack of audio entirely?

elishacloud commented 2 years ago

First and foremost, after doing the fresh install, I left the Shader options and DirectX9 enabled; this causes the game to crash:

Try downloading D3DX9.zip and extracting these files into the Silent Hill 2 folder and see if that makes any difference.

Any ideas regarding the lack of audio entirely?

  1. Try disabling the custom streaming engine and see if that makes a difference.
  2. The other thing you could try would be to check your speaker settings in the OS. Setting the speakers for "Stereo" is best.
  3. Try temporarily removing or renaming the "dsound.dll" file.
elishacloud commented 2 years ago

Ok, can you try once more with this build? I think this might eliminate the need to disable the "Run game in DirectX9" option or download the D3DX9.zip file.

New testing build: d3d8.zip

HexagonSun2077 commented 2 years ago

Ok, can you try once more with this build? I think this might eliminate the need to disable the "Run game in DirectX9" option or download the D3DX9.zip file.

New testing build: d3d8.zip

Will do in just a bit! (Just got off of work) I'll also be trying the audio options you suggested above! Thank you for helping us Linux Users 😊.

HexagonSun2077 commented 2 years ago

Ok, can you try once more with this build? I think this might eliminate the need to disable the "Run game in DirectX9" option or download the D3DX9.zip file.

New testing build: d3d8.zip

Just tried the new d3d8.dll and yes! it does fix the visual errors in the beginning! However, similarly to another user's comment in the Steam Deck thread, I have the shadow alphas doing funky things:

SilentHill2_Electric_Shadow_Boogaloo_DLC

I have no Nvidia card on hand to try and see if it's still happening within that driverspace, but I'm assuming it's something to do with the open-source MESA drivers for AMD cards.

Furthermore, regarding the audio issues, I'm still stumped. I checked that stereo was set within my sound settings, disabled the custom audio engine, and completely disabled the 'dsound.dll' to no avail.

Oddly, I've tried running the game through 'Bottles', an app that creates Wine/DXVK sandboxed 'bottles' for running windows games and apps; I've gotten the enhancements to be not working at all within bottles, however, when enabling the 'use Steam Runtime' option, the audio is fixed.

Bottles_steamruntime_fixes_audio_no_enhancements SH2_Bottles

I'm not attributing this to the enhancement packages not being picked up, seeing as if I disable the Steam Runtime, the audio disappears and the game still launches without the visual enhancements and fixes. (Probably because I haven't set the native, builtin option for d3d8 within Bottles.) This isn't a huge deal, I'm not planning on running the game this way, just thought it was weird... I'm trying to figure out what exactly the steam runtime is doing that is fixing the audio issue.

HexagonSun2077 commented 2 years ago

So... after setting the appropriate DLL override within Bottles, the Enhancement Packages work great and the audio is present as well! It's still doing that weird shadow alpha issue, but hey; we got sound lol. I'm going to try and add the game to Steam and run it through proton. This is my 'bottles' setup that got the game working (almost) flawlessly.

(What is in that Steam Runtime making it work so well?)

SH2_Bottles_SteamRuntime_d3d8Over-ride

HexagonSun2077 commented 2 years ago

Quick update; adding the game and the Config Tool to Steam gave me mixed results... running the game with Proton caused the enhanced edition mods and fixes to not load, but the sound worked. (Similarly to Bottles before setting the Steam Runtime and the d3d8 override.) Similarly, this happened as well when loading the config tool using Proton; the config window opens, I can change options, but the game still launches vanilla but with sound. However, if I disable proton on both the game and config tool, and instead use the launch option of '--wine', the enhanced edition files load but... no sound again...

I wonder if there's a proton launch option for setting the d3d8 override within Steam itself...

HexagonSun2077 commented 2 years ago

Another odd find; using the 'Steam Linux Runtime' within Steam does not work; I've even tried adding the --wine and --proton launch options; all it says is that it fails to load.

Does_Not_Work

r2rX commented 2 years ago

Another odd find; using the 'Steam Linux Runtime' within Steam does not work; I've even tried adding the --wine and --proton launch options; all it says is that it fails to load.

I believe the entry should be changed from Steam Linux Runtime to Proton.

Screenshot_20220709_160024

HexagonSun2077 commented 2 years ago

Another odd find; using the 'Steam Linux Runtime' within Steam does not work; I've even tried adding the --wine and --proton launch options; all it says is that it fails to load.

I believe the entry should be changed from Steam Linux Runtime to Proton.

Screenshot_20220709_160024

I've tried forcing proton but the game launches without audio of any kind when I do that.

elishacloud commented 2 years ago

@HexagonSun2077, Here is the latest build with the code cleaned up and fixed. This should fix the alpha shadow issue. d3d8.zip

HexagonSun2077 commented 2 years ago

@elishacloud Yep! That fixed it right up! and it's running with SMAA as well! Big thanks!

Screenshot from 2022-07-09 12-22-59

r2rX commented 2 years ago

@HexagonSun2077 Have you tried with Proton Experimental or perhaps GE-Proton7-24?

HexagonSun2077 commented 2 years ago

@HexagonSun2077 Have you tried with Proton Experimental or perhaps GE-Proton7-24?

I've tried every available proton version and even some Glorious Eggroll ones as well.

No matter what, if I run the game with Proton, the EE mods work but with no audio; alternatively if I run with just the --wine launch option, the game runs vanilla BUT with audio.

There must be a protontricks command that sets the d3d8 override, but I can't find it 😂🤦‍♂️

elishacloud commented 2 years ago

@HexagonSun2077, ok, try this update. I hacked the game binary so that it will load the enhancement module as d3dx.dll rather than d3d8.dll. This will force Linux to load the enhancement module from wine.

Note: Keep in mind that this update no longer works with the SH2EEconfig.exe tool, since the config file has also been renamed. So you will need to change the settings directly from the ini,

Here is the update: sh2pc.zip (removed)

Edit: removed the download...

elishacloud commented 2 years ago

@HexagonSun2077, Ok, disregard that last one. For this update I hacked the sh2pc.exe file to load d3dx.dll, then I added a d3dx.dll file that will force loading the normal enhancement module d3d8.dll. With this update you should be able to use the SH2EEconfig.exe, and all other parts of the enhancement edition as normal.

Just unzip these files to the Silent Hill 2 folder, overwriting any files that are there. Here is the updated: sh2pc-Linux.zip

nipkownix commented 2 years ago

Ah, I mentioned this as a potential solution here. Didn't think you'd do it though, since it requires editing the .exe, even though it shouldn't produce any side-effects (Hopefully? I do remember you guys were having issues after editing the .exe resources to add an icon).

elishacloud commented 2 years ago

Didn't think you'd do it though, since it requires editing the .exe, even though it shouldn't produce any side-effects (Hopefully?

No, this should not produce any side-effects since I just used a hex editor to modify the single byte in the string "d3d8.dll" to "d3dx.dll".

HexagonSun2077 commented 2 years ago

@HexagonSun2077, Ok, disregard that last one. For this update I hacked the sh2pc.exe file to load d3dx.dll, then I added a d3dx.dll file that will force loading the normal enhancement module d3d8.dll. With this update you should be able to use the SH2EEconfig.exe, and all other parts of the enhancement edition as normal.

Just unzip these files to the Silent Hill 2 folder, overwriting any files that are there. Here is the updated: sh2pc-Linux.zip

After unzipping and replacing the files, I've gotten an error saying to insert CD 1: Screenshot from 2022-07-10 11-57-44

That was with launching the EXE from Steam; launching the config tool from Steam (also using Proton Experimental) it crashes: Screenshot from 2022-07-10 11-59-23

Launching the EXEs from my file manager work fine; there's still no audio but if I launch it through Bottles it works.

elishacloud commented 2 years ago

Ok, I guess you can try to use the same update I gave you here and then delete the d3dx.dll and rename the enhancement module d3d8.dll to d3dx.dll. This will for sure force wine/proton into loading the enhancement module. However, it will make it so that the SH2EEconfig.exe tool won't work.

elishacloud commented 2 years ago

Ok, here is another update. For this update I modified the sh2pc.exe to load d3dx.dll. Then d3dx.dll will load the real d3d8.dll from memory, to bypass Wine and Proton. I hope this one works for you.

Here is the update: sh2pc.zip

Void48 commented 1 year ago

@HexagonSun2077 Is this working for you now? I recently bought an AMD GPU and I have really been wanting to move to Linux more and more

JoseZancanaro commented 10 months ago

Hi, I'm having the same audio issue as previously reported.

I'm on Arch Linux and using Lutris to run Silent Hill 2 Enhanced Edition. The installation was complete, without any problems and the game runs, but without audio.

I tested the following suggestions: sh2pc-Linux.zip, change-sh2pc-Linux.zip and sh2pc.zip

Unfortunately, none resolved it for me. Still the last one, the following error occurs to me when I try to run the game option 1) Play Silent Hill 2 Enhanced Edition: Screenshot_2023-12-10_23-05-48

Any possible suggestions? Maybe there was something missing here on my side?

JoseZancanaro commented 10 months ago

Problem solved, it was something on my side.

Installing lib32-libpulse (aur lib32-libpulse ) solved it, and now the audio works perfectly.

Sorry for the inconvenience.

DarkSparkish commented 1 week ago

Seeing as the new SH2 remake dropped this week, I decided it was time to play SH2 (the original) using the PC version with the Enhanced Edition mod. Despite installing the mod successfully, the problem is that the game refuses to boot up no matter what I do. I can manage to go to the settings and make changes to it, but booting up the game leads to a window appearing and briefly after disappearing, and disabling DirectX 9 leads to a full screen going to black for a few seconds only to close again.

I've tried this both via running on Lutris with Wine GE from ProtonUp, and when added to Steam via Proton.

But even without the mod,the best I get is a tiny white square residing on the upper left corner on a black screen.

I've tried reinstalling the mod a couple times and also tried one install without checking Linux/Wine on the installer. None of these options succeeded. I can't find any other guides that go in-depth on what exactly I need (with the newest release at least) or other people that have similar problems as me.

I've been using the pre-configured Silent Hill 2 Director's Cut install that can be found as the top choice on MyAbandonware, and I'm running on EndeavourOS on a Ryzen 7950X3D with an RX 7900 XTX graphics card.

cerroverb commented 1 week ago

so i install the mod through proton ge latest, installs successfully, and i can actually launch it successfully, but when i attempt to just launch the actual exe through same proton ge version in steam, it loads up the insert disc screen. not sure what the issue could be but i could really use some help

DarkSparkish commented 1 week ago

I managed to figure out yesterday.

Apparently it seems that using the pre-configured install from MyAbandonware doesn't work properly on Linux. Or at least not for me. What I ended up doing was to find downloads of all three CDs from a European PC copy of Silent Hill 2 - Director's Cut on the same site, though you need to find a way to extract the content from the BIN/CUE-files originating in the downloaded ZIP folders. It might be easier if you happen to have a real physical PC copy or if they are already in ISO files, but with Archive.org being down for the moment, MyAbandonware will be your best bet.

The way I handled the files was converting the BIN and CUE files of each disc download into ISOs, mounting them and then dragging the contents from each disc into separate folders. I used bchunk for this process.

Then, I ran the SH2 - Director's Cut install script on Lutris (you can find by just searching on Lutris itself), which requires the European 3-CD copy, and that installs the Enhanced Edition mod. After you've chose your desired install location and the installer prompts you to insert the discs, instead of choosing "Automount", you select "Choose", and find the directory for each respective disc the installer asks for. Just click "Confirm" on the locations that are given inside the first box that pops up for the game, and do the same for the Enhanced Edition installer. Install the mod like usual with everything (including the Wine/Linux support box) checked, and once install is finished you should have the game on your Lutris library.

Clicking on the game should let you choose between going straight into the game or going into the Enhanced Edition setup menu letting you either modify/uninstall the game or change game settings, and after that boot the game right up.

And presto! The game boots right up with no issues, and can also be added to your Steam library if you prefer. Silent Hill 2 - Linux