Flutter-pi on Raspberry Pi 4B with 3.5" SPI TFT (fbdev) – how to make it work?
Hi, I’m new to Linux and embedded systems and I’m trying to run a Flutter app on a Raspberry Pi 4B (4GB RAM) using this 3.5" SPI display:
https://www.lcdwiki.com/3.5inch_RPi_Display
I have successfully installed the LCD35-show drivers from:
https://github.com/goodtft/LCD-show
However, as far as I understand, the display currently uses fbdev (framebuffer) and not KMS/DRM, which prevents flutter-pi from working out-of-the-box.
System Info
OS: Linux raspberrypi 6.12.47+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.47-1+rpt1 (2025-09-16) aarch64 GNU/Linux
Flutter (host Windows machine): 3.35.1
Flutter-pi build command (host Windows machine): flutterpi_tool build --arch=arm64 --cpu=pi4 --release
Symptoms / Errors
- Running
flutter-pi --release ~/appoutputs:
window.c: Could not find a preferred output mode!
flutter-pi.c: Couldn't create KMS window.
- In
raspi-config:- I have no "GL Driver" under "Advanced Options"
- But have added
dtoverlay=vc4-fkms-v3dto /boot/config.txt
- But have added
- I have no "GPU Memory" under "Performance Options"
- I have no "GL Driver" under "Advanced Options"
Current /boot/config.txt
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
disable_fw_kms_setup=1
arm_64bit=1
disable_overscan=1
arm_boost=1
hdmi_force_hotplug=1
dtparam=i2c_arm=on
dtparam=spi=on
enable_uart=1
dtoverlay=tft35a:rotate=90
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 480 320 60 6 0 0 0
hdmi_drive=2
Devices / Drivers
$ ls /dev/dri/
by-path card0 card1 renderD128
$ ls /dev/fb*
/dev/fb0
- Display is currently using fbdev via /dev/fb0 (fb_ili9486 driver)
- frame buffer, 480x320, 300 KiB video memory, 32 KiB buffer memory, fps=31, spi0.0 at 16 MHz
- DRM driver for ILI9486 exists on my system: /lib/modules/6.12.47+rpt-rpi-v8/kernel/drivers/gpu/drm/tiny/ili9486.ko.xz
- I’m unsure how to properly load/use this DRM driver instead of fbdev.
What I want
- Run flutter-pi on this SPI display, even if performance isn’t perfect.
- Clarification on whether:
- I can make flutter-pi work with fbdev (any existing workaround/patch?), or
- I should attempt using the ILI9486 DRM driver, and how to do that properly.
Any guidance from people who have run flutter-pi on a similar TFT or SPI framebuffer would be hugely appreciated.
As you pointed out correctly, there's 2 ways to do this. The setup instructions you followed uses roughly this one:
- You let the Raspberry Pi firmware fake a HDMI KMS/DRM display, and have a utility
fbcprunning in the background, that basically does a screencapture of the fake HDMI displays and copies it to the framebuffer, which is the actual display.
You can try running flutter-pi with the --videomode argument to manually select a fitting video mode. If it still doesn't work you can send me the output of drm_info (sudo apt install drm-info)
- Load a real KMS driver and let flutter-pi render to it.
Less hacky and should be more performant, but I'm not sure flutter-pi will work with this automatically. normally the EGL implementation has some built-in logic to do the importing & exporting of buffers between GPU and display controller, not sure that logic works some really non-standard display "controller" such as your SPI display.
If you want to try anyway, you can try this overlay here: https://github.com/raspberrypi/linux/blob/rpi-6.12.y/arch/arm/boot/dts/overlays/piscreen-overlay.dts
Maybe your hardware is not exactly a Pi Screen, but it loads the same driver. (/lib/modules/6.12.47+rpt-rpi-v8/kernel/drivers/gpu/drm/tiny/ili9486.ko.xz as you already found out)