View Full Version : Jabos Dsound > Jabos Xaudio2

22nd March 2011, 04:17 AM
This could definitely improve the audio popping and delays when synching to audio under Vista and Win7.

22nd March 2011, 02:40 PM
i dont have any popping issues; is it sound card specific or something?

22nd March 2011, 03:08 PM
This guy does. (http://forum.pj64-emu.com/showthread.php?p=26531&posted=1#post26531)

22nd March 2011, 04:00 PM
its emulator + windows specific.

22nd March 2011, 09:31 PM
I haven't had it anyway. There was this one thread months back though that this guy had total shit-popping no matter what sound plugin he used, except Mr. zilmar's No Sound and slightly less the Nemu64 plug-in (not plugin, plug-in).

22nd March 2011, 11:47 PM
I looked at XAudio2 as well, it's Microsoft's preferred API when they rewrote the audio stack in Windows Vista. Microsoft has been playing with DirectX ever since Xbox development started as a way to entice cross platform development, quite annoying as times it sends a mixed message.

For what Project64 needs XAudio2 is practically identical to what DirectSound already does... I don't see an immediate need to go rewrite the audio plugin, although it could use an upgrade to DirectSound8.

If we take a step back, here is some hidden settings that can fix and diagnose problems in Project64.cfg

SoftwareBuffer=0 or 1 (default = 1)
BufferSize=-10 to 10 (default = 0)

You can try changing SoftwareBuffer=0 or BufferSize=2, either one of these might help, I'll see if I can improve the defaults for the next build please let me know if any of these settings help

Additionally if you are having a problem with a specific game that is helpful to know.

23rd March 2011, 02:26 AM
Legend of Zelda

popping and crackling with sync to audio off, but the game then suffers from a degree of very noticed input lag.

also i enabled hardware buffer and enabled Alchemy, but still not much difference. i might have to play with the mixing lengths of both.

just figured Xaudio2 would be better on new os's plus you could do internal surround upmixing for the Dolby Surround games.

23rd March 2011, 03:41 AM
Lots of values to test. Too bad I haven't witnessed this issue myself, or I'd eccentrically test them all out of boredom. :D

Um, insane idea here, but since the new system from Vista onwards prefers XAUDIO2 maybe keep the DirectSound device as the default but add a config method for the new implementation?

Not to say that might not complicate things depending in theory how that would be resolved, not to mention its partial succumbing to the audio stack rewrite.

23rd March 2011, 11:33 AM
Xaudio works just fine on XP.

23rd March 2011, 12:52 PM
yea and DirectSound is just a thin layer right above that on modern platforms

popping and crackling with sync to audio off

ah now I understand what you mean, sync audio is very important. sync audio basically means "don't let the game change audio streams until the emulator has finished playing the last one"

so the reason you get pops without it, is because there is always a difference in timing between emulated playback and realtime... that difference varies with the game as well, so without sync to audio the game basically rips the audio stream away and puts a new one in before playback has finished causing a crackling effect, and potentially gaps.

that being said, sync audio is a solution to this problem, but there is likely other ways to solve it, I know this is an area zilmar has been actively looking at in recent years, and specifically with the latest build for games that have been known to behave badly with audio. the job of the audio plugin to sort through this buffering mess in real time is challenging! I'll review a few things and make sure everything is best it can be.

23rd March 2011, 01:47 PM
not thin enough that it doesn't bork buffers up entirely. WASAPI is the worst for buffering.

Trouble is, like i said, when sync to audio is enabled, there is an excessive amount of latency between input and output. this affects both 1.6 and 1.7 on vista/7.

As for popping, in every other directsound app, you can work around it by increasing the amount of buffers and minimise the buffer length to keep latency down.
for instance, 4 buffers with 15ms intervals has both output popping and lag in older snes9x builds, whilst 6buffers at 10ms reduce both for clear sound.

23rd March 2011, 10:03 PM
I remember a while ago that we had discussions around this same topic, reliability and latency are kind of inversely related, dealing with small chunks makes it more prone to popping, I always had this problem when I multitasked for example.

Anyway regardless, I put those hidden options in. If anyone finds changing the options around improves the experience I can expose them in the plugin UI that's a bit friendlier, please let me know what settings improve things and what hardware you have. For my own systems I've never had a problem, and the latency at least for me is acceptable in the games I play.

Perhaps a specific game has a lot of lag, that is something that can be fixed... also hang on for a new build with some improvements

24th March 2011, 04:20 AM
i would prefer to tweak the buffer count and length individually, but thats just me.

24th March 2011, 10:05 PM
They appear individual to me. :/

Apparently on this hardware, always worked perfectly. Even with the more technical audio issues like with TWINE 007, Ms. Pac-Man, etc., other games where if you use game-to-audio sync it froze the frame rate, that was also fixed after 1.6. Only thing I've had to tweak in 1.7 was gfx, input, RSP, R4300.

Consequently as I'm remembering it this support for the other hardware in the DS plugin is the only suggestion / bug report remaining. :D

edit, except previously a prebuffer config for top gear rally

25th March 2011, 05:55 AM
They appear individual to me. :/

no they don't.

25th March 2011, 08:04 AM
Well that's your fault. :rolleyes:

25th March 2011, 09:55 AM
im not talking about alchemy ......

27th March 2011, 04:33 PM
The next build should fix lag in games that have very low frequencies (GoldenEye for example is 22.5khz)... not sure if anyone noticed that.

Additionally "sync game to audio" should be on by default, I can't see any examples where this causes excess latency? Does it still hang some games?

Has anyone noticed in games like "Goemon's Great Adventure" if you turn the frame limiter off it reduces popping drastically?

28th March 2011, 12:21 PM
in that case, Limit frames should be made a per game setting and be off for all games that are audio synced by default. theres some issues that can crop up if you have both enabled at once. (like hitching)

28th March 2011, 09:01 PM
I was always wondering if there was a balance of compromise or even really any difference at all, if you have limit FPS on or off when the game-to-audio sync is in use. In general I've always found results satisfactory with it turned off, so probably not so much of a per-game decision to make so much as a general trend to automatically disable the FPS limitation where the audio sync is used.

"The next build should fix lag in games that have very low frequencies (GoldenEye for example is 22.5khz)... not sure if anyone noticed that."
Not in accordance to the frequency...but yes. Didn't know it was to do with that.

Especially with Azimer's Audio, if you disable the "Emulate/Simulate AI" option to reduce crackling even more and sync the audio more. On some games it really bogged down the frame rate even more than others.

With the one-setting implementation in the DirectSound plugin here though it wasn't as noticeable, though yes some games had rates more bogged down in consequence to audio sync.

"Additionally "sync game to audio" should be on by default, I can't see any examples where this causes excess latency? Does it still hang some games?"

Nope not that I have seen. I remember a list of games where it hung on 1.6, but all of those are completely safe with audio sync on in 1.7. I'm sure in some new beta package people will test there is time for someone to come across a game where maybe it might hang somewhere? But on all recent betas I've never found one.

"Has anyone noticed in games like "Goemon's Great Adventure" if you turn the frame limiter off it reduces popping drastically?"

Hm, actually, in just now testing Goemon's Great Adventure, I haven't heard any popping at all unless of course just the crackling from having limit FPS and audio sync both turned off. Maybe it's another system-correlative result.