• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Support v
« Previous 1 ... 920 921 922 923 924 ... 1138 Next »

Audio Backend Woes: OpenAL vs. DSound
View New Posts | View Today's Posts

Pages (3): 1 2 3 Next »
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Audio Backend Woes: OpenAL vs. DSound
04-06-2010, 02:56 AM (This post was last modified: 04-06-2010, 02:57 AM by ViRGE.)
#1
ViRGE Offline
Junior Member
**
Posts: 15
Threads: 1
Joined: Jan 2010
When it comes to the audio backend for Dolphin, there are two choices: DirectSound and OpenAL. Unfortunately I can't seem to make either one work satisfactorily and I could use some insights if anyone has any to offer.

I'm currently trying to play NSMB on the R51xx/R52xx builds of Dolphin, and thanks to a bug between the frame limiter and idle skipping, I have to turn idle skipping off to keep the frame limiter working. However the issue I'm running in to is that if I do this, the OpenAL backend for Dolphin will crash. Basically I'm finding it unusable: I either have to take a major frame rate hit, or it crashes on me.

However if I use the DirectSound backend, there's a very noticeable delay in the audio; I'd guess 100ms or so. So while DSound works the audio latency is really ghastly on a precision game like NSMB.

So is there something I'm missing here such as a setting? It seems like there's currently no good audio backend for Dolphin based on my experiences.

System Specs:
Core i7 950
4GB RAM
Radeon 5870
Creative SoundBlaster X-Fi XtremeMusic
Win7 Ultimate 64bit
Find
Reply
04-06-2010, 05:59 AM
#2
thaCASHdude Offline
PK Thunder!
*******
Posts: 1,088
Threads: 0
Joined: Aug 2009
try ticking "Enable audio throttle"
Don't let tha name fool you... I'm not rich... yet... Tongue
[color=#009900]
PC Specs:[/color][color=#009900]
Windows 7 Ultimate x64 | Intel Celeron D 352 ~ 3.2Ghz | 3GB RAM | NVIDIA Geforce 6600[/color]

[Image: youtube.png]

[Image: crfnqee]
Website Find
Reply
04-06-2010, 09:49 AM
#3
ViRGE Offline
Junior Member
**
Posts: 15
Threads: 1
Joined: Jan 2010
(04-06-2010, 05:59 AM)thaCASHdude Wrote: try ticking "Enable audio throttle"
Audio throttle is only so-so. It certainly works, but then it's not as smooth as the frame limiter. It tends to come in at 57-58 FPS, which leads to NSMB being oddly jerky at times.
Find
Reply
04-06-2010, 10:59 AM
#4
skid Offline
skidau / skid_au
**********
Developers (Some Administrators and Super Moderators)
Posts: 2,004
Threads: 8
Joined: Aug 2009
I had a look into this area of the code recently and can give you a couple tips if you are able to compile your own builds of Dolphin. Neither of the settings are changeable via the GUI.

The first change (and the one I think will most make the most difference is in a file called "DSoundStream.cpp" in the "Source/Core/AudioCommon/Src" directory.

Within this file is a function named "void DSound::SoundLoop()". Within this function is a line:

Code:
if (numBytesToRender >= 256)

Change the 256 to a lower number (but keep it a positive whole number) to reduce the latency of the DSound backend. The trade-off is that you'll get higher CPU usage - but your PC specs are more than capable of handling it.




The second setting which is less likely to fix the latency and more likely to cause crashes is in a file named, "SystemTimers.cpp" in the directory "Source/Core/Core/Src/HW". This file has two lines (one for the GC and the other is for Wii) that look like this:

Code:
DSP_PERIOD = (int)(GetTicksPerSecond() * 0.003f);
DSP_PERIOD = (int)(GetTicksPerSecond() * 0.005f);

Change the 0.003 or the 0.005 to a lower number, but again a positive number.
Find
Reply
04-06-2010, 01:53 PM
#5
ViRGE Offline
Junior Member
**
Posts: 15
Threads: 1
Joined: Jan 2010
(04-06-2010, 10:59 AM)skid Wrote: I had a look into this area of the code recently and can give you a couple tips if you are able to compile your own builds of Dolphin. Neither of the settings are changeable via the GUI.
I have all the compile tools I need, so I should be able to roll my own build. I'll look in to that when I get the chance, thanks.Smile
Find
Reply
04-06-2010, 10:08 PM
#6
ViRGE Offline
Junior Member
**
Posts: 15
Threads: 1
Joined: Jan 2010
Well I tried dinking with numBytesToRender, but it didn't significantly change things even at very small values. There must be something else about the DSound backend that gives it such a high latency.

While I was at it, I took at look at OpenALStream.h and changed OAL_NUM_BUFFERS from 16 to 8 for the heck of it. Strangely enough it stopped the OpenAL crashing, although there are still pops in the audio. I don't know if Dolphin was creating too many buffers for the X-Fi to handle or what.
Find
Reply
04-07-2010, 12:39 PM
#7
skid Offline
skidau / skid_au
**********
Developers (Some Administrators and Super Moderators)
Posts: 2,004
Threads: 8
Joined: Aug 2009
Did you try the second adjustment above (DSP_PERIOD)?

Apart from that, I do not see any other settings that can be adjusted in the emulator for this area. Maybe there is inherent latency in the DirectX driver/library itself.

The OAL_NUM_BUFFERS change is your best bet so far. Pops in the audio are pretty unavoidable without introducing latency at this stage. This is because Dolphin does not contain code that smooths out the audio output.
Find
Reply
04-07-2010, 02:50 PM
#8
ViRGE Offline
Junior Member
**
Posts: 15
Threads: 1
Joined: Jan 2010
(04-07-2010, 12:39 PM)skid Wrote: Did you try the second adjustment above (DSP_PERIOD)?
Yes, I did. You were right about one thing: it's the fastest way to get to a crash.Wink
Find
Reply
04-09-2010, 07:43 PM (This post was last modified: 04-09-2010, 07:44 PM by ViRGE.)
#9
ViRGE Offline
Junior Member
**
Posts: 15
Threads: 1
Joined: Jan 2010
Just to respond to myself, I finally found the cause of my OpenAL issues: I had Lock Threads To Cores enabled.

Since I'm on an i7 system this ended up being a terrible thing since Dolphin locks to virtual cores 0 and 1, which happen to be Hyperthreading pairs that are sharing the same execution resources. For whatever reason OpenAL suffered greatly for this, and this is what caused my popping and instability. Once I disabled Lock Threads To Cores, all of my OpenAL problems stopped. It's improved my Dolphin experience immensely.
Find
Reply
04-10-2010, 01:50 PM (This post was last modified: 04-10-2010, 01:52 PM by FloW3184.)
#10
FloW3184 Offline
Member
***
Posts: 214
Threads: 5
Joined: Mar 2009
just turn off this stupid "hyperthreading" in your bios and dolphin will run with an extra-speed that should be even higher than the speedup you already noticed by now. Wink
you would not need any framskipping at all anymore.
(fullspeed with sound)

this also happens to most normal games on your mashine.
you will have a speedup and higher min-fps.
My Rig is [Image: sonic09_126821n0f3_203ttr1.gif] for Dolphin
Find
Reply
« Next Oldest | Next Newest »
Pages (3): 1 2 3 Next »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode