|
#1
|
||||
|
||||
![]()
Hello, I'm trying to develop a sound plugin and would like some advice
![]() One thing I need help with is buffers. I tried adding more buffers, but the sound was kinda weird. I probably messed up with the algorithm somewhere. Strange thing is, adding an extra buffer to Zilmar's audio, made SSB64's intro more in sync, but that didn't work for 1964 Audio. I also tried seeing how to reduce crackling. 1964 Audio's sync audio does the job well, but at the price of fps. Lowering the sleep time from 10ms to 8 sorta helped, but it's not a perfect solution. I thought about implementing SSE for the ucode stuff. Problem is, the main part I need to optimize has too many if statements ;/ . If I were to get the cpu usage of the audio plugin down, I might be able to get stable 60fps with sync audio. Here's a macro that is a bottleneck. Code:
VMULF_operation(index, dest, s1, s2, wrElement, wrHiAccum, wrLoAccum, wrFlag0) { if (wrElement || wrHiAccum || wrLoAccum) { _s32 result = ((_s32)(_s16)(s1) * (_s32)(_s16)(s2)); if (wrLoAccum) accumulator[index] = (((_u16)(result << 1)) ^ 0x8000); if (wrElement || wrHiAccum) { _s32 hiValue = (result >> 15); if (result & 0x4000) hiValue++; if (wrHiAccum) accumulator_hi[index].S32 = hiValue; if (wrElement) { Vector_ClampValue(hiValue); (*(_u16*)&(dest)) = (_u16)hiValue; } } } } Also, which do you guys think is more accurate for your typical commercial game, using 1964 HLE audio, or LLE using PJ64's RSP recompiler? I know the HLE one doesn't support every game yet. Last edited by RPGMaster; 5th July 2014 at 02:47 AM. |