kcat / openal-soft

OpenAL Soft is a software implementation of the OpenAL 3D audio API.
Other
2.16k stars 522 forks source link

How do I enable hrtf in openal-soft? #620

Open kotenok2000 opened 2 years ago

kotenok2000 commented 2 years ago

I have put soft_oal.dll to system folders here is openal-info32.exe output Available playback devices: Generic Software on OpenAL Soft on OpenAL Soft on SyncMaster (NVIDIA High Definition Audio) Generic Software on SyncMaster (NVIDIA High Definition Audio) Available capture devices: OpenAL Soft on Default playback device: Generic Software on Default capture device: ALC version: 1100952765.6422036

** Info for device "Generic Software on ALC version: 1.1 ALC extensions: ALC_ENUMERATE_ALL_EXT, ALC_ENUMERATION_EXT, ALC_EXT_CAPTURE, ALC_EXT_EFX HRTF extension not available OpenAL vendor string: Creative Labs Inc. OpenAL renderer string: Software OpenAL version string: 1.1 OpenAL extensions: EAX, EAX2.0, EAX3.0, EAX4.0, EAX5.0, EAX3.0EMULATED, EAX4.0EMULATED, AL_EXT_OFFSET, AL_EXT_LINEAR_DISTANCE, AL_EXT_EXPONENT_DISTANCE Resampler info not available EFX version: 1.0 Max auxiliary sends: 1 Supported filters: !!! none !!! Supported effects: !!! none !!!

kcat commented 2 years ago

Run the alsoft-config.exe utility, switch to the HRTF tab and change "HRTF Mode" to "Force on", then click Apply. I'll note that it won't affect the "Generic Software" devices, which it seems to be opening by default, only devices that have "OpenAL Soft".

kotenok2000 commented 2 years ago

I have already done that.

kcat commented 2 years ago

Then it should be enabled when you use an OpenAL Soft device with OpenAL apps. Are you having a particular issue there?

kotenok2000 commented 2 years ago

When i run openal-info32.exe "OpenAL Soft" it now says Available HRTFs: (null)

kcat commented 2 years ago

I don't think the HRTF extension works through Creative's router, so the info utility can't query the available HRTFs. HRTF itself will still work in games, though.

Ozzuneoj commented 2 years ago

I get basically the same output as the OP from openal-info32.exe and openal-info64.exe.

Is the general consensus that these applications don't actually work to verify if OpenAL Soft is installed and functioning correctly? I found a post from 6 years ago with someone asking for clarification on the same problem. It would be really nice to see the readme in compiled Windows binary updated to reflect that these programs do NOT tell you if OpenAL soft is working, regardless of what they say. Or, if that isn't the case, possibly providing some clarification as to what the output of the info programs mean.

Also, can someone clarify these comments?

" I'll note that it won't affect the "Generic Software" devices, which it seems to be opening by default, only devices that have "OpenAL Soft"."

Is this referring to the "info" program simply checking the wrong output device for OpenAL Soft features? If so, is there any documentation available that explains how to make it check the correct device?

"Then it should be enabled when you use an OpenAL Soft device with OpenAL apps. "

Are we talking about sound output devices? I haven't seen any mention in the OpenAL Soft documentation or website regarding any hardware limitations. Is it possible to use, for example, the HDMI output "audio" device on an Nvidia or AMD graphics card, or an SPDIF PCM stereo output for OpenAL soft? I think many people use devices like this. Even my Xonar DX sound card is showing as a Generic Software device, despite the fact that it actually would support OpenAL in hardware if anything still supported that.

To be clear, I think I've gotten HRTF working on the Xonar system, but it's hard to tell if\why it isn't working properly on some other computers, and I feel like I've gone in circles for a couple of hours trying to figure out, in part, what the "info" programs are trying to tell me.

I love this project but as a peasant Windows user who just wants to ensure HRTF is working on a few systems running Minecraft, the lack of explanation of these things is a bit frustrating. :)

Thank you for your time.

kcat commented 2 years ago

Is the general consensus that these applications don't actually work to verify if OpenAL Soft is installed and functioning correctly?

The openal-info programs just report what it can from OpenAL. It's doesn't verify anything about OpenAL Soft or ensure it's there. Though it does report enough for the user to tell if OpenAL Soft is detected (it'll be listed device names or the OpenAL version string).

Is this referring to the "info" program simply checking the wrong output device for OpenAL Soft features?

No, it's saying that enabling HRTF in OpenAL Soft's config file will only affect OpenAL Soft devices, while Creative's router seems to be opening a Generic Software device by default, which won't give HRTF.

Is it possible to use, for example, the HDMI output "audio" device on an Nvidia or AMD graphics card to use OpenAL soft?

Yes. OpenAL Soft's renderer/mixer is completely software based. As long as the process is capable of accessing the device with WASAPI (Windows' audio API), OpenAL Soft can use the output with the same features as any other output.

To be clear, I think I've gotten HRTF working on the Xonar system, but it's hard to tell if\why it isn't working properly on some other computers, and I feel like I've gone in circles for a couple of hours trying to figure out, in part, what the "info" programs are trying to tell me.

The reasons HRTF may not be working on some computers can be as varied as the computers themselves, and how everything is configured. By default, OpenAL Soft will enable HRTF if the system reports the given output device is stereo headphones or a stereo headset (which is set in the system's device configuration). The stereo-mode config option can be used to override this detection, so you can tell OpenAL Soft the device is headphones or not regardless of what the system says it is.

The openal-info utilities currently don't say whether HRTF is being enabled on the opened device. I guess I could add that if the device has the HRTF extension. Otherwise, you'll have to enable trace logging (set the ALSOFT_LOGLEVEL environment variable to 3) and look at what it prints to stderr (or for non-command-line apps, also set the ALSOFT_LOGFILE environment variable to a full path and filename where it'll write the log; just be aware the log file will be overwritten every time an app is run using OpenAL Soft). Among the output, it'll say if HRTF rendering is enabled.

Hiradur commented 2 years ago

@kotenok2000 said he put soft_oal.dll into system folders. However, most apps will look for OpenAL32.dll not soft_oal.dll, so the latter should be renamed. openal-info might also look for OpenAL32.dll, which could be the reason why it shows the info for the Creative OpenAL driver.

@Ozzuneoj

Is the general consensus that these applications don't actually work to verify if OpenAL Soft is installed and functioning correctly? I found a post from 6 years ago with someone asking for clarification on the same problem. It would be really nice to see the readme in compiled Windows binary updated to reflect that these programs do NOT tell you if OpenAL soft is working, regardless of what they say. Or, if that isn't the case, possibly providing some clarification as to what the output of the info programs mean.

Such observations might be caused by being unaware of the dll search order.