How to use wineasio with FL Studio [Tutorial]
Quick Disclaimer:
I'm not an audio expert (much less on linux audio), so I'd recommend taking my suggestions with a grain of salt. Please call me out if I've done something completely wrong, but nevertheless this method has worked me well enough
⚠️ THESE INSTRUCTIONS ARE FOR ARCH/ARCH-BASED DISTROS
Why use wineasio?
The default FL Studio ASIO driver unfortunately has very high latency (~60ms), which is quite annoying when recording with instruments, singing, etc.
This is the lowest latency I could get at 48khz using the default ASIO driver:
This is where wineasio comes in.
It's an ASIO to JACK driver for WINE, which lets us reach much better latencies (Less than 10ms!):
Prerequisites
I'll be setting this up using pipewire and pipewire-jack so make sure you have those.
I'll assume you've already installed bottles and flatseal through flatpak. Make sure to add kron4ek-wine-10.11 (or similar) under Preferences > Runners
Create your FL Studio bottle following the steps in this repository. Make sure that you set your runner to kron4ek-wine-10.11.
Give bottles access to xdg-run/pipewire-0, just to make sure FL Studio has access to pipewire-jack
Install
You'll need to configure pipewire's sample rate and quantum (buffer) size, so create a config file for pipewire.
$ mkdir .config/pipewire/pipewire.conf.d
$ touch .config/pipewire/pipewire.conf.d/90-asio.conf
Wineasio is pretty picky with sample rates, so i'd recommend setting it to a preferred fixed value. Open .config/pipewire/pipewire.conf.d/90-asio.conf with a text editor and add the following (you can of course edit these values to your preference):
context.properties = {
default.clock.rate = 48000
default.clock.allowed-rates = [ 48000 ]
default.clock.quantum = 256
}
Note: This will lock your sample rate to 48khz. There are probably better ways to do this for wineasio, but this works well enough I guess. If you notice crackling in apps like firefox, you might need to raise the buffer size.
Wineasio needs real-time privileges to work properly.
Run $ sudo pacman -S realtime-privileges and $ sudo usermod -aG realtime <your username here> to set that up.
Restart your computer. Please verify that realtime privileges are enabled.
Install wineasio from the AUR.
Run $ paru -S wineasio. This will install wineasio64.dll to /usr/lib/wine/x86_64-windows/ and wineasio64.dll.so to /usr/lib/wine/x86_64-unix/. Keep these directories open somewhere as we'll need them soon.
We'll need to inject the drivers directly since we're using a sandboxed flatpak applications.
Open the following directories somewhere:
- The C:\ drive of your bottle. In my case,
/home/polariced/.var/app/com.usebottles.bottles/data/bottles/bottles/FLStudio/drive_c/ - The directory where
kron4ek-wine-10.11is installed. You can open it through bottles in preferences > runners and then clicking the respective folder icon. In my case,/home/polariced/.var/app/com.usebottles.bottles/data/bottles/runners/kron4ek-wine-10.11-amd64/
Next, copy wineasio64.dll to the system32 directory of your bottle (inside the C:\ drive directory).
Copy wineasio64.dll to [kron4ek-wine-10.11 directory]/lib/wine/x86_64-windows and wineasio64.dll.so to [kron4ek-wine-10.11 directory]/lib/wine/x86_64-unix.
We're almost done. Create a .bat file with the following contents and place it somewhere in your home folder:
regsvr32 C:\windows\system32\wineasio64.dll
pause
Go to your FL Studio bottle and click on 'Launch executable'. Then run the .bat file to register the driver. You should see something like this:
Open FL Studio to confirm wineasio has been installed under the audio tab. You might need to fiddle around with the sample rate to get it to enable.
And you're done!
I recommend enabling triple buffering and disabling mixing in the buffer switch for the best sound stability. If your sound crackles or distorts, then you probably set your buffer size too low or your sample rate too high in the pipewire config.