README-raspberrypi.txt
author Gabriel Jacobo <gabomdq@gmail.com>
Thu, 03 Oct 2013 10:28:10 -0300
changeset 7778 a571a9947869
parent 7753 e4c38f17bfad
child 7806 03e6aaea8347
permissions -rw-r--r--
SDL_TEXTINPUT support for EVDEV
gabomdq@7753
     1
================================================================================
gabomdq@7753
     2
SDL2 for Raspberry Pi
gabomdq@7753
     3
================================================================================
gabomdq@7753
     4
gabomdq@7753
     5
Requirements:
gabomdq@7753
     6
gabomdq@7753
     7
Raspbian (other Linux distros may work as well).
gabomdq@7753
     8
gabomdq@7753
     9
================================================================================
gabomdq@7753
    10
 Features
gabomdq@7753
    11
================================================================================
gabomdq@7753
    12
gabomdq@7753
    13
* Works without X11
gabomdq@7753
    14
* Hardware accelerated OpenGL ES 2.x
gabomdq@7753
    15
* Sound via ALSA
gabomdq@7753
    16
* Input (mouse/keyboard/joystick) via EVDEV
gabomdq@7753
    17
* Hotplugging of input devices via UDEV
gabomdq@7753
    18
gabomdq@7753
    19
================================================================================
gabomdq@7753
    20
 Raspbian Build Dependencies
gabomdq@7753
    21
================================================================================
gabomdq@7753
    22
gabomdq@7778
    23
sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
gabomdq@7753
    24
gabomdq@7753
    25
You also need the VideoCore binary stuff that ships in /opt/vc for EGL and 
gabomdq@7753
    26
OpenGL ES 2.x, it usually comes pre installed, but in any case:
gabomdq@7753
    27
    
gabomdq@7753
    28
sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
gabomdq@7753
    29
gabomdq@7753
    30
================================================================================
gabomdq@7778
    31
 No input
gabomdq@7778
    32
================================================================================
gabomdq@7778
    33
gabomdq@7778
    34
Make sure you belong to the "input" group.
gabomdq@7778
    35
gabomdq@7778
    36
    sudo usermod -aG input `whoami`
gabomdq@7778
    37
gabomdq@7778
    38
================================================================================
gabomdq@7753
    39
 No HDMI Audio
gabomdq@7753
    40
================================================================================
gabomdq@7753
    41
gabomdq@7753
    42
If you notice that ALSA works but there's no audio over HDMI, try adding:
gabomdq@7753
    43
    
gabomdq@7753
    44
    hdmi_drive=2
gabomdq@7753
    45
    
gabomdq@7753
    46
to your config.txt file and reboot.
gabomdq@7753
    47
gabomdq@7753
    48
Reference: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=5062
gabomdq@7753
    49
gabomdq@7753
    50
================================================================================
gabomdq@7778
    51
 Text Input API support
gabomdq@7778
    52
================================================================================
gabomdq@7778
    53
gabomdq@7778
    54
The Text Input API is supported, with translation of scan codes done via the
gabomdq@7778
    55
kernel symbol tables. For this to work, SDL needs access to a valid console.
gabomdq@7778
    56
If you notice there's no SDL_TEXTINPUT message being emmited, double check that
gabomdq@7778
    57
your app has read access to one of the following:
gabomdq@7778
    58
    
gabomdq@7778
    59
* /proc/self/fd/0
gabomdq@7778
    60
* /dev/tty
gabomdq@7778
    61
* /dev/tty[0...6]
gabomdq@7778
    62
* /dev/vc/0
gabomdq@7778
    63
* /dev/console
gabomdq@7778
    64
gabomdq@7778
    65
This is usually not a problem if you run from the physical terminal (as opposed
gabomdq@7778
    66
to running from a pseudo terminal, such as via SSH). If running from a PTS, a 
gabomdq@7778
    67
quick workaround is to run your app as root or add yourself to the tty group,
gabomdq@7778
    68
then re login to the system.
gabomdq@7778
    69
gabomdq@7778
    70
   sudo usermod -aG tty `whoami`
gabomdq@7778
    71
    
gabomdq@7778
    72
The keyboard layout used by SDL is the same as the one the kernel uses.
gabomdq@7778
    73
To configure the layout on Raspbian:
gabomdq@7778
    74
    
gabomdq@7778
    75
    sudo dpkg-reconfigure keyboard-configuration
gabomdq@7778
    76
    
gabomdq@7778
    77
To configure the locale, which controls which keys are interpreted as letters,
gabomdq@7778
    78
this determining the CAPS LOCK behavior:
gabomdq@7778
    79
gabomdq@7778
    80
    sudo dpkg-reconfigure locales
gabomdq@7778
    81
gabomdq@7778
    82
================================================================================
gabomdq@7753
    83
 Notes
gabomdq@7753
    84
================================================================================
gabomdq@7753
    85
gabomdq@7753
    86
* Building has only been tested natively (i.e. not cross compiled). Cross
gabomdq@7753
    87
  compilation might work though, feedback is welcome!