RPI: Android 9 Pie on Raspberry Pi 3B & 3B+

Raspberry Pi 3B+ can also run Android Pie now!

  • Update 2019-04-25 Upload system image and How to video to github.com

Any one can download image from github.com: https://github.com/brobwind/pie-device-brobwind-rpi3-binary

A video about how to flash and extend userdata partition also included.

  • Update 2019-03-03 Update kernel image and upload all source code

Download link: 2019_03_02_rpi3_13fa200.bin.gz

The u-boot, kernel, OpenGL driver has been upload to github.com, you can download code by executing following command:

$ pushd device/brobwind/rpi3 && git pull && popd
$ repo sync -c

Antutu benchmark on Raspberry Pi 3 Model B+:

And Geekbench 4 on Raspbery Pi 3 Model B+:

  • Update 2019-02-17 Antutu benchmark

Today, I try to run Antutu benchmark app to check the RPi 3B & 3B+ performance, then discover the sores are almost the same. There must be something wrong, then I decided to check the CPU frequency from /sys/devices/system/cpu/, but there is not cpufreq related items. The next step is rebuild the bcm2835 cpufreq module and figure out the actual running frequency. Finally it turns out  both RPi 3B & 3B+ CPU frequency at 600MHz x 4。

  • Update 2019-01-26

GUI: OpenGL based on mesa3d and hardware composer based on drm

Audio: support a2dp and on-board audio jack

Knowing issue:

1. Enable `Debug GPU overdraw’ in system settings will make app crash

2. Enable `Debug non-retangular clip operations’ in system settings will make app crash

