[DEV][ROM] AOSP (Android 13) for Raspberry Pi 4 B

Search This thread

KonstaT

Senior Member
Jan 20, 2016
770
456
KonstaKANG.com
Here’s my build of AOSP (Android 13) for Raspberry Pi 4 Model B, Pi 400, and Compute Module 4. It’s for advanced users only. Pi 4 model with at least 2GB of RAM is required to run this build.

Important! Raspberry Pi hardware specific implementation in this build is based on source code released on my Raspberry Vanilla project but this build still offers various additional features and enhancements over that. This image includes parts that are licensed under non-commercial license (Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International). You may use this build freely in personal/educational/etc use. Commercial use is not allowed with this build! You can contact me by email to discuss creating customized Android builds for commercial purposes.

Screenshot_20220819-154849.png


Working:
  • Audio (HDMI, 3.5mm jack, USB microphones, bluetooth speakers/headphones, etc)
  • Audio DAC (using GPIO DACs e.g. Hifiberry DAC+)
  • Bluetooth (and bluetooth tethering)
  • Camera (using official Pi camera modules & UVC USB webcams)
  • GPIO
  • GPS (using external USB modules e.g. U-Blox 7)
  • Ethernet
  • Hardware accelerated graphics (V3D, OpenGL & Vulkan)
  • HDMI display (and HDMI-CEC)
  • I2C
  • IR remotes (using external GPIO IR modules e.g. TSOP4838)
  • RTC (using external GPIO I2C modules e.g. DS3231)
  • Sensors (using external GPIO I2C modules e.g. MPU6050, LSM6DS3, LSM303DLHC, BME280/BMP280, and APDS9930 accelerometer, gyroscope, magnetometer, temperature, pressure, humidity, ambient light, and proximity)
  • Serial console (using external GPIO serial console adapters e.g. PL2303)
  • SPI
  • Touchscreen/multi-touch (official 7” touchscreen, USB touchscreens, Waveshare SPI touchscreens)
  • USB (mouse, keyboard, storage, etc)
  • USB-C (ADB, MTP, PTP, USB tethering)
  • Wifi (and wifi tethering)

Not working:
  • Hardware video decoding & encoding (software decoding & encoding works, option to test highly experimental H.264 hardware video decoding)

Issues:
  • Camcorder (i.e. recording videos) & some third party camera apps don't work with official Pi camera modules (works with UVC USB webcams)
  • SELinux is in permissive mode
  • Encrypting userdata is not supported
  • and more…

Sources:

Thanks:
  • Roman Stratiienko and GloDroid project
  • Peter Yoon and android-rpi project
  • AOSP reference board developers (dragonboard, hikey, yukawa)
  • Android-x86 project
 
Last edited:

KonstaT

Senior Member
Jan 20, 2016
770
456
KonstaKANG.com
How to install:
  1. Follow the official Raspberry Pi instructions for writing the image to the SD card.
You can also update to newer builds using TWRP flashable OTA packages.
  1. Download AOSP13-xxxxxxxx-KonstaKANG-rpi4-ota.zip and save it to your device’s internal storage or use an external USB drive
  2. Boot to TWRP recovery (see FAQ)
  3. Install AOSP13-xxxxxxxx-KonstaKANG-rpi4-ota.zip from your selected storage
  4. (Flash GApps/Magisk/other add-ons you had previously installed)
  5. Boot out of recovery (see FAQ)
Changes that are backed up and restored flashing OTAs:
  • Device specific settings changed using Settings -> System -> Raspberry Pi settings
  • Manual changes to /boot/resolution.txt and /boot/rc_keymap.txt
  • USB boot configuration in /boot/config.txt
  • User specific options in /boot/config_user.txt
Changes that are not backed up and restored flashing OTAs:
  • Manual changes to /boot/config.txt (and any other manual changes to /boot partition)
  • GApps
  • Magisk

FAQ:

FAQ is getting quite long and difficult to maintain in several different places. You can find the always up-to-date FAQ here:
https://konstakang.com/devices/rpi4/AOSP13/
 
Last edited:
  • Like
Reactions: garylawwd

KonstaT

Senior Member
Jan 20, 2016
770
456
KonstaKANG.com
7.9. changelog:
  • update to latest AOSP release (android-13.0.0_r4)
  • add support for virtualization
  • tweak Launcher3 default workspace
  • add /boot/config_user.txt for user specific options to backup/restore during OTAs
  • update to Linux 5.15.64 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 September 2022

1.9. changelog:
  • new Raspberry Pi Android kernel bring-up based on AOSP android13-5.15-lts
  • update to Linux 5.15.63 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)

26.8. changelog:
  • update to Mesa main (22.3.0-devel)
  • Vulkan 1.2 (thanks to people at Igalia for Vulkan 1.2 conformance and Roman Stratiienko for latest Mesa fixes)
  • fix Vulkan related issue on Chromium-based browsers

21.8. changelog:
  • also available as OTA package
  • fix issue with toggling bluetooth
  • add built-in VNC server
  • allow VNC input to wake the device
  • fix AOSP Calendar app crash
  • fix long press on power button behavior
  • minor brightness fixes for the official 7” display

