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

"OpenAL HRTF mixing: Unsupported format" - Fixed in OpenAL Soft #115

Open
ThreeDeeJay opened this issue Nov 22, 2022 · 14 comments
Open

"OpenAL HRTF mixing: Unsupported format" - Fixed in OpenAL Soft #115

ThreeDeeJay opened this issue Nov 22, 2022 · 14 comments

Comments

@ThreeDeeJay
Copy link

Current release (22.01_16 and test build 22.05_25) uses OpenAL Soft 1.18.2 (from 2017) and it fails to render audio in HRTF and instead reports "Unsupported format" so it just uses regular stereo panning:

IMAGE ALT TEXT

However, if you replace OpenAL32.dll with the latest OpenAL Soft DLL, HRTF works and ambisonics is even spatialized following orientation (or headtracking in VR)
*Click to play video
IMAGE ALT TEXT

Even surround sound gets virtualized properly for headphones when HRTF is on.
So perhaps the next release could include the updated DLL if everything else works fine too 👀

@gkv311
Copy link
Owner

gkv311 commented Nov 22, 2022

Thanks for noticing. Clearly need to work on updating third parties within the next release...

image

@ThreeDeeJay
Copy link
Author

Yeah, I remember it worked at some point without having to update so I'm not sure what changed/broke, at least on my end. 😅
I think older OpenAL Soft builds were less consistent when enabling HRTF, especially when the playback device was set to certain speaker configurations. 🤔

@gkv311
Copy link
Owner

gkv311 commented Feb 4, 2023

@ThreeDeeJay , could you please check if newer sView build with OpenAL soft 1.23.0 makes any difference on your system?

@gkv311 gkv311 added the question label Feb 4, 2023
@ThreeDeeJay
Copy link
Author

Hmm, this is odd. now instead of no HRTF there's just no audio at all, though only with the file that uses an ambisonics tracks, not sure if that's the specific cause, though. This file with a stereo track does output audio: https://i.imgur.com/sHpcBbJ.mp4

@gkv311
Copy link
Owner

gkv311 commented Feb 5, 2023

Thanks for sharing file that is detected as Ambisonic one - I've been unable to find such samples (old ones with Ambisonic sound haven't been detected as such). Will look at it later - probably I should put some new extra code for new FFmpeg audio channels interface...
image

@gkv311
Copy link
Owner

gkv311 commented Feb 8, 2023

Hmm, this is odd. now instead of no HRTF there's just no audio at all,

I've fixed this regression (sViewSetup_v.23.02_8.exe) - now tracks detected by FFmpeg as Ambisonic should be automatically handled.

@ThreeDeeJay
Copy link
Author

Neat, now both ambisonics and HRTF are active so I'll go ahead and close this issue.👍
https://i.imgur.com/AgcD45j.mp4
Though I should point out that it's behaving differently than last time: now the voice seems to be locked and there doesn't seem to be any verticality when I look up and down. And even though YouTube supports head-locked stereo on top of the 4-channel 1st Order Ambisonics and the filename says 6 channels, it's actually only 4 channels so I don't think the voice shouldn be locked in place. 🤔
Also, here's the OpenAL Soft log:
alsoft_error.txt

@ThreeDeeJay
Copy link
Author

Another thing I noticed: the ambisonics sound field seems to be rotated 90 degrees to the left relative to the video.
Like, in this video, the sounds that should come from the direction I'm looking at (like the drums and vocals) are heard on my left:
https://i.imgur.com/1sgIbFn.mp4
Not sure if these files have metadata specifying the relative rotation or if a simple 90 degree rotation by default would work with other files, but perhaps in the future you could consider implementing a way to rotate the sound field, maybe even with a channel activity heat map overlay to match sounds to visuals like this:
image

@gkv311
Copy link
Owner

gkv311 commented Feb 9, 2023

Ok, I'll try to check - maybe new FFmpeg reorders channels in the file...

the filename says 6 channels, it's actually only 4 channels

Anyway, sView currently handles only 4-channel ambisonics mapping to OpenAL.

@gkv311 gkv311 reopened this Feb 9, 2023
@gkv311
Copy link
Owner

gkv311 commented Feb 9, 2023

Agrrr... difficult to find some reasonable samples. Could you share the file with the drums?

On the file below, it sounds like the order of Ambisonic channels is correctly passed (though sample for some reason has broken channel order of 5.1 AAC stream):
https://www.youtube.com/watch?v=yoVbl-QPe9Q

@ThreeDeeJay
Copy link
Author

Here ya go and here's the youtube link, just in case.
On youtube, the panning seems aligned even though it isn't in sview so I'm not sure what's causing it. Same with this video (file download). By the way, you can use JDownloader to download specific video and audio tracks, in case you need to test more files.

That said, the video you linked does seem to be aligned properly: https://i.imgur.com/Su15CZn.mp4

@ThreeDeeJay
Copy link
Author

@gkv311 btw in case you didn't get the notification from #125 (this issue and solution also exist on Android), kcat/openal-soft#824 (comment)
Though on Android, we also need an MHR (HRTF) file, which isn't being embedded into the library used, though a better option would be to also allow loading external MHRs and the OpenAL Soft dev suggested how to do it here: kcat/openal-soft#824 (comment)

@gkv311
Copy link
Owner

gkv311 commented Feb 19, 2024

Thanks for investigation. Hope to have some time to look into it..

@ThreeDeeJay
Copy link
Author

Cool beans.
Also it'd be nice to upgrade other dependencies like ffmpeg to support newer formats like AV1 👀👌

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

No branches or pull requests

2 participants