kcat / dsoal

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

No sound from rear speakers in 5.1 config, indirectsound works fine #54

Closed drivetheory closed 2 years ago

drivetheory commented 2 years ago

(yes, indirectsound INI & DLL are removed when testing DSOAL)

OS: Win7 (x64) SND: Creative SB X-Fi SPK: Creative GigaWorks G500 5.1

DSOAL: dsoal-r430 OpenAL-Soft: openal-soft-1.22.0-bin

Games Tested: Thief: Gold (1998) Fallout New Vegas (2010)

openal-info64.exe OUTPUT:

Available playback devices:
    SB X-Fi Audio [0001]
    Generic Software on 5.1 Speakers (Creative SB X-Fi)
Available capture devices:
    Microphone (Yeti Stereo Microph
    "What U Hear" (Creative SB X-Fi
Default playback device: SB X-Fi Audio [0001]
Default capture device: Microphone (Yeti Stereo Microph
ALC version: 839019536.107104

ALC Error: Invalid enum parameter passed as an argument to an ALC call. (0xa003), @ 138
** Info for device "SB X-Fi Audio [0001]" **
ALC version: 1.1
ALC extensions:
    None
HRTF extension not available
Output mode extension not available
OpenAL vendor string: Creative Labs Inc.
OpenAL renderer string: SB X-Fi Audio [0001]
OpenAL version string: OpenAL version 1.1
OpenAL extensions:
    EAX
EAX1.0
EAX2.0
EAX3.0
EAX4.0
EAX5.0

Resampler info not available
EFX version: 1.0
Max auxiliary sends: 2
Supported filters:
    Low-pass
Supported effects:
    EAX Reverb, Reverb, Chorus, Distortion, Echo, Flanger, Frequency Shifter,
    Vocal Morpher, Pitch Shifter, Ring Modulator, Autowah, Compressor,
    Equalizer

%APPDATA%\alsoft.ini

[General]
channels=surround51

[decoder]
hq-mode=true

%CURRENT-GAME-ROOT-DIR%\alsoft.ini

[general]
drivers="wasapi"
channels="surround51"
mirh commented 2 years ago

Sigh. Could you try the latest openal-soft git (remember to rename as dsoal-aldrv.dll), and then if that still doesn't work dsoal-r422? https://github.com/kcat/openal-soft/actions http://vaporeon.io/hosted/dsoal-builds/old/

Also, take note at least openal-info64 is using the creative driver, not openal-soft.

drivetheory commented 2 years ago

replaced the two DLLs with those from dsoal-r422...

in r430 when I rotate my 1st person FOV in game to cause a 3D positional sound to move from the front left/center/right speakers to the rear speakers the 3D positional sound stops playing when it gets to the rear speakers.

in r422, the 3D Positional sound never leaves and is instead emitted from the front left, right & center speakers.

drivetheory commented 2 years ago

My apologies it seems somehow today during these hours and hours of testing both my OpenAL32.dll got replaced by Creative's... I deleted creative's DLLs and replaced them with the openal-soft-1.22.0-bin DLLs. However, the problems still exist regardless.

openal-info64.exe OUTPUT:

Available playback devices:
    OpenAL Soft on 5.1 Speakers (Creative SB X-Fi)
Available capture devices:
    OpenAL Soft on Microphone (Yeti Stereo Microphone)
    OpenAL Soft on "What U Hear" (Creative SB X-Fi)
Default playback device: OpenAL Soft on 5.1 Speakers (Creative SB X-Fi)
Default capture device: OpenAL Soft on Microphone (Yeti Stereo Microphone)
ALC version: 1.1

** Info for device "OpenAL Soft on 5.1 Speakers (Creative SB X-Fi)" **
ALC version: 1.1
ALC extensions:
    ALC_ENUMERATE_ALL_EXT, ALC_ENUMERATION_EXT, ALC_EXT_CAPTURE,
    ALC_EXT_DEDICATED, ALC_EXT_disconnect, ALC_EXT_EFX,
    ALC_EXT_thread_local_context, ALC_SOFT_device_clock, ALC_SOFT_HRTF,
    ALC_SOFT_loopback, ALC_SOFT_loopback_bformat, ALC_SOFT_output_limiter,
    ALC_SOFT_output_mode, ALC_SOFT_pause_device, ALC_SOFT_reopen_device
Available HRTFs:
    Built-In HRTF
Output channel mode: 5.1 Surround
OpenAL vendor string: OpenAL Community
OpenAL renderer string: OpenAL Soft
OpenAL version string: 1.1 ALSOFT 1.22.0
OpenAL extensions:
    EAX, EAX2.0, EAX3.0, EAX4.0, EAX5.0, EAX-RAM, AL_EXT_ALAW, AL_EXT_BFORMAT,
    AL_EXT_DOUBLE, AL_EXT_EXPONENT_DISTANCE, AL_EXT_FLOAT32, AL_EXT_IMA4,
    AL_EXT_LINEAR_DISTANCE, AL_EXT_MCFORMATS, AL_EXT_MULAW,
    AL_EXT_MULAW_BFORMAT, AL_EXT_MULAW_MCFORMATS, AL_EXT_OFFSET,
    AL_EXT_source_distance_model, AL_EXT_SOURCE_RADIUS, AL_EXT_STEREO_ANGLES,
    AL_LOKI_quadriphonic, AL_SOFT_bformat_ex, AL_SOFTX_bformat_hoa,
    AL_SOFT_block_alignment, AL_SOFT_callback_buffer,
    AL_SOFTX_convolution_reverb, AL_SOFT_deferred_updates,
    AL_SOFT_direct_channels, AL_SOFT_direct_channels_remix,
    AL_SOFT_effect_target, AL_SOFT_events, AL_SOFT_gain_clamp_ex,
    AL_SOFTX_hold_on_disconnect, AL_SOFT_loop_points, AL_SOFTX_map_buffer,
    AL_SOFT_MSADPCM, AL_SOFT_source_latency, AL_SOFT_source_length,
    AL_SOFT_source_resampler, AL_SOFT_source_spatialize, AL_SOFT_UHJ
Available resamplers:
    Nearest
    Linear
    Cubic
    11th order Sinc (fast)
    11th order Sinc
    23rd order Sinc (fast)
    23rd order Sinc *
EFX version: 1.0
Max auxiliary sends: 4
Supported filters:
    Low-pass, High-pass, Band-pass
Supported effects:
    EAX Reverb, Reverb, Chorus, Distortion, Echo, Flanger, Frequency Shifter,
    Vocal Morpher, Pitch Shifter, Ring Modulator, Autowah, Compressor,
    Equalizer, Dedicated Dialog, Dedicated LFE
mirh commented 2 years ago

Not that system-wide openal should matter for dsoal, I just mentioned it just for the records.

replaced the two DLLs with those from dsoal-r422...

I asked you to first try the latest oal-soft build, with the latest dsoal. https://github.com/kcat/openal-soft/actions/runs/2447331786#artifacts

drivetheory commented 2 years ago

I greatly appreciate you pointing out the global DLL shenanigan's.. didn't realize they got replaced

my apologies, i was under the impression that in order to use the 'latest' openal-soft i would need to compile from source and i do not have that capability setup at the moment and was looking into it.

didn't realize compiled binaries were available inside the workflow runs (used to pulling them from the releases page).

downloaded 32-bit DLL from the run you specified, dropped it into FONV root as 'dsoal-aldrv.dll' executed FONV, same behavior, as 3D sound reaches rear speakers it disappears.

again, my apologies for my ignorance i exhibited earlier.

mirh commented 2 years ago

Ok, well, good. I reckon this seems like a bug indeed. ALchemy is probably more of a benchmark than indirectsound btw.

drivetheory commented 2 years ago

thanks for the response. yeah, used ALchemy for years but am looking towards the future, towards programs that don't require owning a creative sound card.. https://i.imgur.com/GhyFv96.jpeg yeah, daniel_K released a universal version of ALchemy around the time he was fixing Creative's drivers for them... hell, back when my college education was more fresh in my mind i was a lot more useful as well.. http://drivetheory.org/creative/

anyhow, if you need a guinea pig for testing say the word.

kcat commented 2 years ago

If you set the ALSOFT_LOGLEVEL environment variable to 3, running a DSound app with DSOAL should make OpenAL Soft print out a trace log to stderr. You can optionally also set the ALSOFT_LOGFILE environment variable to a path+filename to have it write the log there instead. Getting a log for r430 and r422 should help diagnose why the rear speakers aren't being used in the newer version when they were in the older version.

drivetheory commented 2 years ago

just to clarify, the rear speakers didn't work in r422. in r422 the 3D sound behaved as if the rear speakers didn't exist (ie. 3.1) and only played sound in the front speakers. in r430 the 3D sound behaved as if the rear speakers did exist (ie 5.1) but were not connected.

will implement the environment variables when im done working for the day in a couple hours and start testing there after. will post back with results in a handful of hours

drivetheory commented 2 years ago

did testing, used this version of OpenAL-Soft for all tests: https://github.com/kcat/openal-soft/actions/runs/2447331786#artifacts also installed the DLLs globally

merely replaced the dsound.dll each time with the DSOAL release being tested, left my basic INI in place

Fallout New Vegas generated log files, Thief Gold (from GOG) did not... Thief Gold since release on GOG with the NewDark engine supports OpenAL. When using the OpenAL setting in game , the global OpenAL-Soft DLL produced surround sound properly. When using the DSOAL method Thief behaved the same as FONV, no sound from rear speakers.

OpenAL-Soft_logfile_dsoal-r422_FONV.txt OpenAL-Soft_logfile_dsoal-r430_FONV.txt

test 2 (all other output devices disabled) OpenAL-Soft_logfile_dsoal-r422_FONV_TEST2.txt OpenAL-Soft_logfile_dsoal-r430_FONV_TEST2.txt

kcat commented 2 years ago

When using the OpenAL setting in game , the global OpenAL-Soft DLL produced surround sound properly. When using the DSOAL method Thief behaved the same as FONV, no sound from rear speakers.

And both the OpenAL Soft DLL and dsoal-aldrv.dll are the same version of OpenAL Soft? I have no idea why the same DLL would behave differently in this regard. It's enabling 5.1 output in both cases, and DSOAL/the app can't influence the behavior of the rear speakers in this way.

drivetheory commented 2 years ago

yes, all same version. Thief being from the 1990s probably skips reading the env. vars. which is why there's no log generated. Deus Ex GOTY also doesn't generate log file.

will go through satsun's list and find more DS3D games I can use for testing

kcat commented 2 years ago

It's not the app responsible for reading the env vars, that's the library doing it independently from the app. The only reasons I can think of why it doesn't work is, 1) the app comes with and uses its own OpenAL that's not OpenAL Soft, 2) it clears all env vars prior to launching the app or loading the OpenAL DLL, and/or 3) it overrides the file i/o functions and prevents extraneous output. 1 is something I can see happening, while 2 and 3 are somewhat extreme (but not beyond the realm of possibility; Minecraft/Java does this which makes it difficult to get a log from OpenAL Soft even though it uses it).

drivetheory commented 2 years ago

tested the original Far Cry (GOG version). same problem when using DSOAL, no sound from the rear speakers. using indirectsound/ALchemy works fine. Far Cry also would not generate a log file...

While reading on satsun's page I noticed something interesting... http://satsun.org/audio/ Speakers must be set to 5.1 rear surround in Windows, defaults to stereo if set 7.1/5.1 side config. Consider IndirectSound. this was related to games that use Miles, but still the differentiation between 5.1 rear/side was interesting

will test modded Minecraft bext

kcat commented 2 years ago

While reading on satsun's page I noticed something interesting... http://satsun.org/audio/ Speakers must be set to 5.1 rear surround in Windows, defaults to stereo if set 7.1/5.1 side config. Consider IndirectSound.

Is that what you have set in the device configuration?

drivetheory commented 2 years ago

that is not an option at all in Windows 7, there is no differentiation between side & rear 5 1

drivetheory commented 2 years ago

had some very interesting results with modded minecraft... testing some more... using the MultiMC launcher with Direwolf20's pack extracted the OpenAL DLLs to a temporary folder called 'native'. I swapped out the DLLs for OpenAL-Soft DLLs before they got loaded...

EDIT: not getting rear speaker sound at all in modded minecraft... EDIT AGAIN... seems there are no rear speaker sounds in vanilla minecraft 1.18... LAST EDIT... seems significant changes occurred in minecraft between 1.12 & 1.14... 1.12, surround sound, 1.14, no rear speaker sound at all

OpenAL-Soft_logfile [MultiMC Minecraft, DLLs swapped].txt [OpenAL-Soft_logfile MultiMC Minecraft.txt

to be honest, usually im watching Netflix when playing minecraft so it's always muted...

kcat commented 2 years ago

Does the latest commit help at all? Can you provide an updated trace log from one of the misbehaving apps?

drivetheory commented 2 years ago

IN USE: https://github.com/kcat/dsoal/actions/runs/2025178604 https://github.com/kcat/openal-soft/actions/runs/2458602155

Well Done! FONV works 100%

LOG: OpenAL-Soft_logfile_Latest_Commits_FONV.txt

also tested Far Cry, also works 100% (but doesn't generate a log file) also tested Thief, works 100%, no log file

kcat commented 2 years ago

Looks like Windows transparently handles 5.1 Rear vs 5.1 Side nowadays. Or the driver does. Either way.

Regarding the missing log files, it's best to ensure ALSOFT_LOGFILE has a full path and filename, and the path is one you have write permissions for. If it's just a filename or a relative path, the app can change the current working directory before OpenAL Soft opens the log, causing it to place the file in an unexpected place (or a non-existent folder, preventing it from being created). Or if it's in a place you don't have write permissions, it may end up in the virtual store which is known to cause problems for file visibility.

drivetheory commented 2 years ago

Win7, UAC is completely disabled, and im a local admin (and my pc is not part of an active directory domain) ALSOFT_LOGFILE env. var. is set to "c:\OpenAL-Soft_logfile.txt"

mirh commented 2 years ago

In https://github.com/kcat/dsoal/issues/33 there seems to be no problem with far cry logging..

Or the driver does.

I reckon somebody should test some normal random realtek, just to be sure this is not the n-th creative shenanigan.

drivetheory commented 2 years ago

OpenAL-Soft_logfile_RealTek_FONV.txt ignore the label "Stereo Speakers", i swapped my 5.1 to this device and all worked fine. it's labelled that way because that's where teamspeak/discord sounds come from ;)

FarCry will not generate a log using the onboard RealTek as well... I am curious if in the thread you mention what release of game they are using. retail? 64-bit retail?

mirh commented 2 years ago

We meant the driver behaviour in handling different 5.1 configurations, not logging.

I really don't know what could stop that from happening (except perhaps the dll not loading at all, are you using the right bitness?)

kcat commented 2 years ago

I also meant when selecting "5.1 Surround" in the speaker setup, Windows will automatically use the rear or side channels given the hardware/drivers, without displaying different "5.1 Surround (Side)" and "5.1 Surround (Rear)" modes.

drivetheory commented 2 years ago

affirmative.