ValveSoftware / steam-audio

Steam Audio
https://valvesoftware.github.io/steam-audio/
Apache License 2.0
2.2k stars 152 forks source link

`iplBinauralEffectApply` always outputs silence on armv8 #331

Closed cshenton closed 3 months ago

cshenton commented 3 months ago

System Information Please provide the following information about your system:

Issue Description Passing valid audio samples (duplexed microphone) to iplBinauralEffectApply always outputs silence, even when spatialBlend is set to 0.0, which should just be a passthrough (nvm, mono input doesn't trigger this).

Steps To Reproduce Steps to reproduce the behavior:

  1. Create context, default hrtf, binaural effect, mono input, stereo output buffers
  2. In audio callback, read samples into input
  3. Invoke iplBinauralEffectApply with the hrtf.
  4. Manually / otherwise deinterleave into the output buffer

The result is silence (validated programmatically, all samples precisely 0.0). Params are as follows:

IPLBinauralEffectParams params = {
        .direction = { 1.0f, 0.0f, 0.0f },
        .interpolation = IPL_HRTFINTERPOLATION_NEAREST,
        .spatialBlend = 1.0f, // or any value
        .hrtf = ipl_hrtf, // Default hrtf
        .peakDelays = NULL,
}; 
cshenton commented 3 months ago

The issue was caused by incorrect usage of the API in the official documentation.

image

No volume field is being set here, it needs to be set to 1.0 otherwise the stream will just output silence (I don't remember that field last time I used SteamAudio). Leaving the issue open as this is a documentation bug.

nisehime commented 3 months ago

Should have been fixed? https://github.com/ValveSoftware/steam-audio/pull/309

lakulish commented 3 months ago

@cshenton This documentation issue was fixed in #309, so I'm closing this issue.

nisehime commented 3 months ago

@lakulish I think the issue is that it was not reflected on github pages doc

cshenton commented 3 months ago

Yes, on several different pages on the github pages documentation the incorrect usage is shown. This is what I was referring to.

lakulish commented 3 months ago

The documentation in the gh-pages branch will be updated when the next official release is made, which I plan to do soon.