2024-01-06
Getting WineASIO to work (at least on Fedora 39)
(This post was updated on 2024-03-30 to support Fedora 40 too.)
Background
Recently I formatted my home computer and made the jump to Linux – specifically, the lazy way and just using Fedora Workstation 39 KDE Spin. It’s been surprisingly pretty good so far!
However, I wanted to try running a Windows game via WINE which had ASIO support to get its HD audio working. After some mucking about, I got WineASIO working and thought I’d share the details on how.
Making it work
Note: I only needed it working for 64-bit so that’s all I bothered with. It also assumes you are wanting to use Pipewire JACK (although, build steps could probably be adapted to regular JACK too).
Building WineASIO
In case it works (and/or saves me time in future!), I’ve uploaded a build of v1.2.0 here: /static/upload/wineasio64-1.2.0-build.tar.gz
- Grab a copy of WineASIO’s source code (at time of writing it was v1.2.0): https://github.com/wineasio/wineasio/releases
- Install build dependencies (assuming you already have base ‘Development Tools’ group):
sudo dnf install pipewire-jack-audio-connection-kit-devel wine-devel
- Unpack it, then simply use
make 64
to run the build, outputs intobuild64
. Out should come awineasio64.dll
andwineasio64.dll.so
- (A reference I saw seemed to suggest a modified Makefile was needed, but this seemed to no longer be the case)
Installing WineASIO
In my case, I was using Bottles (Flatpak) to manage my WINE prefix, so this was the part that needed to cater for it. For the purposes of these steps, I will highlight the Bottles locations. – Otherwise, the default WINE prefix lives in ~/.wine
, and the default WINE libraries live in /usr/lib64/wine
.
(wineasio-register
could work, but to make sure the final registering works in Bottles I think it’s better to just do it manually.)
- Ensure the Pipewire JACK connection kit is installed:
sudo dnf install pipewire-jack-audio-connection-kit
- Ensure your user is able to use realtime priorities (via the Pipewire group / security limit rule), and can access audio devices:
sudo usermod -aG pipewire,audio $USER
- Copy built WineASIO libraries into WINE libraries folder:
cp wineasio64.dll.so ~/.var/app/com.usebottles.bottles/data/bottles/runners/wine-ge-proton8-25/lib64/wine/x86_64-unix
cp wineasio64.dll ~/.var/app/com.usebottles.bottles/data/bottles/runners/wine-ge-proton8-25/lib64/wine/x86_64-windows
- Copy built WineASIO DLL into relevant prefix folder (or, the game EXE folder should work too):
cp wineasio64.dll ~/.var/app/com.usebottles.bottles/data/bottles/bottles/<BOTTLE NAME>/drive_c/windows/system32
- For Bottles Flatpak, you’ll also need to allow access to the Pipewire device:
flatpak override --user --filesystem=xdg-run/pipewire-0 com.usebottles.bottles
- Restart Bottles for good measure
- Register WineASIO DLL with the WINE system:
- In Bottles, fire up the Command Prompt for the relevant prefix
C:
cd C:\WINDOWS\SYSTEM32
regsvr32 wineasio64.dll
- A reboot is now probably required
Testing it
At this stage you may be able to just fire up whatever it is you’re trying to do. However, in my case, it was very unhelpful because at first it didn’t work right away, and the game decided to hang on startup.
- Grab a copy of VB-Audio’s ASIO Driver Tester: https://forum.vb-audio.com/viewtopic.php?t=1204
- Unpack it, then launch VBASIOTest64.exe
- Click ‘Devices’ -> ‘WineASIO’
- (At this stage, WineASIO should come up. Otherwise, review the installation steps above.)
- You should hear a sine wave playing, and numbers should start coming up. This is how you know it all worked!
- (Otherwise, an error message should come up below and in the terminal. In my case, the terminal output suggested it couldn’t connect to JACK, and it turned out it was the Flatpak allow step that was missed.)
The ASIO device should be ready to go, connected to Pipewire JACK! It should be simply called ‘WineASIO’, for any programs that should require its name.
References
Notably, some of these details I stumbled across were seemingly out of date in some spots, so I wanted to post my own post/guide. They did help me put this together though, so here are the references:
- https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1495
- https://github.com/theNizo/linux_rocksmith/blob/main/guides/setup/fed-pipewire.md
Further experimentation
There’s certainly a few things more I’d like to play with in this space:
- Different kernels. I’m already running the kernel-cachyos since that was most convenient in COPR, but perhaps some other realtime ones could further improve latency/quality
- I stumbled upon audlinux, and this is fairly intriguing
- The kernel has definitely already improved single-core-heavy game performance, I’d suggest experimenting here for sure if you have time to waste :)
- Resampling quirks. I now have to run my system in 44.1kHz mode to match audio output from WINE (or it results in no or sped up audio)… but I’m curious if I can run it in 48kHz instead and just have the 44.1kHz resample. (or, just a way to have apps detect/forced to the right one, and no crackling/artefacts!!)
Updates after initial publishing:
- 2024-01-07: Added missing realtime/audio setup+group steps, missing C drive switch in DLL registration, and minor reordering of steps
- 2024-01-29: Moved prebuilt download into blog hosting rather than relying on Windblume filehost
- 2024-03-30: F40 or this change possibly broke this guide - updated realtime instructions to actually use pw group instead of piggybacking realtime-setup’s ’nice’ rules - those aren’t actually needed and just the pipewire group was the whole time. Also added further experimentation notes for future expansion