ValveSoftware / Proton

Compatibility tool for Steam Play based on Wine and additional components
Other
24.5k stars 1.07k forks source link

No cutscene audio in Daedalic Games (Memoria, The Night of the Rabbit, A New Beginning - Final Cut) (105000 230820 243200) #1412

Open RiantAnda opened 6 years ago

RiantAnda commented 6 years ago

Compatibility Report

System Information

I confirm:

Symptoms

No audio in game cutscenes. All three games are based on the same engine (Visionare) and use the same cutscene file type (mkv containers with VP8 video and ogg audio).

Reproduction

Start a new game and watch intro cutscene at the beginning or during game play -> No audio

steam-105000.log steam-230820.log steam-243200.log

kisak-valve commented 6 years ago

Hello @RiantAnda, #40 indicates one of the games was healthy with an earlier iteration of proton. Can you check if Proton 3.7-3 has the same behavior?

RiantAnda commented 6 years ago

Hi @kisak-valve, I'm sorry but I've checked all Proton releases so far and had no luck. It's a shame, because those games seem to be running OK otherwise and I really would like to play them again. Maybe @pprotonrep could verify if cutscenes were checked? The ingame audio is fine.

ghost commented 6 years ago

Apparently even Windows has sound related bugs with A New Beginning including one with no sound in cutscenes: https://steamcommunity.com/app/105000/discussions/0/613936039496945015/ https://steamcommunity.com/app/105000/discussions/0/540738052616946061/ https://steamcommunity.com/app/105000/discussions/0/648811670566936682/ https://steamcommunity.com/app/105000/discussions/0/540736966186935592/ https://steamcommunity.com/app/105000/discussions/0/846943082501876197/

The Night of the Rabbit: https://steamcommunity.com/app/230820/discussions/0/617321352266147241/ (Asus Xonar GX mode (EAX alternative) would cause no sound with cutscenes

Memoria - same ^ https://steamcommunity.com/app/243200/discussions/0/35220315948306369/

Yes, with the demo [The Night of the Rabbit] I also have no cutscene audio. Specs: https://gist.github.com/byte1024/ae88bc29f9531b86c7b4d9187572dc27

sdl2.dll found in game dir & same with the other audio dll's. Videos have sound outside of game in regular video player.

Its important to note that: Intro videos have sound after starting game. Swap an intro video with one of the videos during the game and it will also have no audio even though it should be the same player and everything else. For example, space bar pauses both.

I don't know if this should be a Proton issue or a game issue but I lean towards the game. It could be something is happening that the game just doesn't like (similar to gx mode) but I'm not aware of anything.

So there's two different systems with the problem. Nvidia audio is look like, and mine I tried both usb audio device and onboard headphone out.

In addition you can swap in an mp4 file (I just so happened to have created one the other day) and it will also have no audio during the game scene but will during the opening logo sequence.

The Steam log ultimately shows nothing of use as far as I can tell. Just plays the logo video then plays the first video on new game. No errors in-between or during the second one.

RiantAnda commented 6 years ago

I tried Memoria today with "Proton 3.16-1 Beta", but still no audio in the opening cutscene.

RiantAnda commented 5 years ago

I've tested out Lutris today and interestingly, the issue is gone with Wine 4.3! It's reproducible with 4.2 in Lutris, but the current 4.3 solves the issue in each of the three games.

Neodamode commented 5 years ago

I still have no audio in cutscenes with Lutris' Wine-4.3 (nor with any Proton version). I've tested it with Memoria (243200), but the thing is that I completed this game myself like a year ago using Wine, and the cutscenes had sound. There's also a video on youtube of someone playing it using Wine-1.9.23 (staging) without issues, so I've tried with that version too with Lutris, but the cutscenes remain stubbornly muted.

RiantAnda commented 5 years ago

@Neodamode Sorry for the question, but you get general in-game audio for Memoria? -I'm asking, because I didn't until I installed lib32-libpulse.

