Whisky-App / Whisky

A modern Wine wrapper for macOS built with SwiftUI
https://getwhisky.app
GNU General Public License v3.0
11.85k stars 253 forks source link

[Bug]: Distorted sound in Source games #445

Open excellproj opened 11 months ago

excellproj commented 11 months ago

Description

I ran several games: Portal 2, Half-Life 2 and Team Fortress 2, and I noticed heavily distorted sound both in the menus and in the game. It feels like the sound is playing at 0.5x speed. The sound is playing in jerks.

Steps to reproduce

To install the Steam app in a bottle, download one of the games (Portal 2 or TF2), and run it

Expected behaviour

I expected normal sound

Logs

 Whisky Version: 2.0.0
Date: 27.09.2023, 6:28:15 am
macOS Version: Версія 14.0 (23A344)
Bottle Name: Games
Wine Version: 7.7.0
Windows Version: win10
Bottle URL: /Users/MyName/BottleGames/6AF1EFD3-D918-421F-A576-7E683ECD36F6

Arguments: winecfg -v win10 

Launched Wine (9697)
00f0: thread_get_state failed on Apple Silicon - faking zero debug registers
00f8: thread_get_state failed on Apple Silicon - faking zero debug registers
0110:err:module:open_builtin_so_file failed to load .so lib "/Users/MyName/Library/Application Support/com.isaacmarovitz.Whisky/Libraries/Wine/lib/wine/x86_64-unix/wineusb.sys.so"
0110:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\wineusb": c0000142
002c:err:setupapi:SetupDiInstallDevice Failed to start service L"wineusb" for device L"ROOT\\WINE\\WINEUSB", error 1114.
002c:err:setupapi:SetupDiInstallDevice Failed to control service L"wineusb" for device L"ROOT\\WINE\\WINEUSB", error 1062.
wine: configuration in L"/Users/MyName/BottleGames/6AF1EFD3-D918-421F-A576-7E683ECD36F6" has been updated.
Process exited with code 0

What version of Whisky are you using?

2.0.0

What version of macOS are you using?

Sonoma (macOS 14)

Issue Language

noma4i commented 11 months ago

I can add that TF2 is able to run while the framerate is so low that it's unplayable.

timsayshey commented 11 months ago

Yeah, Steam runs insanely well but when I launch CounterStrike or CS:S, the framerate is unplayable as well. Feels like it just needs some tweaks, or maybe the Proton compatibility package? Enabling DXVK didn't really help much either.

excellproj commented 11 months ago

I can add that TF2 is able to run while the framerate is so low that it's unplayable.

I agree with you, but if we run a test game where the stable FPS is above 60, but the sound issues persist.

excellproj commented 11 months ago

Yeah, Steam runs insanely well but when I launch CounterStrike or CS:S, the framerate is unplayable as well. Feels like it just needs some tweaks, or maybe the Proton compatibility package? Enabling DXVK didn't really help much either.

Interestingly, Portal 2 works fine except for the same sound issues.

timsayshey commented 11 months ago

I'm on a 2020 M1 Macbook Pro so it could be the hardware but CS:S runs at 120FPS through Parallels.

noma4i commented 11 months ago

BTW I was able to run CS:GO2 with okayish performance in the menus but still unplayable.

MrFrankChen commented 11 months ago

I encountered the same issue on game "The Legend of Sword and Fairy 5 Prequel".

IsaacMarovitz commented 11 months ago

This is an issue with Source games in general. The sound is heavily tied to rendering performance. I'm not sure if there's an easy solution to this.

sjavora commented 11 months ago

This seems to be connected to physics interactions. HL2 will play fine until you cause a bunch of crates to fall at which point it becomes unplayable.

wengland02 commented 11 months ago

This seems to an issue with games that use DX9 and older. I am experiencing the same issues with NASCAR Racing 2003 Season and LEGO Island. DgVoodoo2 does not help.

jeanlain commented 11 months ago

I'm getting poor performance and audio stuttering in other DX9 games like Tome Raider Anniversary (stuttering is even worse than in Source games).

martimcfly commented 11 months ago

maybe it can be fixed similar like this cs2 issues see here: https://www.youtube.com/watch?v=oSFYFIGS-uc

apocalypsemeow commented 10 months ago

This seems to an issue with games that use DX9 and older. I am experiencing the same issues with NASCAR Racing 2003 Season and LEGO Island. DgVoodoo2 does not help.

I'm trying to play Project Diablo II, which may run on DX9 or older since it is a modified Diablo II. Similar sound issues to OP.

paull27 commented 10 months ago

I'm trying to play NFS Hot Pursuit from 2010, which is DX9 as well. The game runs smooth and sound is perfect in the menu and map, but as soon as the car select screen starts (and on the street as well) the sound is disturbed / every effect is played at least twice :/

racinginfinite87 commented 10 months ago

What I figured out from one's comment on youtube video on how to install Portal 2 using Whisky, changing your output device's format to 44100 Hz in Audio MIDI Setup helps to solve the issue, at least for Portal 2. Might help with other source games too, although I haven't tested it yet.

paull27 commented 10 months ago

Unfortunately doesn't work for me, my speakers' settings were already on 44100 Hz. Tried changing the values, without effect

cgarst commented 9 months ago

Also noticed this with Worms Armageddon, DX9. Alternatively, it's working OK through Wine via Porting Kit.

kahlos commented 9 months ago

What I figured out from one's comment on youtube video on how to install Portal 2 using Whisky, changing your output device's format to 44100 Hz in Audio MIDI Setup helps to solve the issue, at least for Portal 2. Might help with other source games too, although I haven't tested it yet.

This pointed me in the right direction for a non-source game. I've found the audio works no problem when using an external audio device, but has constant skipping / judderyness when using the in-built speakers on my M1 MacBook Pro.

I tried setting the default audio drivers (ALSA, OSS, PulseAudio) in Winetricks settings, but predictably nothing worked besides the default Mac CoreAudio driver.

Some old wine forum posts lead me to my solution; changing the sample rate in the format settings in the Audio MIDI Setup utility:

image image

Adjusting to 44.1 kHz resolved the skipping / juddery issues for me on the built-in M1 MacBook Pro speakers. A little odd, as nothing is running through MIDI per se, but I guess Wine's CoreAudio driver pulls its sample rate through from this setting? Either way, worth a try if you're getting audio issues

travissanderson commented 9 months ago

@kahlos that worked for me as well, thanks for posting!

excellproj commented 9 months ago

@kahlos that worked for me as well, thanks for posting!

Yes, it worked for the MacBook speaker, but unfortunately, it doesn't apply to the AirPods. 🥲

Moroshima commented 9 months ago

The same issue when I play "Senren * Banka", it's also based on dxd9.

Gunmetalblue commented 8 months ago

