kcat / dsoal

A DirectSound DLL replacer that enables surround sound, HRTF, and EAX support via OpenAL Soft
GNU Lesser General Public License v2.1
373 stars 50 forks source link

F.E.A.R: Radio dialogue not played with the "Enable Sound Card" option enabled (Italian dubbing) #37

Open Kappa971 opened 2 years ago

Kappa971 commented 2 years ago

~I would like to report some problems encountered with FEAR:~

  1. With the Italian dubbing (but I have read that it also happens with the Russian one, so it could concern all non-English languages) and the "Enable Sound Card" option enabled, the radio dialogues are silent. This also happens with Creative Alchemy, so it could be a game bug. It can be "solved" by converting the affected audio files from stereo to mono (all game sounds are mono, only radio dialogue is stereo). ~2. The game menu sound is cut off.~ ~3. With DSOAL_LOGLEVEL = 1, the log files get filled with the following error repeated indefinitely: 2d14:err:dsound:EAX4Slot_Set Unexpected null effect propid 0x00000000 besides these two: 2d14:fixme:dsound:IKsPrivatePropertySetImpl_Get unsupported property: {f2957840-260c-11d1-a4d8-00c04fc28aca} 2d14:err:dsound:DSBuffer_Initialize Panning for multi-channel buffers is not supported~

~This is the complete log file: dsoal_log.txt~

https://github.com/kcat/dsoal/issues/37#issuecomment-1066658955 https://github.com/kcat/dsoal/issues/37#issuecomment-1067117865

mirh commented 2 years ago

1) sounds similar to the max payne problem, just in reverse 2) is it the same in XP? 3) second line should be irrelevant #3

Kappa971 commented 2 years ago
  1. FEAR without EAX works perfectly. With EAX enabled, the radio dialogues are silent, converting the audio files of the radios to mono, they work. Max Payne on the other hand crashes without ALchemy or with DSOAL without converting all audio files.
  2. I don't know if it happens with XP but with ALchemy it doesn't. At the beginning of this video, you can hear the sound of the menus being cut off some times: https://m.youtube.com/watch?v=VAZ1UTEz1Tw
  3. Ok
mirh commented 2 years ago

I linked the "no sound" part of the max payne issue, not crashing. But who knows if they were ever supposed to work. Are english files already mono?

Everything else.. seems like we have three bugs:

Kappa971 commented 2 years ago

I linked the "no sound" part of the max payne issue, not crashing. But who knows if they were ever supposed to work. Are english files already mono?

Max Payne with DSOAL without converting the audio, crashes before the menu. With ALchemy it is fine without converting the audio with the sound fix 1.12.1.beta, I don't know why. The audio files of the radio dialogue in English (FEAR) are in stereo but also work with EAX. Apparently they are the same as the Italian files, it is very strange. All other sounds and dialogues are in mono and work without any conversion, even in Italian (and therefore I guess also in other languages). With FEAR ArchiveEdit v2 (http://fear-combat.nl/FEAR-Public-Tools.html) you can open Arch00 files and see what's inside them. Arch00 files appear to work similarly to Doom's WADs.

Everything else.. seems like we have three bugs:

  • menu sound is cut off
  • FXSLOT_EFFECT_NULL isn't handled
  • panning for multi-channel buffers isn't supported (idk why it went from a fixme to a error in bae23cb)

That's correct, although I don't know what those errors mean :)

Kappa971 commented 2 years ago

With the latest build of DSOAL:

  1. With the Italian dubbing (but I have read that it also happens with the Russian one, so it could concern all non-English languages) and EAX enabled, the radio dialogues are silent. This also happens with Creative Alchemy, so it could be a game bug. It can be "solved" by converting the affected audio files from stereo to mono (all game sounds are mono, only radio dialogue is stereo).

This problem is still present, but I think it is a strange problem with the game which is therefore not related to DSOAL.

  1. The game menu sound is cut off.

