this has been rewritten yet again as most workarounds aren't required anymore since wine 3+
example video of the final result: https://www.youtube.com/watch?v=zkqzQoeOGfU
with touchscreen: https://www.youtube.com/watch?v=GcIrlorWmaQ
performance is indistinguishable from windows. there might be a very slight ~25ms sound latency which is easily compensated with +25 local offset
tested on
- gentoo, wine-3.5, radeon, dwm
- arch, wine 3.5-1, nvidia proprietary drivers, gnome (thanks @_goeo for testing and helping out)
at the bottom of this guide you can find a bunch of extra tips about video drivers and other system tweaks which can help a lot in certain systems, make sure to read them if you have time
some cutting-edge distros run wayland by default. it's recommended that you log into xorg instead (most DE-s have an option at login to select X as your session). wayland is untested and will likely have a performance hit on osu as wine doesn't support it and needs to run though a xorg compatibility layer
install the newest wine version you can find for your distro, 3+ is recommended. if you're stuck with old 2.x versions you might wanna try 1.8 or 1.9 if you can get them
- ubuntu: sudo dpkg --add-architecture i386 wget -nc https://dl.winehq.org/wine-builds/Release.key sudo apt-key add Release.key sudo apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/
- arch:
pacman -Sy wine
. you can also try wine-staging for extra gaming features if you play other games but as far as I know development has stopped. - gentoo:
sudo emerge --ask =app-emulation/wine-vanilla-9999
if you have any problems installing wine, see the extras for useful links with more info
install winetricks
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x winetricks
sudo mv -v winetricks /usr/local/bin
create a new wine prefix and install .NET 4.6.2, gdiplus and japanese font aliases:
WINEPREFIX=~/osu-wine WINEARCH=win32 winetricks -q dotnet462 cjkfonts gdiplus
run winecfg
WINEPREFIX=~/osu-wine WINEARCH=win32 winecfg
navigate to graphics and ensure that "allow the window manager to decorate the windows" and "allow the window manager to control the windows" are enabled. this can allow native fullscreen to work which can help performance on bloated desktop environments like gnome
optional: fixing japanese fonts
as discovered by _goeo, it's possible to fix both the top right icons in the main menu and japanese fonts by copying fonts from a windows install or iso.
to extract japanese fonts from the Windows 10 iso:
download the iso from here https://www.microsoft.com/en-us/software-download/windows10ISO
install 7z
-
ubuntu:
sudo apt install p7zip
-
arch:
sudo pacman -Sy p7zip
-
gentoo:
sudo emerge --ask app-arch/p7zip
cd ~/Downloads 7z e Win10_*.iso sources/install.wim 7z x install.wim 1/Windows/Fonts sudo cp -r 1/Windows/Fonts /usr/share/fonts/WindowsFonts sudo chmod -R 755 /usr/share/fonts/WindowsFonts sudo fc-cache -f
fix wonky font hinting:
WINEPREFIX=~/osu-wine WINEARCH=win32 winetricks settings fontsmooth=rgb
see https://wiki.archlinux.org/index.php/Microsoft_fonts#Extracting_fonts_from_a_Windows_ISO for more info
you can also just copy your fonts folder from a windows install and install it in the same way
set wine audio driver to alsa to reduce latency (works even if you use pulseaudio)
WINEPREFIX=~/osu-wine WINEARCH=win32 winetricks sound=alsa
registry dsound tweak to further minimize sound latency
cat > dsound.reg << "EOF"
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Wine\DirectSound]
"HelBuflen"="512"
"SndQueueMax"="3"
EOF
WINEPREFIX=~/osu-wine WINEARCH=win32 wine regedit dsound.reg
download the osu installer https://m1.ppy.sh/r/osu!install.exe
run it:
WINEPREFIX=~/osu-wine WINEARCH=win32 wine ~/Downloads/osu\!install.exe
the updater should say that it's installing in C:\Users\youruser\Local Settings\Application Data\osu!
if it's not, you better take note of where it's installing or click to change the location
if the updater gets stuck in a loop at the discord-rpc dll see section troubleshooting
osu will start up and start downloading the bundled beatmaps, let it finish, set it up however you like and check how it feels
don't worry if it's stuck with vsync, we will disable it with our launcher script. also see extras for more info on vsync tweaks
if you're on a fancy desktop environment with a compositor and effects, you might want to run in fullscreen (which should be the default). this will potentially bypass the compositor.
if you use multiple monitors and/or fullscreen isn't working well, you are forced to use window or borderless windowed. since window mode can suffer all kinds of performance issues because of desktop environments and their compositors, I recommend turning off your compositor or not using one at all. if you keep having poor performance or input lag, try a lightweight window manager like openbox, dwm, jwm, i3, or a de with no compositor like lxde
if you use a tiling window manager like dwm, fullscreen might not play well with it (freezes when you switch workspaces on dwm), so disable fullscreen which will make the game borderless fullscreen (unless you change resolution)
create a shortcut to your osu folder:
ln -sv osu-wine/drive_c/users/loli/Local\ Settings/Application\ Data/osu\! ~/osufolder
create a script to start osu:
cat > osu << "EOF"
#!/bin/sh
export vblank_mode=0
export WINEARCH=win32
export WINEPREFIX=$HOME/osu-wine
wine ~/osufolder/osu\!.exe "$@"
EOF
sudo mv osu /usr/bin/
sudo chmod +x /usr/bin/osu
create a script to kill osu and shutdown wine. this is useful when osu freezes or doesn't seem to start
cat > osukill << "EOF"
#!/bin/sh
export vblank_mode=0
export WINEARCH=win32
export WINEPREFIX=$HOME/osu-wine
wineserver -k
EOF
sudo mv osukill /usr/bin/
sudo chmod +x /usr/bin/osukill
you can now run osu
in a terminal or launcher to start osu and osukill
to force-kill it
and of course you can access your osu folder to drop in skins and whatnot at ~/osufolder
if you're a more gui oriented person, you can create a desktop shortcut like so (replace loli with your username):
wget http://w.ppy.sh/c/c9/Logo.png -O ~/osulogo.png
cat > ~/Desktop/osu\!.desktop << "EOF"
[Desktop Entry]
Encoding=UTF-8
Name=osu!
Comment=Weeb circle clicking game
Type=Application
Exec=osu %F
Icon=/home/loli/osulogo.png
StartupWMClass=osu!.exe
Categories=
EOF
chmod +x ~/Desktop/osu\!.desktop
remember to read your or other distro's wiki (I recommend arch and gentoo wikis) to find potentially known solutions to your problems
here's some useful resources:
- https://wiki.archlinux.org/index.php/wine
- https://wiki.winehq.org/Ubuntu
- https://wiki.archlinux.org/index.php/NVIDIA
- https://wiki.archlinux.org/index.php/ATI
- https://wiki.archlinux.org/index.php/intel_graphics
- https://wiki.gentoo.org/wiki/NVidia/nvidia-drivers
- https://wiki.gentoo.org/wiki/Radeon
- https://wiki.gentoo.org/wiki/Intel
- https://help.ubuntu.com/community/RadeonDriver
- https://help.ubuntu.com/community/AMDGPU-Driver
- https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia
- https://wiki.debian.org/NvidiaGraphicsDrivers
- https://wiki.debian.org/AtiHowTo
- https://wiki.archlinux.org/index.php/Touchscreen
- https://wiki.archlinux.org/index.php/Wacom_tablet
- https://www.if-not-true-then-false.com/2015/fedora-nvidia-guide/
- https://ibcomputing.com/how-to-install-wine-3-linux/#Install_Wine_3_in_Ubuntu_1804_or_Earlier
limit your fps.
while the game is not running, open your osu!.user.cfg, and set the CustomFrameLimit to the highest fps your computer can handle stably. Note that osu! normally shows how many milliseconds it takes to render a frame instead of the fps in the "fps counter", so the math is fps = 1000/(how many milliseconds it takes to render one frame)
arch linux users have reported seeing red X'es on the osu installer / launcher. this seems to be caused by a broken or missing 32-bit libpng. try installing libpng (both the 32bit and 64bit versions) like so (this command is for arch, but the fix applies to all distros where this happens):
pacman -Sy lib32-libpng libpng
if it still doesn't work, check what version of libpng you have by doing
ls /usr/lib | grep libpng
then symlink it to libpng12.so.0 (replace libpng16.so with whatever version you have)
sudo ln /usr/lib/libpng16.so /usr/lib/libpng12.so.0
sudo ln /usr/lib32/libpng16.so /usr/lib32/libpng12.so.0
note that the lib32 part is only required if you are on a 64-bit system.
osu! updater stuck in a loop or stuck at discord dll get the discord-rpc dll from a working osu install or download it from here http://hnng.moe/f/Zzq and place it into your osu folder
I started osu but nothing pops up and it's hogging cpu this happens very rarely, the solution is to kill osu completely and restart it by running the osukill script created in the guide
if the game's framerate is still limited and you are on a radeon GPU, you can try the following which disables vsync on some old radeon GPUs:
sudo mkdir -v /etc/X11/xorg.conf.d
cat > tmp.conf << "EOF"
Section "Device"
Identifier "Radeon"
Driver "radeon"
Option "SwapbuffersWait" "off"
EndSection
EOF
sudo mv tmp.conf /etc/X11/xorg.conf.d/10-radeon.conf
and reboot or restart xorg (change "radeon" to "amdgpu" if you're using the amdgpu driver).
if you are on nvidia, check the proprietary driver's control panel and make sure there is no vsync anywhere enabled. if it's still limited, doublecheck your in-game frame limiter from the options.
again, you can check your distro's wiki for more driver and distro specific tweaks
you can disable mouse acceleration by running
xset m 0 0
to check that acceleration is disabled, you can run:
xset q | grep -A 1 Pointer
which will output
Pointer Control:
acceleration: 0/1 threshold: 0
if you have a barebones xorg setup you can easily add the command to your .xinitrc or other init scripts.
on distros like ubuntu/mint you can open "Startup Applications", click Add -> custom command and set it up like so:
you can adjust the mouse polling rate like so:
echo "options usbhid mousepoll=1" | sudo tee /etc/modprobe.d/usbhid.conf
where 1 is the interval in milliseconds, meaning that 1 is 1000Hz, 2 is 500Hz and so on.
you must either reboot or "sudo rmmod usbhid && sudo modprobe usbhid" to apply changes, and if the command fails you will have no keyboard or mouse control until you reboot.
I don't recommend changing this unless you feel a clear latency or choppyness in your mouse movements, as it can increase cpu usage in xorg and firefox.
if for some reason your huion isn't recognized or isn't working as a tablet, you can get the amazing digimend drivers:
- arch aur https://aur.archlinux.org/packages/digimend-kernel-drivers-dkms-git/
- manually https://github.com/DIGImend/digimend-kernel-drivers#installing
however, many distros already come with them
if you have multiple monitors and the tablet is mapped to the wrong one, you can re-map it, otherwise just skip to xinput_calibrator.
list your monitors using xrandr:
xrandr
for me it shows two monitors named DVI-0 and DVI-1:
Screen 0: minimum 320 x 200, current 3286 x 1080, maximum 16384 x 16384
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
DVI-0 connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
...
DVI-1 connected primary 1920x1080+1366+0 (normal left inverted right x axis y axis) 531mm x 299mm
1920x1080 60.00 + 144.00* 119.98 99.93 84.90 59.94
...
in my case, DVI-1 is my main 144Hz monitor.
run xinput in a terminal to see the list of your input devices, mine is:
...
⎜ ↳ ELAN Touchscreen id=10 [slave pointer (2)]
⎜ ↳ HUION 420 Pen id=11 [slave pointer (2)]
⎜ ↳ HUION 420 Mouse id=12 [slave pointer (2)]
⎜ ↳ HUION 420 Consumer Control id=14 [slave pointer (2)]
⎜ ↳ SteelSeries Kana Gaming Mouse id=16 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
...
↳ HUION 420 Keyboard id=13 [slave keyboard (3)]
↳ HUION 420 System Control id=15 [slave keyboard (3)]
in my case, "HUION 420 Pen" is my device name.
you can now map your tablet to your desired monitor like so (remember to use your own device name and monitor name):
xinput map-to-output "HUION 420 Pen" DVI-1
you can set this command to run at startup as explained in mouse acceleration.
if you wish to change your tablet's area (I don't), install xinput_calibrator if it's not already:
- ubuntu, debian and other derivates
sudo apt install xinput-calibrator
- arch aur: https://aur.archlinux.org/packages/xinput_calibrator-git/
- gentoo
sudo emerge --ask x11-apps/xinput_calibrator
apt install xinput-calibrator
now list your devices to find out your tablet's id and name:
xinput_calibrator --list
this is what it outputs for me:
Device "ELAN Touchscreen" id=10
Device "HUION 420 Pen" id=11
sometimes there will be two huion devices for 1 tablet, just pick the first one.
you can now run xinput_calibrator with your tablet's name (id also works). don't do anything, just let it run to get the default area values in case you lose them.
xinput_calibrator --device "HUION 420 Pen"
Calibrating EVDEV driver for "HUION 420 Pen" id=11
current calibration values (from XInput): min_x=0, max_x=8340 and min_y=0, max_y=4680
in my case, the default area is 0 8340 0 4680.
you can now set the area values using your device's name (replace the values with your desired values, see below on how to calculate them):
xinput set-prop "HUION 420 Pen" "Evdev Axis Calibration" 0 8340 0 4680
you can set this command to run at startup as explained in mouse acceleration.
same configuration as huion tablets. my Asus VT168N is supported out of the box and shows up as "ELAN Touchscreen". all you have to do is use map-to-output as explained in the huion section and map it to itself.
this is really simple maths and logic. Just read through the examples and you will get it.
let's say I wanted an area half the size of the full area in the top left corner with the same aspect ratio as the default area.
in my case, the default area is 0 8340 0 4680.
8340 / 4680 = 1.78205128205
BottomX = 8340 / 2 = 4170
BottomY = 4170 / 1.78205128205 = 2340
The new area is 0 4170 0 2340.
Let's say I wanted to center this area.
TopX = (8340 - 4170) / 2 = 2085
TopY = (4680 - 2340) / 2 = 1170
BottomX = 4170 + 2085 = 6255
BottomY = 2340 + 1170 = 3510
The new area is 2085 6255 1170 3510.
Let's say I wanted this area in the bottom right corner.
TopX = 8340 - 4170 = 4170
TopY = 4680 - 2340 = 2340
BottomX = 4170 + 4170 = 8340
BottomY = 2340 + 2340 = 4680
The new area is 4170 8340 2340 4680.
if you want to achieve the same effect as "forced proportions" you can calculate the aspect ratio of your monitor and use that instead of 1.78205128205 in the above calculations. The aspect ratio for 16:9, for example, is simply 16/9 = 1.77777777778.
input-wacom has great support for wacom tablets
- arch:
sudo pacman -S xf86-input-wacom
- ubuntu:
sudo apt install xserver-xorg-input-wacom
- gentoo:
sudo emerge --ask x11-drivers/xf86-input-wacom
see "mapping wacom tablets to a subregion of the screen" to adjust the area
these 2 settings control smoothing of the cursor movement
xsetwacom set "device name" Suppress 2
xsetwacom set "device name" RawSample 4
you can get your device name with
xsetwacom --list devices
Suppress makes the cursor position update only for bigger changes, which can stabilize it but can also introduce unresponsiveness. it's recommended to keep this low, range is 1-100
RawSample is how many position samples are interpolated together. this smooths cursor movement and stabilizes it, but also creates input latency. it's recommended to keep this low. range is 1-20
see http://linuxwacom.sourceforge.net/wiki/index.php/Tablet_Configuration for more info
(discovered by @_goeo)
if you use a wacom tablet and you do not drag, you may notice that you go out of your tablet's range much easier than on windows. this is because of a tablet feature where it has two different states of being in proximity, and in range, in which the pen is still close enough that the tablet detects it but not as close as "in proximity". the current linux wacom drivers completely ignore this second state, and only update your pen's location if it's in proximity. but the maintainer of the linuxwacom project has done some work on it (i'm not sure if they're planning to merge it (perhaps as a setting) to the main driver), and this branch is the fixed driver where you can lift your pen as high as you could on windows.
https://github.com/jigpu/input-wacom/tree/bamboo-inrange
you will have to manually install it.
uninstall any older version of input-wacom just to be sure
first of all, get the prerequisites:
- debian, ubuntu, mint:
sudo apt-get install linux-headers-$(uname -r) build-essential
- rhel, centos, fedora:
sudo yum install gcc "kernel-devel-uname-r == $(uname -r)"
- arch:
sudo pacman -Syy
sudo pacman -S linux
sudo reboot
after the reboot
sudo pacman -S linux-headers
- open SUSE 11.4:
sudo zypper install kernel-devel
sudo zypper install --type pattern devel_basis
cd
git clone --branch bamboo-inrange --depth 1 https://github.com/jigpu/input-wacom
cd input-wacom
if test -x ./autogen.sh; then ./autogen.sh; else ./configure; fi && make && sudo make install || echo "Build Failed"
reboot and enjoy your drivers
see https://github.com/linuxwacom/input-wacom/wiki/Installing-input-wacom-from-source for more info
see the calculations in the huion section if you need to decide an area from scratch.
xsetwacom allows more advanced area configuration on wacom tablets. you can map your tablet's area to a specific region of the screen instead of an entire monitor.
xsetwacom --set <device id> MapToOutput <width>x<height>+<x>+<y>
you can get your device id with
xsetwacom --list devices
here's some examples:
full screen:
xsetwacom --set 15 MapToOutput 1920x1080+0+0
full screen, right monitor of a dual monitor setup with 2 1920x1080 screens:
xsetwacom --set 15 MapToOutput 1920x1080+1920+0
800x600 rectangle in the top left:
xsetwacom --set 15 MapToOutput 800x600+0+0
how to calculate XY to center the area:
x = (monitor width - area width) / 2
y = (monitor height - area height) / 2
note that the xy coordinates are across all screens, so for example if you have a 1024x768 monitor on the left and you want your area on the right monitor you must add 1024 to x.
- ubuntu:
sudo add-apt-repository ppa:obsproject/obs-studio
sudo apt-get update && sudo apt-get install obs-studio
- arch:
sudo pacman -Sy obs-studio
- gentoo:
sudo emerge --ask media-video/obs-studio
once that's done, just run OBS and set it up like you would on windows. I am using a PS3eye as a handcam which is supported out of the box on linux.
if window capture gives you a black screen, scroll down in the settings and tick "use alpha-less texture format".
if you compiled your kernel from scratch (for example on gentoo) and you want to use the ps3eye, the required kernel modules are:
CONFIG_VIDEO_V4L2=y
CONFIG_USB_GSPCA_OV534=y
CONFIG_USB_GSPCA_OV534_9=y
you can set these in /usr/src/linux/.config and recompile, or search from them in make menuconfig.
remember to reboot.
on a pure ALSA system you need to manually add an ALSA audio capture device in your scene with the correct device.
here's my ~/.asoundrc with loopback audio set up correctly for recording (you need to have the alsa loopback device enabled in your kernel)
https://github.com/Francesco149/loli-overlay/blob/master/sys-config/loli/files/asound.conf
adjust it to your devices if you're gonna copy it. and then in OBS you would select the loopback PCM as the device
a pure alsa setup can achieve lower latency than pulseaudio. here's my ~/.asoundrc for reference
https://github.com/Francesco149/loli-overlay/blob/master/sys-config/loli/files/asound.conf
adjust it to your devices. you should tweak the buffer sizes to the limits of your hardware by trial and error.
more info: https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture https://wiki.gentoo.org/wiki/ALSA
if you don't want to remove pulseaudio you can always use pasuspender to temporarily stop pulseaudio while playing osu:
pasuspender -- osu
for amd, the radeon open-source drivers are recommended. if you're feeling adventurous, you can try amdgpu. it has better vulkan support and better support for newer GPU's. it might have a performance hit on specific models though.
for nvidia, it's recommended to use the proprietary nvidia drivers.
for intel integrated graphics, the open-source drivers that ship with the kernel should be fine
if you have ubuntu, it's likely that the drivers installed by default will just work
to check that your driver is properly accelerating graphics, open a shell and run:
glxinfo | grep render
You should get something like (the important part being the first line):
direct rendering: Yes
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: Gallium 0.4 on AMD PITCAIRN (DRM 2.43.0, LLVM 3.8.0)
GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth,
GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_packed_depth_stencil,
GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth,
GL_NV_blend_square, GL_NV_conditional_render, GL_NV_depth_clamp,
GL_OES_element_index_uint, GL_OES_fbo_render_mipmap,
another thing you can use to test is
vblank_mode=0 glxgears
which after a couple seconds should be outputting pretty high fps values (over 14'000 for me).
always check with your distro's wiki on how to install drivers as steps might be slightly different:
- https://wiki.archlinux.org/index.php/NVIDIA
- https://wiki.archlinux.org/index.php/ATI
- https://wiki.archlinux.org/index.php/intel_graphics
- https://wiki.gentoo.org/wiki/NVidia/nvidia-drivers
- https://wiki.gentoo.org/wiki/Radeon
- https://wiki.gentoo.org/wiki/Intel
- https://help.ubuntu.com/community/RadeonDriver
- https://help.ubuntu.com/community/AMDGPU-Driver
- https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia
- https://www.if-not-true-then-false.com/2015/fedora-nvidia-guide/
- https://wiki.debian.org/NvidiaGraphicsDrivers
- https://wiki.debian.org/AtiHowTo
- http://linuxwacom.sourceforge.net/wiki/index.php/Tablet_Configuration
- https://wiki.archlinux.org/index.php/Wacom_tablet
if you have a 144hz monitor or any monitor that isn't 60Hz you will want to take advantage of that.
run this:
xrandr --output DVI-1 --mode 1920x1080 --rate 144
replace 1920x1080 with your resolution, 144 with your refresh rate and DVI-1 with your monitor's name from the xml file (or you can run xrandr to find out your monitor's name on other distros):
if xrandr is not installed, your package manager will have it for sure, so install it.
you can put this into your ~/.xinitrc to run it on startup
for ubuntu and mint you might also need to edit monitors.xml. open a terminal an run the following
nano ~/.config/monitors.xml
then identify the monitor on which you want to change the refreshrate (in my case DVI-1) and change the number in
<rate>60</rate>
to your desired refresh rate, then press CTRL+O to save, press enter to confirm and press CTRL+X to exit.
this will take effect after a reboot. you can also immediately change the refresh rate using the xrandr command above
my vg248qe monitor support lightboost, which greatly reduces the amount of motion blur and pixel ghosting for fast moving objects. you can enable it with the following commands (only tested on the vg248qe, other monitors might have different modelines):
xrandr --newmode "1920x1080_120lb" 286.7 1920 1968 2000 2080 1080 1083 1088 1149 +HSync -VSync
xrandr --addmode DVI-1 1920x1080_120lb
xrandr --output DVI-1 --mode 1920x1080_120lb
where DVI-1 is your monitor's name (see "refresh rate" above to get your monitor's name).
Osu! crashes when it auto-updates(for me at least). The way I fixed it (Fedora 33) is just to download osu!install.exe again and run
WINEPREFIX=~/osu-wine WINEARCH=win32 wine ~/Downloads/osu\!install.exe
again, and then the game starts up just fine.