Difference between revisions of "Smooth Quake in Linux"

From QWiki
Line 71: Line 71:
  
 
Warning: Higher polling rates will increase CPU usage.
 
Warning: Higher polling rates will increase CPU usage.
 +
 +
'''Mouse related tools'''
 +
 +
* evhz:  https://gitlab.com/iankelling/evhz
 +
 +
* Ubuntu enable buttons howto: https://help.ubuntu.com/community/ManyButtonsMouseHowto
  
 
==Screen==
 
==Screen==

Revision as of 19:14, 22 April 2019

General

WARNING: Page recently updated and not fully vetted, please consider talking to client developers before doing advanced changes to your system !!!

This page contains solutions and tips for various tearing, lagging, jerky and sucky Quake configurations, on Linux.

  • If you have low fps, try installing proprietary video drivers and disabling compositing (see compositing section below).
  • For minimal tearing set your framerate cap (cl_maxfps) above 1000, and for absolute minimum tearing set to a multiple of your refresh rate (e.g. 1001).
  • Some clients run much better than others under linux. Make sure you try ezQuake, fodQuake and FTE.

Mouse

Change mouse hz to 500/1000

Note: The usb polling rate will automatically be as high as possible on most modern usb controllers (ehci/xhci/etc) in recent linux kernels. It is still worth checking that it is actually running at the desired polling rate as some bios settings can prohibit the polling rate from going above a certain level and may need to be changed.

First and foremost check what your current rate is, it may very well already be at 500/1000 (depending on your mouse and usb controller limits):

Download and compile evhz:

git clone https://gitlab.com/iankelling/evhz.git
cd evhz
gcc evhz.c -o evhz

Run evhz and move mouse around, see that polling rate reaches desired/expected rate:

sudo ./evhz

Example output (500Hz mouse):

...
A..... G3: Latest   500Hz, Average   488Hz
...

If your mouse is not polling as fast as it should be, try forcing a polling rate in the usbhid module. To check current polling rate setting in usbhid, type in console:

cat /sys/module/usbhid/parameters/mousepoll

Using console, open /etc/modules in editor with admin rights:

sudo gedit /etc/modules

Add this two lines at the end:

-r usbhid
usbhid mousepoll=x

value "x" can be:

1 = 1000Hz 2 = 500Hz 4 = 250Hz 8 = 125Hz 10 = 100Hz (Default)

for example, to change polling rate to 500Hz, end lines in /etc/modules schould be:

-r usbhid
usbhid mousepoll=2

