glimagesinkbin: GBM: wrong colors (something instead of RGBA) on Raspberry Pi 4B
Environment:
- Raspberry Pi 4B with 4GB RAM
- Raspberry Pi OS (Debian armhf), no X server running
- Screen resolution via HDMI is 1280x720, single screen attached
- GStreamer 1.19 from git 2021-04-05, same problem also happens with GStreamer 1.14.
Running the following command results in a blue-green checker pattern, but it should result in a red-green checker pattern.
gst-launch-1.0 gltestsrc pattern=checkers-8 ! "video/x-raw(memory:GLMemory),width=1280,height=720,framerate=25/1" ! glimagesinkelement
Verified against the following command which is working as expected
gst-launch-1.0 gltestsrc pattern=checkers-8 ! "video/x-raw(memory:GLMemory),width=1280,height=720,framerate=25/1" ! glcolorconvert ! gldownload ! kmssink
I first suspected there was a mixup between RGBA and BGRA, however subsequent tests became even weirder with colors mixed up more creatively and even neighboring pixels swapped.
At the native resolution of 1280x720, not only red/blue are swapped, but every 16 pixels in horizontal direction two pixel columns are swapped and every 16 pixels in vertical direction, two pixel rows are swapped.
gst-launch-1.0 gltestsrc pattern=checkers-8 ! "video/x-raw(memory:GLMemory),width=1280,height=720,framerate=25/1" ! glimagesink
The following command has red and blue switched like in the example above, but additionally the right bar in the lower row next to the changing black-and-white noise is pink instead of gray.
gst-launch-1.0 videotestsrc ! video/x-raw,width=1280,height=720,framerate=25/1 ! glupload ! glimagesink
The pattern should look identical to the one from the following command:
gst-launch-1.0 videotestsrc ! video/x-raw,width=1280,height=720,framerate=25/1 ! kmssink
I have no idea whether this is a GStreamer bug or a Raspberry Pi 4B graphics driver bug, but it is really weird.