flutter-pi icon indicating copy to clipboard operation
flutter-pi copied to clipboard

Flutter-pi issues on Raspberry Pi 5

Open des256 opened this issue 10 months ago • 2 comments

Hi, flutter-pi has a few issues on Raspberry Pi 5 that become apparent with more recent linux kernels. Later vc4-kms-dsi overlay support very simple and more limited hardware planes. I found the planes would not support hardware rotation at all, and the available pixel formats are also limited. For our project (github.com/mind-children) I forked flutter-pi (github.com/des256/flutter-pi) and commented out some of the rotation checks to make it functional again. Actual rotation now happens in the flutter app with a RotatedBox(). Also, I got the output to work with --pixelformat RGB565, which translates internally to RG16, which is supported by the hardware plane.

@ardera I did not design any proper PR for your repo yet, because I'm not sure how you would want to solve this going forward (i.e. rotation not being available on basic vc4-kms-dsi).

des256 avatar Jan 29 '26 16:01 des256

Hey! thanks for the report. You're right, seems like pi5 dsi does not support the rotation property.

However the rotation property was not used for the --rotate arg, it was just unconditionally set to 0, so display and touch are not misaligned when fbcon is rotated using a kernel cmdline arg. (which causes only the primary plane to have a non-zero rotation, but of course touch is not rotated with it, so you manually need to force a 0 rotation)

The flutter engine, at least the OpenGL backend, allows setting a root surface transformation matrix, which will be applied to the whole surface. That's the mechanism that the --rotation arg uses. It's very rare for display controllers to support all possible rotations you might want to do, so this transform matrix is the most compatible way to get arbitrary rotations.

I have a PR here: #512 to make it not enforce the rotation, if property is not present or the rotation value is not supported.

ardera avatar Jan 31 '26 14:01 ardera

fixed, released as part of 1.1.1

ardera avatar Jan 31 '26 16:01 ardera