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

Consider to use equalpower panning model #5278

Closed
takahirox opened this issue Mar 23, 2022 · 4 comments · Fixed by #5454
Closed

Consider to use equalpower panning model #5278

takahirox opened this issue Mar 23, 2022 · 4 comments · Fixed by #5454
Assignees
Labels
enhancement work that enhances an existing feature optimization

Comments

@takahirox
Copy link
Contributor

takahirox commented Mar 23, 2022

Is your feature request related to a problem? Please describe.

Three.js uses HRTF as panning model by default. It is higher quality but probably more costly than equalpower.

Describe the solution you'd like

Consider to use equalpower as optimization. Some options how to use/switch.

  1. Always use equalpower. It mighe be good enough. (We should test.)
  2. Use equalpower only on (low-end) mobile devices
  3. Use equalpower if the quality mode is low
  4. Add preference to select panning model
  5. Dynamically switch if pwerformance is bad, for example by watching the FPS counter

Additional context

Making benchmark test would help us determine whether we should use equalpower or not.

@takahirox takahirox added enhancement work that enhances an existing feature optimization labels Mar 23, 2022
@takahirox
Copy link
Contributor Author

takahirox commented Apr 15, 2022

There are some documents that describe that HRTF is more expensive than equalpower.

But I couldn't find any resource which compare the actual performance difference between them. And unclear how likely much gain we can get with equalpower in Hubs.

So I would like to start with adding "use equalpower panning mode" in the preferences. We can test in Hubs by switching it. If we get noticable performance benefit, we can keep the preference and/or introduce smarter optimization like dynamically switching it depending on the FPS number. If we don't see actual performance improvement we may revert the change.

Any thoughts?

@netpro2k
Copy link
Contributor

From the tests I ran in #5057 (comment) equalpower definitely made a noticeable difference in perf on my Android device, especially in Firefox. The "web audio perf" doc you linked also suggests there is a pretty massive difference, calling hrtf "Very expensive" and equalpower "rather cheap"

Since we have had issues with audio on Android and were considering disabling panning altogether (#5291) I think just always using equalpower on Android might be a good idea (maybe all mobile devices?). This would probably also apply on Android based VR headsets which I don't think we have heard as many complaints about, so we might consider filtering those out.

As you said, ultimately we probably want to decide this based on actual system performance instead of just device detection, but I think doing it based on device type would be a good start.

No strong opinion on if we also expose this as a preference, though if we do maybe we should call it something like "positional audio quality" with hrtf being "High".

@takahirox
Copy link
Contributor Author

Thanks for the comment.

The test is a bit too panner node intensive. Perhaps more many panner nodes than actual use. I'm not really sure how much performance gain we will get in practical use cases because I don't know how much audio processing consumes hardware resources. Even if the document mentions hrtf is very expensive, I want to test on actual devices and use cases at first.

made a noticeable difference in perf

I speculate "perf" in this context means how much the audio is fine/broken on Android devices in the tests. Likely the audio quality in the test may be related to CPU usage, but not 100% sure. I want to check the FPS number or take profiling in actual systems. The test will be easier with the preference than with forcing equalpower on mobiles.

Personally I want to separately think of equalpower option from the Android panner audio problem because it seems to only slightly metigate the problem.

And the actual performance difference is unclear while the actual panning quality difference is obvious (for me). I think perhaps we will want to keep "panning model quality" in the preferences, tho this is what we should discuss later, not now.

@takahirox
Copy link
Contributor Author

The panning quality difference is obvious for me between HRTF and equalpower. Some mobile users, especially earbuds users, may still prefer HRTF. On the other hand, some desktop users, especially low-end desktop users, may prefer equalpower for the performance.

I would like to propose to introduce panning quality high/low to the preferences. Low (equalpower) on mobiles by default, and high (HRTF) by default on others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement work that enhances an existing feature optimization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants