|
al_create_dispkay() never returns on Pi4, Buster Lite |
chundermike
Member #16,629
January 2017
|
Hi I'm trying to build an existing project on the Raspberry pi 4. Works fine on the pi3. Built the allegro library and my program fine, but when it runs, al_create_display() never returns. Allegro init worked fine, as did al_get_display_mode(). I'm running the latest Raspian Buster Lite. And Allegro version 5.2.4. Any ideas? Cheers |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Rebuild with Allegro 5.2.5+ and report back. Step into al_create_display with a debugger if you can. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
chundermike
Member #16,629
January 2017
|
Hi, Rebuilt with Allegro 5.2.5; al_create_display() still never returns. Here's a gdb backtrace if that's any use? I Ctrl-C'd the debug session after a few seconds when I knew it was in the hang state... Cheers, pi@raspberrypi:~/fruitbox_1.14base/build $ gdb --args ../fruitbox --test-buttons For help, type "help". fruitbox v1.15beta2 (Oct 10 2019, 20:11:59) by Mike Kingsley |
Edgar Reynaldo
Major Reynaldo
May 2007
|
That's funny it's stuck inside a semaphore wait in eglCreateContext Sounds like a deadlock if you want me to guess. When you SIGINT, could you try these two commands and report back? gdb>info threads gdb>thread apply all bt Also, google was no help with 'rpc recv rpi4 egl'. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
chundermike
Member #16,629
January 2017
|
pi@raspberrypi:~/fruitbox_1.14base $ gdb --args ./fruitbox --test-buttons For help, type "help". fruitbox v1.15beta2 (Oct 10 2019, 20:11:59) by Mike Kingsley
at ../sysdeps/unix/sysv/linux/futex-internal.h:205 Thread 5 (Thread 0xb43fd280 (LWP 610)): Thread 4 (Thread 0xb4bfe280 (LWP 609)): Thread 3 (Thread 0xb53ff280 (LWP 608)): Thread 2 (Thread 0xb5d49280 (LWP 607)): Thread 1 (Thread 0xb5d4a010 (LWP 596)): |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Can you wait longer before hitting Ctrl-C? Let it cogitate for 5 minutes, and then do it. Because your last backtrace was caught in al_load_png_f, and not egl_create_context. But other than that, it looks like a classic deadlock. There are 4 threads all waiting on SOMETHING.... My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
chundermike
Member #16,629
January 2017
|
Ok, thanks for persisting with this. This time, I waited 30 mins before hitting Ctrl-C... pi@raspberrypi:~/fruitbox_1.14base $ gdb --args ./fruitbox --test-buttons For help, type "help". fruitbox v1.15beta2 (Oct 10 2019, 20:11:59) by Mike Kingsley
at ../sysdeps/unix/sysv/linux/futex-internal.h:205 Thread 5 (Thread 0xb43fd280 (LWP 2012)): Thread 4 (Thread 0xb4bfe280 (LWP 2011)): Thread 3 (Thread 0xb53ff280 (LWP 2010)): Thread 2 (Thread 0xb5d49280 (LWP 2009)): Thread 1 (Thread 0xb5d4a010 (LWP 2005)): |
Edgar Reynaldo
Major Reynaldo
May 2007
|
chundermike, It's clearly stuck in your DisplayClass constructor. Can you post that? Are you loading assets before allegro is initialized or before creating a display? My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
SiegeLord
Member #7,827
October 2006
|
How are you building Allegro, using the RPI backend or the regular linux one? "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
chundermike
Member #16,629
January 2017
|
Hi, All the source code for the entire project is in: https://github.com/chundermike/rpi-fruitbox/tree/master/build The display constructor is in display.cpp. If you look at fruitbox.cpp lines 244 onwards you can see that I initialise Allegro (and check for success) before the display constructor is called and any assets are loaded. I built the Allegro libraries using: cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-raspberrypi.cmake -DSHARED=off (The complete build process is described in build.txt in the build directory on GitHub.) Just to confirm, the exact same executable works absolutely fine on my Pi3 (and zero), including on Buster Lite. I basically took the SD card from my Pi4, stuck it in my Pi3 and fruitbox works perfectly, so would that rule out any config / OS issues? I'm not sure if the OS configures itself differently when detecting different hardware? The only thing I know is the that Pi4 uses a different Broadcom SoC to the Pi3 (ARM version and VideoCore version). Again, thanks for your ongoing support. Cheers, |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Well, to be specific, it's failing in ogl_upload_bitmap in src/opengl/ogl_bitmap.c:515 . It calls glGetError, which is not returning. The only thing I can think of is rpi4 changed their GLES without telling anyone. Can you update your graphics drivers on a Raspberry Pi 4? Also, can you try a purely Linux based build and see if it does the same thing? My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
chundermike
Member #16,629
January 2017
|
Ok...I'll look into updating my graphics drivers; to be honest haven't got a clue how to do that but I'll have a google. Regarding pure linux version, I've successfully built and run it on my Ubuntu PC if that helps? EDIT: I've done a bit of googling, and found this discussion... https://www.raspberrypi.org/forums/viewtopic.php?f=68&t=243892&sid=8252e28d34347707d59e995b68290f68 ...not sure it'll throw any light on the situation though? The second-to-last paragraph in this entry suggests initialisation may fail... https://www.raspberrypi.org/forums/viewtopic.php?t=243892#p1489670 |
Edgar Reynaldo
Major Reynaldo
May 2007
|
What I meant was, can't you run the linux version on your Pi? Also, it looks like there are possibly some drivers for mesa you need to install. BUMP My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
SiegeLord
Member #7,827
October 2006
|
I obtained a RPI4 for testing, but waiting on an micro HDMI adapter to actually start doing so... EDIT: Alright, I got the adapter and got Allegro installed. I went the newly recommended route: treat RPI as a regular Linux OS, so I didn't use the custom toolchain. Basically, everything that I tested worked fine (creating windows, fullscreen windows, audio with ALSA), so I think maybe it's just the dedicated Rpi backend that's not working. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
chundermike
Member #16,629
January 2017
|
Thanks SiegeLord, I tried building Allegro 5.2.5 for regular Linux (cmake .. -DSHARED=off), but it still doesn't work (get failure returned from al_get_display_mode(), which is subtly different to the original failure). That happens if I chose Legacy (non-GL) driver or GL (Fake KMS) driver. Any chance you could provide a step-by-step build guide of what you exactly did? (sorry to be a pain) EDIT: that was using Buster Lite...maybe Buster Desktop will work (If I understand correctly that uses X11??), so I'll try that... EDIT2: So I tried it with Buster desktop and it works ok, so thanks very much for the help and support...much appreciated. However, I've got a few more questions now if that's ok... 1. What's the point of the Raspberry Pi cmake version if the plain Linux one works? Presumably it's something to do now with the fact that the Pi4 uses more standard Linux graphics drivers? (complete guess as it's not something I know much about). 2. Instead of building the allegro library from scratch, could I just do a "sudo-apt get allegro5-dev" as it seems that allegro is part of the Raspbian repository. 3. What can I do to get Allegro working in Buster Lite (i.e. without the desktop)? My app doesn't run particularly smoothly when the Pi is running the desktop. Presumably it's just a matter of installing the graphics libraries that are part of the desktop image and not included in the Lite version? If so, do you know what I need to install? Many thanks again, |
SiegeLord
Member #7,827
October 2006
|
Glad you got one working configuration! chundermike said: What's the point of the Raspberry Pi cmake version if the plain Linux one works? The dedicated RPI backend came before the plain Linux one worked, now it has limited use cases (maybe none?) Quote: Instead of building the allegro library from scratch, could I just do a "sudo-apt get allegro5-dev" as it seems that allegro is part of the Raspbian repository. Yes, you can try it! It might be slightly outdated, but it's certainly worth trying. Quote: What can I do to get Allegro working in Buster Lite That's my bad, I completely missed the 'Lite' part! I'll need to test this configuration and get back to you. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Edgar Reynaldo
Major Reynaldo
May 2007
|
{"name":"bump-w8-1.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/0\/5002f8c93a35d72afb281c89d8ef800f.png","w":500,"h":500,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/0\/5002f8c93a35d72afb281c89d8ef800f"} My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Rodolfo Lam
Member #16,045
August 2015
|
Does Raspbian Lite contain any graphics stack at all? You could try instead of using Raspbian Desktop, using a lightweight window manager with Raspbian Lite instead of a Desktop Environment. That way your application can start from an already initialized graphics stack.
|
chundermike
Member #16,629
January 2017
|
Allegro works fine with Raspian Stretch (and Jessie) Lite, so the problem is just with Buster Lite. The only difference I'm aware of with Buster is that they've changed all the graphics drivers... |
SiegeLord
Member #7,827
October 2006
|
Another bump, this is still on the TODO list. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|