DISCLAIMER: This tutorial assumes that you have already successfully installed osu on Linux, this thread focuses on improving the performance as much as possible to get the best gaming experience.
Going through the how-to install osu on Linux thread made me realize that many people have some major performance issues, so I decided to share all the configuration modifications I made on my machine.
The Instructions here work on Debian based systems (like Ubuntu) and Arch Linux, but should also work for any other system.
1. The Basics (aka things you should have done already without me telling you because they're obvious duh)
->make sure your user is in the audio and video group by running the command
groupsif you are not already please add yourself to them (depending on your Distro the (recommended) command can differ, please just google it it's an simple task)
->install some proper graphics drivers it gives you an huge performance boost
=>for 64bit users please note that depending on your Distro you might have also to install the multilib GPU drivers (Ubuntu users should be fine I guess (never did looked it up though))
->install gdiplus in wine (not really for performance but I count it as essential)
->use an fast window manager like openbox or i3-wm (I use i3 because it's pretty awesome (no pun intended))
2. Save Stuff to do.
->*buntu users should install a lowlatency kernel to reduce latency (it is from the official repository so it should be save)
sudo apt-get install linux-lowlatency
->disable pulseaudio it just gives you additional audio output latency
=>edit the autospawn option in "~/.config/pulse/client.conf" (if it doesn't exist create it) so it looks like that:
# Disable autospawning the PulseAudio daemonevery time you want to run osu you can now disable pulseaudio (and re enable it afterwards) (run as normal user)
autospawn = no
#disable pulseaudio
pulseaudio -k
#enable pulseaudio
pulseaudio -D
->the next thing to do is to give alsa a higher priority
=>edit your "/etc/security/limits.conf" so it looks like that (for memlock use your amount of ram or "unlimited")
@audio - rtprio 99
@audio - memlock 512000
@audio - nice -19
->according to this (which I found through the Sound FAQ of the official WineHQ page) alsa can adjust to jackd2's buffer size by using a bridge, that means it is possible to get a audio latency of a few milliseconds.
=>Doing it the hard way would be to follow the guide mentioned above.
=>Or you could just use some tools that were created by the same guy installation instructions
==>You only need the Cadence package the rest is only interesting for musicians.
==>Arch users find links to the AUR in the Software>Applications tab on the site
==>you will have to modprobe snd-aloop to make it work but this will be covered later in the tut
==>the actual minimal latency depends on your audio card (for me it's 128 -> 2.7ms (but you should start with 1024 or 512))
->many of you have some fancy graphic tablets which are some pretty good and fast input devices, only problem is that your system doesn't use them with the maximum refresh rate so lets fix that (that also counts for your mouse)
=>edit your "/etc/modprobe.d/modprobe.conf" 2=500HZ=2ms latency (you can also use 1 but normally 2 should be more than enough)
options usbhid mousepoll=2=>if you use an USB Audio Card like I do also add:
options snd-usb-audio nrpacks=1=>to enable this option (should be enabled by default, but just to make sure) edit "modules-load.d/whatevernameyouwant.conf" (you only need the second line if you enabled the snd-usb-audio option in the previous step and the snd-aloop if you want to use the alsa-jack bridge)
usbhid
snd-usb-audio
snd-aloop
this is it for the save stuff.
3. Advanced Modifications (these options are advanced changes that can potentially break your system (only if you are doing something wrong) or make it hang up together with osu (hasn't happened to me yet), it is advised that you know what you are doing or can at least pretend to know )
These options are also only tested on Arch Linux (means that all commands and configuration locations used in here are the Arch standard ones) but should mostly apply to all the other systems.
->if you want to increase the r/w speed of your hdd/ssd edit your "/etc/fstab" (for more info on the applied options read the manpage of mount) that can potentially reduce ingame lag caused by your hd/ssd
commit=60 noatime
->for the following steps you might want to optimize your compiler flags first
->there are some custom wine builds out there, I tried out the wine-csmt and the wine-rt package.
I found the wine-rt package to be the most satisfying one.
Just install it like any other AUR package, you might have to create a new wine prefix for osu (or at least use wineboot to update your current one)
=>to use the new advantages of your wine-rt put the following in front of your osu start command
env WINE_RT=15 WINE_SRV_RT=10
->everyone is always talking about how great lowlatency and rt kernel's are (well yes they are great) but they are nothing compared to the -ck patched kernel it really gave my in and output a big boost
you can get it here or if you are using fbdecondecor for your splashscreen here
you also should read the Arch Wiki entry, I recommend enabling the BFQ and there are a few other settings you might want to change.
->increase the priority level of osu(so that osu can actually use all the latency improvements to the fullest and minimize random framedrops):
=>edit "/etc/security/limits.d/91-nice.conf"
username - nice -4=>add the following in front of your osu start command (if you enabled BFQ in the last step you only use the nice command without the ionice)
ionice -c2 nice -n -4
4. Is this it?
Well yes at least for now I might give you an update with more stuff in a few weeks.
I'm currently experimenting with wine-asio, driconf, general GPU driver configuration and some other small stuff like better CPU on demand scaling. (I don't like to have my CPU running on an high frequency all the time so I haven't covered CPU scaling here yet (I'm not sure if I even need it with the -ck kernel))
For all the people who are wondering if there is actually any practical room for more improvements let me tell you this:
I can get a Audio latency of 0.7ms (with xruns from time to time)/1.3ms(without xruns) by using mplayer+.opus file(opus itself has an minimal latency of 5ms so I'm talking about the actual server latency that is possible with the setup) hooked up directly to jack, and that's just for audio (this is also my ultimate goal for the latency of osu)
Think I forgot something? Then please let me know!
I'm always happy about feedback.
#This is the don't be an lazy idiot and give the source of information part and is to give some credit to the people that deserve it (also so you can read up on all the stuff I posted above)
alsa-tuning
linuxaudio-latency guide
Mouse Polling Rate
linux-ck
reduce-buffer-size
wine measure latency