19.8. changelog:
  • initial release (android-13.0.0_r3)
  • Mesa 22.0.3
  • Linux 5.10.136 kernel
  • Android security patch level: 5 August 2022

Previous builds:
 
Last edited:

card13

Senior Member
Nov 27, 2008
442
162
32
Washington State
OnePlus 3T
OnePlus 5
@KonstaT I noticed on most of your ROMs you mention the Hardware Video Encoding/Decoding, I remember reading the answer to this question before but can't remember where on here or what it was (it was awhile back I read it). What is the cause of Hardware Video Encoding/Decoding issue (general terms or a link is ok, just trying to refresh my memory)?

Also thank you for all the hard work!
 

KonstaT

Senior Member
Jan 20, 2016
770
456
KonstaKANG.com
@KonstaT I noticed on most of your ROMs you mention the Hardware Video Encoding/Decoding, I remember reading the answer to this question before but can't remember where on here or what it was (it was awhile back I read it). What is the cause of Hardware Video Encoding/Decoding issue (general terms or a link is ok, just trying to refresh my memory)?

Also thank you for all the hard work!
Raspberry Pi 4 uses kernel V4L2 interface for hardware video decoding/encoding. On regular Linux distributions libraries like GStreamer or FFmpeg are used to utilize the V4L2 interface. Multimedia framework on Android in entirely different of course. Recent Android versions have codec2 component to utilize the V4L2 interface (https://android.googlesource.com/platform/external/v4l2_codec2/).

Hardware codecs supported on Pi 4 are stateful H.264 at maximum 1080p (1920x1080) and stateless H.265 at maximum 4K (3840x2160). v4l2_codec2 supports stateful H.264, VP8, and VP9 codecs, so only H.264 is currently in the scope with the Pi 4 on Android.

There's already an option to enable H.264 hw video decoding. Current issue with it is that hw codecs on Pi don't produce linear buffers but use their on own tiling modifier instead. And software decoder manages H.264 at 1080p just fine anyway.
 
Last edited:
  • Like
Reactions: card13

KonstaT

Senior Member
Jan 20, 2016
770
456
KonstaKANG.com
New build. Few quick fixes.


  • also available as OTA package
  • fix issue with toggling bluetooth
  • add built-in VNC server
  • allow VNC input to wake the device
  • fix AOSP Calendar app crash
  • fix long press on power button behavior
  • minor brightness fixes for the official 7" display
 

KonstaT

Senior Member
Jan 20, 2016
770
456
KonstaKANG.com
New build. Vulkan 1.2.


  • update to Mesa main (22.3.0-devel)
  • Vulkan 1.2 (thanks to people at Igalia for Vulkan 1.2 conformance and Roman Stratiienko for latest Mesa fixes)
  • fix Vulkan related issue on Chromium-based browsers
 
  • Like
Reactions: sallyahaj

Neogx

Senior Member
Jan 25, 2014
99
14
san
Damn i haven't upgraded since Andriod 11 i think nows a good time to try out this version
 

eXtermia

Member
Sep 3, 2007
21
1
does anyone know how to convert qemu or otherwise this into an VMDK, I would like to load it in esxi vmware fling on a pi possibly. I haven't have much success in coverting raw .img files into a vmdk but supposedly it works
 
  • Like
Reactions: WPA3

WPA3

New member
Aug 26, 2022
2
0
If you ever do manage to get it sorted please let me know im also interested in this.
 

eXtermia

Member
Sep 3, 2007
21
1
does anyone know how to convert qemu or otherwise this into an VMDK, I would like to load it in esxi vmware fling on a pi possibly. I haven't have much success in coverting raw .img files into a vmdk but supposedly it works
well I did get it in , but can't seem to make it bootable, same thing for kali . I have debian and ubuntu running. Seems I am missing an ARM64.EFI or so for android
 

KonstaT

Senior Member
Jan 20, 2016
770
456
KonstaKANG.com
New build. Linux 5.15 kernel.


  • new Raspberry Pi Android kernel bring-up based on AOSP android13-5.15-lts
  • update to Linux 5.15.63 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
 
  • Like
Reactions: lee99

KonstaT

Senior Member
Jan 20, 2016
770
456
KonstaKANG.com
New build.


  • update to latest AOSP release (android-13.0.0_r4)
  • add support for virtualization
  • tweak Launcher3 default workspace
  • add /boot/config_user.txt for user specific options to backup/restore during OTAs
  • update to Linux 5.15.64 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 September 2022
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    Here’s my build of AOSP (Android 13) for Raspberry Pi 4 Model B, Pi 400, and Compute Module 4. It’s for advanced users only. Pi 4 model with at least 2GB of RAM is required to run this build.

    Important! Raspberry Pi hardware specific implementation in this build is based on source code released on my Raspberry Vanilla project but this build still offers various additional features and enhancements over that. This image includes parts that are licensed under non-commercial license (Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International). You may use this build freely in personal/educational/etc use. Commercial use is not allowed with this build! You can contact me by email to discuss creating customized Android builds for commercial purposes.

    Screenshot_20220819-154849.png


    Working:
    • Audio (HDMI, 3.5mm jack, USB microphones, bluetooth speakers/headphones, etc)
    • Audio DAC (using GPIO DACs e.g. Hifiberry DAC+)
    • Bluetooth (and bluetooth tethering)
    • Camera (using official Pi camera modules & UVC USB webcams)
    • GPIO
    • GPS (using external USB modules e.g. U-Blox 7)
    • Ethernet
    • Hardware accelerated graphics (V3D, OpenGL & Vulkan)
    • HDMI display (and HDMI-CEC)
    • I2C
    • IR remotes (using external GPIO IR modules e.g. TSOP4838)
    • RTC (using external GPIO I2C modules e.g. DS3231)
    • Sensors (using external GPIO I2C modules e.g. MPU6050, LSM6DS3, LSM303DLHC, BME280/BMP280, and APDS9930 accelerometer, gyroscope, magnetometer, temperature, pressure, humidity, ambient light, and proximity)
    • Serial console (using external GPIO serial console adapters e.g. PL2303)
    • SPI
    • Touchscreen/multi-touch (official 7” touchscreen, USB touchscreens, Waveshare SPI touchscreens)
    • USB (mouse, keyboard, storage, etc)
    • USB-C (ADB, MTP, PTP, USB tethering)
    • Wifi (and wifi tethering)

    Not working:
    • Hardware video decoding & encoding (software decoding & encoding works, option to test highly experimental H.264 hardware video decoding)

    Issues:
    • Camcorder (i.e. recording videos) & some third party camera apps don't work with official Pi camera modules (works with UVC USB webcams)
    • SELinux is in permissive mode
    • Encrypting userdata is not supported
    • and more…

    Sources:

    Thanks:
    • Roman Stratiienko and GloDroid project
    • Peter Yoon and android-rpi project
    • AOSP reference board developers (dragonboard, hikey, yukawa)
    • Android-x86 project
    2
    I have recently started new open source project for Android on Raspberry Pi. Raspberry Vanilla AOSP.

    Goal of the project is to provide fairly minimal Android device configuration that supports all the built-in hardware on Raspberry Pi and provide stable ground for any further development. My personal builds (such as this one) still offer various features/enhancements over that.
    1
    How to install:
    1. Follow the official Raspberry Pi instructions for writing the image to the SD card.
    You can also update to newer builds using TWRP flashable OTA packages.
    1. Download AOSP13-xxxxxxxx-KonstaKANG-rpi4-ota.zip and save it to your device’s internal storage or use an external USB drive
    2. Boot to TWRP recovery (see FAQ)
    3. Install AOSP13-xxxxxxxx-KonstaKANG-rpi4-ota.zip from your selected storage
    4. (Flash GApps/Magisk/other add-ons you had previously installed)
    5. Boot out of recovery (see FAQ)
    Changes that are backed up and restored flashing OTAs:
    • Device specific settings changed using Settings -> System -> Raspberry Pi settings
    • Manual changes to /boot/resolution.txt and /boot/rc_keymap.txt
    • USB boot configuration in /boot/config.txt
    • User specific options in /boot/config_user.txt
    Changes that are not backed up and restored flashing OTAs:
    • Manual changes to /boot/config.txt (and any other manual changes to /boot partition)
    • GApps
    • Magisk

    FAQ:

    FAQ is getting quite long and difficult to maintain in several different places. You can find the always up-to-date FAQ here:
    https://konstakang.com/devices/rpi4/AOSP13/
    1
    @KonstaT I noticed on most of your ROMs you mention the Hardware Video Encoding/Decoding, I remember reading the answer to this question before but can't remember where on here or what it was (it was awhile back I read it). What is the cause of Hardware Video Encoding/Decoding issue (general terms or a link is ok, just trying to refresh my memory)?

    Also thank you for all the hard work!
    Raspberry Pi 4 uses kernel V4L2 interface for hardware video decoding/encoding. On regular Linux distributions libraries like GStreamer or FFmpeg are used to utilize the V4L2 interface. Multimedia framework on Android in entirely different of course. Recent Android versions have codec2 component to utilize the V4L2 interface (https://android.googlesource.com/platform/external/v4l2_codec2/).

    Hardware codecs supported on Pi 4 are stateful H.264 at maximum 1080p (1920x1080) and stateless H.265 at maximum 4K (3840x2160). v4l2_codec2 supports stateful H.264, VP8, and VP9 codecs, so only H.264 is currently in the scope with the Pi 4 on Android.

    There's already an option to enable H.264 hw video decoding. Current issue with it is that hw codecs on Pi don't produce linear buffers but use their on own tiling modifier instead. And software decoder manages H.264 at 1080p just fine anyway.
    1
    New build. Vulkan 1.2.


    • update to Mesa main (22.3.0-devel)
    • Vulkan 1.2 (thanks to people at Igalia for Vulkan 1.2 conformance and Roman Stratiienko for latest Mesa fixes)
    • fix Vulkan related issue on Chromium-based browsers