Embedded Linux embedding for Flutter

Overview

Embedded Linux (eLinux) embedding for Flutter

image

build-test

This project was created to develop non-official embedded Linux embeddings of Flutter. This embedder is focusing on embedded Linux system use cases. It is also implemented based on Flutter desktop for Windows and has some unique features to use it in embedded systems.

flutter-elinux

Note that this project is the source code of the embedder. If you develop your flutter app for eLinux, use flutter-elinux, which is a non-official extension to the Flutter SDK to build and debug Flutter apps for embedded Linux devices.

Objective & Goal

Our objective is to use Flutter in embedded systems. We're developing this embedder to use Flutter in embedded products. Ultimately we would like to propose and contribute this software to the mainline of Flutter Engine, which means we would like to add an embedded systems version into the Flutter repo for all embedded developers. Please note that this is just our ideal, not the official opinion of the Flutter community.

We would be grateful if you could give us feedback on bugs and new feature requests. We would like to cover the specifications of general-purpose embedded systems.

Features

  • Flutter embedder optimized for Embedded Systems
    • Lightweight than Flutter desktop for Linux (Not using X11 and GTK)
    • Minimal dependent libraries
    • The main target of this embedder is Arm64 devices. We haven't confirmed in Arm 32bit (ARMv7, armhf) devices
  • Display backend support
  • Always single window fullscreen
    • You can choose always-fullscreen or flexible-screen (any size) only when using Wayland/X11 backend
  • Keyboard, mouse and touch inputs support
  • Equivalent quality to Flutter desktops
  • API compatibility with Flutter desktop for Windows and GLFW
    • APIs such as MethodChannel and EventChannel are completely the same with them

Companion repos

Repo Purpose
flutter-elinux Flutter tools for eLinux
flutter-elinux-plugins Flutter plugins for eLinux
meta-flutter Yocto recipes of eLinux embedding for Flutter

Documentation

Documentation for this software can be found at Wiki.

Supported platforms

This embedder supports x64 and Arm64 (aarch64, ARMv8) architectures on Linux which supports either Wayland backend or DRM backend.

Tested devices

