docs/README-linux.md
author Manuel Alfayate Corchete
Thu, 22 Oct 2020 19:51:57 +0200
changeset 14191 7bb6793cd70f
parent 13809 c40934185184
permissions -rw-r--r--
kmsdrm: Add comment about KMSDRM_VideoQuit() changes.
slouken@10486
     1
Linux
slouken@10486
     2
================================================================================
slouken@10486
     3
slouken@10486
     4
By default SDL will only link against glibc, the rest of the features will be
slouken@10486
     5
enabled dynamically at runtime depending on the available features on the target
slouken@10486
     6
system. So, for example if you built SDL with Xinerama support and the target
slouken@10486
     7
system does not have the Xinerama libraries installed, it will be disabled
slouken@10486
     8
at runtime, and you won't get a missing library error, at least with the 
slouken@10486
     9
default configuration parameters.
slouken@10486
    10
slouken@10486
    11
slouken@10486
    12
================================================================================
slouken@10486
    13
Build Dependencies
slouken@10486
    14
================================================================================
slouken@10486
    15
    
icculus@13809
    16
Ubuntu 20.04, all available features enabled:
slouken@10486
    17
slouken@10486
    18
sudo apt-get install build-essential mercurial make cmake autoconf automake \
slouken@10486
    19
libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
slouken@10486
    20
libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
icculus@13809
    21
libxss-dev libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev \
icculus@13809
    22
libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \
icculus@13809
    23
libsndio-dev libwayland-dev libxkbcommon-dev
slouken@10486
    24
slouken@10486
    25
NOTES:
icculus@13809
    26
- This includes all the audio targets except arts and esd, because Ubuntu
icculus@13809
    27
  (and/or Debian) pulled their packages, but in theory SDL still supports them.
icculus@13808
    28
- libsamplerate0-dev lets SDL optionally link to libresamplerate at runtime
icculus@13808
    29
  for higher-quality audio resampling. SDL will work without it if the library
icculus@13808
    30
  is missing, so it's safe to build in support even if the end user doesn't
icculus@13808
    31
  have this library installed.
slouken@10486
    32
- DirectFB isn't included because the configure script (currently) fails to find
slouken@10486
    33
  it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the 
slouken@10486
    34
  configure script to include DirectFB support. Send patches.  :)
slouken@10486
    35
slouken@10486
    36
slouken@10486
    37
================================================================================
slouken@10486
    38
Joystick does not work
slouken@10486
    39
================================================================================
slouken@10486
    40
slouken@10486
    41
If you compiled or are using a version of SDL with udev support (and you should!)
slouken@10486
    42
there's a few issues that may cause SDL to fail to detect your joystick. To
slouken@10486
    43
debug this, start by installing the evtest utility. On Ubuntu/Debian:
slouken@10486
    44
slouken@10486
    45
    sudo apt-get install evtest
slouken@10486
    46
    
slouken@10486
    47
Then run:
slouken@10486
    48
    
slouken@10486
    49
    sudo evtest
slouken@10486
    50
    
slouken@10486
    51
You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX"
slouken@10486
    52
Now run:
slouken@10486
    53
    
slouken@10486
    54
    cat /dev/input/event/XX
slouken@10486
    55
slouken@10486
    56
If you get a permission error, you need to set a udev rule to change the mode of
slouken@10486
    57
your device (see below)    
slouken@10486
    58
    
slouken@10486
    59
Also, try:
slouken@10486
    60
    
slouken@10486
    61
    sudo udevadm info --query=all --name=input/eventXX
slouken@10486
    62
    
slouken@10486
    63
If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it,
slouken@10486
    64
you need to set up an udev rule to force this variable.
slouken@10486
    65
slouken@10486
    66
A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks 
slouken@10486
    67
like:
slouken@10486
    68
    
slouken@10486
    69
   SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
slouken@10486
    70
   SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
slouken@10486
    71
   
slouken@10486
    72
You can set up similar rules for your device by changing the values listed in
slouken@10486
    73
idProduct and idVendor. To obtain these values, try:
slouken@10486
    74
    
slouken@10486
    75
    sudo udevadm info -a --name=input/eventXX | grep idVendor
slouken@10486
    76
    sudo udevadm info -a --name=input/eventXX | grep idProduct
slouken@10486
    77
    
slouken@10486
    78
If multiple values come up for each of these, the one you want is the first one of each.    
slouken@10486
    79
slouken@10486
    80
On other systems which ship with an older udev (such as CentOS), you may need
slouken@10486
    81
to set up a rule such as:
slouken@10486
    82
    
slouken@10486
    83
    SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1"
slouken@10486
    84