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

[C API] Unable to get TrueAudioNext reflections to work (inaudible reverb) #290

Open
Oldnice opened this issue Dec 7, 2023 · 0 comments

Comments

@Oldnice
Copy link

Oldnice commented Dec 7, 2023

System Information

  • Steam Audio version: 4.4.1
  • Operating System and version: Windows 10 x86-64bit
  • GPU (used with TrueAudioNext): AMD Radeon RX 6900 XT

Issue Description
When using TrueAudioNext for realtime reflection reverb, no audible reverb is produced. (output buffer is filled with zeroes). Using realtime Convolution, instead, produces audible and correct reverbs. In my project, both reflection types utilize the same code path, and both use IPLReflectionMixer (iplReflectionEffectApply + iplReflectionMixerApply) to mix the results into an ambisonics field, but only the Convolution produces any audible (and to my ear, perfectly acceptable) results.

Steps To Reproduce

Here's an overview of the steps I'm taking, and the relevant input values. Do note that the addressess of the devices might change between images, since the images were captured in multiple runs.

  1. Query OpenCL devices, and generate OpenCL device with iplOpenCLDeviceCreate:
    00_opencl_devicesettings
    10_opencl_device
    20_opencl_create
    Logs verify the device creation was successful:

Using 4 CUs for convolution, 4 CUs for IR update.
Initialized OpenCL platform: Advanced Micro Devices, Inc. AMD Accelerated Parallel Processing (OpenCL 2.1 AMD-APP (3592.0)).
Display: Initialized OpenCL device: Advanced Micro Devices, Inc. gfx1030 (OpenCL 2.0 AMD-APP (3592.0)).

  1. Create simulator, using the OpenCL device, and TAN device:
    30_createSimulator
    iplSimulatorRunReflections is run after, to produce reflection outputs for source.

  2. Create mixer:
    55_createMixer

  3. Create reflection effect:
    35_createReflectionEffect

  4. Apply reflection on source data, using the built-in mixer:
    40_applyReflection
    out buffer is empty at this point, but that is expected when using a mixer.

  5. Apply the mixer, to receive the mixed ambisonics value:
    50_mixerApply
    At this point, right after running iplReflectionMixerApply, the out buffer is always empty, when using TrueAudioNext.

  6. For completeness, here's ambisonics decode applied to the mixer results (though mixer output was already nothing but zeroes):
    60_decodeAmbisonics

Further notes:

  • Releasing and recreating the OpenCL device always fails, if any TrueAudioNext processing has been done on the device. iplOpenCLDeviceCreate reports failure (IPLerror::IPL_STATUS_INITIALIZATION), and the following is output into logs:
Found OpenCL Device, Name: gfx1030, Vendor: Advanced Micro Devices, Inc., Version: OpenCL 2.0 AMD-APP (3592.0)
Initialized AMD Advanced Media Framework v1.4.32.0.
[AMFComputeFactoryImpl]   Error: ..\..\..\..\..\runtime\src\core\ComputeFactoryImpl.cpp(287):OpenCL failed, error = -6:clCreateCommandQueueWithProperties() failed
Exception thrown at 0x00007FF94E54CF19 in UnrealEditor-Win64-DebugGame.exe: Microsoft C++ exception: ipl::Exception at memory location 0x000000A4FEB78230.*/

Creating the OpenCL device, then immediately destroying it, and then immediately creating it again works with no issues, if no TrueAudioNext processing has been done with the device.

Example input buffer and output buffer values

Example audio input:

 -0.00172118004   -0.00143529195   -0.00117724971  -0.000932493480  -0.000783622963  -0.000634752563  -0.000654670293  -0.000684444385  -0.000843787915

Example output (after iplReflectionMixerApply), when using TrueAudioNext:

0.00000000       0.00000000       0.00000000       0.00000000       0.00000000       0.00000000       0.00000000       0.00000000       0.00000000

Example output (after iplReflectionMixerApply), when using Convolution (reverb is working, and audible):

-0.0174932014    -0.0114187943   -0.00632799277   -0.00425020093   -0.00136331562    0.00159678515    0.00134437112    0.00147513626   0.000849729404

The output values contain the ambisonics field values, so they are meaningless here, other than to show the difference between working Convolution, and non-working TrueAudioNext.

Using TrueAudioNext and Radeon Rays at the same time is also broken, but produces different results (after iplReflectionMixerApply):

-nan(ind)        -nan(ind)        -nan(ind)        -nan(ind)        -nan(ind)        -nan(ind)        -nan(ind)        -nan(ind)        -nan(ind)

Radeon Rays seems to be working, whether TrueAudioNext is enabled or not, so I'm assuming the OpenCL device is at least somewhat correctly working, under the hood.

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

1 participant