Alexander,
I find myself in pretty much the same boat as you. I would like to know if you found a reasonable way forward.
The following is the state of affairs as far my testing shows. Could you also confirm if this is along the lines of what you are seeing?
PS : My apologies for the poorly structured notes, this is more stream of consciousness than a well thought though list.
Drivers :
- buster on RPi4B uses vc4-fkms-v3d. vc4-kms-v3d may or may not work, I have not tried.
- bullseye on RPi4B uses vc4-kms-v3d. vc4-fkms-v3d does not boot to a virtual terminal (no screen visible).
Window Provider SDL2 :
- SDL2 (by itself) (upto latest version, 2.0.22) and then kivy[full] compiles fine on both distributions. Setting the window backend to sdl2 works in that it displays the window.
- SDL2 on bullseye is noticeably laggy, irrespective of the presence of video. I'm seeing 5fps with simple animations.
- SDL2 also seems to compile OK on bullseye with --enable-arm-neon. This seems to kick things up to 12fps. Not sure if the cause and effect are closely related, though. I did a bunch of other things in between.
- I have not yet tested SDL2 with --enable-arm-neon on buster. I hope to do so soon.
Video Provider ffmpeg:
- This does not work at all. It seems to be unmaintained.
Video Provider gstreamer:
- This works reliably on both distributions. FPS of 1-2 (or even less) is what I get. Kivy's reported FPS (monitor module) is in the 20-40 range, but the video is obviously skipping frames.
Video Provider ffpyplayer:
- This works on bullseye. FPS is again 5ish FPS, but I'm uncertain if it's a kivy / kivy installation / environment problem. It looks and feels exactly like the bad framerate during animations.
- In order to make it work on bullseye, I installed additional packages ffmpeg (may not be needed?) and libavdevice-dev (needed). I only later noticed that libavdevice-dev seems to installing some version of libsdl2 from the apt repository. I currently suspect the use of this other version of libsdl is what is causing the sluggishness. It seems possible that manually compiling libavdevice against the correct libsdl2 version may improve matters.
- When libavdevice-dev is installed on buster, libsdl2 is broken. I suspect the buster libavdevice is built against a libsdl2 version < 2.0.10, which results in undefined symbol: SDL_RWread
- As a result, ffpyplayer is not viable in buster without trying to compile libavdevice, which I have not yet worked up the courage to try.
Kivy and Dispmanx :
- Upto RPi3, egl_rpi respected KIVY_BCM_DISPMANX_LAYER
- RPi4 no longer supports egl_rpi. SDL2 does not seem to care about KIVY_BCM_DISPMANX_LAYER
- Making the window background transparent has so far not worked (this code is suspect on my end, though, so I can't be sure it isn't something I broke). (Window.clearcolor = [0, 0, 0, 0])
Omxplayer
- omxplayer on RPi4 Buster respects dispmanx layers, and works as intended.
- omxplayer does not run on RPi4 Bullseye (vc4-kms-v3d)
- When using RPi4 buster with SDL2, setting omxplayer -layer "-200" (something less than -127) does result in the omxplayer window not showing. I'm hoping it is because it is hidden behind it.
FFplay
- FFplay runs video perfectly on RPi4 Bullseye.
- It does not know about or support dispmanx layers, so moving it behind the kivy window using dispmanx is likely not viable.
VLC
- VLC does not seem to want to install and run without X. I suspect I will have nightmares of VLC's stderr outputs for some days.
- RPi4 Bullseye installing just vlc-bin does nothing useful. I ended up installing vlc, which pulled 1GB+ of packages with it. I later read that installing vlc-plugin-base may have been enough.
- When there's no X, vlc does not want to display any video with any combination of "-V aa", "-V fb", "-I ncurses". The only luck I had was having the default result in an ascii art version of the video playing on my ssh terminal.
- vlc is supposed to support some kind of MMAL output interface. I have no idea if it does, or how to make it do anything, but if I understand it correctly it should work on RPi4 Buster with vc4-fkms-v3d and do what we want.
During all of this, I have purposefully avoided checking if any audio is working, so can't comment on audio at all, other than that it worked fine on RPi3 and in the past on RPi4B Buster + omxplayer.
Thanks and Regards
Shashank