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