To test immediately without rebooting, type the following as a single command (otherwise you'll lose input on any usb devices you might have):

sudo rmmod usbhid;sudo modprobe usbhid mousepoll=2

Now run evhz again, if you are still not seeing the polling rate you're expecting it very well may be a bios setting. If you have any usb legacy or compatibility modes in your bios, disable them, this should fix the issue. Warning: disabling usb legacy/compatibility support in your bios may render your usb keyboard/mouse non-functional in grub, do not be alarmed if you cannot navigate the grub menu in this mode. It will still be usable before grub (eg bios) and after the linux kernel has loaded.

Warning: Higher polling rates will increase CPU usage.

Mouse related tools

Screen

Users have reported that running a second x server can give a more responsive quake LINK
Excerpt/Conclusion from the above link:

  • To run your engine in a second X server (which might help on various occasions) on virtual terminal 12 (you could switch between regular X and 2nd one by pressing ctl+alt+f7 and ctr+alt+f12):

xinit /path/to/your/executable_or_script -- :1 vt12

  • If you want you can also create a new xorg.conf for this new X server and specify it via attaching "-config xorg_qw.conf" in the command line.

xinit /path/to/your/executable_or_script -- :1 -config xorg_qw.conf

  • You can also simply type xinit -- :1 to get an console where you then start the game.

Sound

ezQuake 2.1 new soundcode:
ezQuake 2.1 has new soundcode for ALSA/OSS/Pulseaudio ported from FodQuake. This will allow you to have other sound sources than only ezQuake.

  • Choose sound driver with s_driver alsa/oss/pulse
  • If you are running on a system without pulseaudio and got problems with new ALSA code, you can first try setting s_alsa_noworkaround 1 and do s_restart.
  • If that doesn't help, you can switch to the old drivers (called legacy) with cl_uselegacydrivers 1 for ALSA/OSS (still chosen by s_driver).
  • Pulseaudio will need to be set in config files before starting client in order to work. (Pulseaudio code is treated as experimental)


Information below is for the old soundcode ONLY:

  • Got software mixing and problems with sound in ezquake? SOLUTION: add +set s_device dmix to command line and don't use local .asoundrc
  • if you don't get sound at all with those settings try doing these things:

- add yourself to group 'audio' ($ addgroup username audio) ; then disconnect/reconnect (login)
- $ echo 'ezquake-gl.glx 0 0 direct' > /proc/asound/card0/pcm0p/oss (might need to chmod it first)


Other Common problems

Missing files error Unlike Windows, Linux is case-sensitive, which means "PaK0.pAk" and "pak0.pak" are different files. If you just copied the Quake directory from your Windows machine, it's possible that there are some files in upper case. Fortunately, that's easy to fix.

  • change to your main quake directory

e.g. 'cd /home/joe/quakeworld'

  • convert every file in your Quake directory (including all subdirectories) to lowercase, run this little script (by faustov@ryba):
#! /bin/bash
#

Cdir ()
{
for elem in * ; do
        if [[ -d "$elem" ]] ; then 
                mv "$elem" "$(echo $elem | sed -e 's/./\L&/g')" 2> /dev/null
                elem=$(echo $elem | sed -e 's/./\L&/g');
                cd "$elem";
                Cdir;
                cd ..;
        else 
                mv "$elem" "$(echo $elem | sed -e 's/./\L&/g')" 2> /dev/null
        fi;
done;
}

Cdir;


Keyboard issues If you get laggy/skippy input from the keyboard when using high refresh rate mouse polling, you could try switching keyboard drivers if you want to keep the mouse the way it is. My keyboard frequently ignored my commands when using 1000hz evdev+ evdev keyboard, so I switched them to mouse/kbd X11 drivers and things seem okay now.

Launch ezQuake by clicking on qw:// links in your browser

KDE (untested):

[Protocol]
exec=/path/to/qw/ezquake-gl.glx +qwurl '%u'
protocol=qw
input=none
output=none
helper=true
listing=false
reading=false
writing=false
makedir=false
deleting=false
icon=package
Description=qw
  • Save this code in ${KDEHOME}/share/services/qw.protocol

Adapted from http://ubuntuforums.org/showpost.php?&p=2618481

Gnome (untested):

gconftool-2 -t string -s /desktop/gnome/url-handlers/qw/command exec /path/to/qw/ezquake-gl.glx +qwurl "%s"
gconftool-2 -t bool -s /desktop/gnome/url-handlers/qw/enabled true
gconftool-2 -t bool -s /desktop/gnome/url-handlers/qw/needs_terminal false 

Adapted from http://ubuntuforums.org/showpost.php?&p=2618481

Firefox:

Create a new file containing this:

#!/bin/sh
#
# ezquake launcher script for qw:// links
#
exec /path/to/qw/ezquake-gl.glx +qwurl "$@"
  • Save it as qwconnect.sh and chmod +x it. Place it in your qw folder.
  • In Firefox go to about:config.
  • Rightclick, "new" -> "string": "network.protocol-handler.app.qw" "/path/to/qwconnect.sh"
  • Rightclick, "new" -> "boolean": "network.protocol-handler.external.qw" "true"
  • Rightclick, "new" -> "boolean": "network.protocol-handler.warn-external.qw" "false" (unless you want that "are you sure" box)

Compile ezQuake yourself

You can use GIT to get the latest development sources and compile ezQuake yourself.

Prerequisites

  • A working Internet connection
  • Installed software
    • git (package git)
    • gcc, make... and a sane buildsystem (mainly build-essential)
    • libraries, see below

Procedure

  • change to your home directory
cd ~ 
  • checkout the code from git to folder ezquake
git clone git://github.com/ezQuake/ezquake-source ezquake
  • install necessary libraries (for Ubuntu)
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev libasound2-dev x11proto-xf86dga-dev x11proto-xf86vidmode-dev libxxf86dga-dev libxxf86vm-dev libxext-dev libsvga1-dev libxpm-dev
  • for OpenSUSE
sudo zypper install freeglut-devel alsa-devel
  • change to libs directory
cd ezquake/libs/linux-x86/ (or linux-x86_64 for 64bit)
  • invoke a script downloading precompiled versions
 ./download.sh 
cd ../../
  • compile the OpenGL binary
make glx
  • (optional) Software version SVGA (32bit only)
make svga
  • (optional) Software version X11
make x11

If everything went smoothly, your freshly compiled binary can be found in release-x86/ezquake-gl.glx (or release-x86_64/ dir for 64bit)

Links

Other OS

Windows

See Smooth Quake

Macintosh

If ezQuake doesn't work for you, feel free to try Fodquake http://www.fodquake.net