This has been fixed, but now the menu sound has some reverb that shouldn't be there (that's not the only reverb problem encountered with the latest version of DSOAL, maybe I should open a new issue?)

  1. With DSOAL_LOGLEVEL = 1, the log files get filled with the following error repeated indefinitely: 2d14:err:dsound:EAX4Slot_Set Unexpected null effect propid 0x00000000 besides these two: 2d14:fixme:dsound:IKsPrivatePropertySetImpl_Get unsupported property: {f2957840-260c-11d1-a4d8-00c04fc28aca} 2d14:err:dsound:DSBuffer_Initialize Panning for multi-channel buffers is not supported

Now the log file shows this: 37cc:fixme:dsound:IKsPrivatePropertySetImpl_Get unsupported property: {f2957840-260c-11d1-a4d8-00c04fc28aca} 37cc:fixme:dsound:EAX4Slot_Query Unhandled effect propid: 0x00000000 37cc:err:dsound:DSBuffer_Initialize Panning for multi-channel buffers is not supported

I'm not sure if I should keep this issue open.

Kappa971 commented 2 years ago

I think I can close this issue for the moment.

mirh commented 2 years ago

https://web.archive.org/web/20050426013920/http://msdn.microsoft.com/archive/en-us/directx9_c/directx/htm/multichannelwavformats.asp https://web.archive.org/web/20030819144319/http://msdn.microsoft.com/library/en-us/stream/hh/stream/aud-prop_8ugj.asp I wonder if the first problem couldn't have something to do with some of this stuff I remembered from the max payne digging. Perhaps the game is debatably placing the radio chatter in the 3D space, and some of international publishers dubbed it in stereo. And even though that's not officially supported in ds8, retaining support for older versions meant that some skimpier driver devs eventually let it play even with the last version too. While Microsoft wrapper to WASAPI is very strict. Or anyhow something along those lines. ... Unless that also happened in XP, in which case I'm just blathering.

Kappa971 commented 2 years ago

https://web.archive.org/web/20050426013920/http://msdn.microsoft.com/archive/en-us/directx9_c/directx/htm/multichannelwavformats.asp https://web.archive.org/web/20030819144319/http://msdn.microsoft.com/library/en-us/stream/hh/stream/aud-prop_8ugj.asp I wonder if the first problem couldn't have something to do with some of this stuff I remembered from the max payne digging. Perhaps the game is debatably placing the radio chatter in the 3D space, and some of international publishers dubbed it in stereo. And even though that's not officially supported in ds8, retaining support for older versions meant that some skimpier driver devs eventually let it play even with the last version too. While Microsoft wrapper to WASAPI is very strict. Or anyhow something along those lines. ... Unless that also happened in XP, in which case I'm just blathering.

I used a tool to extract the game's audio files. I have compared the English and Italian audio files. The English radio dialogue audio files are in stereo and are also reproduced with hardware acceleration enabled in the menu. The Italian files look identical but they are not played. I ended up converting all Italian radio audio files to mono and the problem is solved.

I could upload two example files here, maybe someone understands the difference between the two.

I don't know if this also happens in XP.

EDIT I have FEAR installed in Italian, I thought there were also the files in English (I probably had FEAR installed in English too when I did the test). I can share Italian audio files (Rename the files voice_ITA.z01.zip, voice_ITA.z02.zip and voice_ITA.z03.zip to voice_ITA.z01, voice_ITA.z02 and voice_ITA.z03 before extracting): voice_ITA.zip voice_ITA.z01.zip voice_ITA.z02.zip voice_ITA.z03.zip If you have an English FEAR installation, you can use this tool to open .Arch00 files (it should be the FEARL.Arch00 file, voice folder): FEAR_ArchiveEdit_v2.zip

mirh commented 2 years ago

Then maybe the problem is not with stereo or mono? Maybe it's sampling rate, bit depth or the codec? Despite the files being all .wavs, I see some of them are actually mp3 for instance.

Kappa971 commented 2 years ago

Then maybe the problem is not with stereo or mono? Maybe it's sampling rate, bit depth or the codec? Despite the files being all .wavs, I see some of them are actually mp3 for instance.

