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

How to make it run even if no screen is connected

Open moham96 opened this issue 2 years ago • 9 comments

If the screen is not powered on then flutter-pi fails with this:

[flutter-pi] Device "/dev/dri/card0" doesn't have a display connected. Skipping.
[flutter-pi] Could not find a connected connector!

In my case I can't guarantee that the screen will be on by the time flutter-pi is ran so how can I make flutter-pi run headless if no screen is connected/powered on and then maybe adjust after a screen is on?

Previously my app was written in pyqt and the pi was using the old framebuffer driver where I had to force a specific HDMI mode so that it works if the screen is connected or not, now I have rewritten my app in flutter and I'm stuck

moham96 avatar Apr 16 '23 16:04 moham96

Using fkms driver and setting hdmi_force_hotplug=1 seems to work and the app is able to start at boot even when no screen is connected.and apparently adjust the resolution automatically when a screen is later connected. But does this have any drawback? Is the fkms driver well supported by flutter-pi? Is it possible to achieve the same results with kms driver?

moham96 avatar Apr 19 '23 08:04 moham96

But does this have any drawback?

The fkms driver showed some flickering in the past (even though vsync is enabled), at least on DSI. Not sure that's still the case

Is the fkms driver well supported by flutter-pi?

Yep, same as the KMS one

Is it possible to achieve the same results with kms driver?

Don't think so I'm afraid, flutter itself doesn't support display hotplugging or multi-display, so any solution would require flutter-pi to fake a display itself. That's quite hacky and also requires some fundamental modesetting changes but the benefit is pretty small. I'll rather wait till flutter has true multi-display & display hotplugging support (that's WIP at the moment, but you can already see some of the work in flutter stable) and then implement it using that

ardera avatar Apr 20 '23 10:04 ardera

I had the same issue and was able to get this running by setting this options:

hdmi_force_hotplug=1

hdmi_group=1
hdmi_mode=76
hdmi_force_mode=1

dtoverlay=vc4-fkms-v3d

FlorianAlt avatar Jun 09 '23 09:06 FlorianAlt