forum

Improving the Performance of osu! on Linux.

posted
Total Posts
4
Topic Starter
Theblackdog_old

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
groups
if 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 daemon
autospawn = no
every time you want to run osu you can now disable pulseaudio (and re enable it afterwards) (run as normal user)
#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
Hamdium
Thanks @TheBlackDog for your youtube guide https://www.youtube.com/watch?v=kyadBkUXRUA
It worked pretty well for me, except that I didn't understood pretty well how to create a launcher (I'm a linux noob).


The only problem I have is that I play with mouse, and I would like to adjust the sensibility, but I don't know how to adjust it to be just like what I used in windows.
On windows I had disabled the mouse acceleration, with "raw mouse input" on osu settings, with a razer deathadder that was set at 1200 dpi on the razer synapse.

However, I haven't found Razer Synapse for Ubuntu 14.04, and the pointer speed options in the mouse settings for ubuntu aren't very helpful for me.
Espionage724
- You can disable PulseAudio on a per-app basis instead of doing it system-wide. You can use the pasuspender command for that (just throw it in the command before wine; and/or also configure wine to just use ALSA instead of Pulse.

- Ideally, for kernels, I'd recommend grabbing the latest (you're comfortable with; ideally I'd go with the latest stable) from http://kernel.ubuntu.com/~kernel-ppa/mainline/ (for Ubuntu and variants). A generic and lowlatency kernel is provided. The general rule is that lowlatency helps lower input latency as far as possible, but the generic kernel helps overall throughput (performance).
Topic Starter
Theblackdog_old

Hamdium wrote:

Thanks @TheBlackDog for your youtube guide https://www.youtube.com/watch?v=kyadBkUXRUA
It worked pretty well for me, except that I didn't understood pretty well how to create a launcher (I'm a linux noob).

The only problem I have is that I play with mouse, and I would like to adjust the sensibility, but I don't know how to adjust it to be just like what I used in windows.
On windows I had disabled the mouse acceleration, with "raw mouse input" on osu settings, with a razer deathadder that was set at 1200 dpi on the razer synapse.

However, I haven't found Razer Synapse for Ubuntu 14.04, and the pointer speed options in the mouse settings for ubuntu aren't very helpful for me.
For the launcher i'ts actually pretty easy all your user programs are found in "/usr/bin/" so if you create a file with the command that you normally use for launching osu you can just start it like any other program, please note that this only works like setting an alas (but system wide), it works with desktops like i3.
In case you want to find it in the application list of your DE you might want to follow this tutorial (haven't tried it out myself but should work).

As for the mouse acceleration I never had one of these but I found this program and it's GitHub page.
I don't know if it's worth looking into but I hope it helps~



Espionage724 wrote:

- You can disable PulseAudio on a per-app basis instead of doing it system-wide. You can use the pasuspender command for that (just throw it in the command before wine; and/or also configure wine to just use ALSA instead of Pulse.

- Ideally, for kernels, I'd recommend grabbing the latest (you're comfortable with; ideally I'd go with the latest stable) from http://kernel.ubuntu.com/~kernel-ppa/mainline/ (for Ubuntu and variants). A generic and lowlatency kernel is provided. The general rule is that lowlatency helps lower input latency as far as possible, but the generic kernel helps overall throughput (performance).
That's pretty neat definitely will try that out.
The thing with the kernel is that the -ck kernel has an incredibly low latency and a much faster development cycle, also gives a much better process scheduling. (can build it with the generic module setup or an minimal one (which I currently prefer)), before I tried it out, lowlatency and -rt was alway's the best option available, well I like -ck a lot more.
Please sign in to reply.

New reply