README-linux.txt
author Ryan C. Gordon <icculus@icculus.org>
Tue, 22 Jul 2014 21:41:49 -0400
changeset 9012 aa058c87737b
parent 8826 acf0915f7fca
permissions -rw-r--r--
Added audio device buffer queueing API.
gabomdq@7972
     1
================================================================================
gabomdq@7972
     2
Simple DirectMedia Layer for Linux
gabomdq@7972
     3
================================================================================
gabomdq@7972
     4
gabomdq@7972
     5
By default SDL will only link against glibc, the rest of the features will be
gabomdq@7972
     6
enabled dynamically at runtime depending on the available features on the target
gabomdq@7972
     7
system. So, for example if you built SDL with Xinerama support and the target
gabomdq@7972
     8
system does not have the Xinerama libraries installed, it will be disabled
gabomdq@7972
     9
at runtime, and you won't get a missing library error, at least with the 
gabomdq@7972
    10
default configuration parameters.
gabomdq@7972
    11
gabomdq@7972
    12
gabomdq@7972
    13
================================================================================
gabomdq@7972
    14
Build Dependencies
gabomdq@7972
    15
================================================================================
gabomdq@7972
    16
    
gabomdq@7972
    17
Ubuntu 13.04, all available features enabled:
gabomdq@7972
    18
gabomdq@7972
    19
sudo apt-get install build-essential mercurial make cmake autoconf automake \
gabomdq@7972
    20
libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
gabomdq@7972
    21
libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
gabomdq@7972
    22
libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
gabomdq@7972
    23
libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev
gabomdq@7972
    24
icculus@8826
    25
Ubuntu 14.04 can also add "libwayland-dev libmirclient-dev libxkbcommon-dev"
icculus@8826
    26
to that command line for Wayland and Mir support.
icculus@8784
    27
gabomdq@7973
    28
NOTES:
gabomdq@7973
    29
- This includes all the audio targets except arts, because Ubuntu pulled the 
gabomdq@7973
    30
  artsc0-dev package, but in theory SDL still supports it.
gabomdq@7973
    31
- DirectFB isn't included because the configure script (currently) fails to find
gabomdq@7973
    32
  it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the 
gabomdq@7973
    33
  configure script to include DirectFB support. Send patches.  :)
gabomdq@7972
    34
gabomdq@7973
    35
gabomdq@7980
    36
================================================================================
gabomdq@7980
    37
Joystick does not work
gabomdq@7980
    38
================================================================================
gabomdq@7980
    39
gabomdq@7980
    40
If you compiled or are using a version of SDL with udev support (and you should!)
gabomdq@7980
    41
there's a few issues that may cause SDL to fail to detect your joystick. To
gabomdq@7980
    42
debug this, start by installing the evtest utility. On Ubuntu/Debian:
gabomdq@7980
    43
gabomdq@7980
    44
    sudo apt-get install evtest
gabomdq@7980
    45
    
gabomdq@7980
    46
Then run:
gabomdq@7980
    47
    
gabomdq@7980
    48
    sudo evtest
gabomdq@7980
    49
    
gabomdq@7980
    50
You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX"
gabomdq@7980
    51
Now run:
gabomdq@7980
    52
    
gabomdq@7980
    53
    cat /dev/input/event/XX
gabomdq@7980
    54
gabomdq@7980
    55
If you get a permission error, you need to set a udev rule to change the mode of
gabomdq@7980
    56
your device (see below)    
gabomdq@7980
    57
    
gabomdq@7980
    58
Also, try:
gabomdq@7980
    59
    
gabomdq@7980
    60
    sudo udevadm info --query=all --name=input/eventXX
gabomdq@7980
    61
    
gabomdq@7980
    62
If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it,
gabomdq@7980
    63
you need to set up an udev rule to force this variable.
gabomdq@7980
    64
gabomdq@7980
    65
A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks 
gabomdq@7980
    66
like:
gabomdq@7980
    67
    
gabomdq@7980
    68
   SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
gabomdq@7980
    69
   SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
gabomdq@7980
    70
   
gabomdq@7980
    71
You can set up similar rules for your device by changing the values listed in
gabomdq@7980
    72
idProduct and idVendor. To obtain these values, try:
gabomdq@7980
    73
    
gabomdq@7980
    74
    sudo udevadm info -a --name=input/eventXX | grep idVendor
gabomdq@7980
    75
    sudo udevadm info -a --name=input/eventXX | grep idProduct
gabomdq@7980
    76
    
gabomdq@7980
    77
If multiple values come up for each of these, the one you want is the first one of each.    
gabomdq@7980
    78
gabomdq@7980
    79
On other systems which ship with an older udev (such as CentOS), you may need
gabomdq@7980
    80
to set up a rule such as:
gabomdq@7980
    81
    
gabomdq@7980
    82
    SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1"
gabomdq@7980
    83