Skip to content

Commit 09696d0

Browse files
committed
Apply comments
1 parent 21d902a commit 09696d0

File tree

1 file changed

+31
-34
lines changed

1 file changed

+31
-34
lines changed

README.md

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ _The difference between packages and plugins is that packages don't include any
1919
## 🖥️ Supported Platforms
2020
Although flutter-pi is only tested on a Rasberry Pi 4 2GB, it should work fine on other linux platforms, with the following conditions:
2121

22-
- support for hardware 3D acceleration. more precisely support for kernel-modesetting (KMS) and the direct rendering infrastructure (DRI)
22+
- support for hardware 3D acceleration. more precisely support for kernel-modesetting (KMS) and the direct rendering infrastructure (DRI)
2323
- CPU architecture is one of ARMv7, ARMv8, x86 or x86 64bit.
2424

2525
This means flutter-pi won't work on a Pi Zero (only the first one) or Pi 1.
@@ -33,16 +33,17 @@ If you encounter issues running flutter-pi on any of the supported platforms lis
3333

3434
## 📑 Contents
3535

36-
1. **[Building flutter-pi on the Raspberry Pi](#-building-flutter-pi-on-the-raspberry-pi)**
37-
1.1 [Dependencies](#dependencies)
38-
1.2 [Compiling](#compiling)
39-
2. **[Running your App on the Raspberry Pi](#-running-your-app-on-the-raspberry-pi)**
40-
2.1 [Configuring your Raspberry Pi](#configuring-your-raspberry-pi)
41-
2.2 [Building the App](#building-the-app-new-method-linux-only)
42-
2.3 [Running your App with flutter-pi](#running-your-app-with-flutter-pi)
43-
2.4 [gstreamer video player](#gstreamer-video-player)
44-
3. **[Performance](#-performance)**
45-
3.1 [Graphics Performance](#graphics-performance)
36+
1. **[Building flutter-pi on the Raspberry Pi](#-building-flutter-pi-on-the-raspberry-pi)**
37+
1.1 [Dependencies](#dependencies)
38+
1.2 [Compiling](#compiling)
39+
2. **[Running your App on the Raspberry Pi](#-running-your-app-on-the-raspberry-pi)**
40+
2.1 [Configuring your Raspberry Pi](#configuring-your-raspberry-pi)
41+
2.2 [Building the App](#building-the-app-new-method-linux-only)
42+
2.3 [Running your App with flutter-pi](#running-your-app-with-flutter-pi)
43+
2.4 [gstreamer video player](#gstreamer-video-player)
44+
2.5 [audioplayers](#audioplayers)
45+
3. **[Performance](#-performance)**
46+
3.1 [Graphics Performance](#graphics-performance)
4647
3.2 [Touchscreen latency](#touchscreen-latency)
4748
4. **[Useful Dart Packages](#-useful-dart-packages)**
4849
5. **[Discord](#-discord)**
@@ -62,7 +63,7 @@ If you encounter issues running flutter-pi on any of the supported platforms lis
6263

6364
<details>
6465
<summary>More Info</summary>
65-
66+
6667
flutter-pi needs flutters `icudtl.dat` and `libflutter_engine.so.{debug,profile,release}` at runtime, depending on the runtime mode used.
6768
You actually have two options here:
6869

@@ -71,7 +72,7 @@ If you encounter issues running flutter-pi on any of the supported platforms lis
7172

7273
</details>
7374

74-
75+
7576
</details>
7677

7778
3. Install cmake, graphics, system libraries and fonts:
@@ -85,15 +86,15 @@ If you encounter issues running flutter-pi on any of the supported platforms lis
8586
```
8687
<details>
8788
<summary>More Info</summary>
88-
89+
8990
- flutter-pi needs the mesa OpenGL ES and EGL implementation and libdrm & libgbm. It may work with non-mesa implementations too, but that's untested.
9091
- The flutter engine depends on the _Arial_ font. Since that doesn't come included with Raspbian, you need to install it.
9192
- `libsystemd` is not systemd, it's just an utility library. It provides the event loop and dbus support for flutter-pi.
9293
- `libinput-dev`, `libudev-dev` and `libxkbcommon-dev` are needed for (touch, mouse, raw keyboard and text) input support.
9394
- `libudev-dev` is required, but actual udev is not. Flutter-pi will just open all `event` devices inside `/dev/input` (unless overwritten using `-i`) if udev is not present.
9495
- `gpiod` and `libgpiod-dev` where required in the past, but aren't anymore since the `flutter_gpiod` plugin will directly access the kernel interface.
9596
</details>
96-
97+
9798
4. Update the system fonts.
9899
```bash
99100
sudo fc-cache
@@ -122,12 +123,12 @@ If you encounter issues running flutter-pi on any of the supported platforms lis
122123
```bash
123124
sudo raspi-config
124125
```
125-
126+
126127
2. Switch to console mode:
127128
`System Options -> Boot / Auto Login` and select `Console` or `Console (Autologin)`.
128129

129-
3. *You can skip this if you're on Raspberry Pi 4 with Raspbian Bullseye*
130-
Enable the V3D graphics driver:
130+
3. *You can skip this if you're on Raspberry Pi 4 with Raspbian Bullseye*
131+
Enable the V3D graphics driver:
131132
`Advanced Options -> GL Driver -> GL (Fake KMS)`
132133
133134
4. Configure the GPU memory
@@ -144,7 +145,7 @@ If you encounter issues running flutter-pi on any of the supported platforms lis
144145

145146
<details>
146147
<summary>More information</summary>
147-
148+
148149
- flutter-pi requires that no other process, like a X11- or wayland-server, is using the video output. So to disable the desktop environment, we boot into console instead.
149150
- The old broadcom-proprietary GL driver was bugged and not working with flutter, so we have to use the Fake KMS driver.
150151
- Actually, you can also configure 16MB of GPU memory if you want to. 64MB are needed when you want to use the [`omxplayer_video_player`](https://pub.dev/packages/omxplayer_video_player) plugin.
@@ -159,7 +160,7 @@ _One-time setup:_
159160
2. Install the [flutterpi_tool](https://pub.dev/packages/flutterpi_tool):
160161
Run `flutter pub global activate flutterpi_tool` (One time only)
161162
3. If running `flutterpi_tool` directly doesn't work, follow https://dart.dev/tools/pub/cmd/pub-global#running-a-script-from-your-path
162-
to add the dart global bin directory to your path.
163+
to add the dart global bin directory to your path.
163164
Alternatively, you can launch the tool via:
164165
`flutter pub global run flutterpi_tool ...`
165166

@@ -168,7 +169,7 @@ _Building the app bundle:_
168169
2. Run `flutterpi_tool build` to build the app.
169170
- This will build the app for ARM 32-bit debug mode.
170171
- `flutterpi_tool build --help` gives more usage information.
171-
- For example, to build for 64-bit ARM, release mode, with a Raspberry Pi 4 tuned engine, use:
172+
- For example, to build for 64-bit ARM, release mode, with a Raspberry Pi 4 tuned engine, use:
172173
`flutterpi_tool build --arch=arm64 --cpu=pi4 --release`
173174
3. Deploy the bundle to the Raspberry Pi using `rsync` or `scp`:
174175
- Using `rsync` (available on linux and macOS or on Windows when using [WSL](https://docs.microsoft.com/de-de/windows/wsl/install-win10))
@@ -197,15 +198,15 @@ rsync -a ./build/flutter_assets/ pi@raspberrypi:/home/pi/flutter_gallery/
197198
<details>
198199
199200
<summary>Instructions</summary>
200-
201+
201202
1. Make sure you've installed the flutter SDK. **You must** use a flutter SDK that's compatible to the installed engine binaries.
202-
- for the flutter SDK, use flutter stable and keep it up to date.
203-
- always use the latest available [engine binaries](https://github.com/ardera/flutter-engine-binaries-for-arm)
204-
203+
- for the flutter SDK, use flutter stable and keep it up to date.
204+
- always use the latest available [engine binaries](https://github.com/ardera/flutter-engine-binaries-for-arm)
205+
205206
If you encounter error messages like `Invalid kernel binary format version`, `Invalid SDK hash` or `Invalid engine hash`:
206207
1. Make sure your flutter SDK is on `stable` and up to date and your engine binaries are up to date.
207208
2. If you made sure that's the case and the error still happens, create a new issue.
208-
209+
209210
2. Open terminal or commandline and `cd` into your app directory.
210211

211212
3. `flutter build bundle`
@@ -219,7 +220,7 @@ rsync -a ./build/flutter_assets/ pi@raspberrypi:/home/pi/flutter_gallery/
219220
```bash
220221
scp -r ./build/flutter_assets/ pi@raspberrypi:/home/pi/my_apps_flutter_assets
221222
```
222-
223+
223224
#### Example
224225
1. We'll build the asset bundle for `flutter_gallery` and deploy it using `rsync` in this example.
225226
```bash
@@ -233,7 +234,7 @@ rsync -a ./build/flutter_assets/ pi@raspberrypi:/home/pi/flutter_gallery/
233234
234235
<details>
235236
<summary>More information</summary>
236-
237+
237238
- flutter_gallery is developed against flutter master. `d77920b4ced4a105ad35659fbe3958800d418fb9` is currently the latest flutter gallery
238239
commit working with flutter stable.
239240
</details>
@@ -373,7 +374,7 @@ OPTIONS:
373374
--pixelformat <format> Selects the pixel format to use for the framebuffers.
374375
If this is not specified, a good pixel format will
375376
be selected automatically.
376-
Available pixel formats: RGB565, ARGB4444, XRGB4444, ARGB1555, XRGB1555, ARGB8888, XRGB8888, BGRA8888, BGRX8888, RGBA8888, RGBX8888,
377+
Available pixel formats: RGB565, ARGB4444, XRGB4444, ARGB1555, XRGB1555, ARGB8888, XRGB8888, BGRA8888, BGRX8888, RGBA8888, RGBX8888,
377378
--videomode widthxheight
378379
--videomode widthxheight@hz Uses an output videomode that satisfies the argument.
379380
If no hz value is given, the highest possible refreshrate
@@ -407,18 +408,15 @@ of the flutter app you're trying to run.
407408
`[flutter engine options...]` will be passed as commandline arguments to the flutter engine. You can find a list of commandline options for the flutter engine [Here](https://github.com/flutter/engine/blob/master/shell/common/switches.h).
408409
409410
### gstreamer video player
410-
Gstreamer video player is a newer video player based on gstreamer. The older video player (omxplayer_video_player) was based on deprecated omxplayer and it was kind of a hack. So I recommend using the gstreamer one instead.
411+
Gstreamer video player is a newer video player based on gstreamer. The older video player (omxplayer_video_player) was based on deprecated omxplayer and it was kind of a hack. So I recommend using the gstreamer one instead.
411412
412413
To use the gstreamer video player, just rebuild flutter-pi (delete your build folder and reconfigure) and make sure the necessary gstreamer packages are installed. (See [dependencies](#dependencies))
413414
414415
And then, just use the stuff in the official [video_player](https://pub.dev/packages/video_player) package. (`VideoPlayer`, `VideoPlayerController`, etc, there's nothing specific you need to do on the dart-side)
415416
416417
### audioplayers
417-
418418
As of current moment flutter-pi implements plugin for `audioplayers: ^4.0.0`.
419-
420419
There are several things you need to keep in mind:
421-
422420
- As flutter-pi is intended for use on constrained systems like raspberry pi, you should avoid creating multiple temporary instances and instead prefer to use one global instance of `AudioPlayer`. There is limit you can easily hit if you're going to spam multiple instances of `AudioPlayer`
423421
- Plugin was tested to work with ALSA and `pulseaudio` might prevent the plugin from playing audio correctly:
424422
- Hence please make sure you delete `pulseaudio` package from your system.
@@ -447,7 +445,6 @@ This is why I created my own (userspace) touchscreen driver, for improved latenc
447445
| linux_spidev ([package](https://pub.dev/packages/linux_spidev/)) ([repo](https://github.com/ardera/flutter_packages/tree/main/packages/linux_spidev)) | 🖨 peripherals | Hannes Winkler | SPI bus support for dart/flutter, uses kernel interfaces directly for more performance. |
448446
| dart_periphery ([package](https://pub.dev/packages/dart_periphery)) ([repo](https://github.com/pezi/dart_periphery)) | 🖨 peripherals | [Peter Sauer](https://github.com/pezi/) | All-in-one package GPIO, I2C, SPI, Serial, PWM, Led, MMIO support using c-periphery. |
449447
| flutterpi_gstreamer_video_player ([package](https://pub.dev/packages/flutterpi_gstreamer_video_player)) ([repo](https://github.com/ardera/flutter_packages/tree/main/packages/flutterpi_gstreamer_video_player)) | ⏯️ multimedia | Hannes Winkler | Official video player implementation for flutter-pi. See [GStreamer video player](#gstreamer-video-player) section above. |
450-
| audioplayers ([package](https://pub.dev/packages/audioplayers)) ([repo](https://github.com/bluefireteam/audioplayers/tree/main/packages/audioplayers)) | ⏯️ multimedia | Blue Fire | flutter-pi implements audio plugin v4. |
451448
452449
## 💬 Discord
453450
There a `#custom-embedders` channel on the [flutter discord](https://github.com/flutter/flutter/wiki/Chat) which you can use if you have any questions regarding flutter-pi or generally, anything related to embedding the engine for which you don't want to open issue about or write an email.

0 commit comments

Comments
 (0)