ardera / flutter-pi

A light-weight Flutter Engine Embedder for Raspberry Pi that runs without X.
MIT License
1.48k stars 153 forks source link

error: Couldn't create GBM surface for rendering - Rasberry pi 5 with 7 inch DSI official display #413

Closed 7aku8 closed 2 weeks ago

7aku8 commented 3 weeks ago

Hey, I'm kinda noob in embedded programming so sorry if that's a trivial issue. I've been struggling for few hours, trying to run Flutter app with flutter-pi on Raspberry pi 5 [4gb and Debian GNU/Linux 12 (bookworm)] with official touch screen display.

I skipped 4. step from "Configuring your Raspberry PI" as I wasn't able to find this setting in raspi-config. I also wasn't able to find GL driver settings so I enabled fake KMS manually by changing dtoverlay=vc4-kms-v3d to dtoverlay=vc4-fkms-v3d in config.txt file.

Display itself works fine.

I built an app with this command:

flutterpi_tool build --arch=arm64 --release

And then tried to run it with command:

flutter-pi --release /home/pi/ui

And I ended up with that error:

modesetting.c: Could not set DRM client universal planes capable. drmSetClientCap: Operation not supported
flutter-pi.c: Could not create drmdev from device at "/dev/dri/card0". Continuing.
flutter-pi.c: Device "/dev/dri/card2" doesn't have a display connected. Skipping.
egl_gbm_render_surface.c: Couldn't create GBM surface for rendering. gbm_surface_create_with_modifiers: Invalid argument
egl_gbm_render_surface.c: Will retry without modifiers
modesetting.c: Couldn't add buffer as DRM fb. drmModeAddFB2WithModifiers: Invalid argument
egl_gbm_render_surface.c: Couldn't add GBM buffer as DRM framebuffer.
window.c: Couldn't present flutter layer on screen. surface_present_kms: Input/output error

I tried several different config.txt changes without any success. Setting option display_auto_detect to 0 disables whole screen. What I can add is that it used to work just fine with HDMI display.

Do you guys have any ideas whether that's a library issue or I'm doing something wrong?

ardera commented 3 weeks ago

Can you try without the fkms change? Could be that no longer works on Pi 5, though it shouldn't be necessary anymore anyway.

If the issue persists, can you post the output of the raspinfo command?

7aku8 commented 3 weeks ago

Sure, so I reinstalled OS to make sure that other changes I did will not affect it. I went through the setup process once again, skipping fkms change. Finally I ran into exactly same issue as before.

raspinfo output

7aku8 commented 2 weeks ago

@ardera FYI I tried to use Pi4 with 64-bit Raspbian Bullseye instead of Pi5 and it works perfectly fine.

anirudh-walia commented 2 weeks ago

running it on a rpi5 with a 3.5 inch tft display getting this same error

modesetting.c: Could not set DRM client universal planes capable. drmSetClientCap: Operation not supported
flutter-pi.c: Could not create drmdev from device at "/dev/dri/card0". Continuing.
flutter-pi.c: Device "/dev/dri/card1" doesn't have a display connected. Skipping.
Segmentation fault
ardera commented 2 weeks ago

@anirudh-walia That's not the same error. How is your TFT display connected to the Pi? What model?

anirudh-walia commented 2 weeks ago

My bad just saw the first few lines it's a 3.5-inch TFT display connected via GPIO pins the display is working fine with touch and everything.

LCD Type    
TFT

Interface   
SPI

Touch Screen Type   
Resistive Screen

Touch Controller    
XPT2046

Colors  
65536

Backlight   
Yes, LED

Resolution (Pixel)  
320*480

Aspect Ratio    
8:5