mdias / rs_asio

ASIO for Rocksmith 2014

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add to know issues in README.md

brejsku opened this issue · comments

Hi!

First of all, thanks for providing a low latency solution for us audio interface users playing rocksmith. Love what you're doing here!
I have found an interesting "issue" that i solved and would like you to update the readme to reflect my findings if you deem it appropriate.


I'm using: Focusrite 18i8 3rd gen and Windows 10.

I had an audio issue where all sounds coming from the game were distorted with a choppy static echo. Now i know that this problem was due to a BufferSize mismatch.

What i haven't found in the instructions was to set the audio interface to a specific input and output bit format setting (see pictures below)

inputs1
outputs1

The problem i was encountering was because my default setting was not 16bit (DVD quality) - 48KHz but 24bit (Studio quality) - 48KHz (more on this below), so the recommended settings of buffer sizes of 48, 96 or 192 did not work for me at the time. Changing the default format setting to 16bit and setting the custom buffer size to 96 allowed me to get a clean sound. Yay!

But i wanted to keep the default format setting at 24bit, because i did not want to keep changing the settings every time i wanted to record something. So, setting the custom buffer size with a bit of simple math 96 / 16bit = 6 -> 6 * 24bit=144 allowed me to keep playing with clean audio.

Please update the README.md so, that the mentioned buffer sizes are for 16bit default format settings and alternative format settings may use different buffer sizes. Feel free to use the provided pictures if needed.


Bellow I'll paste my Rocksmith and ASIO (16, 24bit) settings:
Rocksmith:

[Audio]
EnableMicrophone=1
ExclusiveMode=1
LatencyBuffer=2
ForceDefaultPlaybackDevice=
ForceWDM=0
ForceDirectXSink=0
DumpAudioLog=0
MaxOutputBufferSize=0
RealToneCableOnly=1
MonoToStereoChannel=0
Win32UltraLowLatencyMode=1
[Renderer.Win32]
ShowGamepadUI=0
ScreenWidth=0
ScreenHeight=0
Fullscreen=1
VisualQuality=1
RenderingWidth=0
RenderingHeight=0
EnablePostEffects=1
EnableShadows=1
EnableHighResScope=1
EnableDepthOfField=1
EnablePerPixelLighting=1
MsaaSamples=4
DisableBrowser=0
[Net]
UseProxy=1
[Global]
Version=1

ASIO (using 16bit - 48KHz)

[Config]
EnableWasapiOutputs=0
EnableWasapiInputs=0
EnableAsio=1

[Asio]
; available buffer size modes:
;    driver - respect buffer size setting set in the driver
;    host   - use a buffer size as close as possible as that requested by the host application
;    custom - use the buffer size specified in CustomBufferSize field
BufferSizeMode=custom
CustomBufferSize=96

[Asio.Output]
Driver=Focusrite USB ASIO
BaseChannel=0
AltBaseChannel=
EnableSoftwareEndpointVolumeControl=1
EnableSoftwareMasterVolumeControl=1
SoftwareMasterVolumePercent=100
EnableRefCountHack=

[Asio.Input.0]
Driver=Focusrite USB ASIO
Channel=0
EnableSoftwareEndpointVolumeControl=1
EnableSoftwareMasterVolumeControl=1
SoftwareMasterVolumePercent=100
EnableRefCountHack=

[Asio.Input.1]
Driver=Focusrite USB ASIO
Channel=1
EnableSoftwareEndpointVolumeControl=1
EnableSoftwareMasterVolumeControl=1
SoftwareMasterVolumePercent=100
EnableRefCountHack=

[Asio.Input.Mic]
Driver=
Channel=1
EnableSoftwareEndpointVolumeControl=1
EnableSoftwareMasterVolumeControl=1
SoftwareMasterVolumePercent=100
EnableRefCountHack=

ASIO (using 24bit - 48KHz) <- the only difference is in the CustomBufferSize setting

[Config]
EnableWasapiOutputs=0
EnableWasapiInputs=0
EnableAsio=1

[Asio]
; available buffer size modes:
;    driver - respect buffer size setting set in the driver
;    host   - use a buffer size as close as possible as that requested by the host application
;    custom - use the buffer size specified in CustomBufferSize field
BufferSizeMode=custom
CustomBufferSize=144

[Asio.Output]
Driver=Focusrite USB ASIO
BaseChannel=0
AltBaseChannel=
EnableSoftwareEndpointVolumeControl=1
EnableSoftwareMasterVolumeControl=1
SoftwareMasterVolumePercent=100
EnableRefCountHack=

