forum

[added] [Gameplay] ASIO / WASAPI (exclusive) support

posted
Total Posts
62
This is a feature request. Feature requests can be voted up by supporters.
Current Priority: +5,998
show more
BilliumMoto

peppy wrote:

I was talking to BilliumMoto, who quoted 80ms.

There's no way directsound adds 50ms. your sound card's drivers are FUCKED if that is the case.

Also your numbers are off. No (good) keyboard is as high as 40ms and most are FAR under 10ms. Get a high speed camera and actually measure your shit before barfing numbers.

I recorded myself, delay is indeed about 100ms, worse than I originally thought
Mp3 of recording here: http://puu.sh/nyBAk/3c83268efd.mp3
Both keyboard and laptop speakers were placed within a foot of the mic.

I have Win10, Pok3r keyboard with standard drivers, using DirectSound with a pretty generic audio card that comes with any decent Lenovo Laptop.
If you can fix my problem please do, because according to you something is seriously fucked with my computer.

Also have more tact before calling someone a "number barfer" next time, PR is important sometimes. Thanks.

Edit: Might be worth noting that this was tested in a Mania map, since for some reason Mania has an additional latency built in, at least that's how it seems.
TakuMii
^...I consider myself a latency snob, and even I find that hard to believe... Even the worst mechanical keyboards (aka Razer) have measured delays of around 30ms. Unless you're doing something ridiculous like running the game with Vsync turned on (or even playing in windowed mode), there has to be something incredibly wrong with your setup or method of measurement.
BilliumMoto
I can assure you that Vsync is not on, and that the recording was made while playing in fullscreen.
Also that this has been the latency I've experienced since day one of installing osu (on a different computer from the one I currently use).
If I'm really the only dude out of thousands who experience latency problems this bad, so be it.
peppy
I can assure you that what you are seeing is very likely not a directsound-related issue. I'm pretty sure switching out directsound alone will not fix your problem, unfortunately.
DimenSham
Try to find out if the USB port you are using is going through an extra hub. If I use my keyboard through the ASMedia ASM1042 hub that controls half of my USB ports on the motherboard it adds roughly 55ms but I can avoid this by going straight to the chipset. Only one out of the 8 keyboards I tried was noticeably different than the others, even my cheap scissor switch model matched the input latency of my mechanical keyboards.
peppy
USB hubs can be quite bad, yes.
iMey
A very exciting result.

According to Microsoft's documentation, I upgrade my computer's operating system from win7 to win10, and change to the driver by Microsoft win10 from the third-party driver.
In win7 or win10 with third-party driver, Repeated testing shows my computer has 55-65ms delay to get the hitsounds with keyboard, but in win10 with MS's driver. My 1000Hz keyboard testing's result is about 40ms, relatively stable, 125Hz mouse results between 45ms to 60ms, not very stable.

The delay has been greatly reduced obviously.

Keyboard Testing Picture
Keyboard Sounds Recording Files
Mouse Testing Picture
Mouse Sounds Recording Files

Sounds Card: ALC888(onboard)
Keyboard:CM Quick Fire(1000hz)
Mouse:Lenovo N14608(125hz)
Drivers:10.0.10240.16384
vincaslt
I experience insane audio delays when DOLBY digital plus is turned on. Turning it off lowers the latency significantly, so watch out for that.
peppy
Yes, you don't want DOLBY on. Also turn off all windows-level "enhancements":

Danshi_old_1

peppy wrote:

Yes, you don't want DOLBY on. Also turn off all windows-level "enhancements":

Well this fixed my quiet audio.. Got a fright when I clicked apply.
Evil Peppy
peppy
It's for the best. If you have loudness equaliser on, your audio volume will be very dynamic in places it shouldn't be.
Tanomoshii Nekojou
Oooooooooohhhh! Finally I found this! :D I think this will correct osu!'s accuracy in audio output~. :)
mxp
I've been thinking about this for the past year. Finally it's actually coming to the attention of everyone else. I seriously hope this becomes a thing.
vincaslt

peppy wrote:

As mentioned in the OP, the usual case is well under 10ms latency using DirectSound (I've tested on multiple onboard and external sound cards). Adding ASIO support brings with it compatibility issues, futher dependencies, and usually not enough gain to be worth it.

I've experimented with ASIO previously (a few years ago) and it wasn't worth the effort. These days that applies even more so, as sounds cards (and their support for DirectSound) and windows mixing latency are in a far better state than when ASIO was actually useful.

There's better gains to be made elsewhere, such as decoupling the input handling from draw process (something we are working on this year).

WSAPI on the other hand is something that is possible (it's basically a single flag change in the library we use) but requires updating the library to the latest version. This is something on my short-term priority list for other reasons, so you may see that happen in the very near future.
May I ask how you measure 10ms delay, because if I had it, I would be pretty happy. I measure 51-56ms delay on my computer from mouse click to actual hitsound with the best settings I managed to find.
peppy
I can assure you that what you are seeing is very likely not a directsound-related issue. I'm pretty sure switching out directsound alone will not fix your problem, unfortunately.
Zinkon

peppy wrote:

I can assure you that what you are seeing is very likely not a directsound-related issue. I'm pretty sure switching out directsound alone will not fix your problem, unfortunately.
I tested on a random piano program the delays of WASAPI, ASIO and Direct Sound. Had microphone near mouse and speakers, clicked a few times, found the average delay between the two. WASAPI - ~55 ms. ASIO @ 128 buffer size ~20 ms. ASIO @ 512 buffer size ~35ms. Direct Sound ~ 70 ms. So ASIO definitely 100% fixes the problem. I tested directly in osu! as well and got ~57 ms. I tested the delay on 7 friend's PC's as well and it was never below 50 ms. It was usually 50-100 ms.

Since I cannot believe you achieve <10ms I request proof. A recording of you mouse clicking and the resulting hit sounds coming out of the speakers. Preferably the hit sound would be a clicky one.

I would kill for audio delay reduction. The fun it provides is immeasurable.

Edit: I read the entire thread, I'll try to upgrade to Windows 10 and see if I get a difference

Edit2: With Windows 10 I'm getting ~51 ms mouse click to ingame hit sound delay. Which is about 6 ms better than Windows 8.1. Well that's nice. I still want to try out WASAPI though. And of course ASIO would be the ultimate heaven

Edit3: Recalculated the piano results with Windows 10:

Direct Sound ~60 ms
WASAPI ~50 ms
WASAPI in exclusive mode ~17 ms
Chirimu

Zinkon wrote:

peppy wrote:

I can assure you that what you are seeing is very likely not a directsound-related issue. I'm pretty sure switching out directsound alone will not fix your problem, unfortunately.
I tested on a random piano program the delays of WASAPI, ASIO and Direct Sound. Had microphone near mouse and speakers, clicked a few times, found the average delay between the two. WASAPI - ~55 ms. ASIO @ 128 buffer size ~20 ms. ASIO @ 512 buffer size ~35ms. Direct Sound ~ 70 ms. So ASIO definitely 100% fixes the problem. I tested directly in osu! as well and got ~57 ms. I tested the delay on 7 friend's PC's as well and it was never below 50 ms. It was usually 50-100 ms.

Since I cannot believe you achieve <10ms I request proof. A recording of you mouse clicking and the resulting hit sounds coming out of the speakers. Preferably the hit sound would be a clicky one.

I would kill for audio delay reduction. The fun it provides is immeasurable.

Edit: I read the entire thread, I'll try to upgrade to Windows 10 and see if I get a difference

Edit2: With Windows 10 I'm getting ~51 ms mouse click to ingame hit sound delay. Which is about 6 ms better than Windows 8.1. Well that's nice. I still want to try out WASAPI though. And of course ASIO would be the ultimate heaven

If you can upload a proof that ASIO is working better with this random piano program, this could be a nice argument for this feature request. (Or i test it myself and upload the result)
mideeli

[ Rin Satsuki ] wrote:

Zinkon wrote:

I tested on a random piano program the delays of WASAPI, ASIO and Direct Sound. Had microphone near mouse and speakers, clicked a few times, found the average delay between the two. WASAPI - ~55 ms. ASIO @ 128 buffer size ~20 ms. ASIO @ 512 buffer size ~35ms. Direct Sound ~ 70 ms. So ASIO definitely 100% fixes the problem. I tested directly in osu! as well and got ~57 ms. I tested the delay on 7 friend's PC's as well and it was never below 50 ms. It was usually 50-100 ms.

Since I cannot believe you achieve <10ms I request proof. A recording of you mouse clicking and the resulting hit sounds coming out of the speakers. Preferably the hit sound would be a clicky one.

I would kill for audio delay reduction. The fun it provides is immeasurable.

Edit: I read the entire thread, I'll try to upgrade to Windows 10 and see if I get a difference

Edit2: With Windows 10 I'm getting ~51 ms mouse click to ingame hit sound delay. Which is about 6 ms better than Windows 8.1. Well that's nice. I still want to try out WASAPI though. And of course ASIO would be the ultimate heaven

If you can upload a proof that ASIO is working better with this random piano program, this could be a nice argument for this feature request. (Or i test it myself and upload the result)
Here is the guide Zinkon used. You can use it and verify the results yourself and get pseudo ASIO hitsounds for Osu.
Zinkon
Recalculated the piano results with Windows 10:

Direct Sound ~60 ms Proof: Image Sound file
WASAPI ~50 ms Proof: Image Sound file
WASAPI in exclusive mode ~17 ms Proof: Image Sound file
osu! ingame ~51 ms Proof: Image Sound file

Basically my dream right now is a WASAPI audio option with an "Exclusive mode" checkbox. Didn't even test ASIO because WASAPI is plenty good enough and peppy already said it was easy enough to implement. So now I'm shaking with excitement :D
GatorZZ

Zinkon wrote:

WASAPI in exclusive mode ~17 ms Proof: Image Sound file
]
Hnnnng. Yes please!
-Tooru-
Yes please. I've never been able to properly use hitsounds because of my UO offset, so if this can somehow help, it'd be truly amazing..
Kempie
I like your test, Zinkon. I performed roughly the same test to bring up more evidence that WASAPI exclusive mode or ASIO makes a very significant difference for at least some people. I've had to disable hitsounds due to high latency in osu!, but keysounds in LR2 with ASIO playback have never bothered me a bit.

My setup:
SPOILER
  1. Windows 10
  2. i7 5820k 6-core @ 3.3GHz
  3. Focusrite Scarlett 2i2 USB audio interface
  4. Shure SM57 microphone
  5. Sennheiser HD558 headphones
  6. Filco Majestouch 2 keyboard, using the PS/2 connector
  7. Reaper DAW
Microphone touches the insides of my headphones and is at ~8cm away from the key i'm hitting to play a synth sound. Synth sound is configured with 0ms attack (even makes a popping sound when played).

On the bottom right of every screenshot you can see the duration of the selected area in seconds.

Keyboard + ASIO: ~15ms

Keyboard + WASAPI: ~15ms

Keyboard + Directsound: ~113ms

Keyboard + osu!mania hitsounds (directsound?): ~62ms

I've had my UO at -52ms with hitsounds disabled for a while now before running this test, so my test results seem to somewhat agree with my UO. I couldn't get Reaper to use directsound with low buffer sizes. I ended up with 2 buffers of 892 samples. 2 buffers with 880 samples refused to make any kind of sound, not even popping and crackling. So there might be something I can do to lower that 113ms, but I'm not sure how.

TL;DR: ASIO and WASAPI give me 15ms delay between key press and audio playback. Htsound delay in osu! is 60ms for me. WASAPI / ASIO needs to happen.
Franc[e]sco
take my votes
E m i
I wish I had votes. Syncing up asio hitsounds with osu music required me to go from -11 offset to -162 offset.
DeletedUser_1981781
If you have an ASIO only soundcard (like mine, INFRASONIC QUARTET, a recording card which isn't intended for gaming) you'll have definitely latency issues since it has to emulate directsound for applications that won't run on ASIO.

I have to switch back to onboard soundcard whenever I play osu!.

These are my latency outputs:
ASIO CARD emulating DIRECTSOUND at 512 samples: 125ms (I've been playing like this lately and it's terrible)
ASIO CARD emulating DIRECTSOUND at 256 samples (default for most cards): 102ms
ASIO CARD emulating DIRECTSOUND at 48 samples: 85ms

ONBOARD DIRECTSOUND: 65ms
ONBOARD ASIO4ALL: Haven't tested it yet.

ASIO 512 samples: 60ms
ASIO 256 samples: 38ms
ASIO 48 samples: 25ms

Note that I did these tests with a really cheap Genius standard keyboard instead a decent mechanical one, which may also add extra 15 ms to my results.

But I post this for people with this issue desperately looking for a way to run osu! on ASIO: Best advice for now is to switch back to onboard when playing this game.
Kempie

ARGENTINE DREAM wrote:

If you have an ASIO only soundcard (like mine, INFRASONIC QUARTET, a recording card which isn't intended for gaming) you'll have definitely latency issues since it has to emulate directsound for applications that won't run on ASIO.

....
There's no reason why any ASIO-capable device cannot provide the drivers required by DirectSound. On a slightly different note: DirectSound has been using WASAPI internally since Vista came out (it has also been deprecated since Vista).


ARGENTINE DREAM wrote:

But I post this for people with this issue desperately looking for a way to run osu! on ASIO: Best advice for now is to switch back to onboard when playing this game.
I do remember setting my Universal Offset with ppy's latency test map and my onboard audio (rather than my USB audio interface). I got it at ~-70ms, similar to what it was with my USB interface. YMMV, of course.
DeletedUser_1981781

Kempie wrote:

There's no reason why any ASIO-capable device cannot provide the drivers required by DirectSound
It's just some devices weren't thought for running DirectSound, as I stated earlier, those may emulate DirectSound better than onboard cards and using way lower CPU processing, but at the cost of adding some milliseconds to the actual output.

Kempie wrote:

I got it at ~-70ms
That's probably the latency most players get when running osu! unless they have some CPU or GPU issues.
Shizai
Bump

Still as big an issue as it was 3 years ago.
arily
I measured 34~43ms latency on hitsound.
here's my method:
  1. although It's not directly related to DirectSound but I recorded my keystroke sound.
  2. when I hit any key, an ASIO based VSTi host will produce a sound output to my soundcard (host buffer is 0.67ms, ASIO buffer is 3.458ms. My AD-DA added roughly 1.5ms latency also.
  3. I routed osu to my onboard output to separate different sound source. Also because this should be the most typical situation for most players.
  4. I confirmed that my hit-sound has no muted part at the start.
  5. I played osu without music so it's pure hit-sound.
  6. I recorded all three Audio stream(keystroke sound, sound produced by VSTi host, Osu hit-sound) using one multi-channel ADC connected to the ProTools System to ensure absolutely synced recording.
  7. By calculating the gap between VSTi produced sound and Osu hit-sound with ASIO latency included, we will find out the latency between a key-stroke is registered and the sound coming out from ADC.(Since ADC latency are vary and we have no control of that It's not included in the calculation.)
  8. Do the calculation Multiple times to get more accurate results.

I'll put a link to my ProTools Session below. Do the calculation yourself if you intrust me.
It's fine if you don't have ProTools since there're audio files in the "Audio Files" folder. by importing them into any DAW you could see the waveform (such as Audacity (it's free!)).
As an audio engineer I have confident about the result I put here.
(BTW the latency between the keyboard and VSTi host are about 6~13ms. So compared to the Dsound delay it's LOW)
https://drive.google.com/open?id=1GPsHEY02rQuWIMwJ-4b6ji7ehA_b_yG1 here's the session.
sorry for that the file names has no relationship to the content.
  1. 音频 1_03.wav - Key stroke.
  2. 音频 2_03.L.wav, 音频 2_03.R.wav - Stereo recorded osu sound.
  3. 音频 3_03.L.wav, 音频 3_03.R.wav - VSTi Hosted produced sound.
Vestaia
To put to rest the notion that this is "not a direct sound issue".

Microsoft reports 48ms round trip latency (around 30ms for output) in their documentation https://docs.microsoft.com/en-us/windows-hardware/drivers/audio/low-latency-audio

I was able to achieve ~30ms latency by capturing on the driver output directly in an ESXI VM. However, Microsoft also defaults to a 10ms hardware buffer. This will realistically put audio latency at around 40ms under *ideal* circumstances, which is terrible. Considering CoreAudio, ALSA, ASIO, etc... can all reasonably achieve <5ms.

Here are some measurements of actual latencies (internal timers, does not include kb latency):
Realtek ALC1220 DirectSound - 42 ms
Realtek ALC1220 DirectSound + REAL - 34 ms
Realtek ALC1220 WASAPI - 25 ms
Realtek ALC1220 CoreAudio 32 sample buffer - 3 ms

Cirrus CS42L83A DirectSound - 38 ms
Cirrus CS42L83A DirectSound + REAL - 31 ms
Cirrus CS42L83A WASAPI - 24 ms
Cirrus CS42L83A CoreAudio 32 sample buffer - 3 ms

Note: The hardware buffer can be reduced using REAL
https://github.com/miniant-git/REAL

The 70-80 ms latencies people are reporting are likely not due to directsound alone, though in any case, directsound is a significant contribution. Directsound has not had a direct interface to the driver since windows XP. It was deprecated in Windows Vista and has since ran as an emulated device in WASAPI. There should be reason to use directsound other than that the code for it already exists (and I entirely understand not wanting to change a "mostly working" system).
Lifemarr
is this resolved now thanks to today's update?
abraker
LastExceed
Necroing because the title incorrectly says "[added]". OP asked about EXCLUSIVE audio, not just WASAPI in general, and we don't have that yet. The related github issue is also still open.
Please sign in to reply.

New reply