I've made some tests with different wine versions in Lutris: 4.3-x86_64 ok tkg-4.2-x86_64 No cutscene audio tkg-4.1-x86_64 ok
tkg-4.0-x86_64 ok 3.21-x86_64 No cutscene audio 3.20-x86_64 No cutscene audio 3.16-x86_64 No cutscene audio 3.10-x86_64 Game not working 3.7-x86_64 Game not working 3.0-x86_64 Game not working

Could you also test with 4.1 and 4.2?

Neodamode commented 5 years ago

@RiantAnda So, yes, I had audio in-game, just not on the cutscenes. The Wine version being used makes no difference (4.2, 4.1 ...). But I've found out that using the SDL_AUDIODRIVER="winmm" environment variable solves it. With that there's sound everywhere, with Lutris' wines and with Proton, except with Proton 3.16-8 Beta (game gets stuck). In Steam: SDL_AUDIODRIVER="winmm" %command% as a launch option.

RiantAnda commented 5 years ago

Thanks @Neodamode ! I can confirm that SDL_AUDIODRIVER="winmm" %command% provides the missing cutscene audio in each of the three games. Finally a workaround! I can also confirm that the games get stuck/hang with 3.16-8 Beta. Hopefully this gets sorted out.

RiantAnda commented 5 years ago

Sorry, didn't mean to close this issue, wrong button...

CubeTheThird commented 4 years ago

Just want to mention that setting SDL_AUDIODRIVER="winmm" %command% no longer appears to work as a workaround, even with older versions of Proton.

RiantAnda commented 4 years ago

I've checked "Memoria" with Proton 3.7-8 and the workaround still works. What older versions of Proton did you test, exactly?

CubeTheThird commented 4 years ago

It would seem I was indeed mistaken. Version 3.7-8 does work. I had tested newer versions than this. Thanks!

ashtonx commented 4 years ago

3.7.8 has no sound in cutscenes,SDL_AUDIODRIVER="winmm" %command% restores audio, but can make it crackle and hard to listen.

ashtonx commented 4 years ago

SDL_AUDIODRIVER="directsound" %command% Seemed to fix the issue for now, will need more time to confirm though

meskobalazs commented 4 years ago

I have tried the current Proton version – at the time of writing of this post, this is 5.13-2, and faced the same issue. I can confirm, that using Proton 3.7-8 and SDL_AUDIODRIVER="directsound" %command% solves the problem.

daddeltrotter commented 3 years ago

I can confirm that the combiation of using Proton 3.7-8 and SDL_AUDIODRIVER="directsound" %command% is the only way to have the game working with all audio working. In all later proton versions the changed launchpad option reuslts in broken sound in intro but still no sound in cut scenes.

daddeltrotter commented 3 years ago

To fix the audio issues in cut scenes in Proton 6.3-7, you can change system.reg in the pfx folder of the game and add an entry to section/key “[System\CurrentControlSet\Control\Session Manager\Environment]”. For a New Beginning - Final Cut", add a line “SDL_AUDIODRIVER”=”winmm”. For "Memoria" and "The Night of the Rabbit", add a line “SDL_AUDIODRIVER”=”directsound”.

chewi commented 2 years ago

The Night of the Rabbit has been driving my crazy. I'm using Proton 6.3. I normally have SDL_AUDIODRIVER set to pipewire. This causes the game to crash soon after starting. I have found this with other Windows games too, possibly because SDL2 in the Soldier runtime does not support Pipewire. winmm and directsound also cause a crash. Only pulse, dummy, disk, or unsetting the variable allow it to start.

This is strange for two reasons. First, the string pulse literally does not appear in the game's SDL2.dll. Second, dummy silences the sound during the Daedalic Entertainment logo (which appears to be a video), but the sound otherwise plays. If I set it to disk, then also setting SDL_DISKAUDIOFILE to a Linux path works, but setting it to a Windows path does nothing. The overall impression I get is that SDL is only being used in a native Linux context rather than a Wine/Windows context during videos/cutscenes. Perhaps that's why the post above suggests setting this through the registry instead. Admittedly I didn't see that till now.

I think SDL2.dll still has something to do with videos/cutscenes though, because if I replace it with the latest version from libsdl.org, then winmm and directsound no longer cause it to crash. I just get silence, no matter what I set it to. I'm guessing that it still partially relies on SDL2.dll to set up the sound, and this fails with the new version for some reason, so using a value that the Linux SDL does not support no longer causes it to crash.

Regardless of what I did above, I would also get crackling sound during gameplay. I couldn't fix it with PULSE_LATENCY_MSEC, the crackling would just get better or worse, but never go away. I noticed openal32.dll in the game's directory, which combined with the above, suggested to me that the rest of the audio is not handled by SDL at all. To test this theory, I deleted openal32.dll. The sound remained. But the crackling went away. :exploding_head: You might think this is because SDL tries to use OpenAL as a backend, fails, and then tries something else, but SDL doesn't support OpenAL. In fact, it's the other way round, OpenAL supports SDL as a backend. Seriously, I have no idea. :joy:

chewi commented 2 years ago

Aha, I've just noticed Wine/Proton includes its own openal32.dll. No doubt that one works better than the one the game ships with.

Risca commented 2 years ago

I was having this issue as well and replacing SDL2.dll with version 2.0.22 (latest stable) from http://libsdl.org/download-2.0.php made it work! Thank you @chewi for the suggestion :smiley: I'm using Lutris with Wine version _lutris-fshack-7.2-x8664

Risca commented 2 years ago

My previous comment was for the game The Night of the Rabbit.

To get audio working for cutscenes in A New Beginning, I had to get more down and dirty. Simply replacing SDL2.dll gave me no audio at all, but it did give me a different error message:

Advised audio format 33056 is not supported!

I did some digging around with IDA Pro, and 33056 is the SDL audio format AUDIO_F32. The game requests AUDIO_S16 and will fail to play any sound in videos if it doesn't get what it wants. The audio logic looks something like this:

SDL_AudioSpec want, have;
// it fills in more specs than format, not shown here.
want.format = AUDIO_S16;
SDL_OpenAudio(&want, &have);
if (want.format != have.format) {
    printf("Advised audio format %d is not supported!\n", have.format);
    return -1;
}

However, SDL_OpenAudio() can be called without the have argument and then SDL2 will automatically convert audio samples, under the hood, to the want format. It probably takes a bit more performance, but it works! I also had to modify all other references to have so that they point to want instead, since nothing is filling in that struct anymore. Basically changing the code to this:

SDL_AudioSpec want;
// it fills in more specs than format, not shown here.
want.format = AUDIO_S16;
SDL_OpenAudio(&want, NULL);
if (want.format != AUDIO_S16) {
    printf("Advised audio format %d is not supported!\n", have.format);
    return -1;
}

Here's a similar patch for Qemu which sort of fixes the same issue: https://patchwork.kernel.org/project/qemu-devel/patch/20200120024422.GA686@PC-SEANJYE/

I don't know how to best make an automatic patch. Maybe someone else can help with this?

Here are the bytes I changed:

Address Offset in file Length Original bytes Patched bytes
0x5ACBFC 0x1ABFFC 0x4 8D 44 24 2C 31 C0 90 90
0x5ACC66 0x1AC066 0x4 8D 4C 24 30 31 C9 90 90
0x5ACC86 0x1AC086 0x1 30 18
0x5ACCC6 0x1AC0C3 0x1 32 1A
0x5ACCE5 0x1AC0E1 0x1 32 1A
0x5ACD01 0x1AC0FE 0x1 32 1A
0x5ACD09 0x1AC106 0x1 2C 14
0x5ACD18 0x1AC115 0x1 30 18

I've sent an email to Daedalic Entertainment about the issue. Let's see if I get a reply :D

Risca commented 2 years ago

This was with done with version 2.0.4.0395 of A New Beginning - Final Cut

chewi commented 2 years ago

Great detective work!

marianoag commented 1 year ago

SDL_AUDIODRIVER apparently only works with a very old versions of Proton. I found out through a report from Memoria's Protondb that installing FAudio solves the issue. I was investigating what was needed to make it work and found out that there's no need to install anything, just avoid using a builtin dll.

WINEDLLOVERRIDES="xaudio2_7=d" %command%

I tested the 3 games and all of them have audio in cutscenes.