Opened 13 years ago
Last modified 12 years ago
#931 closed defect
Fix OpenAL issues on OS X — at Initial Version
Reported by: | Jan Wassenberg | Owned by: | Sound Department |
---|---|---|---|
Priority: | Must Have | Milestone: | |
Component: | Core engine | Keywords: | patch |
Cc: | Kimball | Patch: |
Description
OS X CoreAudio has some trouble with our reuse of sources (see http://www.wildfiregames.com/forum/index.php?showtopic=15066). There are various bandaids such as FIFO reuse (thus giving CoreAudio more time to finish what it's doing before we reset the source properties). However, one proper fix might be to just generate/delete sources anew.
This used to be super expensive on hardware implementations, but OpenALsoft should manage much faster. I have implemented this approach (see attached patch) and run a quick test.
With the old suballocator, running -autostart="We Are Legion", sending the front middle guy forwards and waiting for the dust to clear, I see tc_OpenAL_source: 3790.03 kc (5203x) (about 0.2 us per alloc). The new patched version gets tc_OpenAL_source: 239.762 Mc (5411x). Apparently the battle went slightly differently, there were also more casualties, but the per-alloc cost is indeed higher (14 us). Still nothing to worry about; I think this approach is fine on software implementations of OpenAL.
I'd appreciate people testing this on OS X, which requires removing the little kill-switch in hwdetect.js.
Questions:
1) does this fix the issues?
2) is the per-alloc overhead [converting the above number to seconds by dividing by the CPU clock and normalizing according to the number of calls (in parentheses)] similar?