forum

Ultimate guide to low-latency osu! on Linux (rev.12)

posted
Total Posts
277
show more
TheAussie

Franc[e]sco wrote:

TheAussie wrote:

I have one problem with osu, the audio skips,pops, crackles and ive followed the guide. maybe you can help me? remotely or something.
does it also crackle during alsa audio tests?
No, it was when i switched to PulseAudio for OBS, but i have configured settings a bit different since then and it doesn't seem to be happening.
Nato Morichika
Can't get ce or beta run on wine :<

What I had installed in osu's prefix:
nat@nat ~ % ./winetricks list-installed       
baekmuk
corefonts
dotnet20
dotnet20sp1
dotnet30sp1
dotnet35
dotnet40
dotnet45
eufonts
gdiplus
gdiplus_winxp
msxml3
takao
unifont
wenquanyi
./winetricks list-installed 4.95s user 2.81s system 87% cpu 8.899 total

But when I try to switch to ce or beta, it automatically switch back to stable fallback. So I switch that on Windows as suggested. osu! did update itself to ce on Windows, but when I try to run it with wine, osu!update shows up and 'update' osu to stable fallback version... :I

I am not on linux, but OS X, not sure if that matter.
Topic Starter
Franc[e]sco

MagicNAT wrote:

Can't get ce or beta run on wine :<

What I had installed in osu's prefix:
nat@nat ~ % ./winetricks list-installed       
baekmuk
corefonts
dotnet20
dotnet20sp1
dotnet30sp1
dotnet35
dotnet40
dotnet45
eufonts
gdiplus
gdiplus_winxp
msxml3
takao
unifont
wenquanyi
./winetricks list-installed 4.95s user 2.81s system 87% cpu 8.899 total

But when I try to switch to ce or beta, it automatically switch back to stable fallback. So I switch that on Windows as suggested. osu! did update itself to ce on Windows, but when I try to run it with wine, osu!update shows up and 'update' osu to stable fallback version... :I

I am not on linux, but OS X, not sure if that matter.

why not use the beta osx build since you're on osx? maybe there are more graphical support issues with wine on osx
http://osx.ppy.sh/

also if it might help this is the list installed from a working install:
loli@jigoku:~$ WINEPREFIX=~/.wine WINARCH=win32 winetricks list-installed
corefonts
dotnet20sp1
dotnet20
dotnet30sp1
dotnet35
dotnet40
dotnet45
gdiplus
gdiplus_winxp
msxml3
takao
vcrun2008
vcrun2010
AGRX
peppy said its not possible to run anything else than stable on osx Wine build atm. Have to wait for native client ;/
Nato Morichika

Franc[e]sco wrote:

MagicNAT wrote:

Can't get ce or beta run on wine :<

What I had installed in osu's prefix:
nat@nat ~ % ./winetricks list-installed       
baekmuk
corefonts
dotnet20
dotnet20sp1
dotnet30sp1
dotnet35
dotnet40
dotnet45
eufonts
gdiplus
gdiplus_winxp
msxml3
takao
unifont
wenquanyi
./winetricks list-installed 4.95s user 2.81s system 87% cpu 8.899 total

But when I try to switch to ce or beta, it automatically switch back to stable fallback. So I switch that on Windows as suggested. osu! did update itself to ce on Windows, but when I try to run it with wine, osu!update shows up and 'update' osu to stable fallback version... :I

I am not on linux, but OS X, not sure if that matter.

why not use the beta osx build since you're on osx? maybe there are more graphical support issues with wine on osx
http://osx.ppy.sh/

also if it might help this is the list installed from a working install:
loli@jigoku:~$ WINEPREFIX=~/.wine WINARCH=win32 winetricks list-installed
corefonts
dotnet20sp1
dotnet20
dotnet30sp1
dotnet35
dotnet40
dotnet45
gdiplus
gdiplus_winxp
msxml3
takao
vcrun2008
vcrun2010
:D I had successfully runs it. Just enable the hide version option from wine, and osu! allows me to update.



