Table of Contents
- Audio output method from games supported by spice
- What should I use then?
- Game-specific information
- Spice audio hooks
- Low latency audio mode for DSound and Shared Mode WASAPI
- Backend conversion
- Exclusive WASAPI -> Shared WASAPI (-wasapishared)
- Exclusive WASAPI -> ASIO conversion (-asioconvert)
- Volume change prevention (automatic)
- WASAPI/ASIO Boost Audio Volume (-volumeboost)
- Downmixing / resampling / buffer modification
- Other audio hooks and hacks
Audio output method from games supported by spice
Note
Audio settings are highly dependent on your audio driver and audio hardware. What is written below is true in general, but there are some situations where things are not as you expect; e.g., some DACs have higher latency with ASIO than Exclusive WASAPI.
DirectSound (DSound)
DDR, popn, etc, including many older versions of games (IIDX24 and below, gfdm XG3 and below, older SDVX...).
Highest latency, but compatible with basically everything. Allows for multiple audio streams. Audio can be captured.
WASAPI shared mode
High latency, compatible with most devices. Allows for multiple streams. Audio can be captured.
You may need to set "Default Format" to the correct sample rate in Windows audio settings before starting the game.
WASAPI exclusive mode
IIDX25-30 (LDJ), SDVX (nemsys cabinets), Gitadora, etc. Used by most newer games.
Exclusive here means it only allows one audio stream at a time (i.e., the game takes over all of audio, preventing other games and applications from using it).
Game will not show up in Windows audio mixer.
Some games using WASAPI exclusive mode can be patched (DLL hex edit) to use shared mode instead - but not all games.
Low latency, requires that audio device supports exclusive mode at the correct sample rate. Needs "Allow applications to take exclusive control" setting enabled in Windows audio settings, on by default.
Audio cannot be directly captured by another application, so a workaround is needed to record or share the audio stream.
ASIO
Lowest latency. Requires special audio device to support ASIO, at specific format, as the game directly communicates with the audio card, skipping Windows audio layers. On most audio hardware, running ASIO will be an exclusive operation (mutes all other audio streams).
Game will not show up in Windows audio mixer. Depending on your audio device, adjusting the volume may or may not be possible.
Audio cannot be directly captured by another application, so a workaround is needed to record or share the audio stream.
So far, only IIDX and SDVX have native support for ASIO. By default, the games look for a specific sound card in the registry, Asus Xonar AE, which is what the arcade cabs use - read that page if you have the card.
Important
Please update to spice2x-26-03-05 (or newer) as it contains updates to how ASIO options are presented.
Alternatively, you can try to convince the game to use your ASIO-compatible device:
- Open spicecfg.
- Find
IIDX ASIO Driver (-iidxasio)orSDVX ASIO Driver (-sdvxasio)option in Options tab. - Click on
Pickand choose your desired ASIO Driver.
Warning
Software ASIO drivers, such as ASIO4ALL, ASIO4ALL v2, FlexASIO are not going to provide you with better latency in most cases. They are receiving ASIO and then converting them to WASAPI Exclusive or Shared in the back end (on your CPU). If your hardware does not natively support ASIO, avoid these software solutions, and instead try to change spice options and/or patch the game to use WASAPI Exclusive for best performance.
XAudio2
Nostalgia uses XAudio2 API.
What should I use then?
Optimizing for latency
In order of preference:
- (IIDX/SDVX only) use native ASIO via
-iidxasioor-sdvxasio - Exclusive WASAPI, if the game supports it
- Shared WASAPI / DSound, with
-lowlatencysharedaudioturned on (read the section below for how to correctly turn it on) - Shared WASAPI / DSound
Try the above in the priority order, moving onto the next option if things don't work out.
Backend conversion is not in the list above as results may vary. If you need to screenshare or record, some of the options above may not be applicable to you.
Reducing audio latency on your audio device
You can try the steps on this page. Specifically the part about using Windows inbox audio driver instead of vendor-proprietary one (such as Realtek).
Many games will query your audio card to check for the lowest buffer setting and use that, so having the right driver and configuration can certainly help.
Game-specific information
IIDX
IIDX 24 and below
- Uses DirectSound.
- See Hypersonik DLL hook (linked below) to output audio via exclusive WASAPI.
IIDX 25-26
- Uses exclusive WASAPI.
- See Backend Conversion section below if you want to output as shared mode WASAPI.
IIDX 27-30
- By default, Spice will tell the game to use exclusive WASAPI.
- Patches exist to change from exclusive mode WASAPI to shared mode WASAPI.
- To use native ASIO, set
IIDX Sound Output Device (-iidxsounddevice)andIIDX ASIO Driver (-iidxasio).
IIDX 31+
- All DLL types use ASIO, but spice will automatically apply a patch to use exclusive WASAPI.
- This patch is signature based and therefore not perfect - future DLLs may fail to get patched.
- Patches exist to change from exclusive mode WASAPI to shared mode WASAPI.
- To use native ASIO, set
IIDX Sound Output Device (-iidxsounddevice)andIIDX ASIO Driver (-iidxasio).
For ASIO, according to https://iidx.org/infinitas_asio, 44100Hz Int24LSB is the required format.
SDVX
SDVX 1-4
Uses DirectSound.
SDVX VW
Uses exclusive WASAPI. Patches exist to use shared mode WASAPI.
SDVX EG/Nabla
- The game will look for ASIO device first (use
SDVX ASIO Driver (-sdvxasio)to override device).- It requires 8 channels, 44.1kHz and 24-bit depth.
- If you only have 2 audio channels for ASIO, enable
-sdvxasio2choption. - If bit-depth is 16 bit, you can garbled audio.
- If ASIO initialization fails, it automatically switches over to exclusive WASAPI
- You'll see
M:BMSoundLib: Failed to Open Asio device.in the log if this happens
- You'll see
- Patches exist to use shared mode WASAPI
- (all of this applies to both KFC and UFC modes)
Gitadora
XG3 and below use DSound. GITADORA and above will use exclusive WASAPI.
For Guitar, you'll probably want to use cab type 3 (white cab, single guitar) so that you get guitar sounds from both speakers. In other cab types, they have two guitars, so you only hear guitar sounds from one speaker. Unless you want to play two player guitar, of course.
You'll most likely want to apply the 2 channel audio patch by setting -2ch option.
For GITADORA, there are no patches to make things shared WASAPI - except Arena Model versions (Delta).
For info about Arena Model, see this page as things have completely changed.
Popn
All versions of Popn before High Cheers use DirectSound.
- See Hypersonik DLL hook (linked below) to output audio via exclusive WASAPI to reduce latency.
- Alternatively, use
-lowlatencysharedaudio.
For High Cheers, the game uses WASAPI Exclusive.
FutureTomTom
Uses Exclusive WASAPI @ 4 channels. Use WASAPI downmix option to reduce to 2 channels as needed.
Nostalgia
Uses XAudio2 API which is built on top of DSound on WinXP and WASAPI on newer OS.
Spice audio hooks
Low latency audio mode for DSound and Shared Mode WASAPI
Use Low Latency Shared Audio option (-lowlatencysharedaudio) to reduce latency. If your audio device supports it, it can lower the round-trip latency from a typical 10ms down to 2-3ms, which is a significant improvement.
Requires Windows 10 or higher. Works for DirectSound and shared mode WASAPI, but does not work for exclusive WASAPI or ASIO.
How do I know if it's doing anything?
Enable the option and check log.txt. It'll look something like this
Good scenario (reduction, 10ms -> 2.67ms) - using Windows inbox driver on Realtek audio device
I:audio::lowlatency: low latency shared mode audio client initialized successfully
I:audio::lowlatency: this is NOT used to output sound, but rather to reduce buffer sizes when the game requests an audio client at a later point
I:audio::lowlatency: ... sample rate : 48000 Hz
I:audio::lowlatency: ... min buffer size : 128 samples (2.6666667 ms)
I:audio::lowlatency: ... max buffer size : 480 samples (10 ms)
I:audio::lowlatency: ... default buffer size : 480 samples (10 ms)
I:audio::lowlatency: ... Windows will use minimum buffer size (instead of default) for shared mode audio clients from now on
In the above example, the min buffer size is lower than default buffer size, so you end up with lower latency.
Bad scenario (no reduction, stays at 10ms) - using Realtek drivers on the same device as above
I:audio::lowlatency: low latency shared mode audio client initialized successfully
I:audio::lowlatency: this is NOT used to output sound, but rather to reduce buffer sizes when the game requests an audio client at a later point
I:audio::lowlatency: ... sample rate : 48000 Hz
I:audio::lowlatency: ... min buffer size : 480 samples (10 ms)
I:audio::lowlatency: ... max buffer size : 480 samples (10 ms)
I:audio::lowlatency: ... default buffer size : 480 samples (10 ms)
I:audio::lowlatency: ... Windows will use minimum buffer size (instead of default) for shared mode audio clients from now on
In the above example, the min buffer size is the same as default buffer size, so the latency will not go any lower.
For best results, use Windows inbox audio driver. You may lose some features with this, however; e.g., Stereo Mix, multiple audio channel support, audio effects and filters, etc.
Basically, it's the same as running REAL, using Windows audio APIs to accomplish the same thing.
Backend conversion
Exclusive WASAPI -> Shared WASAPI (-wasapishared)
Converts exclusive mode to shared mode.
- Ensure the game is outputting to exclusive WASAPI
- Enable
WASAPI Force Shared Mode & Auto-Resample (-wasapishared) option
It's the same idea as shared WASAPI patches, except that this will result in more compatible streams;
- scratch buffer is used to prevent buffer overrun/underrun issues (reduced crackling noise)
- instructs the OS to automatically perform sample rate / channel conversion (no need to change sample rate before booting up the game)
This option can also be combined with low latency option. Make sure you don't have shared wasapi patches also enabled at the same time.
Exclusive WASAPI -> ASIO conversion (-asioconvert)
Important
ASIO conversion should only be used as last resort.
Configuring Spice to convert Exclusive WASAPI to ASIO backend, use the following:
- Ensure the game is outputting to WASAPI Exclusive
- Set
WASAPI Exclusive to ASIO Conversion (-asioconvert)option to your ASIO driver by clicking onPickbutton and choosing your driver.
For example, this technique can be used with IIDX 25-26 to output shared WASAPI audio. The game would output as exclusive WASAPI, spice converts that to ASIO and pipes to FlexASIO, and FlexASIO converts to shared WASAPI. (Consult FlexASIO documentation on how to accomplish this).
To check if it's working properly, look for log messages like this:
I:audio::asio: Device Info:
I:audio::asio: ... Name : FlexASIO
I:audio::asio: ... Version : 0
I:audio::asio: ... Inputs : 0 channels
I:audio::asio: ... Outputs : 2 channels
I:audio::asio: ... Buffer Minimum : 48 samples
I:audio::asio: ... Buffer Maximum : 48000 samples
I:audio::asio: ... Buffer Preferred : 960 samples
I:audio::asio: ... Buffer Granularity : 1 samples
I:audio::asio: Channel Info:
I:audio::asio: ... Channel 0: OUT 0 FL (Front Left) (group: 0, type: ASIOSTFloat32LSB)
I:audio::asio: ... Channel 1: OUT 1 FR (Front Right) (group: 0, type: ASIOSTFloat32LSB)
I:audio::asio: ASIO thread entering main loop
Whenever possible, you should use the native audio output from the game, instead of going through the Spice audio backend conversion, as it will add a bit of latency.
Volume change prevention (automatic)
Some games like to set the volume of your default audio device to 100% as it launches, which is very fun! Spice2x now has hooks to prevent this from happening, which means you might not need to patch your DLLs to do the same. This is enabled by default.
Spice only hooks some of Windows volume APIs, which should cover most games. If there is a game that still sets your volume to 100%, let us know by filing a bug, maybe someone can look into adding another hook.
For most games, there are also patches that can be applied.
WASAPI/ASIO Boost Audio Volume (-volumeboost)
Exactly what it says; boosts the volume by a constant decibel value. You can use this if the game is too quiet (IIDX, SDVX tend to be fairly quiet). Not responsible for any hearing damage or broken speakers and headphones.
Downmixing / resampling / buffer modification
With the options below, supported games should run on practically any audio hardware. Even low budget USB speakers or TVs over HDMI can handle WASAPI exclusive audio with increased buffers and resampling enabled.
WASAPI Stereo Downmix (-downmix)
Some games require surround sound setup. For example, FutureTomTom wants 4 channels, and GitaDora Arena Cabinet requires a 7.1 setup. If you turn on -downmix option, you can play these games with just a stereo system; spice will lie to the game engine that surround system is available, internally perform a downmix to stereo, and output to your audio device with just two channels.
WASAPI Exclusive Mode Resampling (-resample)
Allows you to upsample / downsample exclusive mode streams. This can be useful if your audio device doesn't support the sample rate that the game wants (e.g., you have 48kHz-only device but SDVX wants 44kHz). Note that this only works for exclusive mode, not shared.
WASAPI Exclusive Buffer Size (-exclusivebuffer)
Allows you to modify the buffer size. This can be used if the buffer size requested by the game engine is too low (e.g., SDVX requests 3 ms) and causing static noise in your speakers. You should start with 10 (10 milliseconds) and slowly increase it; higher values are safer, but will add more latency.
ASIO 7.1 to Stereo "Downmix" (-asiodownmix)
This performs a downmix from 7.1 to 2 channel by extracting audio from specified channels and routing them to the front speakers (e.g., rear channels to front channels). It doesn't do any mixing, just swapping of channel destinations (just a memcpy), but can be used if the game is outputting audio to the wrong channel.
Other audio hooks and hacks
hypersonik for hooking older IIDX versions (IIDX24 and below) and pop'n music to output exclusive WASAPI instead of DSound, which significantly reduces latency. Can be used as an alternative to -lowlatencysharedaudio.
If you want to force the game to use a different audio device, you can use the Windows volume mixer and change the default output device on Windows 10/11, and then restart spice. If that's too difficult for you to figure out, you can try EarTrumpet.