Tiny Core Base > Raspberry Pi
/dev/dri on piCore12.0
runningopenloop:
Hello,
I think I'm trying to get /dev/dri to populate?
I've got an SDL2 application I'm working on and trying to make run on piCore 12.0. I had started with piCore13.03 but as per:
http://forum.tinycorelinux.net/index.php?topic=24762.0
http://forum.tinycorelinux.net/index.php/topic,24855.msg159683.html#msg159683
It appears piCore13.03 doesn't yet work for SDL applications. Before I saw these messages I tried piCore13.03 and was getting errors that /dev/dri could not be opened.
So trying again with piCore12.0.$ uname -a
Linux box 5.4.51-piCore #1 Sat Sep 19 11:11:32 EDT 2020 armv6l GNU/Linux
Note I'm not running X, here's my onboot.lst.
openssh.tcz
compiletc.tcz
rpi-vc.tcz
rpi-vc-dev.tcz
SDL2-dev.tcz
SDL2_image.tcz
SDL2_image-dev.tcz
SDL2_gfx.tcz
graphics-5.4.51-piCore.tcz
squashfs-tools.tcz
> I made the SDL2_gfx tcz.
> I was hoping graphics-5.4.51-piCore would make things work, but no.
I am running on a old RpiB1
$ cat /proc/cpuinfo
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 697.95
Features : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7
Hardware : BCM2835
Revision : 0002
Serial : 00000000bc3f268b
Model : Raspberry Pi Model B Rev 1
Here is my cmdline.txt, I tried without vga=791 also:zswap.compressor=lz4 zswap.zpool=z3fold console=tty1 root=/dev/ram0 elevator=deadline rootwait quiet nortc loglevel=3 noembed multivt vga=791
I've tried with and without the following line in config.txt. Otherwise config.txt is stock. (sounds like I may actually not want to do this).
dtoverlay=vc4-fkms-v3d
----
Currently my issue is that when I run my application, video fails to initialize. With piCore12.0 I don't get errors about /dev/dri, but SDL_GetError says there is no available video device. Here's my video init snippet and the resulting output.
int numRenderDrivers = SDL_GetNumRenderDrivers();
printf( "%d render drivers:\n", numRenderDrivers );
for( int i = 0; i < numRenderDrivers; ++i )
{
SDL_RendererInfo rendererInfo;
SDL_GetRenderDriverInfo(i, &rendererInfo);
printf("Render driver %d: ", i );
PrintRendererInfo(rendererInfo);
}
SDL_Init(SDL_INIT_VIDEO);
cout << "SDL Init done" << endl;
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
win = SDL_CreateWindow("Test", 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP);
I get this output:
4 render drivers:
Render driver 0: Renderer: opengl software=0 accelerated=1, presentvsync=1 targettexture=1
Render driver 1: Renderer: opengles2 software=0 accelerated=1, presentvsync=1 targettexture=1
Render driver 2: Renderer: opengles software=0 accelerated=1, presentvsync=1 targettexture=0
Render driver 3: Renderer: software software=1 accelerated=0, presentvsync=0 targettexture=1
SDL Init done
Failed to create SDL Window
SDL Error = >No available video device<
---
Any guidance would be appreciated.
modprobe vc4 does load some modules, but no /dev/dri is populated.
* Doesn't change the fact the application doesn't work and SDL_GetError returns No available video device.
* It seems strange to me that it is listing a video drivers.. but then doesn't work.
* I've run this code on arch linux and it works.73
Juanito:
The sdl2 extension has been updated recently on both piCore and piCore64 13.x.
I've tested ffplay, which uses sdl2, successfully on both piCore and piCore64 13.x - albeit on RPi3/RPi4 and using x11/wayland
Using dtoverlay=vc4-kms-v3d{,-pi4} and loading graphics-KERNEL gives:
--- Code: ---[RPi3]
$ ls /dev/dri*
card0 renderD128
[RPi4]
$ ls /dev/dri*
card0 card1 renderD128
--- End code ---
runningopenloop:
Thanks for the note Juanito. I've not quite made progress yet. However I think the root issue for me using SDL2 is not the /dev/dri drivers existing. But rather, it seems that SDL could have been compiled without support the RPI driver.
Setting SDL_VIDEODRIVER=RPI doesn't seem to work. I may still be missing something here, but is it possible to know with what drivers SDL has been compiled?
I thought the code snippet I'm using above would have told me, and I think want to use the opengles2.
However this thread: https://stackoverflow.com/questions/57672568/sdl2-on-raspberry-pi-without-x
shows someone's configure resulting in this list:
Video drivers : dummy rpi x11(dynamic) kmsdrm(dynamic) opengl opengl_es1 opengl_es2 vulkan wayland(dynamic)
So it has opengl_es2 and rpi.
https://wiki.libsdl.org/FAQUsingSDL
I've also tried some of these, as might be expected, I did get XDG_RUNTIME_DIR directory missing with starting with SDL_VIDEODRIVER=x11 (or was it wayland)... which is expected since I don't have X installed.
I've been trying to compile it myself on the RPi, but I've been getting errors which sound like out of memory errors for the compiler.
> I guess my next attempt will be to cross-compile with RPi driver enabled.
In the meantime, is it possible to confirm that the picore12 and picore13 SDL don't have RPI driver enabled somehow?
73,
Timothy
Juanito:
Here are the details for the compilation: http://tinycorelinux.net/13.x/armv7/tcz/src/sdl2/compile_sdl2
Juanito:
Ah - I see the rpi driver requires the closed source stuff in rpi-vc-dev.
Given that mesa, etc is compiled for the open source video drivers, I'm not sure how they would play together.
Maybe you could compile sdl2 locally using rpi-vc-dev and --enable-video-rpi in addition to the build notes linked above and see if it works?
Navigation
[0] Message Index
[#] Next page
Go to full version