Seems like this option is only available though wine-staging.
Topic Starter
Franc[e]sco
just finished testing my setup on gentoo and it runs smoothly at an average of 0.39ms frame time (almost 3k fps). Will update the guide with gentoo-related stuff tomorrow
NoYzE
Thx for the guide. I somehow got it running in Debian but not very good. Some Pulse/Alsa problems first, then background and Skin problems. Now some other problems with latency. For some reason Debian has no low-latency or rt-kernel for newer releases, because they say it's in the kernel already or something like that. I hope to see some native love for linux with the upcoming .NET Core but knowing peppy i doubt it^^
Topic Starter
Franc[e]sco
btw I managed to get both pulse and osu running in realtime scheduling on gentoo, I'm kinda busy atm but I will eventually update the guide
NoYzE
Besides the osu rant about deleting background makes it aaaangry i got the issues fixed now. (Bad idea to use the same config you used with windows) I have to use alsa directly and set offset to excactly -30 though, but i get latency < 1ms.
Topic Starter
Franc[e]sco

NoYzE wrote:

Besides the osu rant about deleting background makes it aaaangry i got the issues fixed now. (Bad idea to use the same config you used with windows) I have to use alsa directly and set offset to excactly -30 though, but i get latency < 1ms.

the winealsa.drv patch should chip off at least 10ms off that -30, also I suggest setting that as the map's offset, not global offset because at least 15-20ms of it are keyboard input latency caused by wine, because the audio sounds spot-on. or at least that's my case.
wobbol
To all the Arch Linux people: trying to keep 32bit software to a minimum, package lib32-gnutls is nessary for cuttingedge to aquire a connection to the OSU! server.

#glxinfo is here
# pacman -S mesa-demos

##
### get a good alsa interface for wine here
##

#make sure you have multilib
# nano /etc/pacman.conf

#install wine-stageing (just happens to be avalable from multilib)
# pacman -Syu wine-staging

#quell naggboxes about no geko or mono being avalable (these packages are not used to my knoledge)
# pacman -S wine_gecko wine-mono

#winetricks
# pacman -S winetricks


#install 32 bit libs for alsa(probably need more for pulse)
# pacman -S lib32-alsa-lib lib32-alsa-plugins

#
##Test wine audio here
#

#osu! requires gnutls (will also quiet some errors when installing dotnet45)
# pacman -S lib32-gnutls

#
## install dotnet45 corefonts
## download and install osu!


If switching to cutting edge gives you some trouble try what MagicNAT did
I had successfully runs it. Just enable the hide version option from wine, and osu! allows me to update.



Seems like this option is only available though wine-staging.
P.S. Please forgive my formatting :o im dead.
Jerod212
Is it helping to hide the wine version? Because when I do that a lot of number just dissapear in osu, everything work fine and i'm able to play but i'm not sure if a notice a cursor lag or not (i'm using a bamboo tablet)
Espionage724
Hmm, is using a lowlatency kernel recommended nowadays? I've asked the question in other places, and the general consensus was that it was pretty pointless on general-use workstations unless you did work with mechanics and machinery that require low latency. Not sure if it helps osu! that much vs a standard kernel, but unless osu! is the only thing you're doing on that computer to not care, throughput will be lower.

From my understanding, modded kernels and even SteamOS that advertise the use of a lowlatency kernel have tweaks done to it to also make it worthwhile for general desktop usage.

For Ubuntu and Debian, I'd recommend XanMod kernel: http://xanmod.org/

Liquorix is also an alright choice for Ubuntu and Debian: http://liquorix.net/

For openSUSE, pontostroy's drm-next kernel is nice (not certain if it's actually latency-optimized or if it's just bleeding-edge): http://download.opensuse.org/repositori ... /drm-next/

For Arch, Gentoo, and anyone wanting to manually patch the kernel for whatever distro they use, pf-kernel also looks really interesting: https://pf.natalenko.name/


And two other notes for the guide; disabling mouse acceleration with xset can be problematic or just not work depending on the input library being used (pretty sure it doesn't work at all with libinput). There's an Arch wiki page somewhere with a few better methods. Also the PPA link for Wine Staging is outdated (the staging wiki has the new PPA; too lazy to copy/paste atm lol).
Topic Starter
Franc[e]sco
I'm using the ck kernel on gentoo, I dunno if it actually improves input lag / game performance but might as well use it.

Also thanks for the info on the ppa & mouse accel.
AGRX
is possible to apply any of these fixes on mac osx wine wrapper? performance is kinda weak...
Howl
As a tl;dr of what a fellow arch linux user previously said, you need to do some tweaks before starting osu!, otherwise it won't start.

To make HTTPS work, and thus make the connection to the update server work, you need to do the following (assuming you have the multilib repository set up):

sudo pacman -S samba lib32-gnutls

At least, that did it for me (running Antergos)
Topic Starter
Franc[e]sco

Howl wrote:

As a tl;dr of what a fellow arch linux user previously said, you need to do some tweaks before starting osu!, otherwise it won't start.

To make HTTPS work, and thus make the connection to the update server work, you need to do the following (assuming you have the multilib repository set up):

sudo pacman -S samba lib32-gnutls

At least, that did it for me (running Antergos)
with wine-staging it worked out of the box for me on gentoo, but I guess it depends on the distro and architecture
Howl

Franc[e]sco wrote:

with wine-staging it worked out of the box for me on gentoo, but I guess it depends on the distro and architecture

Probably had to specify it's more an Arch Linux thing, I guess :P Perhaps you installed the 32-bit version of gentoo, thus gnutls was already 32-bit?

Anyway, after setting up osu! for 2 straight hours, I can say it now works almost like a charm. The only problem left is the icons, but I guess I can live without them. I can't be bothered to dig deep to find out the source of the problem.
Splooshie

Jerod212 wrote:

Is it helping to hide the wine version? Because when I do that a lot of number just dissapear in osu, everything work fine and i'm able to play but i'm not sure if a notice a cursor lag or not (i'm using a bamboo tablet)
I had the same issue. I turned off the hide wine version option after updating osu and that fixed the numbers.
Topic Starter
Franc[e]sco

Howl wrote:

Franc[e]sco wrote:

with wine-staging it worked out of the box for me on gentoo, but I guess it depends on the distro and architecture
Probably had to specify it's more an Arch Linux thing, I guess :P Perhaps you installed the 32-bit version of gentoo, thus gnutls was already 32-bit?

Anyway, after setting up osu! for 2 straight hours, I can say it now works almost like a charm. The only problem left is the icons, but I guess I can live without them. I can't be bothered to dig deep to find out the source of the problem.
nah I'm on 64 bit but I think gentoo manages multiarch stuff a bit differently than arch so that's probably why
- MoonRider
thanks for the guide. works perfect on ubuntu 15.10!
I can already feel the difference.
AGRX
again, does anyone know if there are fixes that can lower latency on mac wine wrapper ? some winetricks or registry hacks ?... :(
Maybe i should give a linux a try because installing win on my machine is not possible at this moment.
Topic Starter
Franc[e]sco

Agrrox wrote:

again, does anyone know if there are fixes that can lower latency on mac wine wrapper ? some winetricks or registry hacks ?... :(
Maybe i should give a linux a try because installing win on my machine is not possible at this moment.
I don't own a mac, sorry. But you could try manually setting up wine instead of using the osx build, although it will probably end up performing the same.
n54
I'm having a problem on arch.
Sound works fine but osu cant connect, error is
fixme:ras:RasEnumConnectionsW RAS support is not implemented! Configure program to use LAN connection/winsock instead!
lib32-gnutls is installed.
The error occurs as soon as i install dotnet45 in my wineprefix. With dotnet20 it works, but then the only working osu version is the stable one.
Any ideas on that?
Espionage724

elektrobier wrote:

I'm having a problem on arch.
Sound works fine but osu cant connect, error is
fixme:ras:RasEnumConnectionsW RAS support is not implemented! Configure program to use LAN connection/winsock instead!
lib32-gnutls is installed.
The error occurs as soon as i install dotnet45 in my wineprefix. With dotnet20 it works, but then the only working osu version is the stable one.
Any ideas on that?
Try only dotnet40. Not sure if dotnet45 is actually needed, but I can play osu! fine with 40.
n54
Doesn't work either, same error.
ShadowSageMike
I just CAN NOT get the wine dlls [winealsa.drv] to compile! It always says nothing to do here. I even tried compiling wine itself and it never built the dang dll files... anyone else have any issues, and if you figured out how to get it working, could you please share? Running debian jessie, tried compiling in ubuntu 15.10. same issue.
SyrenE_old
I'd just like to add that my audio seemed by be lowered after doing this(I believe this happened when changing the audio configuration files). I was searching around and found that my master volume was at 34% when I used the command: alsamixer -c 0, so there I just increased the master volume back and everything was back to normal. Before looking here everything else I looked in was showing 100% volume(using KDE 5).

Also, I was experiencing stuttering/freezing when using XanMod kernel, does anyone else experience this?
Topic Starter
Franc[e]sco

ShadowSageMike wrote:

I just CAN NOT get the wine dlls [winealsa.drv] to compile! It always says nothing to do here. I even tried compiling wine itself and it never built the dang dll files... anyone else have any issues, and if you figured out how to get it working, could you please share? Running debian jessie, tried compiling in ubuntu 15.10. same issue.
sorry for the late reply, but have you tried the precompiled ones I provided? either way tweaking the .drv files will not boost latency all that much so I'd say it's not critical.

by the way, I just updated the guide to fix japanese, korean and chinese characters (thanks to Astar who messed around with it until he figured it out). you basically install gdiplus and cjkfonts and then set gdiplus to builtin then native in winecfg -> libraries and it works out of the box. if it doesn't, try switching between builtin and native for gdiplus in winecgf -> libraries.

Also I am still thinking about putting together a gentoo version of this guide (since I actually play osu on gentoo as my daily driver) but there's just so many tweaks that I've done that I can't remember them all.
Topic Starter
Franc[e]sco
Also I'd like to add that right now Stable (Latest) runs smoother than cuttingedge for me (which usually isn't the case). And since it has switched to the OpenGL only engine as well, you can just use it no problem on linux.
cmcooper123
How would i go about using a second sound card so i could switch between my two sound cards?
ShadowSageMike

Franc[e]sco wrote:

ShadowSageMike wrote:

I just CAN NOT get the wine dlls [winealsa.drv] to compile! It always says nothing to do here. I even tried compiling wine itself and it never built the dang dll files... anyone else have any issues, and if you figured out how to get it working, could you please share? Running debian jessie, tried compiling in ubuntu 15.10. same issue.
sorry for the late reply, but have you tried the precompiled ones I provided? either way tweaking the .drv files will not boost latency all that much so I'd say it's not critical.

by the way, I just updated the guide to fix japanese, korean and chinese characters (thanks to Astar who messed around with it until he figured it out). you basically install gdiplus and cjkfonts and then set gdiplus to builtin then native in winecfg -> libraries and it works out of the box. if it doesn't, try switching between builtin and native for gdiplus in winecgf -> libraries.

Also I am still thinking about putting together a gentoo version of this guide (since I actually play osu on gentoo as my daily driver) but there's just so many tweaks that I've done that I can't remember them all.
Pulseaudio seems to have a bit of input lag but its very very very small, but if I boot back into windows, its gone.

ALSA isn't an option for me, either.

PS: I disappeared from this thread because your precompiled ones worked, so thank you~!
cmcooper123
Never mind, i was having a problem that was unrelated to this guide
hetake2
Works fine on Arch.
Jerod212
Compatibility mode solved some latency issues for me.
Topic Starter
Franc[e]sco
I just messed around with schedtool (should be available on most distros) and managed to achieve better responsiveness and more consistent framerates by changing wineserver and osu priority like so:

sudo schedtool -F -p 15 -n -4 -a 0x5 $(pidof osu\!.exe)
sudo schedtool -F -p 20 -n 19 $(pidof /usr/bin/wineserver)

will add this to the guide eventually.

NOTE: 0x5 is for a i7-4790k, if you don't have hyperthreading or less than 4 cores you might need to adjust it to a valid core number

Also, moving the wine prefix to a SSD greatly helps in disk access speed, as wine seems to slow down disk access slightly which makes it horribly slow on my HDD
kamild_
That's a very comprehensive guide, thank you! On a side note, that just shows why Linux is far from being ready for gaming in general. Swapping kernels and video drivers, generally diving deep into the terminal just to get this game run as well as on Windows, where it's pretty much "install and play"...

Even though I'd like to try that. But I have a couple of questions before I get started:
  1. I actually forgot what kind of driver I have installed on my Kubuntu. "fglrxinfo" says "OpenGL version string: 4.5.13416 Compatibility Profile Context 15.302" so I guess it's fglrx (the fact that this command actually exists also seems to give that away...). At this point, what's the proper method of installing the driver from padoka's PPA?
  2. Once I do switch to padoka's mesa driver, is it safe to follow the "Simple installation" method for XanMod kernel?
EDIT: I almost forgot. My PC is running Kubuntu 15.10 x64. My CPU is Intel Core i5-3350P and GPU is Radeon R9 280X,
Espionage724

TheReduxPL wrote:

That's a very comprehensive guide, thank you! On a side note, that just shows why Linux is far from being ready for gaming in general. Swapping kernels and video drivers, generally diving deep into the terminal just to get this game run as well as on Windows, where it's pretty much "install and play"...

Even though I'd like to try that. But I have a couple of questions before I get started:
  1. I actually forgot what kind of driver I have installed on my Kubuntu. "fglrxinfo" says "OpenGL version string: 4.5.13416 Compatibility Profile Context 15.302" so I guess it's fglrx (the fact that this command actually exists also seems to give that away...). At this point, what's the proper method of installing the driver from padoka's PPA?
  2. Once I do switch to padoka's mesa driver, is it safe to follow the "Simple installation" method for XanMod kernel?
EDIT: I almost forgot. My PC is running Kubuntu 15.10 x64. My CPU is Intel Core i5-3350P and GPU is Radeon R9 280X,
It could depend on the hardware, but on both of my computers; a standard osu! install with default conditions (standard kernel, no messing with alsa or pulse, etc) works fine.

As for the other questions, yeah if fglrxinfo works, you have fglrx (but to be certain it's actually being used; run glxinfo | grep 'renderer' and it should show either fglrx/Catalyst, Gallium, or llvmpipe).

To use padoka's PPA, you'll want to fully remove Catalyst first. These instructions should work fine for that (should work on Ubuntu 15.10 and other versions even though it says Trusty). After that, you can add padoka's PPA, refresh software sources, and then dist-upgrade and reboot. Can use this command below (copy/paste into Terminal as a single line):

sudo add-apt-repository 'ppa:paulo-miguel-dias/mesa' -y && sudo apt-get update && sudo apt-get dist-upgrade && sync

As for XanMod; I just download the archive, extract it, and run sudo dpkg -i *.deb in the folder. I believe one of the packages are optional, but I don't really care :p (it was a headers package I think). After that, I also do a sudo apt-get autoremove && sudo update-grub to clean up any old Ubuntu kernel images (it'll keep the last/latest stock kernel though) and fix GRUB.
kamild_

Espionage724 wrote:

...
Thank you so much! I was also thinking if I need to mess with the kernel but after doing all the steps in this guide, I still don't feel like it's latency-free. Although the sound is very well synced now and mouse seems to work more reliably, there's still something wrong - in one of the songs I get ~97% accuracy when playing on Windows but on Linux something's still off and I could barely reach ~80%. I'd like to try messing with my drivers and a kernel in hope of getting this sorted out.

Also your glxinfo command shows "OpenGL renderer string: AMD Radeon R9 200 Series".
Espionage724

TheReduxPL wrote:

Espionage724 wrote:

...
Thank you so much! I was also thinking if I need to mess with the kernel but after doing all the steps in this guide, I still don't feel like it's latency-free. Although the sound is very well synced now and mouse seems to work more reliably, there's still something wrong - in one of the songs I get ~97% accuracy when playing on Windows but on Linux something's still off and I could barely reach ~80%. I'd like to try messing with my drivers and a kernel in hope of getting this sorted out.

Also your glxinfo command shows "OpenGL renderer string: AMD Radeon R9 200 Series".
One thing to try may be to disable compositing (I think Alt + F12 on KDE disables it on toggle), and another is to disable any kind of vsync with osu! (starting it with vblank_mode=0 accomplishes this).

I don't think performance itself is a problem, but here's a few things I do on my Ubuntu installs that may be of interest:

https://gitlab.com/Espionage724/Linux/b ... p.txt#L200
This enables some tweaks for radeon to boost performance. The way I do it there is global and may require a reboot, but you could also add the same R600_DEBUG= environment variable to osu!'s start command too to use it instantly (same way with vblank_mode=0).

https://gitlab.com/Espionage724/Linux/b ... p.txt#L215
This tells the kernel to be more strict on using RAM before the swap partition.

https://gitlab.com/Espionage724/Linux/b ... p.txt#L358
This tells Xorg to use modesetting instead of the radeon-specific graphics driver. This can be comparable to using AMDGPU and usually improves performance. An alternative (should this not work for some reason) can be found below.

https://gitlab.com/Espionage724/Linux/b ... p.txt#L429
This tells Xorg to use DRI3 with the radeon-specific driver. The default is DRI2. DRI3 usually improves performance. If AMDGPU is available to install on the system, you should probably use it instead of radeon (pretty sure the DRI3 option is the same; can check man amdgpu to be sure).

As for the renderer; maybe try glxinfo | grep 'Catalyst' (or change Catalyst to fglrx, Gallium, or llvmpipe). Whichever of those show something, that's likely what is being used.
show more
Please sign in to reply.

New reply