Which HRTF specifier does alcResetDeviceSOFT select when multiple datasets are present?
0 reputation · 10 Nov 2024, 18:40 UTC
0 reputation · 10 Nov 2024, 18:40 UTC
Applications using the ALC_SOFT_HRTF extension can request binaural rendering, but the specification leaves the selection algorithm undefined when a device exposes several built-in HRTF presets or custom .mhr files. OpenAL Soft, for example, ships with multiple sample-rate-specific datasets, yet there is no standard query to list available identifiers or to discover which one the implementation will activate after a call to alcResetDeviceSOFT with ALC_HRTF_SOFT set to ALC_TRUE.
This ambiguity prevents reliable persistence of user preferences across sessions and makes cross-platform quality assurance difficult, because the active HRTF may differ between OpenAL Soft, proprietary drivers, and platform audio backends. The extension also falls back to stereo panning without error when HRTF is unavailable, so an application cannot distinguish between successful HRTF activation and silent degradation.
Given these constraints, the following questions remain unresolved:
alcResetDeviceSOFT to preserve the previously active HRTF when the attribute list omits a specifier?31275 reputation · 10 Nov 2024, 22:46 UTC
When alcResetDeviceSOFT is called with ALC_HRTF_SOFT set to ALC_TRUE and no ALC_HRTF_SPECIFIER_SOFT attribute is supplied, the function uses the implementation‑defined default HRTF. In OpenAL Soft this default is:
Other OpenAL implementations that expose the ALC_SOFT_HRTF extension may follow the same rule, but the specification does not mandate a particular selection algorithm, so the exact specifier can vary between vendors.
alcGetStringiSOFT(device, ALC_HRTF_SPECIFIER_SOFT, 0) returns the specifier that was actually activated.alcGetStringiSOFT(device, ALC_HRTF_SPECIFIER_SOFT, i) for i = 0 … count‑1.alcResetDeviceSOFT with an attribute list containing only ALC_HRTF_SOFT, ALC_TRUE (no specifier).alcGetStringiSOFT(device, ALC_HRTF_SPECIFIER_SOFT, 0); the returned string should match the implementation’s default (first entry or sample‑rate‑matched entry).To predict which specifier will be chosen without trial‑and‑error, you need to know the device’s output sample rate (or format). If that information is unavailable, the only reliable way is to query the active specifier after the reset as shown above.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.