They are all audio files with MPEG Layer 3 codec with WAV container, they aren't WAV PCM. This also applies to English audio files. If you have FEAR in English, then check for yourself (you could also upload the English audio files here). Radio audio files usually end in "r" ([number]r.wav). Converting these files to mono, they are also played correctly (with "Enable Sound Card = ON"). With "Enable sound card = OFF" stereo files are played correctly so there is some problem with DirectSound3D. It seems as if the game or DirectSound3D doesn't know which channel to play stereo tracks in, and therefore doesn't play anything. The strange thing is that stereo English audio files are played! (with the "Enable Sound Card" option enabled). I compared the English and Italian files a while ago and I didn't notice any difference, maybe you or someone else may have better luck. I uploaded the Italian audio files for this reason.

Choum28 commented 2 years ago

Then maybe the problem is not with stereo or mono? Maybe it's sampling rate, bit depth or the codec? Despite the files being all .wavs, I see some of them are actually mp3 for instance.

They are all audio files with MPEG Layer 3 codec with WAV container, they aren't WAV PCM. This also applies to English audio files. If you have FEAR in English, then check for yourself (you could also upload the English audio files here). Radio audio files usually end in "r" ([number]r.wav). Converting these files to mono, they are also played correctly (with "Enable Sound Card = ON"). With "Enable sound card = OFF" stereo files are played correctly so there is some problem with DirectSound3D. It seems as if the game or DirectSound3D doesn't know which channel to play stereo tracks in, and therefore doesn't play anything. The strange thing is that stereo English audio files are played! (with the "Enable Sound Card" option enabled). I compared the English and Italian files a while ago and I didn't notice any difference, maybe you or someone else may have better luck. I uploaded the Italian audio files for this reason.