Board / SoC Vendor OS / BSP Backend Status
Jetson Nano NVIDIA JetPack 4.3 Wayland ✔️
Jetson Nano NVIDIA JetPack 4.3 DRM ✔️ (#1)
Raspberry Pi 4 Model B Raspberry Pi Foundation Ubuntu 20.10 Wayland ✔️
Raspberry Pi 4 Model B Raspberry Pi Foundation Ubuntu 20.10 DRM ✔️ (#9)
i.MX 8MQuad EVK NXP Sumo (kernel 4.14.98) Wayland ✔️
i.MX 8M Mini EVKB NXP Zeus (kernel 5.4.70) Wayland ✔️
RB5 Development Kit Qualcomm Ubuntu 18.04.05 DRM ✔️
Zynq Xilinx - - Not tested
Desktop (x86_64) Intel Ubuntu 20.04 Wayland ✔️
Desktop (x86_64) Intel Ubuntu 20.04 DRM ✔️
Desktop (x86_64) Intel Ubuntu 20.04 X11 ✔️
QEMU (x86_64) QEMU AGL (Automotive Grade Linux) koi Wayland ✔️
QEMU (x86_64) QEMU AGL (Automotive Grade Linux) koi DRM ✔️

Note

  • i.MX 8M platforms don't support applications using EGL on GBM, which means the DRM-GBM backend won't work on i.MX 8M devices.

Tested Wayland compositors

Weston ✔️ Sway ✔️ Wayfire ✔️ Gnome ✔️ Phosh ✔️
Cage ✔️ Lomiri ✔️ Plasma Wayland ✔️ Plasma Mobile ✔️ GlacierUX ✔️

Contributing

Now, we cannot accept any Pull Request (PR). Because We are building a system (e.g. CLA) to accept PRs, so please wait for a while the system is getting ready! However, we are always welcome to report bugs and request new features by creating issues.

With the assumption, our final goal of this software openly is to be merged this embedder into Flutter Engine after getting feedbacks. And Google CLA will be required when we do that in the future. Therefore, we cannot easily accept an external PR. However, you can free to create issues for reporting bugs and requesting new features.

See also: Contributing to the Flutter engine

Comments
  • On-screen keyboard doesn't work

    On-screen keyboard doesn't work

    Currently, the virtual keyboard input is only enabled when running as weston-desktop-shell. Reported from: https://twitter.com/PakoSStoyanov/status/1391034963030597632

    bug wayland on-screen keyboard 
    opened by HidenoriMatsubayashi 36
  • Can't run Gallery app

    Can't run Gallery app

    Can't start the Gallery app using the embedder. There are no log messages to help narrow down why that is:

    $ ./flutter-client ./gallery/build/linux/x64/release/bundle     
    
    

    Observed on my x64 system as well as the PinebookPro (rk3399) and PinePhone (Allwinner A64).

    Tried with drm client and debug modes as well - still no feedback from the system as to why it doesn't want to start.

    bug wayland 
    opened by psstoyanov 22
  • Add Yocto support

    Add Yocto support

    Do you have a plan to add a Yocto support for flutter-embedded-linux?

    Yocto Layer for the Flutter already exists : https://github.com/jwinarske/meta-flutter

    It has support for some of the engines, such as flutter-pi.

    enhancement yocto 
    opened by jmarijan 19
  • Mouse cursor is visible even when no mouse is connected

    Mouse cursor is visible even when no mouse is connected

    There is a mouse cursor that appears even when no mouse is connected, on flutter-pi it only comes up when a mouse is connected however in this case it comes up by default on. This is on a gbm backend

    drm mouse-cursor 
    opened by Taha-Firoz 18
  • Test in various Wayland compositors

    Test in various Wayland compositors

    At the moment using the standalone wayland client appears to be made to work only within a Weston environment. My attempts to use the embedder with other Wayland environments such as Plasma Wayland, wlroots based ones like Wayfire result in the following error:

    [ERROR][linuxes_window_wayland.cc(627)] Invalid compositor and shell.
    Failed to create view controller.
    

    I haven't attempted to run the embedder within Cage or Phosh but I don't expect different results.

    From what I can see, this is because the defined shell protocol is specific to Weston's implementation: https://github.com/sony/flutter-embedded-linux/tree/master/src/wayland/protocol

    Would using a different shell implementation like xdg allow for more Wayland environments to be supported? Or is the error given by the embedder a result from different check defined somewhere in linuxes_window_wayland.h?

    From the Wayland book, I can see the section explaining on how to generate the C headers and glue code. Would experiments with other shell protocols be useful to the project?

    My understanding isn't as complete as I would like it to be so I don't know if I'm just using the Wayland client incorrectly in this case.

    wayland 
    opened by psstoyanov 17
  • Building flutter-engine with fontconfig support

    Building flutter-engine with fontconfig support

    If we want to display CJK characters using system font, we have to enable fontconfig support. Just add --enable-fontconfig to ./flutter/tools/gn command. Could you please consider enabling this in your CI pipeline when you build the artifacts?

    enhancement 
    opened by andreadaoud 14
  • Run with Wayland backend

    Run with Wayland backend

    After following the docs, I have been trying to run with Wayland backend, however I get the error which I have been unable to resolve:

    ./flutter-client --bundle=./sample/build/linux/x64/release/bundle/
    embedder.cc (939): 'FlutterEngineInitialize' returned 'kInvalidArguments'. Not running in AOT mode but could not resolve the kernel binary.
    [ERROR][flutter_linuxes_engine.cc(221)] Failed to start Flutter engine: error 2
    Failed to create view controller.
    Failed to create a Flutter window.
    

    Any help would be greatly appreciated! Thanks

    opened by alfiedouglas-tewke 13
  • Ozone abstraction

    Ozone abstraction

    Hi, I was wondering if you might be interested in using Ozone to abstract away the back ends for Wayland, DRM, etc.

    That would also bring along support for X11, Cast and any future backends as well.

    There is no dependency on any other toolkit like GTK or even a dependency on Chromium.

    It would bring along support for running headless, using hardware overlays and zero-copy texture uploads for things like low power hardware accelerated video on embedded and desktop platforms.

    opened by oilipheist 13
  • [README] Installing the embedder library and using different modes (debug/profile/release)

    [README] Installing the embedder library and using different modes (debug/profile/release)

    The documentation implies that libflutter_engine.so has to be installed here:

    • https://github.com/sony/flutter-embedded-linux#install-flutter-core-embedder-library and here:
    • https://github.com/sony/flutter-embedded-linux/blob/master/BUILDING-ENGINE-EMBEDDER.md#5-install-embedder-library

    While this is the preferred method, the libraries can be loaded without placing them in /urs/lib. The following method can be used instead: LD_LIBRARY_PATH=<path_to_engine> ./flutter-client ./sample/build/linux/x64/debug/bundle

    This could be useful when:

    • Switching quickly between debug / profile / release modes for the Flutter application without replacing libflutter_engine.so
    documentation 
    opened by psstoyanov 13
  • DRM doesn't work the PinePhone

    DRM doesn't work the PinePhone

    Using PinePhone running ManjaroARM with Plasma Mobile, the DRM backend doesn't work. Device information:

    • Allwinner A64
    • kernel: Linux plasma-mobile 5.11.4-1-MANJARO-ARM #1 SMP Sun Mar 7 19:22:26 UTC 2021 aarch64 GNU/Linux
    • mesa: 20.3.4 (the device is using the Lima driver)

    Flutter version:

    $ flutter --version
    Flutter 2.1.0-11.0.pre.164 • channel unknown • unknown source
    Framework • revision ede798e029 (2 days ago) • 2021-03-09 01:34:02 -0500
    Engine • revision 2441c476a6
    Tools • Dart 2.13.0 (build 2.13.0-116.0.dev)
    

    LLDB trace when running the drm backend:

    Process 29798 launched: '/home/kde/flutter-embedded-linux/build/flutter-drm-backend' (aarch64)
    [ERROR][native_window_drm.cc(185)] Couldn't get resources
    Process 29798 stopped
    * thread #1, name = 'flutter-drm-bac', stop reason = signal SIGSEGV: invalid address (fault address: 0x20)
        frame #0: 0x0000aaaaaab2e570 flutter-drm-backend`flutter::NativeWindowDrm::FindConnector(this=0x0000aaaaaac75870, resources=0x0000000000000000) at native_window_drm.cc:215:34
       212 	}
       213 	
       214 	drmModeConnectorPtr NativeWindowDrm::FindConnector(drmModeResPtr resources) {
    -> 215 	  for (int i = 0; i < resources->count_connectors; i++) {
        	                                 ^
       216 	    auto connector = drmModeGetConnector(drm_device_, resources->connectors[i]);
       217 	    // pick the first connected connector
       218 	    if (connector->connection == DRM_MODE_CONNECTED) {
    

    I don't have a RPi4 to verify if it is the same issue as the one observed with https://github.com/sony/flutter-embedded-linux/issues/9

    bug drm mouse-cursor 
    opened by psstoyanov 12
  • cmake gives linker error while performing cmake --build .

    cmake gives linker error while performing cmake --build .

    I am following steps mentioned in wiki, I tried prebuilt libflutter_engine.so (elinux-arm64-debug, elinux-arm64-release, elinux-x64), but every time, cmake is throwing same issue, I am sharing error here.

    ubuntu@ubuntu:build$ sudo cmake -DUSER_PROJECT_PATH=examples/flutter-wayland-client -DCMAKE_BUILD_TYPE=Debug ..
    User project: examples/flutter-wayland-client
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/ubuntu/flutter-projects/mylxc_flutter/flutter-embedded-linux/build
    ubuntu@ubuntu:build$ sudo cmake --build .
    [  1%] Linking CXX executable flutter-client
    /usr/bin/ld: libflutter_engine.so: error adding symbols: file in wrong format
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [CMakeFiles/flutter-client.dir/build.make:857: flutter-client] Error 1
    make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/flutter-client.dir/all] Error 2
    make: *** [Makefile:130: all] Error 2
    

    Please help me out!

    NOTE: I have installed Yocto for cross building Cross Building from x64 to arm64

    Thanks in advance

    question 
    opened by Khalid-Faisal 11
  • Install flutter on Variscite i.MX8M Nano

    Install flutter on Variscite i.MX8M Nano

    Hello everybody

    I would need help installing flutter in a Variscite card equipped with i.MX8M Nano processor.

    I started to follow the guide, but it is not clear to me how to proceed and in what order the various steps should be followed.

    Then is there a way to compile on a macOS with M1 and then run on this card?

    The things that are mostly unclear to me are where it says to refer to the cmake build path, and also where to find the flutter-client it refers to in some places in the guide, but I don't find where this is installed.

    Thank you

    opened by marco-1988 0
  • Poor render performances on iMX 8 Nano (X11)

    Poor render performances on iMX 8 Nano (X11)

    Hello and thanks again for the package !

    I am having trouble to see good performances on my linux device. I am running my flutter app (release mode) on an IMX 8 Nano under Debian 11.

    My device has no GPU, 1 CPU with 1 core - 1Go of RAM - 1Go disk space. I run the flutter app under OpenBox in X11.

    Animation are very janky and missing a lot of frames (Navigator.push with the default animation), scrolling a ListView above other widgets is also laggy. The CPU is also rising up to 90% while scrolling a ListView.builder. Any Transform.translate animation style is janky.

    I would like to run a Wayland compositor but i can't find a good one :

    • Weston doesn't run standalone - DRM is not supported and under a Openbox - XFCE it works but the performances are worse.
    • GNOME requires 2Go disk space that i have not.

    I have seen that you have tested :

    Capture d’écran 2022-09-16 à 17 20 37

    May i know which Wayland compositor did you use please ? Do you think my device hardware specifications are enough (without GPU or only 1 core) to run a usual Flutter app ?

    Thanks a lot in advance

    Note : I have run a basic flutter app with only a ListView.builder inside, the scrolling is rising the CPU up to 90% but the animation is quite smooth on X11 (OpenBox). If i scroll a ListView.builder above a Container that has a Image.asset behind (100x100 with 100Kb), it starts lagging.

    question x11 
    opened by Tom3652 18
  • Software rendering support

    Software rendering support

    From https://github.com/sony/flutter-elinux/issues/124

    Because I think that many embedded device have no GPU. I want to know if elinux flutter can run on CPU?

    enhancement question 
    opened by HidenoriMatsubayashi 1
  • Add JSON config/ini file to launch instead of command line only

    Add JSON config/ini file to launch instead of command line only

    I've worked in quiet a few designs in possible config files to launch the embedder from instead of the just command line parameters. It could help make it a lot clearer to start your application and configurations can be more detailed if we do.

    enhancement 
    opened by Taha-Firoz 7
  • flutter-client fails to start Dart VM HTTP Service

    flutter-client fails to start Dart VM HTTP Service

    Hi,

    I've built the debug wayland recipes using meta-flutter and can run flutter apps in debug mode. Whenever I start a flutter app (by using flutter-client -b /path/to/bundle) I get the following error

    flutter: Could not start Dart VM service HTTP server:
    SocketException: Failed to create server socket (OS Error: Cannot assign requested address, errno = 99), address = 127.0.0.1, port = 0
    #0      _NativeSocket.bind (dart:io-patch/socket_patch.dart:996:7)
    <asynchronous suspension>
    #1      Server.startup.startServer (dart:vmservice_io/vmservice_server.dart:424:19)
    <asynchronous suspension>
    #2      Server.startup (dart:vmservice_io/vmservice_server.dart:443:11)
    <asynchronous suspension>
    

    and subsequently I am unable to attach the debugger. This also fails when using flutter custom-devices on a host machine to try and debug (same error).

    Why would this be, is there a way to see a more verbose log?

    Thanks

    question 
    opened by LeoBound 8
Releases(3316dd8728)
Owner
Sony
Sony Group Corporation
Sony
Flutter on Windows, MacOS and Linux - based on Flutter Embedding, Go and GLFW.

go-flutter - A package that brings Flutter to the desktop Purpose Flutter allows you to build beautiful native apps on iOS and Android from a single c

null 5.5k Jan 6, 2023
Embedded Flutter

flutter_embedded This repo is used for CI automation to build flutter-engine embedder for Linux. Project Status x86_86 and aarch64 functional No exter

Joel Winarske 154 Dec 28, 2022
Flutter plugin for Flutter desktop(macOS/Linux/Windows) to change window size.

desktop_window Flutter plugin for Flutter desktop(macOS/Linux/Windows) to change window size. Usage import 'package:desktop_window/desktop_window.dart

ChunKoo Park 72 Dec 2, 2022
A clean front-end plugin to Volumio, the Linux distribution for music playback. Volumio Touch Display Lite is written in Flutter and runs on flutter-pi.

EN | 中文 Touch Display Lite plugin for Volumio 3 Feng Zhou, 2021-12 Touch Display Lite is a clean and fast user interface for Volumio 3, the Linux dist

Feng Zhou 5 Jul 26, 2022
File picker plugin for Flutter, compatible with mobile (iOS & Android), Web, Desktop (Mac, Linux, Windows) platforms with Flutter Go support.

A package that allows you to use the native file explorer to pick single or multiple files, with extensions filtering support.

Miguel Ruivo 987 Jan 6, 2023
🎞 Flutter media playback, broadcast & recording library for Windows, Linux & macOS. Written in C++ using libVLC & libVLC++. (Both audio & video)

dart_vlc Flutter media playback, broadcast, recording & chromecast library for Windows, Linux & macOS. Written in C++ using libVLC & libVLC++. Install

Hitesh Kumar Saini 417 Dec 29, 2022
Flutter library for window blur & transparency effects for on Windows & Linux. 💙

flutter_acrylic Window blur & transparency effects for Flutter on Windows & Linux Installation Mention in your pubspec.yaml. dependencies: ... flu

Hitesh Kumar Saini 437 Dec 31, 2022
A Flutter plugin to read 🔖 metadata of 🎵 media files. Supports Windows, Linux & Android.

flutter_media_metadata A Flutter plugin to read metadata of media files. A part of Harmonoid open source project ?? Install Add in your pubspec.yaml.

Harmonoid 60 Dec 2, 2022
A cross-platform (Android/Windows/macOS/Linux) USB plugin for Flutter

quick_usb A cross-platform (Android/Windows/macOS/Linux) USB plugin for Flutter Usage List devices List devices with additional description Get device

Woodemi Co., Ltd 39 Oct 1, 2022
A tutorial for creating an Ubuntu Linux Flutter app, using the yaru theme

Building a Yaru app with Flutter Summary URL https://github.com/ubuntu/user_manager Category Environment Linux Status Feedback Link Author Frederik Fe

Ubuntu 22 Dec 21, 2022
A flutter application to monitor your Linux PC statistic.

Linux Stats App A flutter application to monitor your Linux PC statistic. Screenshots Installation Download or clone the repository: $ git clone https

Malte2036 7 Dec 17, 2022
An 🎵 audio playback library for Flutter Desktop. Supports Windows & Linux. Based on miniaudio.

✒ libwinmedia is sequel to this project. It provides network playback, better format support, control & features. An audio playback library for Flutte

Hitesh Kumar Saini 50 Oct 31, 2022
A small karaoke app made in Flutter for Linux

Karaoke app for linux A small karaoke/lyrics display for the currently running VLC song. Video: Make sure the songs have metadata (at least title and

Wazzaps 63 Jan 7, 2023
A simple-to-use flutter update package for Windows, MacOS, and Linux.

Updat - The simple-to-use, flutter-based desktop update package Updat is a simple-to-use reliable flutter-native updater that handles your application

Eduardo M. 14 Dec 21, 2022
🎵 A cross-platform media playback library for C/C++ with good number of features (only Windows & Linux).

libwinmedia A cross-platform media playback library for C/C++ & Flutter with good number of features. Example A very simple example can be as follows.

Harmonoid 38 Nov 2, 2022
A package which provides most of the window decorations from linux themes.

Window Decorations A package which provides most of the window decorations from linux themes. Features Easier to use and implement Native looking wind

Prateek SU 20 Dec 21, 2022
A cross-platform app ecosystem, bringing iMessage to Android, PC (Windows, Linux, & even macOS), and Web!

BlueBubbles Android App BlueBubbles is an open-source and cross-platform ecosystem of apps aimed to bring iMessage to Android, Windows, Linux, and mor

BlueBubbles 318 Jan 8, 2023
An app to monitor linux PC stats directly from your phone.

L I N U X M O N An app to monitor linux PC stats such as CPU, Battery, RAM etc. on your phone. Installation Install the server on your PC LINUX Downlo

Ayush Singh 20 Dec 21, 2022
A pure Dart implementation of Firebase with initial support aimed at FlutterFire for Linux & Windows.

FlutterFire Desktop A work in progress pure Dart implementation of Firebase with initial support aimed at FlutterFire for Linux & Windows. A FlutterFi

Invertase 293 Jan 4, 2023