- Online Community Forums » Installation, Setup & Configuration » Allegro 5 on Raspberry Pi 4

This thread is locked; no one can reply to it. rss feed Print
Allegro 5 on Raspberry Pi 4
Member #12,934
June 2011

Has anyone had any luck getting Allegro 5 (namely, trying for Allegro working on a Raspberry Pi 4? I've been struggling to do so. I had to refresh myself on the procedure for getting it working on the Raspberry Pi 3. My procedure for getting it working on the Raspberry Pi 3 is as follows...

1) Image a microSD card with Raspbian Buster (latest release used, 2019-09-26).

2) Run terminal commands...

sudo apt-get update
sudo rpi-update

3) Reboot the Raspberry Pi, then run terminal commands...

tar -zxvf allegro-
sudo apt-get install libgdk-pixbuf2.0-dev libpango1.0-dev libcairo2-dev cmake
 libx11-dev libgl1-mesa-dev libxcursor-dev freeglut3-dev libpng-dev libjpeg-dev 
libfreetype6-dev libgtk2.0-dev libasound2-dev libpulse-dev libopenal-dev 
libflac-dev libdumb1-dev libvorbis-dev libphysfs-dev
cd allegro-
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-raspberrypi.cmake
sudo make install
sudo ldconfig
cd ~

4) Create a simple example. I like using the bouncer example, saved as bouncer.c (attached).

5) Compile and run the example...

gcc bouncer.c -o bouncer $(pkg-config --cflags --libs allegro-5)

Works fine on the Raspberry Pi 3. On the Raspberry Pi 4 I get just a blinking cursor. I added return 0; to various locations to try and find what it seems to be getting hung-up on and it seems to be al_create_display that's hanging things up.

Not sure if it'll be of any help, but I enabled allegro.log and on the RPi4 the log file stops where I have #####, whereas on the RPi3 it continues, logging 5 more lines...

opengl   D        ogl_display.c:200  _al_ogl_create_backbuffer        [   0.02937] Creating backbuffer
display  I        ogl_display.c:222  _al_ogl_create_backbuffer        [   0.02941] Deduced format ABGR_8888_LE for backbuffer.
opengl   D        ogl_display.c:231  _al_ogl_create_backbuffer        [   0.02946] Creating backbuffer bitmap
display  I        ogl_display.c:250  _al_ogl_create_backbuffer        [   0.02959] Created backbuffer bitmap (actual format: ABGR_8888_LE)
opengl   D         ogl_bitmap.c:414  ogl_upload_bitmap                [   0.03031] Created new OpenGL texture 1 (32x32, format ABGR_8888_LE)
dtor     D               dtor.c:196  _al_register_destructor          [   0.03161] added dtor for bitmap 0xd7d4c0, func 0x76e6e948
opengl   D            ogl_fbo.c:467  ogl_new_fbo                      [   0.03205] Created FBO: 1
dtor     D               dtor.c:196  _al_register_destructor          [   0.03253] added dtor for queue 0xd7e608, func 0x76e872b0


dtor     D               dtor.c:227  _al_unregister_destructor        [   4.00748] removed dtor for bitmap 0xd7d4c0
opengl   D            ogl_fbo.c:423  _al_ogl_del_fbo                  [   4.00773] Deleting FBO: 1
dtor     D               dtor.c:227  _al_unregister_destructor        [   4.00788] removed dtor for timer 0xd7ad98
dtor     D               dtor.c:227  _al_unregister_destructor        [   4.05956] removed dtor for queue 0xd7e608
system   I           pisystem.c:58   pi_shutdown_system               [   4.09278] shutting down.

Member #16,629
January 2017


I've had the same issue. Works on a Pi 4 using Buster desktop but not lite, but you need to build the Allegro library using the generic linux cmake file and not raspberry pi version. The Allegro guys are supposed to be looking at it, but haven't done so yet. I think it's something to do with the updated graphics drivers that the new Pi4 videocore GPU uses.

Here's a link to my original post reporting the problem...


Go to: