Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

meta-flutter

yocto layer for flutter related artifacts.

recommended development flow starts with making an embedder run on desktop, then target. this approach will save you a good deal of time and aggrevation.

note: in theory swift shader (cpu render) engine builds should work with the right build flags. be warned it won’t work out of the box. select a soc with a gpu that supports opengl 3.0+ and save yourself the engineering nre.

note: if you get a gray screen running the gallery app, chances are you don’t have lc_all set. check /usr/share/locale/ on your target for available locale, and set lc_all appropriately. example: export lc_all=en_gb

layers dependencies

  • meta-clang (sony embedders only)

overview

target bsp is expected to have a gpu with opengles v3.0+ support.

this layer includes recipes to build

  • flutter-engine (channel selection, default is beta)
  • flutter-sdk (channel selection, default is beta)
  • fltter-gallery application (interpreted and aot – requires master channel override)
  • flutter-pi (drm w/vsync)
  • flutter-wayland (basic poc) / waylandpp/ipugxml
  • sony embedders (no vsync except recent naive wayland vsync; which is not power friendly)

notes

targets flutter-engine is known to work on

  • agl qemu images – x86_64
  • dragonboard 410c – aarch64
  • intel minnowboard max (baytrail) – intel-icore7-64
  • nvidia nano dev kit – aarch64
  • nvidia xavier nx dev kit – aarch64
  • raspberry pi 3 / compute – aarch64 / armv7hf
  • raspberry pi 4 / compute – aarch64
  • renesas r-car m3ulcb – aarch64
  • stm32mp157x – cortexa7t2hf
  • etc, etc

building for arm (32-bit) has an outstanding p4 bug on this: https://github.com/flutter/flutter/issues/83765

nvidia xavier/nano

local.conf changes

target_gcc_version = "8.3.0"
flutter_channel = "master"
image_install_append = " flutter-drm-eglstream-backend"
image_install_append = " flutter-gallery"

or

target_gcc_version = "8.3.0"
flutter_channel = "master"
core_image_extra_install += "
    flutter-drm-eglstream-backend 
    flutter-gallery 
"

build egl image

bitbake demo-image-egl

run flutter application on target (defaults to aot)

flutter_drm_device=/dev/dri/card0 flutter-drm-eglstream-backend -b /usr/share/flutter-gallery/sony

nxp i.mx 8quadxplus mek

repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-gatesgarth -m imx-5.10.9-1.0.0.xml
repo sync -j20
distro=fslc-wayland machine=imx8qxpmek source setup-environment build
pushd ../sources
git download -b dunfell https://github.com/jwinarske/meta-flutter.git
popd
bitbake-layers add-layer ../sources/meta-clang ../sources/meta-flutter
echo -e 'target_gcc_version = "10.2.0"' >> conf/local.conf
echo -e 'flutter_channel = "dev"' >> conf/local.conf
echo -e 'image_install_append = " flutter-wayland"' >> conf/local.conf
echo -e 'image_install_append = " flutter-gallery"' >> conf/local.conf
bitbake fsl-image-multimedia
...
build configuration:
bb_version           = "1.48.0"
build_sys            = "x86_64-linux"
nativelsbstring      = "universal"
target_sys           = "aarch64-fslc-linux"
machine              = "imx8qxpmek"
distro               = "fslc-wayland"
distro_version       = "3.2-snapshot-20210616"
tune_features        = "aarch64 armv8a crc cortexa35 crypto"
target_fpu           = ""

raspberry pi 3/4 (aarch64)

export machine=raspberrypi4-64

or

export machine=raspberrypi3-64
mkdir rpi_yocto && cd rpi_yocto
repo init -u https://github.com/jwinarske/manifests.git -m rpi64.xml -b dunfell
repo sync -j20
source ./setup-environment $machine
bitbake-layers add-layer ../sources/meta-clang ../sources/meta-flutter
echo -e 'flutter_channel = "dev"' >> conf/local.conf
echo -e 'image_install_append = " flutter-pi"' >> conf/local.conf
echo -e 'image_install_append = " flutter-gallery"' >> conf/local.conf
bitbake core-image-minimal

note: you may want/need to increase the gpu_mem value. it’s defaulting to 64.

stm32mp157x discovery board (doesn’t include build hack)

setup ubuntu 16.04 for building yocto images. envsetup.sh will complain if you’re missing a package.

mkdir openstlinux-5.10-dunfell-mp1-21-03-31 && cd openstlinux-5.10-dunfell-mp1-21-03-31
repo init -u https://github.com/stmicroelectronics/oe-manifest.git -b refs/tags/openstlinux-5.10-dunfell-mp1-21-03-31
repo sync -j20
distro=openstlinux-eglfs machine=stm32mp1-disco source layers/meta-st/scripts/envsetup.sh
pushd ../layers
git download -b dunfell https://github.com/jwinarske/meta-flutter.git
git download -b dunfell https://github.com/kraj/meta-clang.git
popd
bitbake-layers add-layer ../layers/meta-flutter ../layers/meta-clang
echo -e 'machine_features_remove = "fip"n' >> conf/local.conf
echo -e 'distro_features_remove = "wayland"n' >> conf/local.conf
echo -e 'distro_features_remove = "x11"n' >> conf/local.conf
echo -e 'flutter_channel = "master"n' >> conf/local.conf
echo -e 'core_image_extra_install += " ' >> conf/local.conf
echo -e '  flutter-pi ' >> conf/local.conf
echo -e '  flutter-drm-gbm-backend ' >> conf/local.conf
echo -e '  flutter-gallery ' >> conf/local.conf
echo -e '"' >> conf/local.conf
cat conf/local.conf
bitbake st-image-core
...
target_sys      = "arm-ostl-linux-gnueabi"
machine         = "stm32mp1-disco"
distro          = "openstlinux-eglfs"
distro_version  = "3.1-snapshot-20210602"
tune_features   = "arm vfp cortexa7 neon vfpv4 thumb callconvention-hard"
target_fpu      = "hard"

see release notes regarding “fip”: https://wiki.st.com/stm32mpu/wiki/stm32mp15_openstlinux_release_note

build egl image

bitbake demo-image-egl

run flutter application on target (defaults to aot)

flutter_drm_device=/dev/dri/card0 flutter-drm-eglstream-backend -b /usr/share/flutter-gallery/sony

general yocto notes

when building on systems with gcc version > than uninative in yocto distro add the following to conf/local.conf

inherit_remove = "uninative"

sony notes

  • not accepting prs
  • no real texture solution
  • preliminary vsync support
  • weston >= 8 does not work
  • no multi-engine
  • no platform view / hybrid composition
  • not enough debug spew for debug builds
  • code difficult to follow
  • too much boiler plate

Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Comments are closed.