Have same problem with old games: Space Rangers and Magicka 2. The changing format to 44 hz partly solves the problem but still unplayable :(

excellproj commented 8 months ago

What I figured out from one's comment on youtube video on how to install Portal 2 using Whisky, changing your output device's format to 44100 Hz in Audio MIDI Setup helps to solve the issue, at least for Portal 2. Might help with other source games too, although I haven't tested it yet.

This pointed me in the right direction for a non-source game. I've found the audio works no problem when using an external audio device, but has constant skipping / judderyness when using the in-built speakers on my M1 MacBook Pro.

I tried setting the default audio drivers (ALSA, OSS, PulseAudio) in Winetricks settings, but predictably nothing worked besides the default Mac CoreAudio driver.

Some old wine forum posts lead me to my solution; changing the sample rate in the format settings in the Audio MIDI Setup utility: image image

Adjusting to 44.1 kHz resolved the skipping / juddery issues for me on the built-in M1 MacBook Pro speakers. A little odd, as nothing is running through MIDI per se, but I guess Wine's CoreAudio driver pulls its sample rate through from this setting? Either way, worth a try if you're getting audio issues

I tried these settings on the game Portal: Revolution, but unfortunately, they didn't work.

roryabraham commented 7 months ago

Some old wine forum posts lead me to my solution; changing the sample rate in the format settings in the Audio MIDI Setup utility

This seems to have completely fixed the audio for me on Age of Mythology Extended Edition (2022 M2 MacBook Pro, using wired headphones)

Max64x commented 3 months ago

I managed to fix it by setting the speaker configuration to 2 speakers (which is what I have), from the default setting (7.1 speakers). You may need to set the speaker configuration to your amount.

undakovr commented 2 months ago

What I figured out from one's comment on youtube video on how to install Portal 2 using Whisky, changing your output device's format to 44100 Hz in Audio MIDI Setup helps to solve the issue, at least for Portal 2. Might help with other source games too, although I haven't tested it yet.

This pointed me in the right direction for a non-source game. I've found the audio works no problem when using an external audio device, but has constant skipping / judderyness when using the in-built speakers on my M1 MacBook Pro.

I tried setting the default audio drivers (ALSA, OSS, PulseAudio) in Winetricks settings, but predictably nothing worked besides the default Mac CoreAudio driver.

Some old wine forum posts lead me to my solution; changing the sample rate in the format settings in the Audio MIDI Setup utility: image image

Adjusting to 44.1 kHz resolved the skipping / juddery issues for me on the built-in M1 MacBook Pro speakers. A little odd, as nothing is running through MIDI per se, but I guess Wine's CoreAudio driver pulls its sample rate through from this setting? Either way, worth a try if you're getting audio issues

thanks. changing the the hz to 4100 made it work flawlessly

AliceMousie commented 1 month ago

I was having this issue in CS2 despite my headphones already being at 44.1KHz with no option to change them. Fix for me was adding -directsound to the launch options.

I also seem to have a higher performance floor when setting -threads 8 in launch options, especially in gunfights and in offline with bots, but this might have to be a lower number if your CPU doesn't have enough cores.

alimyuz commented 3 weeks ago

Adding -directsound in Deadlock launch option completely disabled the sound for me. 44.1KHz option also did not work.

ywake commented 3 weeks ago

I also faced the same problem and could not solve it with MIDI settings, but I solved it by updating wine to the latest version.

Here's how I updated wine.

# install wine via homebrew
brew install --cask --no-quarantine wine-stable

# Check the location of wine
where wine64
# output:
# /Users/your_name/Library/Application Support/com.isaacmarovitz.Whisky/Libraries/Wine/bin/wine64
# /opt/homebrew/bin/wine64

# Remove the old wine
rm /Users/your_name/Library/Application\ Support/com.isaacmarovitz.Whisky/Libraries/Wine/bin/wine64

# Create a symbolic link to the new wine
ln -s /opt/homebrew/bin/wine64 /Users/your_name/Library/Application\ Support/com.isaacmarovitz.Whisky/Libraries/Wine/bin/wine64

After that, recreate the bottle

I actually did it in a little different way, so there may be some errors, but I hope it helps.

Gcenx commented 3 weeks ago

@ywake I’d advise against doing this as you’ll loose access to esync/msync/d3dmetal and many other hacks.

The Winehq packages only contain a small subset of hacks to make wine function nicely on macOS & Rosetta2.

Also the way Whisky install DXVK will cause regressions for other versions of wine.

dr-dimitru commented 2 weeks ago

I experienced the same switching to Mono inside the game solved issue for me; But it's terrible for shooters

SlavenIvanov commented 1 week ago

I had the audio issue with deadlock. Tried 44 100HZ and it didn't work. But changing it to 96 000Hz did the trick!

Screenshot 2024-08-25 at 20 23 44