[Asio.Input.0]
Driver=Focusrite USB ASIO
Channel=0
EnableSoftwareEndpointVolumeControl=1
EnableSoftwareMasterVolumeControl=1
SoftwareMasterVolumePercent=100
EnableRefCountHack=

[Asio.Input.1]
Driver=Focusrite USB ASIO
Channel=1
EnableSoftwareEndpointVolumeControl=1
EnableSoftwareMasterVolumeControl=1
SoftwareMasterVolumePercent=100
EnableRefCountHack=

[Asio.Input.Mic]
Driver=
Channel=1
EnableSoftwareEndpointVolumeControl=1
EnableSoftwareMasterVolumeControl=1
SoftwareMasterVolumePercent=100
EnableRefCountHack=

Hello!

First of all thank you for posting here your discovery.

There is a non-small chance that the issue here is simply that 96 is too small of a buffer (when running 24 bit) for your system to handle since that size will swap buffers 33% more often than the same buffer size at 16 bit, and this might've been the issue you faced.
It should be possible to check if this is indeed the case by looking at the RS_ASIO-log.txt after running the game while hearing the audio issues. If it's the case it will be spammed with "xrun" messages indicating this.

Usually ASIO skips any settings you've made in that windows audio settings dialogue, since ASIO works around the windows audio stack. However in practice this will depend on the specific driver implementation of your audio interfaces, so I can't really deny this might be happening. But once again the audio sample format in use will be logged in RS_ASIO-log.txt.

Since this is the first time this behavior has been reported, I'm a bit skeptical that the issue is anything other than xruns.
Can you please post the resulting logs with both 24 bit and 16 bit formats for me to check? It should be enough to play the game until you hear the audio issues (or the same place you'd hear it in the alternate setting) to generated a useful log.

I tried many different buffer sizes with both configurations. My testing methodology was to run the game and when hearing audio cracks or distortions stop the game (via alt +f4). If no noise was present I quit the game when the "enter" button appeared (also alt+f4). I provided the logs below if you'd like to check for yourself. The files are named with "_[bufferSize]" and if they were clean and contained no "xrun" I added "-CLEAN" to the end. Here are my findings:

16bit format
I tried: [16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192]
Notes:
- 48  => almost clean sounding, contains "xrun"
- 96  => sounds perfect, contains "xrun"
- 144 => Clean
- 192 => Clean

RS_ASIO-log_16.txt
RS_ASIO-log_32.txt
RS_ASIO-log_48.txt
RS_ASIO-log_64.txt
RS_ASIO-log_80.txt
RS_ASIO-log_96.txt
RS_ASIO-log_112.txt
RS_ASIO-log_128.txt
RS_ASIO-log_144-CLEAN.txt
RS_ASIO-log_160.txt
RS_ASIO-log_176.txt
RS_ASIO-log_192-CLEAN.txt

24bit format
I tried: [24, 48, 72, 96, 120, 144, 168, 192, 216, 240, 264, 288]
Notes:
- 48  => almost clean sounding, contains "xrun"
- 96  => Clean
- 144 => Clean
- 192 => Clean
- 240 => Clean
- 288 => distorted, no "xrun" in log!             <- this one looks interesting

RS_ASIO-log_24.txt
RS_ASIO-log_48.txt
RS_ASIO-log_72.txt
RS_ASIO-log_96-CLEAN.txt
RS_ASIO-log_120.txt
RS_ASIO-log_144-CLEAN.txt
RS_ASIO-log_168.txt
RS_ASIO-log_192-CLEAN.txt
RS_ASIO-log_216.txt
RS_ASIO-log_240-CLEAN.txt
RS_ASIO-log_264.txt
RS_ASIO-log_288.txt

Thank you for providing such extensive information, this is amazing!

It is well known that Focusrite drivers have timing issues with non-multiples of 48 on the buffer size; this is also documented in the Known Issues part of the readme, so I would only expect clean sound to be possible with 48, 96, 144, 192 etc.

I've had issues myself in the past with buffer sizes above 256 or so (can't remember) with other brands of audio interfaces so idk if that may be on the game or on the drivers.

Now, I'm finding it very curious that you're getting better results with 24 bit rather than 16 bit format since the logs show that no matter what the ASIO driver is only accepting a 32 bit format. (channel info for both show ASIOSTInt32LSB as the sample type).

Perhaps there is some additional magic happening behind the scenes on the Focusrite ASIO drivers that happens when you have 16 bit format selected on windows which makes it impossible to get fast enough buffer switching below 144 samples per second on your machine.

In any case, this is excellent information and I'll add it to the notes indeed. 👍