{"id":13547008,"url":"https://github.com/ardera/flutter-pi","last_synced_at":"2025-05-14T09:06:58.204Z","repository":{"id":37445281,"uuid":"190380053","full_name":"ardera/flutter-pi","owner":"ardera","description":"A light-weight Flutter Engine Embedder for Linux Embedded that runs without X11 or Wayland.","archived":false,"fork":false,"pushed_at":"2025-05-13T17:07:46.000Z","size":2902,"stargazers_count":1758,"open_issues_count":107,"forks_count":172,"subscribers_count":56,"default_branch":"master","last_synced_at":"2025-05-14T09:06:22.866Z","etag":null,"topics":["digital-signage","embedded","flutter","flutter-pi","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ardera.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"ardera","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-06-05T11:10:56.000Z","updated_at":"2025-05-14T08:19:00.000Z","dependencies_parsed_at":"2023-02-16T12:46:02.601Z","dependency_job_id":"b3701166-4f4f-4c71-a5da-7133560404dc","html_url":"https://github.com/ardera/flutter-pi","commit_stats":{"total_commits":677,"total_committers":26,"mean_commits":26.03846153846154,"dds":0.07533234859675042,"last_synced_commit":"af8c8d66c5f40a6aaf366882bb9ca525be9c600a"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardera%2Fflutter-pi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardera%2Fflutter-pi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardera%2Fflutter-pi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardera%2Fflutter-pi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ardera","download_url":"https://codeload.github.com/ardera/flutter-pi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110374,"owners_count":22016391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["digital-signage","embedded","flutter","flutter-pi","raspberry-pi"],"created_at":"2024-08-01T12:00:49.434Z","updated_at":"2025-05-14T09:06:58.160Z","avatar_url":"https://github.com/ardera.png","language":"C","readme":"## 📰 NEWS\n- Added a (not complete) sentry plugin, see: https://github.com/ardera/flutter-pi/wiki/Sentry-Support\n- There's now flutterpi tool to make building the app easier: https://pub.dev/packages/flutterpi_tool\n\n# flutter-pi\nA light-weight Flutter Engine Embedder for Raspberry Pi. Inspired by https://github.com/chinmaygarde/flutter_from_scratch.\nFlutter-pi also runs without X11, so you don't need to boot into Raspbian Desktop \u0026 have X11 and LXDE load up; just boot into the command-line.\n\nYou can now **theoretically** run every flutter app you want using flutter-pi, including apps using packages \u0026 plugins, just that you'd have to build the platform side of the plugins you'd like to use yourself.\n\n_The difference between packages and plugins is that packages don't include any native code, they are just pure Dart. Plugins (like the [shared_preferences plugin](https://github.com/flutter/plugins/tree/main/packages/shared_preferences)) include platform-specific code._\n\n## 🖥️ Supported Platforms\nAlthough flutter-pi is only tested on a Rasberry Pi 4 2GB, it should work fine on other linux platforms, with the following conditions:\n\n- support for hardware 3D acceleration. more precisely support for kernel-modesetting (KMS) and the direct rendering infrastructure (DRI) \n- CPU architecture is one of ARMv7, ARMv8, x86 or x86 64bit.\n\nThis means flutter-pi won't work on a Pi Zero (only the first one) or Pi 1.\n\nKnown working boards:\n\n- Pi 2, 3 and 4 (even the 512MB models)\n- Pi Zero 2 (W)\n\nIf you encounter issues running flutter-pi on any of the supported platforms listed above, please report them to me and I'll fix them.\n\n## 📑 Contents\n\n1. **[Building flutter-pi on the Raspberry Pi](#-building-flutter-pi-on-the-raspberry-pi)**  \n1.1 [Dependencies](#dependencies)  \n1.2 [Compiling](#compiling)  \n2. **[Running your App on the Raspberry Pi](#-running-your-app-on-the-raspberry-pi)**  \n2.1 [Configuring your Raspberry Pi](#configuring-your-raspberry-pi)  \n2.2 [Building the App](#building-the-app-new-method-linux-only)  \n2.3 [Running your App with flutter-pi](#running-your-app-with-flutter-pi)  \n2.4 [gstreamer video player](#gstreamer-video-player)  \n2.5 [audioplayers](#audioplayers)\n3. **[Performance](#-performance)**  \n3.1 [Graphics Performance](#graphics-performance)  \n3.2 [Touchscreen latency](#touchscreen-latency)\n4. **[Useful Dart Packages](#-useful-dart-packages)**\n5. **[Discord](#-discord)**\n\n## 🛠 Building flutter-pi on the Raspberry Pi\n- If you want to update flutter-pi, you check out the latest commit using `git pull \u0026\u0026 git checkout origin/master` and continue with [compiling](#compiling), step 2.\n\n### Dependencies\n\n1. ~~Install the engine-binaries~~ (not required anymore, except when using the old method to build the app bundle, see below)\n\n    \u003cdetails\u003e\n\n    \u003csummary\u003eInstructions\u003c/summary\u003e\n\n    - Follow the instructions [in the _flutter-engine-binaries-for-arm_ repo.](https://github.com/ardera/flutter-engine-binaries-for-arm).\n\n      \u003cdetails\u003e\n      \u003csummary\u003eMore Info\u003c/summary\u003e\n    \n      flutter-pi needs flutters `icudtl.dat` and `libflutter_engine.so.{debug,profile,release}` at runtime, depending on the runtime mode used.\n      You actually have two options here:\n\n      - you build the engine yourself. takes a lot of time, and it most probably won't work on the first try. But once you have it set up, you have unlimited freedom on which engine version you want to use. You can find some rough guidelines [here](https://medium.com/flutter/flutter-on-raspberry-pi-mostly-from-scratch-2824c5e7dcb1).\n      - you can use the pre-built engine binaries I am providing [in the _flutter-engine-binaries-for-arm_ repo.](https://github.com/ardera/flutter-engine-binaries-for-arm). I will only provide binaries for some engine versions though (most likely the stable ones).\n\n      \u003c/details\u003e\n\n    \n    \u003c/details\u003e\n\n3. Install cmake, graphics, system libraries and fonts:\n    ```shell\n    sudo apt install cmake libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev ttf-mscorefonts-installer fontconfig libsystemd-dev libinput-dev libudev-dev  libxkbcommon-dev\n    ```\n\n    If you want to use the [gstreamer video player](#gstreamer-video-player), install these too:\n    ```shell\n    sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-alsa\n    ```\n    \u003cdetails\u003e\n      \u003csummary\u003eMore Info\u003c/summary\u003e\n      \n      - flutter-pi needs the mesa OpenGL ES and EGL implementation and libdrm \u0026 libgbm. It may work with non-mesa implementations too, but that's untested.\n      - The flutter engine depends on the _Arial_ font. Since that doesn't come included with Raspbian, you need to install it.\n      - `libsystemd` is not systemd, it's just an utility library. It provides the event loop and dbus support for flutter-pi.\n      - `libinput-dev`, `libudev-dev` and `libxkbcommon-dev` are needed for (touch, mouse, raw keyboard and text) input support.\n      - `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.\n      - `gpiod` and `libgpiod-dev` where required in the past, but aren't anymore since the `flutter_gpiod` plugin will directly access the kernel interface.\n    \u003c/details\u003e\n    \n4. Update the system fonts.\n    ```bash\n    sudo fc-cache\n    ```\n\n### Compiling\n1. Clone flutter-pi and cd into the cloned directory:\n    ```bash\n    git clone --recursive https://github.com/ardera/flutter-pi\n    cd flutter-pi\n    ```\n2. Compile:\n    ```bash\n    mkdir build \u0026\u0026 cd build\n    cmake ..\n    make -j`nproc`\n    ```\n3. Install:\n    ```bash\n    sudo make install\n    ```\n\n## 🚀 Running your App on the Raspberry Pi\n### Configuring your Raspberry Pi\n1. Open raspi-config:\n    ```bash\n    sudo raspi-config\n    ```\n    \n2. Switch to console mode:\n   `System Options -\u003e Boot / Auto Login` and select `Console` or `Console (Autologin)`.\n\n3. *You can skip this if you're on Raspberry Pi 4 with Raspbian Bullseye*  \n    Enable the V3D graphics driver:  \n   `Advanced Options -\u003e GL Driver -\u003e GL (Fake KMS)`\n\n4. Configure the GPU memory\n   `Performance Options -\u003e GPU Memory` and enter `64`.\n\n5. Leave `raspi-config`.\n\n6. Give the `pi` permission to use 3D acceleration. (**NOTE:** potential security hazard. If you don't want to do this, launch `flutter-pi` using `sudo` instead.)\n    ```bash\n    usermod -a -G render pi\n    ```\n\n7. Finish and reboot.\n\n\u003cdetails\u003e\n  \u003csummary\u003eMore information\u003c/summary\u003e\n  \n  - 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.\n  - The old broadcom-proprietary GL driver was bugged and not working with flutter, so we have to use the Fake KMS driver.\n  - 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.\n  - `pi` isn't allowed to directly access the GPU because IIRC this has some privilege escalation bugs. Raspberry Pi has quite a lot of system-critical, not graphics-related stuff running on the GPU. I read somewhere it's easily possible to gain control of the GPU by writing malicious shaders. From there you can gain control of the CPU and thus the linux kernel. So basically the `pi` user could escalate privileges and become `root` just by directly accessing the GPU. But maybe this has already been fixed, I'm not sure.\n\u003c/details\u003e\n\n### Building the App (New Method, Linux-only)\nThe app must be built on your development machine. Note that you can't use a Raspberry Pi as your development machine.\n\n_One-time setup:_\n1. Make sure you've installed the flutter SDK. Only flutter SDK \u003e= 3.10.5 is supported for the new method at the moment.\n2. Install the [flutterpi_tool](https://pub.dev/packages/flutterpi_tool):\n   Run `flutter pub global activate flutterpi_tool` (One time only)\n3. If running `flutterpi_tool` directly doesn't work, follow https://dart.dev/tools/pub/cmd/pub-global#running-a-script-from-your-path\n   to add the dart global bin directory to your path.  \n   Alternatively, you can launch the tool via:\n   `flutter pub global run flutterpi_tool ...`\n\n_Building the app bundle:_\n1. Open terminal or commandline and `cd` into your app directory.\n2. Run `flutterpi_tool build` to build the app.\n    - This will build the app for ARM 32-bit debug mode.\n    - `flutterpi_tool build --help` gives more usage information.\n    - For example, to build for 64-bit ARM, release mode, with a Raspberry Pi 4 tuned engine, use:  \n       `flutterpi_tool build --arch=arm64 --cpu=pi4 --release`\n3. Deploy the bundle to the Raspberry Pi using `rsync` or `scp`:\n    - Using `rsync` (available on linux and macOS or on Windows when using [WSL](https://docs.microsoft.com/de-de/windows/wsl/install-win10))\n       ```bash\n       rsync -a --info=progress2 ./build/flutter_assets/ pi@raspberrypi:/home/pi/my_apps_flutter_assets\n       ```\n     - Using `scp` (available on linux, macOS and Windows)\n       ```bash\n       scp -r ./build/flutter_assets/ pi@raspberrypi:/home/pi/my_apps_flutter_assets\n       ```\n\n_Example:_\n1. We'll build the asset bundle for `flutter_gallery` and deploy it using `rsync` to a Raspberry Pi 4 in this example.\n```bash\ngit clone https://github.com/flutter/gallery.git flutter_gallery\ncd flutter_gallery\ngit checkout d77920b4ced4a105ad35659fbe3958800d418fb9\nflutter pub get\nflutterpi_tool build --release --cpu=pi4\nrsync -a ./build/flutter_assets/ pi@raspberrypi:/home/pi/flutter_gallery/\n```\n\n2. On Raspberry Pi, run `sudo apt-get install xdg-user-dirs` to install the runtime requirement of flutter_gallery. (otherwise it may [throw exception](https://github.com/flutter/gallery/issues/979#issuecomment-1693361972))\n\n3. Done. You can now run this app in release mode using `flutter-pi --release /home/pi/flutter_gallery`.\n\n### Building the App (old method, linux or windows)\n\n\u003cdetails\u003e\n\n\u003csummary\u003eInstructions\u003c/summary\u003e\n    \n1. Make sure you've installed the flutter SDK. **You must** use a flutter SDK that's compatible to the installed engine binaries.\n   - for the flutter SDK, use flutter stable and keep it up to date.  \n   - always use the latest available [engine binaries](https://github.com/ardera/flutter-engine-binaries-for-arm)  \n   \n   If you encounter error messages like `Invalid kernel binary format version`, `Invalid SDK hash` or `Invalid engine hash`:\n   1. Make sure your flutter SDK is on `stable` and up to date and your engine binaries are up to date.\n   2. If you made sure that's the case and the error still happens, create a new issue.\n   \n2. Open terminal or commandline and `cd` into your app directory.\n\n3. `flutter build bundle`\n\n4. Deploy the asset bundle to the Raspberry Pi using `rsync` or `scp`.\n   - Using `rsync` (available on linux and macOS or on Windows when using [WSL](https://docs.microsoft.com/de-de/windows/wsl/install-win10))\n       ```bash\n       rsync -a --info=progress2 ./build/flutter_assets/ pi@raspberrypi:/home/pi/my_apps_flutter_assets\n       ```\n   - Using `scp` (available on linux, macOS and Windows)\n       ```bash\n       scp -r ./build/flutter_assets/ pi@raspberrypi:/home/pi/my_apps_flutter_assets\n       ```\n       \n#### Example\n1. We'll build the asset bundle for `flutter_gallery` and deploy it using `rsync` in this example.\n```bash\ngit clone https://github.com/flutter/gallery.git flutter_gallery\ncd flutter_gallery\ngit checkout d77920b4ced4a105ad35659fbe3958800d418fb9\nflutter build bundle\nrsync -a ./build/flutter_assets/ pi@raspberrypi:/home/pi/flutter_gallery/\n```\n3. Done. You can now run this app in debug-mode using `flutter-pi /home/pi/flutter_gallery`.\n\n\u003cdetails\u003e\n  \u003csummary\u003eMore information\u003c/summary\u003e\n    \n  - flutter_gallery is developed against flutter master. `d77920b4ced4a105ad35659fbe3958800d418fb9` is currently the latest flutter gallery\n    commit working with flutter stable.\n\u003c/details\u003e\n\n### Building the `app.so` (for running your app in Release/Profile mode)\n- This is done entirely on your development machine as well.\n\n1. Find out the path to your flutter SDK. For me it's `C:\\flutter`. (I'm on Windows)\n2. Open terminal or commandline and `cd` into your app directory.\n3. Build the asset bundle.\n   ```\n   flutter build bundle\n   ```\n4. Build the kernel snapshot. (Replace `my_app_name` with the name of your app)\n    ```cmd\n    C:\\flutter\\bin\\cache\\dart-sdk\\bin\\dart.exe ^\n      C:\\flutter\\bin\\cache\\dart-sdk\\bin\\snapshots\\frontend_server.dart.snapshot ^\n      --sdk-root C:\\flutter\\bin\\cache\\artifacts\\engine\\common\\flutter_patched_sdk_product ^\n      --target=flutter ^\n      --aot ^\n      --tfa ^\n      -Ddart.vm.product=true ^\n      --packages .dart_tool\\package_config.json ^\n      --output-dill build\\kernel_snapshot.dill ^\n      --verbose ^\n      --depfile build\\kernel_snapshot.d ^\n      package:my_app_name/main.dart\n    ```\n\n\u003cdetails\u003e\n  \u003csummary\u003eMore information\u003c/summary\u003e\n\n  - In versions prior to Flutter 3.3.0 the `--packages` argument should be set to `.packages`. In versions greater than or equal to 3.3.0 the `--packages` argument should be set to `.dart_tool\\package_config.json`.\n\u003c/details\u003e\n\n5. Fetch the latest `gen_snapshot_linux_x64_release` I provide in the [engine binaries repo](https://github.com/ardera/flutter-engine-binaries-for-arm).\n6. The following steps must be executed on a linux x64 machine. If you're on windows, you can use [WSL](https://docs.microsoft.com/de-de/windows/wsl/install-win10). If you're on macOS, you can use a linux VM.\n7. Build the `app.so`. If you're building for _arm64_, you need to omit the `--sim-use-hardfp` flag.\n    ```bash\n    gen_snapshot_linux_x64_release \\\n      --deterministic \\\n      --snapshot_kind=app-aot-elf \\\n      --elf=build/flutter_assets/app.so \\\n      --strip \\\n      --sim-use-hardfp \\\n      build/kernel_snapshot.dill\n    ```\n8. Now you can switch to your normal OS again.\n9. Upload the asset bundle and the `app.so` to your Raspberry Pi.\n    ```bash\n    rsync -a --info=progress2 ./build/flutter_assets/ pi@raspberrypi:/home/pi/my_app\n    ```\n    or\n    ```\n    scp -r ./build/flutter_assets/ pi@raspberrypi:/home/pi/my_app\n    ```\n10. You can now launch the app in release mode using `flutter-pi --release /home/pi/my_app`\n\n#### Complete example on Windows\n1. We'll build the asset bundle for `flutter_gallery` and deploy it using `rsync` in this example.\n    ```bash\n    git clone https://github.com/flutter/gallery.git flutter_gallery\n    git clone --depth 1 https://github.com/ardera/flutter-engine-binaries-for-arm.git engine-binaries\n    cd flutter_gallery\n    git checkout d77920b4ced4a105ad35659fbe3958800d418fb9\n    flutter build bundle\n    C:\\flutter\\bin\\cache\\dart-sdk\\bin\\dart.exe ^\n      C:\\flutter\\bin\\cache\\dart-sdk\\bin\\snapshots\\frontend_server.dart.snapshot ^\n      --sdk-root C:\\flutter\\bin\\cache\\artifacts\\engine\\common\\flutter_patched_sdk_product ^\n      --target=flutter ^\n      --aot ^\n      --tfa ^\n      -Ddart.vm.product=true ^\n      --packages .dart_tool\\package_config.json ^\n      --output-dill build\\kernel_snapshot.dill ^\n      --verbose ^\n      --depfile build\\kernel_snapshot.d ^\n      package:gallery/main.dart\n    wsl\n    ../engine-binaries/arm/gen_snapshot_linux_x64_release \\\n      --deterministic \\\n      --snapshot_kind=app-aot-elf \\\n      --elf=build/flutter_assets/app.so \\\n      --strip \\\n      --sim-use-hardfp \\\n      build/kernel_snapshot.dill\n    rsync -a --info=progress2 ./build/flutter_assets/ pi@raspberrypi:/home/pi/flutter_gallery/\n    exit\n    ```\n3. Done. You can now run this app in release mode using `flutter-pi --release /home/pi/flutter_gallery`.\n\n\u003c/details\u003e\n\n### Running your App with flutter-pi\n```txt\npi@hpi4:~ $ flutter-pi --help\nflutter-pi - run flutter apps on your Raspberry Pi.\n\nUSAGE:\n  flutter-pi [options] \u003cbundle path\u003e [flutter engine options]\n\nOPTIONS:\n  --release                  Run the app in release mode. The AOT snapshot\n                             of the app must be located inside the bundle directory.\n                             This also requires a libflutter_engine.so that was\n                             built with --runtime-mode=release.\n\n  --profile                  Run the app in profile mode. The AOT snapshot\n                             of the app must be located inside the bundle directory.\n                             This also requires a libflutter_engine.so that was\n                             built with --runtime-mode=profile.\n\n  --vulkan                   Use vulkan for rendering.\n\n  -o, --orientation \u003corientation\u003e  Start the app in this orientation. Valid\n                             for \u003corientation\u003e are: portrait_up, landscape_left,\n                             portrait_down, landscape_right.\n                             For more information about this orientation, see\n                             the flutter docs for the \"DeviceOrientation\"\n                             enum.\n                             Only one of the --orientation and --rotation\n                             options can be specified.\n\n  -r, --rotation \u003cdegrees\u003e   Start the app with this rotation. This is just an\n                             alternative, more intuitive way to specify the\n                             startup orientation. The angle is in degrees and\n                             clock-wise.\n                             Valid values are 0, 90, 180 and 270.\n\n  -d, --dimensions \"width_mm,height_mm\" The width \u0026 height of your display in\n                             millimeters. Useful if your GPU doesn't provide\n                             valid physical dimensions for your display.\n                             The physical dimensions of your display are used\n                             to calculate the flutter device-pixel-ratio, which\n                             in turn basically \"scales\" the UI.\n\n  --pixelformat \u003cformat\u003e     Selects the pixel format to use for the framebuffers.\n                             If this is not specified, a good pixel format will\n                             be selected automatically.\n                             Available pixel formats: RGB565, ARGB4444, XRGB4444, ARGB1555, XRGB1555, ARGB8888, XRGB8888, BGRA8888, BGRX8888, RGBA8888, RGBX8888, \n  --videomode widthxheight\n  --videomode widthxheight@hz  Uses an output videomode that satisfies the argument.\n                             If no hz value is given, the highest possible refreshrate\n                             will be used.\n\n  --dummy-display            Simulate a display. Useful for running apps\n                             without a display attached.\n  --dummy-display-size \"width,height\" The width \u0026 height of the dummy display\n                             in pixels.\n\n  -h, --help                 Show this help and exit.\n\nEXAMPLES:\n  flutter-pi ~/hello_world_app\n  flutter-pi --release ~/hello_world_app\n  flutter-pi -o portrait_up ./my_app\n  flutter-pi -r 90 ./my_app\n  flutter-pi -d \"155, 86\" ./my_app\n  flutter-pi --videomode 1920x1080 ./my_app\n  flutter-pi --videomode 1280x720@60 ./my_app\n\nSEE ALSO:\n  Author:  Hannes Winkler, a.k.a ardera\n  Source:  https://github.com/ardera/flutter-pi\n  License: MIT\n\n  For instructions on how to build an asset bundle or an AOT snapshot\n    of your app, please see the linked github repository.\n  For a list of options you can pass to the flutter engine, look here:\n    https://github.com/flutter/engine/blob/main/shell/common/switches.h\n```\n\n`\u003casset bundle path\u003e` is the path of the flutter asset bundle directory (i.e. the directory containing `kernel_blob.bin`)\nof the flutter app you're trying to run.\n\n`[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).\n\n### gstreamer video player\nGstreamer video player is a newer video player based on gstreamer.\n\nTo 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))\n\nAnd 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)\n\n### audioplayers\nAs of current moment flutter-pi implements plugin for `audioplayers: ^5.0.0`.\nThere are several things you need to keep in mind:\n- 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`\n- Plugin was tested to work with ALSA and `pulseaudio` might prevent the plugin from playing audio correctly:\n    - Hence please make sure you delete `pulseaudio` package from your system.\n    - Make sure you have `gstreamer1.0-alsa` package installed in addition to packages needed for gstreamer video player.\n    - Make sure you can list audio devices using command: `aplay -L`\n        - If there is error, please investigate why and fix it before using audio\n        - One of the common reasons is outdated ALSA config in which case you should delete existing config and replace it with up to date one\n- Finally, if you want to verify your audio setup is good, you can use `gst-launch` command to invoke `playbin` on audio file directly.\n\n## 📊 Performance\n### Graphics Performance\nGraphics performance is actually pretty good. With most of the apps inside the `flutter SDK -\u003e examples -\u003e catalog` directory I get smooth 50-60fps on the Pi 4 2GB and Pi 3 A+.\n\n### Touchscreen Latency\nDue to the way the touchscreen driver works in raspbian, there's some delta between an actual touch of the touchscreen and a touch event arriving at userspace. The touchscreen driver in the raspbian kernel actually just repeatedly polls some buffer shared with the firmware running on the VideoCore, and the videocore repeatedly polls the touchscreen. (both at 60Hz) So on average, there's a delay of 17ms (minimum 0ms, maximum 34ms). Actually, the firmware is polling correctly at ~60Hz, but the linux driver is not because there's a bug. The linux side actually polls at 25Hz, which makes touch applications look terrible. (When you drag something in a touch application, but the application only gets new touch data at 25Hz, it'll look like the application itself is _redrawing_ at 25Hz, making it look very laggy) The github issue for this raspberry pi kernel bug is [here](https://github.com/raspberrypi/linux/issues/3777). Leave a like on the issue if you'd like to see this fixed in the kernel.\n\nThis is why I created my own (userspace) touchscreen driver, for improved latency \u0026 polling rate. See [this repo](https://github.com/ardera/raspberrypi-fast-ts) for details. The driver is very easy to use and the difference is noticeable, flutter apps look and feel a lot better with this driver.\n\n## 📦 Useful Dart Packages\n\n| Package | Category    | Author | Description |\n| - | - | - | - |\n| flutterpi_tool ([package](https://pub.dev/packages/flutterpi_tool/)) ([repo](https://github.com/ardera/flutterpi_tool)) | 🔧 tooling | Hannes Winkler (me) | Tool to make developing \u0026 distributing apps for flutter-pi easier. |\n| flutter_gpiod ([package](https://pub.dev/packages/flutter_gpiod/)) ([repo](https://github.com/ardera/flutter_packages/tree/main/packages/flutter_gpiod)) | 🖨 peripherals | Hannes Winkler | GPIO control support for dart/flutter, uses kernel interfaces directly for more performance. |\n| linux_serial ([package](https://pub.dev/packages/linux_serial/)) ([repo](https://github.com/ardera/flutter_packages/tree/main/packages/linux_serial)) | 🖨 peripherals | Hannes Winkler | Serial Port support for dart/flutter, uses kernel interfaces directly for more performance. |\n| 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. |\n| 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. |\n| 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. |\n| charset_converter ([package](https://pub.dev/packages/charset_converter)) ([repo](https://github.com/pr0gramista/charset_converter)) | 🗚 encoding | Bartosz Wiśniewski | Encode and decode charsets using platform built-in converter. |\n| sentry_flutter ([package](https://pub.dev/packages/sentry_flutter)) ([repo](https://github.com/getsentry/sentry-dart))|  📊 Monitoring | sentry.io | See https://github.com/ardera/flutter-pi/wiki/Sentry-Support for instructions. |\n\n## 💬 Discord\nThere 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.\n","funding_links":["https://github.com/sponsors/ardera"],"categories":["实用工具","C","工具集","Projects","Desktop [🔝](#readme)","Utilities","20. 桌面/嵌入式开发（跨平台扩展）"],"sub_categories":["桌面应用","桌面端","Desktop","应用内购买"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardera%2Fflutter-pi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fardera%2Fflutter-pi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardera%2Fflutter-pi/lists"}