3. Do not disable `Disable HW overlays’ in system settings

4. Audio over HDMI not support

5. Can not play video

Download link:  2019_01_25_rpi3_a586f2b.bin.gz

  • Feature:

1. Bootloader: u-boot as AndroidThings on RPi 3B v.1.0.4, run on 64-bit mode

2. Kernel: v.4.14.71 run on 64-bit mode

3. Display: 720p(1280×720) @ 60Hz through on board HDMI port

4. Audio:  analog, 2 channel through on board audio jack

5. WiFi: 2.4G (RPi 3B & 3B+), 5G (RPi 3B+)

6. Bluetooth: HCI over UART(ttyAMA0), RPi 3B: 921600bps no flow control; RPi 3B+: 3000000bps with flow control

7. Ethernet: both work, and IP from DHCP

8. OpenGL render:  Skia GL, swiftshader

2018_12_02_launcher3 2018_12_02_settings 2018_12_02_settings_about

  • Knowing issue:

1. External storage (sdcard) no function due to not kernel sdcardfs driver support

2. Bluetooth: Can bind device, ble gatt profile works, pan profile do not work due to not permission to create bt-pan device

3. Network: RPi 3B+: while Ethernet online, WiFi network can not connect; The eth0 device can not auto down while eject the cable

4. Bitmap: The hardware bitmap will miss draw both on Skia GL and OpenGL

5. The device can not go to sleep mode or the Wifi driver will run with error

  • Partition
Disk rpi3b.bin: 8388608 sectors, 4.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 9884F86F-891D-4DD9-B2C8-6277BC24DC26
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 8388574
Partitions will be aligned on 8-sector boundaries
Total free space is 1504957 sectors (734.8 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              40          131111   64.0 MiB    FFFF  rpiboot
   2          131112          133159   1024.0 KiB  FFFF  uboot_a
   3          133160          135207   1024.0 KiB  FFFF  uboot_b
   4          135208          200743   32.0 MiB    FFFF  boot_a
   5          200744          266279   32.0 MiB    FFFF  boot_b
   6          266280         1597479   650.0 MiB   FFFF  system_a
   7         1597480         2928679   650.0 MiB   FFFF  system_b
   8         2928680         2928807   64.0 KiB    FFFF  vbmeta_a
   9         2928808         2928935   64.0 KiB    FFFF  vbmeta_b
  10         2928936         2930983   1024.0 KiB  FFFF  misc
  11         2930984         3455271   256.0 MiB   FFFF  vendor_a
  12         3455272         3979559   256.0 MiB   FFFF  vendor_b
  13         3979560         3987751   4.0 MiB     FFFF  oem_bootloader_a
  14         3987752         3995943   4.0 MiB     FFFF  oem_bootloader_b
  15         3995944         4000039   2.0 MiB     FFFF  frp
  16         4000040         4786471   384.0 MiB   FFFF  swap
  17         4786472         6883623   1024.0 MiB  FFFF  userdata
  • Source code

Source(partial) has been uploaded to github: https://github.com/brobwind/pie-device-brobwind-rpi3

You can build your own OS now.

  • Download

1. 2018_12_02_rpi3b_4117784.zip

2. 2019_01_25_rpi3_a586f2b.bin.gz (With hardware acceleration)

3. 2019_03_02_rpi3_13fa200.bin.gz (With hardware acceleration CPU @ 1.4GHz for Raspbery Pi 3 Model B+)

  • Flash image
$ sudo dd if=rpi3b_4117784.img of=/dev/to/flash bs=4MiB

 

《RPI: Android 9 Pie on Raspberry Pi 3B & 3B+》有83个想法

    1. The aosp_arm target should have built-in support swiftshader. Due to bad UI performance in rpi3b & b+, I am trying porting GPU acceleration stuff (based on mesa3d) and it almost work.

      1. Hi Hzak,

        It’s good to hear Android 9.0 is working in RPI 3B. I have downloaded ANDROID PIE(9.0.0_R8).
        Could you please share your modification to us. I will append your modifications and I will start building.

        Thanks,
        Vasu

  1. Once generated the IMGs how to make them a bin to flash or an img to flash? Thank you for your code.

    PS: I have applied all the patches to enable the video playback on CPU and I want to test it out, thanks!

    1. You can get the instructions from https://github.com/brobwind/pie-device-brobwind-rpi3-u-boot/blob/master/README.md
      or flash the images directly to the partition(ex. uses dd command on ubuntu: dd if=rpiboot.img of=/dev/sda1 bs=4MiB):
      rpiboot.img -> 1st partition
      boot.img -> 4th partition
      system.img -> 6th partition
      vendor.img -> 11th partition

      Nice work, making the video playback on it!

      Thanks

      1. Hi,
        some questions about write the new build image:
        after execute create_partition_table.sh the partitions are fine.
        dd if=out/target/product/rpi3/system.img of=/dev/sdb6
        give me following error:
        [ 3.298934] No filesystem could mount root, tried:
        [ 3.298943] ext4
        [ 3.303940]
        [ 3.307444] Kernel panic – not syncing: VFS: Unable to mount root fs on unknown-block(179,6)
        [ 3.316016] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.14.61-v8+ #4
        [ 3.322465] Hardware name: Raspberry Pi 3 Model B Plus Rev 1.3 (DT)
        [ 3.328826] Call trace:
        [ 3.331323] [] dump_backtrace+0x0/0x274
        [ 3.336808] [] show_stack+0x20/0x28
        [ 3.341938] [] dump_stack+0xa4/0xdc
        [ 3.347071] [] panic+0x14c/0x2a4
        [ 3.351941] [] mount_block_root+0x2b8/0x2e8
        [ 3.357775] [] mount_root+0x7c/0x8c
        [ 3.362907] [] prepare_namespace+0x17c/0x1c4
        [ 3.368832] [] kernel_init_freeable+0x234/0x26c
        [ 3.375020] [] kernel_init+0x18/0x148
        [ 3.380327] [] ret_from_fork+0x10/0x18
        [ 3.385726] SMP: stopping secondary CPUs
        [ 3.389716] Kernel Offset: 0x1b40400000 from 0xffffff8008000000
        [ 3.395725] CPU features: 0x0802004
        [ 3.399264] Memory Limit: none
        [ 3.402379] Rebooting in 5 seconds..

        Any tips for me ??

        1. I think you TF card can not work in the kernel boot up phase.
          Since The TF card clock will be over clocked from 50MHz to 84MHz, you have to choose a better TF card.
          Or just remove the “dtoverlay=sdtweak,overclock_50=84” in the config.txt at the rpiboot (1st) partition.

          1. Hi,

            Thanks for your good work. I wonder how 2019_03_02_rpi3_13fa200.bin was created? Did you use a script for that? Where is it in that case?

          2. Thank you! It’s very interesting to make it work.
            Following steps make the binary:
            $ dd if=/dev/zero of=rpi3_4g.bin bs=$((1024*1024*1024)) count=4 # create 4GiB bin
            $ device/brobwind/rpi3/boot/create_partition_table.sh rpi3_4g.bin # create partition table and bundle images
            $ dd if=/rpi3_4g.bin of=rpi3_4g_trunc.bin bs=512 count=4786480 # reserved 4KiB userdata partition, it will be formated to ext4 filesystem while system bootup

      2. Hi hzak:
        请问一下,我照你的方式去做,但做出来的都是空的bin,
        我也有故意将所有的img 档去除,他也不报错。
        还有什么我没有注意到。
        我有试著在 \out\target\product\rpi3\ 去下 “device/brobwind/rpi3/boot/create_partition_table.sh rpi3_4g.bin”
        但命令须改成”../../../../device/brobwind/rpi3/boot/create_partition_table.sh rpi3_4g.bin”
        但做出的bin 大至上是空的,只有一点不知什么的内容。
        麻烦你了

        谢谢

  2. Patches for Raspberry Pi 3 Android:

    Patch frameworks/native/opengl/libs/EGL/eglApi.cpp
    – format = HAL_PIXEL_FORMAT_RGBA_8888;
    + format = HAL_PIXEL_FORMAT_BGRA_8888;

    Patch frameworks/base/opengl/java/android/opengl/GLSurfaceView.java
    – super(8, 8, 8, 0, withDepthBuffer ? 16 : 0, 0);
    + super(8, 8, 8, 8, withDepthBuffer ? 24 : 0, 0);

    and enable software video decoder patch with:

    frameworks/av/media/libstagefright/colorconversion/SoftwareRenderer.cpp

    case OMX_TI_COLOR_FormatYUV420PackedSemiPlanar:
    {
    – halFormat = HAL_PIXEL_FORMAT_YV12;
    – bufWidth = (mCropWidth + 1) & ~1;
    – bufHeight = (mCropHeight + 1) & ~1;
    break;
    }

  3. A more generalistic guide on compiling the sources, it uses less space and it is fast:

    sudo apt-get install git-core gnupg flex bison gperf build-essential curl gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip openjdk-8-jdk android-tools-adb bc g++-multilib gcc-multilib gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev python python-mako

    mkdir -p ~/bin
    wget ‘https://storage.googleapis.com/git-repo-downloads/repo’ -P ~/bin
    chmod a+x ~/bin/repo

    git config –global user.name yourname
    git config –global user.email youremail

    cd bin

    repo init -u https://android.googlesource.com/platform/manifest -b android-9.0.0_r33 –depth=1

    mkdir -pv device/brobwind
    git clone git://github.com/brobwind/pie-device-brobwind-rpi3 device/brobwind/rpi3

    mkdir -p .repo/local_manifests
    ln -sv ../../device/brobwind/rpi3/local_manifest.xml .repo/local_manifests/

    repo sync -j$(nproc)

    export USE_CCACHE=1

    source build/envsetup.sh
    lunch rpi3-eng
    make -j$(nproc)

  4. Compile error fat16copy.py:

    File “build/make/tools/fat16copy.py”, line 773, in
    root = fat(sys.argv[1]).root

    1. 1. Change the system image size in the BoardConfig.mk https://github.com/brobwind/pie-device-brobwind-rpi3/blob/7c8f7fefd3d7c8bea80ce8b1b042457457cf8c54/BoardConfig.mk#L39
      2. Modify the create partion table script: https://github.com/brobwind/pie-device-brobwind-rpi3/blob/7c8f7fefd3d7c8bea80ce8b1b042457457cf8c54/boot/create_partition_table.sh#L65

      1. Thanks I will give it a try. BoardConfig.mk is easy to change. create_partition_table.sh is more complicated.

      2. hzak,
        I had try to modify the two files to increase system.img to 1000M ,but it can not boot up normally.
        BOARD_SYSTEMIMAGE_PARTITION_SIZE := $(shell echo $$((1000*1024*1024))) # 1000MB
        SIZE_SYSTEM=1000M

        Is there any other files need to modify ?

        1. You should use create_partition_table.sh to flash images, like this:
          $ sudo OUT=${OUT} device/brobwind/rpi3/boot/create_partition_table.sh /dev/sdc
          => Destroy partition table …
          GPT data structures destroyed! You may now partition the disk using fdisk or
          other utilities.
          => Install GPT partition table …
          => Install hybrid MBR partition table …
          => Install images ….
          => Install: rpiboot(/data/PUB-pie-9.0.0_r8/out/target/product/rpi3/rpiboot.img) image …
          131072+0 records in
          131072+0 records out
          67108864 bytes (67 MB, 64 MiB) copied, 11.5602 s, 5.8 MB/s
          => Install: boot_a(/data/PUB-pie-9.0.0_r8/out/target/product/rpi3/boot.img) image …
          39008+0 records in
          39008+0 records out
          19972096 bytes (20 MB, 19 MiB) copied, 3.26968 s, 6.1 MB/s
          => Install: system_a(/data/PUB-pie-9.0.0_r8/out/target/product/rpi3/system.img) image …
          2048000+0 records in
          2048000+0 records out
          1048576000 bytes (1.0 GB, 1000 MiB) copied, 144.857 s, 7.2 MB/s
          => Install: misc(device/brobwind/rpi3/boot/images/misc.img) image …
          2048+0 records in
          2048+0 records out
          1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.105421 s, 9.9 MB/s
          => Install: vendor_a(/data/PUB-pie-9.0.0_r8/out/target/product/rpi3/vendor.img) image …
          524288+0 records in
          524288+0 records out
          268435456 bytes (268 MB, 256 MiB) copied, 35.3077 s, 7.6 MB/s
          => Install: oem_bootloader_a(device/brobwind/rpi3/boot/images/oem_bootloader_a.img) image …
          8192+0 records in
          8192+0 records out
          4194304 bytes (4.2 MB, 4.0 MiB) copied, 0.878807 s, 4.8 MB/s
          => Install: userdata(device/brobwind/rpi3/boot/images/zero_4k.bin) image …
          8+0 records in
          8+0 records out
          4096 bytes (4.1 kB, 4.0 KiB) copied, 0.0116738 s, 351 kB/s
          => Dump partition table ….
          Disk /dev/sdc: 62521344 sectors, 29.8 GiB
          Logical sector size: 512 bytes
          Disk identifier (GUID): B8C7DD66-A44E-41AD-9233-C246A9D07916
          Partition table holds up to 128 entries
          First usable sector is 34, last usable sector is 62521310
          Partitions will be aligned on 8-sector boundaries
          Total free space is 6 sectors (3.0 KiB)

          Number Start (sector) End (sector) Size Code Name
          1 40 131111 64.0 MiB FFFF rpiboot
          2 131112 133159 1024.0 KiB FFFF uboot_a
          3 133160 135207 1024.0 KiB FFFF uboot_b
          4 135208 200743 32.0 MiB FFFF boot_a
          5 200744 266279 32.0 MiB FFFF boot_b
          6 266280 2314279 1000.0 MiB FFFF system_a
          7 2314280 4362279 1000.0 MiB FFFF system_b
          8 4362280 4362407 64.0 KiB FFFF vbmeta_a
          9 4362408 4362535 64.0 KiB FFFF vbmeta_b
          10 4362536 4364583 1024.0 KiB FFFF misc
          11 4364584 4888871 256.0 MiB FFFF vendor_a
          12 4888872 5413159 256.0 MiB FFFF vendor_b
          13 5413160 5421351 4.0 MiB FFFF oem_bootloader_a
          14 5421352 5429543 4.0 MiB FFFF oem_bootloader_b
          15 5429544 5433639 2.0 MiB FFFF frp
          16 5433640 6220071 384.0 MiB FFFF swap
          17 6220072 62521310 26.8 GiB FFFF userdata
          PART: 314F99D5-B2BF-4883-8D03-E2F2CE507D6A CB3A17EF-1995-4C11-A378-7DCFFE91D8D8 rpiboot
          PART: 314F99D5-B2BF-4883-8D03-E2F2CE507D6A 222DA76E-4F41-4638-9896-834ED0DD0E1E uboot_a
          PART: 314F99D5-B2BF-4883-8D03-E2F2CE507D6A B7E02244-4046-4B09-A27F-E72975495043 uboot_b
          PART: BB499290-B57E-49F6-BF41-190386693794 CFB0DA99-A00F-401E-9B2B-67DBD622B80F boot_a
          PART: BB499290-B57E-49F6-BF41-190386693794 BD4AED84-7D40-4071-AAA9-6D9B5A4B8F65 boot_b
          PART: 0F2778C4-5CC1-4300-8670-6C88B7E57ED6 1049B889-DAF1-4069-8EFB-87A0BE26ECFF system_a
          PART: 0F2778C4-5CC1-4300-8670-6C88B7E57ED6 3F988A53-01DF-4852-B222-B8D5017A9C83 system_b
          PART: B598858A-5FE3-418E-B8C4-824B41F4ADFC 69A70019-D6DE-4563-AE73-CB6539444771 vbmeta_a
          PART: B598858A-5FE3-418E-B8C4-824B41F4ADFC 7FF49847-156F-4019-AF09-08AB90554105 vbmeta_b
          PART: 6B2378B0-0FBC-4AA9-A4F6-4D6E17281C47 E0159688-28E8-4C37-BA68-E95655D54F5D misc
          PART: 314F99D5-B2BF-4883-8D03-E2F2CE507D6A 9444B4F7-FDFF-4B1F-8D4A-96F2EA9AFD67 vendor_a
          PART: 314F99D5-B2BF-4883-8D03-E2F2CE507D6A 4AE6C942-71EE-49C1-938C-01E2690EDC4A vendor_b
          PART: AA3434B2-DDC3-4065-8B1A-18E99EA15CB7 CA807D94-1ABD-4977-A884-65976064E2DF oem_bootloader_a
          PART: AA3434B2-DDC3-4065-8B1A-18E99EA15CB7 F858BB40-C3C8-47EB-8261-1A27E643FFFF oem_bootloader_b
          PART: AA3434B2-DDC3-4065-8B1A-18E99EA15CB7 4EF11A67-26FD-45B8-833E-3FC0D268362D frp
          PART: AA3434B2-DDC3-4065-8B1A-18E99EA15CB7 3ED0CC42-0FEC-4346-8D5A-FE873AD2D03B swap
          PART: 0BB7E6ED-4424-49C0-9372-7FBAB465AB4C D8094DB0-79B9-4305-AA2C-D03F924FE484 userdata

          1. 我们是按照这个脚本create_partition_table.sh 进行烧机的。
            对比您的打印log,我们这个终端没有打印这三个相关的log (没有更改SIZE_SYSTEM烧机,能正常启动也没有这些log)
            => Install: rpiboot(/data/PUB-pie-9.0.0_r8/out/target/product/rpi3/rpiboot.img) image …
            => Install: boot_a(/data/PUB-pie-9.0.0_r8/out/target/product/rpi3/boot.img) image …
            => Install: system_a(/data/PUB-pie-9.0.0_r8/out/target/product/rpi3/system.img) image …

            对比不修改SIZE_SYSTEM分区,现在更改SIZE_SYSTEM 之后,用create_partition_table.sh 烧机之后,我们通过gparted 工具发现以下差异:
            1. 更改SIZE_SYSTEM 之后 vendor分区文件系统显示unknown
            2. system 分区size大小随着SIZE_SYSTEM 更改而改变,但是used 和unused 大小没有变化,总是显示used : 555.43MB ,unused:94.57MB

            我们也很困惑这些问题点,请问您有一些其他的建议吗?

          2. create_partition_table.sh决定了每个分区占用TF卡的空间,而https://github.com/brobwind/pie-device-brobwind-rpi3/blob/7c8f7fefd3d7c8bea80ce8b1b042457457cf8c54/BoardConfig.mk#L39 决定了文件系统的大小,这个值要<=create_partition_table.sh的大小。你需要同时修改这两个值。

          3. 非常感谢,我们已经解决了这个问题。
            用dd 命令把vendor.img 重新烧到vendor分区,就可以正常boot了。

            我还想请教另外一个问题,请问我想编译android car ,需要怎么配置呢?
            谢谢~

  5. hzak,

    I wonder if I can distribute my version of your work as long as I give you full credit for it? I will then of course refer to your software sources. Your work is Open Source, right?

    I have successfully compiled your sources and then added a few apps, which I find essential.

    What shall I call you in my description? “Hzak Brobwind a Chinese IT engineer”? Or?

    1. You can do any thing you like. I just make it work.
      Actually, the hzak is just random characters combination.
      Hope it get better and better.
      Thank you!

      1. “hzak is just random characters combination” you say. But what shall I call you then? I want to tell everybody that my (small) work is totally dependent on yours. Or do you mean that is is sufficient to refer to your various web sites?

  6. Ok, thanks. Well, I wrote this:

    MY SOURCES
    You can find my sources for RaspAnd Pie at brobwind.com. From there you can also download the“original” image from 190302, which was compiled by the man behind brobwind.com. He calls himself hazak – a Chinese IT engineer. Following hazak’s instructions you can compile your own Android Pie 9 system for Raspberry Pi 3 Model B and Raspberry Pi 3 Model B+.

    Is that ok?

    http://raspex.exton.se/?p=1111

  7. Hello!

    Anyone knows if we can have google play services working here? And which versión exactly? I have tried some versions but all of them crash continuously. I need push messages.

    Thanks in advance!

    1. GPIO应该是没有问题了,我已经将kernel的代码上传到github的,如果不能正常工作的话,你可以自己改一下。
      最近比较忙,没什么时间搞这个,等有空的时候,我自己再试试看,不好意思啊。

      1. Hi hzak

        Much appreciate your pieonpi. It works well.
        And I also checked that the gpio works well too, both on the binary image and compiled image from the source code.
        (https://github.com/brobwind/pie-device-brobwind-rpi3)

        Please refer https://docs.khadas.com/vim1/HowToAccessGpio.html for the approach.

    1. 当前,系统不支持WiFi display, sink & source模式都不支持。
      并且不确定做WiFi display 是否需要WiFi模块硬件支持。

  8. 你好,我在做一个project需要在Pi上运行Oculus的移动端App,最终是为了让Oculus Go能够stream到Pi上。我现在可以安装Oculus,也能运行其中的功能。但是当我开始从Oculus cast到Pi的时候,Pi就一直黑屏, logcat显示是Oculus的cast module有error但是没有更多细节。请问这个OS有没有啥已知的问题可能会和我遇到的这个相关的?或者可能是Pi的一些硬件limit?。。。。。感激不尽。。

  9. Hi hzak:
    请问一下,我照你的方式去做,但做出来的都是空的bin,
    我也有故意将所有的img 档去除,他也不报错。
    还有什么我没有注意到。
    我有试著在 \out\target\product\rpi3\ 去下 “device/brobwind/rpi3/boot/create_partition_table.sh rpi3_4g.bin”
    但命令须改成”../../../../device/brobwind/rpi3/boot/create_partition_table.sh rpi3_4g.bin”
    但做出的bin 大至上是空的,只有一点不知什么的内容。
    麻烦你了

    谢谢

    1. 你首先要创建rpi3_4g.bin的文件,像这样:
      $ dd if=/dev/zero of=rpi3_4g.bin bs=1GiB count=4
      然后再通过create_partition_table.sh这个脚本文件,将相关的image文件写入到rpi3_4g.bin中。
      同时要注意,这里用到了OUT环境变量:
      $ echo $OUT
      /data/PUB-pie-9.0.0_r8/out/target/product/rpi3

  10. 有硬件加速的两个系统都超级流畅,特别好用。
    试过好多android的pi系统,这个可以说数一数二的顺畅。
    但是发现硬解码播放在线视频的时候,是黑屏的。
    软解码会正常几秒到几分钟,然后也会进入黑屏状态。

    1. 多谢使用。你使用是的第三方的播放器吗,可能是由于GPU(CMA)的内存不够用了,当前最多只能分配256MiB的内存给GPU, 很容易就会出现内存耗尽的问题。
      期待Raspberry Pi 4了。

      1. 这样啊,是使用第三方播放器的,可以切换硬件解码/软件解码的那种。
        安卓解码耗费的CPU也不小的,Pi3确实好难顶住。
        也期待在Pi4上畅快的使用你的超流畅版本的系统。

  11. 非常感谢你的回复,
    我已看到我错的地方,
    我没有注意到你的Image 会到boot 下的Image folder,
    我已将其copy过去了。
    and
    我也发现
    create_partition_table.sh这个脚本下的档案名也有不同,我将其修改为:
    PART: 314F99D5-B2BF-4883-8D03-E2F2CE507D6A rpiboot ${SIZE_RPIBOOT}
    PART: 314F99D5-B2BF-4883-8D03-E2F2CE507D6A uboot_a ${SIZE_UBOOT}
    PART: 314F99D5-B2BF-4883-8D03-E2F2CE507D6A uboot_b ${SIZE_UBOOT}
    PART: BB499290-B57E-49F6-BF41-190386693794 boot ${SIZE_BOOT}
    PART: BB499290-B57E-49F6-BF41-190386693794 boot ${SIZE_BOOT}
    PART: 0F2778C4-5CC1-4300-8670-6C88B7E57ED6 system ${SIZE_SYSTEM}
    PART: 0F2778C4-5CC1-4300-8670-6C88B7E57ED6 system ${SIZE_SYSTEM}
    PART: B598858A-5FE3-418E-B8C4-824B41F4ADFC vbmeta_a ${SIZE_VBMETA}
    PART: B598858A-5FE3-418E-B8C4-824B41F4ADFC vbmeta_b ${SIZE_VBMETA}
    PART: 6B2378B0-0FBC-4AA9-A4F6-4D6E17281C47 misc ${SIZE_MISC}
    PART: 314F99D5-B2BF-4883-8D03-E2F2CE507D6A vendor ${SIZE_VENDOR}
    PART: 314F99D5-B2BF-4883-8D03-E2F2CE507D6A vendor ${SIZE_VENDOR}
    PART: AA3434B2-DDC3-4065-8B1A-18E99EA15CB7 oem_bootloader_a ${SIZE_OEM_BOOTLOADER}
    PART: AA3434B2-DDC3-4065-8B1A-18E99EA15CB7 oem_bootloader_b ${SIZE_OEM_BOOTLOADER}
    PART: AA3434B2-DDC3-4065-8B1A-18E99EA15CB7 frp ${SIZE_FRP}
    PART: AA3434B2-DDC3-4065-8B1A-18E99EA15CB7 swap ${SIZE_SWAP}
    PART: 0BB7E6ED-4424-49C0-9372-7FBAB465AB4C userdata ${SIZE_USERDATA}

    Command 我是用你之前的留言下
    dd if=/dev/zero of=rpi3_4g.bin bs=$((1024*1024*1024)) count=4
    ../../../../device/brobwind/rpi3/boot/create_partition_table.sh rpi3_4g.bin
    dd if=rpi3_4g.bin of=rpi3_4g_trunc.bin bs=512 count=4786480

    bin 档是有资料了,但开机一下就重起。
    我有看到你除了有git 下Rpi3 ,但我还有看到其他的git 路径如kernel-V4.14,
    是我少了这些吗。
    https://github.com/brobwind
    谢谢

    1. 如果你完全照这个步骤来做的话,就可以下载到所以的源代码了:
      https://github.com/brobwind/pie-device-brobwind-rpi3/blob/master/README.md
      (找关键字local_manifest.xml:https://github.com/brobwind/pie-device-brobwind-rpi3/blob/master/local_manifest.xml)

  12. I have built the android from the source code you shared on the github and android is coming up on my Raspberry Pi3.

    Now, I have written a custom video player to play mp4 videos but I am getting below errors:

    07-10 11:57:11.242 191 17659 E OMXNodeInstance: setConfig(0xf2aa9cc0:google.aac.decoder, ConfigPriority(0x6f800002)) ERROR: Undefined(0x80001001)
    07-10 11:57:11.242 188 4349 I ACodec : codec does not support config priority (err -2147483648)
    07-10 11:57:11.243 188 4346 I MediaCodec: [OMX.google.h264.decoder] setting surface generation to 192529
    07-10 11:57:11.243 188 4346 D SurfaceUtils: disconnecting from surface 0xed5c8008, reason connectToSurface(reconnect)
    07-10 11:57:11.243 188 4346 D SurfaceUtils: connecting to surface 0xed5c8008, reason connectToSurface(reconnect)
    07-10 11:57:11.243 191 17659 E OMXNodeInstance: getConfig(0xf2aa9cc0:google.aac.decoder, ConfigAndroidVendorExtension(0x6f100004)) ERROR: Undefined(0x80001001)
    07-10 11:57:11.244 191 17659 E OMXNodeInstance: getExtensionIndex(0xf269c120:google.h264.decoder, OMX.google.android.index.enableAndroidNativeBuffers) ERROR: UnsupportedIndex(0x8000101a)
    07-10 11:57:11.244 188 4347 E ACodec : [OMX.google.h264.decoder] setPortMode on output to DynamicANWBuffer failed w/ err -1010
    07-10 11:57:11.245 188 4349 I MediaCodec: MediaCodec will operate in async mode
    07-10 11:57:11.245 191 17659 W OMXNodeInstance: [0xf269c120:google.h264.decoder] component does not support metadata mode; using fallback
    07-10 11:57:11.248 149 149 W AshmemAllocator: ashmem_create_region(8192) returning hidl_memory(0xecb98180, 8192)
    07-10 11:57:11.248 191 11122 D SoftVideoDecoderOMXComponent: Color Aspects preference: 1
    07-10 11:57:11.248 191 11122 E OMXNodeInstance: setConfig(0xf269c120:google.h264.decoder, ConfigPriority(0x6f800002)) ERROR: UnsupportedIndex(0x8000101a)
    07-10 11:57:11.249 188 4347 I ACodec : codec does not support config priority (err -1010)
    07-10 11:57:11.249 191 11122 E OMXNodeInstance: setConfig(0xf269c120:google.h264.decoder, ConfigOperatingRate(0x6f800003)) ERROR: UnsupportedIndex(0x8000101a)
    07-10 11:57:11.249 188 4347 I ACodec : codec does not support config operating rate (err -1010)
    07-10 11:57:11.249 191 191 E OMXNodeInstance: getConfig(0xf269c120:google.h264.decoder, ConfigAndroidVendorExtension(0x6f100004)) ERROR: UnsupportedIndex(0x8000101a)

    07-10 11:57:11.404 174 288 W MapperHal: buffer descriptor with invalid usage bits 0x2000
    07-10 11:57:11.405 161 262 E [minigbm:gralloc0.cc(119)]: Unsupported combination — HAL format: 842094169, HAL usage: 10528, drv_format: 9997, use_flags: 131328
    07-10 11:57:11.405 174 288 E GraphicBufferAllocator: Failed to allocate (640 x 360) layerCount 1 format 842094169 usage 2920: 3
    07-10 11:57:11.405 174 288 E BufferQueueProducer: [SurfaceView – com.example.customvideoplayer/com.example.customvideoplayer.MainActivity#0] dequeueBuffer: createGraphicBuffer failed
    07-10 11:57:11.405 188 4346 W SoftwareRenderer: Surface::dequeueBuffer returned error -12
    07-10 11:57:11.405 4320 4333 W MediaPlayerNative: info/warning (3, 0)

    Can you please help fixing these issues

    1. You may apply this patch: https://www.raspberrypi.org/forums/viewtopic.php?f=73&t=232234&start=25
      After apply this patch, the chrome browser can play video.
      Hope it helps.

      1. Thanks for the reply.
        Video is playing now but I am not able to get audio from HDMI.
        Can you please help regarding audio from HDMI?

        1. I tried at very early time, but it seems doesn’t work and I haven’t figure out why.
          Here is some tips:
          1. Using aplay(from tinyalsa) to play pcm data to check if it’s the driver problem.
          2. Modify device/brobwind/rpi3/hals/audio/audio_hw.c to select the right audio card.

  13. 谢谢你的回覆,但我真的很笨还是不是太懂。
    我比对了我的和你的code, 我发现我少了u-boot 那一个步骤,
    但我看到rpiboot 和 u-boot是在SD 的相同位置。
    PART: 314F99D5-B2BF-4883-8D03-E2F2CE507D6A rpiboot ${SIZE_RPIBOOT}
    PART: 314F99D5-B2BF-4883-8D03-E2F2CE507D6A uboot_a ${SIZE_UBOOT}
    PART: 314F99D5-B2BF-4883-8D03-E2F2CE507D6A uboot_b ${SIZE_UBOOT}
    所以我不知是不是这一步有问题。谢谢

    1. 这个分区表实际上是借鉴Android官方iot 1.0.5版本的分区表。
      uboot_{a,b}, vbmeta_{a,b}, oem_bootloader_{a,b} 这几个分区是没有使用的。
      u-boot存放在第一个(rpiboot)分区, 名为u-boot-dtok.bin

  14. If I have downloaded an apk from the play store is there a way I can get it running on here? Or can the play store be installed?

  15. AssertionError: Can only handle FAT with 1 reserved sector
    Traceback (most recent call last):
    File “build/make/tools/fat16copy.py”, line 773, in
    root = fat(sys.argv[1]).root

    Not sure what to make of it, I have all of the tools and python installed.

  16. Hi hzak,
    I flashed your image to rip compute module V3 and I have no luck to boot it.
    Is it posible to run on cm kit?
    Thanks in advance

    1. https://www.raspberrypi.org/blog/compute-module-3-launch/
      https://www.raspberrypi.org/products/compute-module-3/
      https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2837/README.md
      It uses BCM2837 which is 64-bit CPU, so it’s possible.

      Place the following file to the first partition (rpiboot):
      https://github.com/brobwind/pie-device-brobwind-rpi3/blob/master/boot/kernel-v4.14/dtbs/4.14.61-v8%2B/broadcom/bcm2710-rpi-cm3.dtb

  17. Hello guys,

    Could I use your project and add my customization to build up my project? Your project is really nice 🙂

    Regards,
    Kha

    1. It requires google GMS, but from the https://www.android.com/gms, It says “While the Android Open Source Project (AOSP) provides common, device-level functionalities such as email and calling, GMS it not part of AOSP. GMS is only available through a license with Google and delivers a holistic set of popular apps and cloud-based services”

      It’s not possible for me to integrate GMS to the final image.

  18. 请问一吓,我想在CM3+上启动,要做那些修改,还有我想移植SIM9800CE的驱动,请问要那些修改?

    1. 看起来CM3+与CM3用的是同一个dtb文件,你可以试试将https://github.com/brobwind/pie-device-brobwind-rpi3/blob/master/boot/kernel-v4.14/dtbs/4.14.61-v8%2B/broadcom/bcm2710-rpi-cm3.dtb 放到rpiboot分区中,看能否正常开机。
      如果你想增加驱动的话,需要重新编译kernel.

      1. 你好,测试了,更换这个文件也是否能开机,测试了,好像完全没是启动动作

      2. 还有我使用GPIO直接驱动RGB的屏,能否像以前一样,修改config.txt来配置

  19. This article really helpful !
    But seem the kernel module is disable. I try write a simple kernel module but can’t porting it.
    Can anyone help me to resolve this, please ! Thanks @HZAK

  20. Hello Hzak,

    I saw the defconfig files config-4.14.61-v8+ (it seems you merged android needed config to bcm2835_defconfig). Could you please share your method? I need it to build my own project?

    Regards,
    Kha Tran

      1. I tried this instruction. But I can NOT get the same kernel defconfig like (config-4.14.61-v8+). Actually, you modified a little bit after mẻging. Is it right, guys?

        Thank you for your support

    1. I do not think it can support NFC. since there is not builtin kernel driver, HAL library and system feature.

发表评论

电子邮件地址不会被公开。 必填项已用*标注