Audio Latency


efegea

Active Member
Joined
Aug 8, 2005
Messages
636
Age
38
Location
GP32Spain, Spain
I'm porting a new emulator that is very cpu demanding (can't say the name of the emulated platform). Without sound, I get acceptable framerates, over 77fps, but with sound enabled it drops to 19fps. I think it's because the oss audio output have very high latency (I've read on the forum something about hundred(s) of milliseconds..too much!!). I tried different fragment sizes but can't get more frames. The output frequency is 44100 and stereo (disabling stereo doesn't make any difference, and the frequency must be 44100, can't be changed)

Is there something I can do to reduce the overhead of the audio output?
 
Is the 77fps without sound being emulated at all, or with the final output to OSS removed?

Latency won't cause a performance degradation like you're describing, and I haven't noticed the audio latency for OSS on Wiz to be great enough to be noticeable (nor has anyone reported such a problem). You're talking about something going from using 13ms per frame to 52.6ms per frame, a cost of nearly 40ms from audio for whatever you output per frame. There's no way that OSS is imposing this, or everything would run terribly on Wiz.

Are you using SDL, or are you outputting to OSS directly?

Temper runs fine with OSS at 44100, but only if the block size is sufficiently large. If I recall correctly it needs 1024 samples large (about 23ms), while GP2X ran happily at only 512. At 512 it was just on the hairy edge of working - it'd often work fine for a while, but then fall behind on the faintest hiccup and practically lock up as it failed to ever catch up again.
 
Back
Top