Dolphin, the GameCube and Wii emulator - Forums

Full Version: Is it unrealistic to expect the audio latency to be fixed eventually?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
If you're wondering what I'm talking about, it's a nearly ever-present audio latency that is slight enough that many people may not notice it, but it still noticeable enough to be fairly evident to anyone who knows how it should sound. Even games that I can run at well above 100% still do it. And it gets much worse if I use anything other than the xaudio backend. I have been told before that it's simply a result of the audio instructions of LLE not being compatible with windows, thus introducing a delay. However, unlike before, I also now get the delay when using HLE. Sometimes the delay inexplicably disappears for a minute or two. I've tried to figure out what causes that, but I've been unsuccessful so far.

Basically what I'm asking is if this delay will always be a part of the emulator or if it's something that can be realistically fixed.
I haven't looked in-depth into the cause of the audio latency, but I think it can be minimised by making the audio mixer process in real-time.

There is one aspect of emulation where we are constrained. The emulator "receives" the audio that is meant to be played that instant. But the audio backends have to buffer the audio data so that the audio does not stutter.
(10-17-2013, 10:15 AM)skid Wrote: [ -> ]I haven't looked in-depth into the cause of the audio latency, but I think it can be minimised by making the audio mixer process in real-time.

There is one aspect of emulation where we are constrained. The emulator "receives" the audio that is meant to be played that instant. But the audio backends have to buffer the audio data so that the audio does not stutter.
Thanks for the response. And are you just sort of thinking out loud with that audio mixer comment or is that something I can actually change?

Either way, you guys have definitely improved the audio a lot recently. HLE is actually pretty good now.
It is not a one-liner change.

It will involve removing the "watermarks" from CMixer::Mix in Mixer.cpp and to make the audio synchronous on the CPU thread by having the scheduler (SystemTimers.cpp / CoreTiming.cpp) call CMixer::Mix at the appropriate interval in a fashion like OpenALStream::Update() does.

I wrote some more information in this issue: http://code.google.com/p/dolphin-emu/issues/detail?id=6272#c1

It would be great if someone could fix this properly.
skid, the last update on that issue was in April. Was the original patch in the ticket ever committed to master? If you don't know, I'll see if I can find it and update some notes on the ticket.

It's been a day or two since I wrote some c++, but I'm willing to give it a shot. If there was a start to this effort I can pick it up where it left off.
The original patch has to do with refactoring and does not affect latency.

No one has publically started the attempt to fix the audio latency / synchronous audio issue.
Understood, but was it ever committed? As a relative newb to the codebase, it would probably be easier to read/understand refactored code.

I'll see what I can get going.
No, it was not committed or merged to master.
I wish you guys luck.

It would be awesome if you could reduce the latency even just a little bit. I eagerly await any progress.
Just wondering if anything ever came of this.
Pages: 1 2