I confirm the problem, as far as I remember this problem was already present when the game was out in 2006 (French version). THe problem is definitely due to the audio file itself (if you replace voice files with the english one in your localised FEARL.Arch00 package, the problem is gone. I also do not understand the bitrate of Audio game file. 2 Channel 16bits, 44100hz -> bitrate 112k?! for the english radio file (128k for localised version)

Which program did you use to convert all audio files ?

Kappa971 commented 2 years ago

I confirm the problem, as far as I remember this problem was already present when the game was out in 2006 (French version). THe problem is definitely due to the audio file itself (if you replace voice files with the english one in your localised FEARL.Arch00 package, the problem is gone. I also do not understand the bitrate of Audio game file. 2 Channel 16bits, 44100hz -> bitrate 112k?! for the english radio file (128k for localised version)

Which program did you use to convert all audio files ?

I used FEAR ArchiveEdit v2 to extract the audio files, opened them in Foobar2000, left only stereo files and converted them to mono via FFMPEG, I think with this parameter to be put in Foobar for conversion: -i pipe:0 -y -ac 1 -c:a libmp3lame -ar 44100 -f wav %d (maybe -ab 112k is also necessary, but I don't remember. Not all files have the same bitrate). I then created a new package with FEAR ArchiveEdit v2, copied to the game folder and added to the Default.archcfg file.

Choum28 commented 2 years ago

I used FEAR ArchiveEdit v2 to extract the audio files, opened them in Foobar2000, left only stereo files and converted them to mono via FFMPEG, I think with this parameter to be put in Foobar for conversion: -i pipe:0 -y -ac 1 -c:a libmp3lame -ar 44100 -f wav %d (maybe -ab 112k is also necessary, but I don't remember. Not all files have the same bitrate). I then created a new package with FEAR ArchiveEdit v2, copied to the game folder and added to the Default.archcfg file.

I tried with this parameters in a script file (to loop on all stereo file) .\ffmpeg.exe -i $file -ac 1 -c:a libmp3lame -ar 44100 -f wav c:\temp\$file The file is corrupt according to footbar after conversion andI have no sound after the change ingame (even without HW mixing).

I also try with encoders : mp3_mf, file is not corrupt in footbar but no change ingame. I also try PCM, the game skip dialog in this case.

Kappa971 commented 2 years ago

I tried with this parameters in a script file (to loop on all stereo file) .\ffmpeg.exe -i $file -ac 1 -c:a libmp3lame -ar 44100 -f wav c:\temp$file The file is corrupt according to footbar after conversion andI have no sound after the change ingame (even without HW mixing).

Try to specify the bitrate in the command as well, I don't remember if without specifying the bitrate, the resulting file takes the bitrate of the source file. It is an unusual audio format, Mpeg Layer 3 encoded WAV. Also I just remembered that for the converted files I also used Mp3tag (otherwise the game would not read the new files).

Choum28 commented 2 years ago

I try to set the bitrate to 128k no change, by default only the mp3_mf seems to keep the same bitrate. What do you do with the mp3tag utility ?

Kappa971 commented 2 years ago

I try to set the bitrate to 128k no change, by default only the mp3_mf seems to keep the same bitrate.

Try FFMPEG with Foobar2000, it works. When converting files, add a profile for FFMPEG (add the ffmpeg.exe path ) and copy the above command.

What do you do with the mp3tag utility ?

If I remember correctly, I added all wav files to Mp3tag, right click and "Remove Tag", then right click and "Save ID3 to MP3 file".

Choum28 commented 2 years ago

I try to set the bitrate to 128k no change, by default only the mp3_mf seems to keep the same bitrate.

Try FFMPEG with Foobar2000, it works. When converting files, add a profile for FFMPEG (add the ffmpeg.exe path ) and copy the above command.

What do you do with the mp3tag utility ?

If I remember correctly, I added all wav files to Mp3tag, right click and "Remove Tag", then right click and "Save ID3 to MP3 file".

Thank you, I was able to make it work. So to summarize for other people that will arrive here for the same issue :

You can also create an Arch00 patch file (by copying convert audio file (C:\temp\fix) only in a voice folder inside the arch00 file) , in that case do not forget to edit Default.archcfg to list your new Arch00 or the game will not load it.

Kappa971 commented 2 years ago
  • Convert all those stereo file to mono with command line :
  • .\ffmpeg.exe -i c:\temp\stereo\INPUTFILE -y -c:a mp3_mf -ac 1 -ar 44100 -f wav C:\temp\fix\OUTPUTFILE }

With Foobar2000 you can convert files automatically once you have used the above command in a custom profile for FFMPEG. I used libmp3lame and it works. In your case you should create a batch file, otherwise you have to use that command for each wav file manually.

You can also create an Arch00 patch file (by copying convert audio file (C:\temp\fix) only in a voice folder inside the arch00 file) , in that case do not forget to edit Default.archcfg to list your new Arch00 or the game will not load it.

This should be the recommended method, and also the most portable for those who want to share this "fix".

mirh commented 2 years ago

https://www.hwupgrade.it/forum/showthread.php?t=1095749 https://www.spieleforum.de/t/fear-probleme-mit-sound.763083/ https://www.gog.com/forum/fear_series/solution_windows_81_no_audio https://web.archive.org/web/20030203033916/http://msdn.microsoft.com/library/en-us/stream/hh/stream/pcdesign_29if.asp https://web.archive.org/web/20070102171430/http://www.softoutfit.com/hints.html#F.E.A.R.+%22No+Sound%22+Problem+Solved So.. I did some more digging, and it seems like people were more or less also having the same problem in XP (unclear how much this was a codec problem, as opposed to hardware mixing itself) On the other hand, reportedly you could just disable "vendor-specific extensions" and the thing suddenly worked again.

Kappa971 commented 2 years ago

https://www.hwupgrade.it/forum/showthread.php?t=1095749 https://www.spieleforum.de/t/fear-probleme-mit-sound.763083/ https://www.gog.com/forum/fear_series/solution_windows_81_no_audio https://web.archive.org/web/20030203033916/http://msdn.microsoft.com/library/en-us/stream/hh/stream/pcdesign_29if.asp https://web.archive.org/web/20070102171430/http://www.softoutfit.com/hints.html#F.E.A.R.+%22No+Sound%22+Problem+Solved So.. I did some more digging, and it seems like people were more or less also having the same problem in XP (unclear how much this was a codec problem, as opposed to hardware mixing itself) On the other hand, reportedly you could just disable "vendor-specific extensions" and the thing suddenly worked again.

What I think is:

  1. the translators used a different mp3 codec
  2. the translators messed with the mp3 tags

Do you have this WMFADist.exe file?

EDIT I tried to edit only the tags with mp3tag but it doesn't work. I also tried to re-encode the files (in stereo) but it doesn't work either. It only works if the files are in mono.

Only the English dubbing of the radios works in stereo!

mirh commented 2 years ago

The translators (if not perhaps the publisher/developer itself) certainly screwed some setting, perhaps their encoder used stereo by default and they forgot to give it the right flags. And QA didn't catch this issue because this was DS3D\EAX\Soundblaster specific.

But if this isn't a problem with anything the OS provides (missing mp3 decoder aside), then it seems like there's actually another link of the chain that is broken and could be fixed instead of these conversions.

Choum28 commented 2 years ago

The polish version is using English voice with Polish subtitles. The audio files are strictly the same as the English one when extracted, the problem is not present

Importing English voices into a localised archives fix the problem. Importing French or german voices inside the English archive triggers the problem.

Edit : Also using extracted sounds directly without packing them in a arch000 file give the same behavior.

Ex : if you put your extracted voice folder in X:\FEAR\myfolder\ and add myfolder inside the Default.archcfg, this will allow you to use extracted files ingame.

ThreeDeeJay commented 1 year ago

I know this is about non-English versions, but the issue also happens in the English version of the Extraction Point DLC. Someone made a fix and gave me permission to upload here https://community.pcgamingwiki.com/files/file/2600-fear-extraction-point-eax-fix/ Also, I added a reference in https://www.pcgamingwiki.com/wiki/F.E.A.R.#Audio

@kcat would it be feasible to make stereo sources that fail behave like mono sources? šŸ¤” Perhaps either by :

kcat commented 1 year ago

@kcat would it be feasible to make stereo sources that fail behave like mono sources?

I'm not sure what you mean by "stereo sources that fail". How are they failing? The

37cc:fixme:dsound:EAX4Slot_Query Unhandled effect propid: 0x00000000

message should be fixed, and

37cc:err:dsound:DSBuffer_Initialize Panning for multi-channel buffers is not supported

is just saying (non-3D) multi-channel buffers won't pan. They still load and will play, it just will play normally and won't pan left or right (which the app probably won't do anyway, DSBCAPS_CTRLPAN is a default flag apps tend to set on non-3D buffers without any intention of panning).

ThreeDeeJay commented 1 year ago

Oh wait, so was this already fixed in a recent DSOAL/OpenAL Soft update? I haven't tested it, but if I understand correctly, according to the first post, some radio dialogues are (/were?) silent because they're in stereo and both DSOAL and ALchemy fail to play them unless they're converted to mono. So perhaps I'm using "stereo sources" in the wrong context here, but my suggestion was basically allowing those stereo sound files to play (at least non-spatialized if they're 3D?), to work around what's apparently a bug in the game itself, not DSOAL/ALchemy emulation. šŸ¤”

kcat commented 1 year ago

Oh wait, so was this already fixed in a recent DSOAL/OpenAL Soft update?

Oh, no wait that fixme still happens. DSOAL handles queries natively since OpenAL's EAX API doesn't have it. I don't think it's a problem here though, since it has nothing to do with whether radio dialog plays or not.

I haven't tested it, but if I understand correctly, according to the first post, some radio dialogues are (/were?) silent because they're in stereo and both DSOAL and ALchemy fail to play them unless they're converted to mono.

According to earlier posts, the English radio dialogs play fine, and they're in stereo too.

The audio files of the radio dialogue in English (FEAR) are in stereo but also work with EAX. ... THe problem is definitely due to the audio file itself (if you replace voice files with the english one in your localised FEARL.Arch00 package, the problem is gone. I also do not understand the bitrate of Audio game file. 2 Channel 16bits, 44100hz -> bitrate 112k?! for the english radio file (128k for localised version)

It seems like a bug in the game, that for some reason the stereo english tracks don't trigger, and converting the localized tracks to mono works around. Unfortunately there's no error reported by DSOAL aside from the above, but those don't indicate any issue with the radio files. As far as DSOAL seems to be concerned, there's no issue loading and playing what it's told to, just for some reason it's not being told to play the regular localized radio tracks.

ThreeDeeJay commented 1 year ago

Ohhh, my b. I thought they meant they "reproduced" the bug with the English files in stereo, but that actually meant play the files. I was bamboozled for a second there so nevermind me and carry on šŸ˜…

mirh commented 1 year ago

They are all audio files with MPEG Layer 3 codec with WAV container, they aren't WAV PCM. This also applies to English audio files.

Uhm, no it doesn't (unless archiveedit does a hidden conversion behind). 10017.wav which I extracted straight from the steam version (which AFAIK isn't localized) is actually a legit PCM file, as also manually evidenced if you check the hex format tag in the RIFF header.

It may be as well that only that is happy in stereo streams. https://learn.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-waveformatex

Kappa971 commented 1 year ago

They are all audio files with MPEG Layer 3 codec with WAV container, they aren't WAV PCM. This also applies to English audio files.

Uhm, no it doesn't (unless archiveedit does a hidden conversion behind). 10017.wav which I extracted straight from the steam version (which AFAIK isn't localized) is actually a legit PCM file, as also manually evidenced if you check the hex format tag in the RIFF header.

It may be as well that only that is happy in stereo streams. https://learn.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-waveformatex

I just know that Foobar 2000 detects those files with mp3 codec and if it's wrong, it won't be able to read the file and return an error. I similarly converted those files to mono with ffmpeg (mp3 with wav container). I've even used mp3tag to get ID3 information into new mono audio files (otherwise F.E.A.R. won't read them) so I can assume they use mp3 encoding (no idea why they used such a particular format). The reason why localized stereo audio files are not being read by the game is still a mystery.

mirh commented 1 year ago

I got the same info (if less detailed) from mediainfo and gspot. I'd exhort you to please "run again" the extraction process from the start. If the byte at offset 0x14 is actually 0x55, then I'm sure those are mp3s. But I'm very skeptical that you'll find english files that haven't just 0x1 there.

Kappa971 commented 1 year ago

I got the same info (if less detailed) from mediainfo and gspot. I'd exhort you to please "run again" the extraction process from the start. If the byte at offset 0x14 is actually 0x55, then I'm sure those are mp3s. But I'm very skeptical that you'll find english files that haven't just 0x1 there.

This is the original Italian audio, it's using MPEG-1 Layer 3 codec. I don't have the game in English.

scr1 scr2 scr3

In any case, this doesn't lead to any progress.

Truth-Unknown commented 1 year ago

I'm curious, since the audio is MP3 in WAVE files, maybe this version of the game is needing an ACM codec? You can try the ACM codec from here: https://www.rarewares.org/mp3-lame-dshow-acm.php#lame-current-acm

mirh commented 1 year ago

LAME is for encoding-only (there's also a string inside the codec mentioning it)? And as for decoding, l3codeca.acm is already being shipped in W10 (unless they somehow gimped/nerfed it with time).. if any l3codecx.ax seems to be missing.

If only people could test with an x-fi on xp..

I don't have the game in English.

Then how could you claim that the files are the same?

Btw it seems really strange that the RIFF container had to be stripped, considering every file I found had it, and that I'm not even sure wav files without are even supposed to be valid.

Kappa971 commented 1 year ago

Then how could you claim that the files are the same?

Because I tried the game in English and the files were of the same format. I no longer have the game in English. You are claiming that the English version audio files are different, but I see no evidence for that. You should upload some pictures to prove it (MediaInfo is enough).

Manu270891 commented 8 months ago

I can confirm that this issue is also present with the spanish dubbing.