Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hybrid Reverb problems when Convolution portion over 0.25s #398

Open
devil304 opened this issue Feb 5, 2025 · 12 comments
Open

Hybrid Reverb problems when Convolution portion over 0.25s #398

devil304 opened this issue Feb 5, 2025 · 12 comments

Comments

@devil304
Copy link

devil304 commented Feb 5, 2025

System Information
Please provide the following information about your system:

  • Steam Audio version: 4.6.0
  • (If applicable) Unity version: 6000.0.32f1
  • Operating System and version: Windows 11
  • (Optional) CPU architecture (e.g. x86-64, armv7): x86-64 (64 bit)

Issue Description
When Convolution portion of hybrid reverb is set over 0.25s (0.25s is ok, but for example 0.3s starts breaking) sound will disappear or engine will crash (soon or on stop or on play)
I'm using 6 audio sources playing in loop and all of them are using baked listener-based reverb through Unity Audio Mixer

Steps To Reproduce
Steps to reproduce the behavior:

  1. Set Convolution portion of hybrid reverb to 0.5s
  2. play 6 sources with baked listener-based reverb
  3. Sound disappears or engine starts crashing

If you are able to provide a minimal project or minimal source code that reproduces the issue, include a link to the project/code here.
I can't

Crash Dump
Will provide later

@lakulish
Copy link
Collaborator

@devil304 Unfortunately, we are unable to reproduce this issue on our end. Could you provide us with some more information about your setup, such as one of the following:

  • a screenshot of your Steam Audio Settings + settings for your Steam Audio Listener and Steam Audio Probe Batch
  • a crash dump
  • a minimal Unity project that reproduces the crash

Any other information you can provide about the circumstances in which the crash occurs would be helpful. Thanks!

@devil304
Copy link
Author

Yes, I will provide screenshots and crush dump as soon as possible when I return to audio tasks in project. I'm currently doing other stuff. I should get back to audio in a week top.

@devil304
Copy link
Author

devil304 commented Feb 21, 2025

@lakulish Here are screenshots and dump, same Unity and Steam Audio versions as in first post.
Tested on two looped Audio Sources.

Click to expand

Image
Image
Image
Image

As you can see here, there is audio on mixer group selected in Audio Source but there is nothing going through to Listener Based Reverb mixer group or to master. Other Mixer Groups weren't used in this test. Second Audio source didn't have selected any audio mixer group but there was complete silence from game.

Click to expand

Image
Image
Image
Image

When I changed Hybrid Reverb Transition Time to 0.25 everything worked fine. Position of player and Audio Sources was the same for 0.518 and 0.25 values.

Here is dump, Editor Crashed when stopping game with 0.518 value. As in previouse cases caught with debbuger attached to Unity Editor from start so it should be complete memory/crash dump. (it's 11.5GB so I compressed it to 7z)
https://drive.google.com/file/d/1OUs4ZQ3YraDA0kSKchI3GzQEPoIUWMjE/view?usp=sharing

@lakulish
Copy link
Collaborator

@devil304 Thanks for providing this information! We were able to reproduce the issue. The crash is occurring because the hybrid reverb transition time (0.518 seconds) is greater than the reverb IR duration (0.25 seconds). This is why the crash disappears when the transition time is set to 0.25 or less.

I am committing a fix for this shortly. If you are able to build phonon.dll from source, you can do so and test out the updated code, and let me know if the issue persists. Otherwise, updated binaries with the fix will be available as part of the next Steam Audio release, and in the meantime, you can increase the reverb IR duration to be greater than the transition time, to work around the crash.

lakulish added a commit that referenced this issue Feb 27, 2025
… when the transition time is greater than the IR duration

See also #398
@devil304
Copy link
Author

I didn't use real-time reverb anywhere and baked has longer duration. But I assume Hybrid Reverb uses real-time duration anyway.

@devil304
Copy link
Author

devil304 commented Feb 28, 2025

@lakulish I compiled steam audio from source few times, but I always have problems with that, maybe you can give me some tips.
I use VS2022 and downloaded VS2015 build tools for Radeon Rays but I can't make it work. Also it can't find OpenCL libs on my computer, I use windows 11 and RTX 4xxx graphic card.
Last time I scraped out whole Radeon Rays, Open CL and True Audio Next code from steam audio for it to compile 😅

@lakulish
Copy link
Collaborator

@devil304 The real-time duration setting is used in two ways: 1) it is used for real-time reverb, and 2) it is also used when loading baked reverb data and using it at run-time. This is subtle difference: in your case, you've set baked duration to 4.2s, so the baked data contains 4.2s IRs, but since your real-time duration is 0.25, when the baked data is loaded, only the first 0.25 are loaded for each IR.

As for compiling Steam Audio, yes, unfortunately the version of Radeon Rays we use requires VS2015. You may need to install VS2015 Community Edition (i.e., the whole IDE, instead of just the build tools). Switching to a newer version of Radeon Rays will let us use newer compilers, but they dropped OpenCL support in newer versions, and switched to Vulkan. This would require us to make major changes and switch our GPU kernels to Vulkan as well, which is a non-trivial task. An alternative might be to hand-craft a patch to Radeon Rays which manually ports their build scripts from Premake to CMake. In the meantime, if you're not using the GPU features of Steam Audio, you can disable Radeon Rays and TrueAudio Next temporarily.

The get_dependencies.py script should be downloading and finding OpenCL on your machine. If this is not happening, could you send the console output from both get_dependencies.py (which should be trying to download OpenCL) and build.py (which should be trying to locate the OpenCL files)?

@devil304
Copy link
Author

devil304 commented Feb 28, 2025

Thanks for information! I will try to compile new version using whole VS2015 on Monday and will let you know if something goes wrong.

@devil304
Copy link
Author

devil304 commented Mar 3, 2025

@lakulish It seems to work on new version (I compiled steam audio using VS2015 without a problem)
Only trying to build steam audio for android there were 2 errors

***/steam-audio/core/deps-build/ffts/src/ffts/src/ffts.c:124:19: error: incompatible integer to pointer conversion passing 'long' to parameter of type 'void *' [-Wint-conversion]
    __clear_cache((long) start, (long) start + length);
                  ^~~~~~~~~~~~
***/steam-audio/core/deps-build/ffts/src/ffts/src/ffts.c:124:33: error: incompatible integer to pointer conversion passing 'size_t' (aka 'unsigned long') to parameter of type 'void *' [-Wint-conversion]
    __clear_cache((long) start, (long) start + length);

(I only censured my system paths)

@devil304
Copy link
Author

devil304 commented Mar 3, 2025

I was building it on Windows 11 using VS2015 (android build also)

@lakulish
Copy link
Collaborator

lakulish commented Mar 3, 2025

@devil304 Yes, we have run into issues with building FFTS, which can vary depending on platform, compiler version, etc. For this reason, we are considering phasing out FFTS and using PFFFT on Android. There is a CMake flag, STEAMAUDIO_ENABLE_FFTS on Android, which defaults to OFF, so you should be able to ignore any issues with building FFTS using get_dependencies.py.

@devil304
Copy link
Author

devil304 commented Mar 5, 2025

It's fixed in version compiled from current code in repository. You can close it now or leave it open until new version will be released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants