User avatar
Konsta
Posts: 682
Joined: Thu Aug 16, 2018 3:55 pm

[DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Wed Oct 11, 2023 6:38 pm

Here are my builds of AOSP (Android 14) for Raspberry Pi 4 and Pi 5. These are for advanced users only.

Pi 4 build supports Raspberry Pi 4 Model B, Pi 400, and Compute Module 4. Pi 4 model with at least 2GB of RAM is required to run this build.
Pi 5 build supports Raspberry Pi 5.

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_20231010-170711.png
Screenshot_20231010-170711.png (143.46 KiB) Viewed 14258 times
https://konstakang.com/devices/rpi4/AOSP14/
https://konstakang.com/devices/rpi5/AOSP14/

Sources:
Last edited by Konsta on Thu Nov 23, 2023 4:43 pm, edited 2 times in total.
KonstaKANG.com

User avatar
Konsta
Posts: 682
Joined: Thu Aug 16, 2018 3:55 pm

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 B

Wed Nov 15, 2023 6:12 pm

Android 14 on Raspberry Pi 5!
https://twitter.com/KonstaKANG/status/1 ... 6853409149
Screenshot_20231115-200621.png
Screenshot_20231115-200621.png (146.2 KiB) Viewed 12114 times
KonstaKANG.com

User avatar
Konsta
Posts: 682
Joined: Thu Aug 16, 2018 3:55 pm

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Thu Nov 23, 2023 4:35 pm

New Pi 4 build.
https://konstakang.com/devices/rpi4/AOSP14/

-update to latest AOSP release (android-14.0.0_r14)
-include AOSP13 wpa_supplicant to fix connecting to protected networks
-add support for booting from NVME (custom CM4 I/O boards with M.2 slot)
-improve audio DAC detection
-improve CPU overclocking option (Pi 4B R1.4+ and Pi 400 clocked at 1800MHz by default)
-fix native screen recording
-update to TWRP 3.7.0_11-1-KonstaKANG
-update to new Raspberry Pi utils (vcgencmd, pinctrl, etc)
-update to v4l-utils master/1.25.0
-update to FFmpeg 6.0.1, AOSP dav1d 1.3.0
-update to libcamera master/v0.1.0
-update to Mesa 23.3.0-rc4
-update to Linux 6.1.61 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
-Android security patch level: 1 November 2023
Last edited by Konsta on Thu Nov 23, 2023 4:55 pm, edited 1 time in total.
KonstaKANG.com

User avatar
Konsta
Posts: 682
Joined: Thu Aug 16, 2018 3:55 pm

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Thu Nov 23, 2023 4:36 pm

First Pi 5 build also available!
https://konstakang.com/devices/rpi5/AOSP14/

-initial release (android-14.0.0_r14)
-Mesa 23.3.0-rc4
-FFmpeg 6.0.1, AOSP dav1d 1.3.0
-alsa-lib/alsa-utils v1.2.10
-libcamera master/v0.1.0
-Linux 6.1.61 kernel
-Android security patch level: 1 November 2023
KonstaKANG.com

User avatar
Konsta
Posts: 682
Joined: Thu Aug 16, 2018 3:55 pm

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Thu Nov 23, 2023 4:41 pm

Decided not to open a separate topic for the Pi 5 release as this forum section seems to get littered with all kinds of new topics. Maybe this helps people to find the right existing topic for discussion. If you want my attention, please use existing topics. There is a topic for each AOSP and LineageOS release exactly for this purpose.

Please mention the device model when reporting any issues in this discussion.
KonstaKANG.com

duckredbeard
Posts: 205
Joined: Mon Apr 29, 2019 1:53 am

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Wed Nov 29, 2023 12:22 am

I have tried a few of your builds but I keep getting stuck with issues getting to the play store. I don't recall what the error was, but something about needing a device ID. I have seen this using different GApps packages. The last time I tried to install, I tried the following versions:

AOSP14-20231123-KonstaKANG-rpi4
AUTO-LiteGapps_arm64_14.0_v2.9_official.zip
You can't know your limits until you exceed them.

User avatar
Konsta
Posts: 682
Joined: Thu Aug 16, 2018 3:55 pm

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Wed Nov 29, 2023 3:20 pm

duckredbeard wrote:
Wed Nov 29, 2023 12:22 am
I have tried a few of your builds but I keep getting stuck with issues getting to the play store. I don't recall what the error was, but something about needing a device ID. I have seen this using different GApps packages. The last time I tried to install, I tried the following versions:

AOSP14-20231123-KonstaKANG-rpi4
AUTO-LiteGapps_arm64_14.0_v2.9_official.zip
GApps are not part of my releases. Please read the relevant FAQ section on how to install GApps package of your choice. Google's device registration page is also linked in the instructions and contains how to retrieve the GSFAID.

If you're not comfortable with command line, there's also third party applications you can use to get the device ID (e.g. https://play.google.com/store/apps/deta ... droidallid
& https://play.google.com/store/apps/deta ... olacbb.ids , from some alternative source of course).
KonstaKANG.com

duckredbeard
Posts: 205
Joined: Mon Apr 29, 2019 1:53 am

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Thu Nov 30, 2023 2:03 am

Thanks for your work on this and especially for your continued support. I was able to get it to work, though the registration of the Google ID took longer than I expected. After attempting to log into the Play Store repeatedly for 10 minutes and only getting the "play protect" warning, I gave up. When I came back about 10 minutes later, I was greeted with the login screen. I have installed a few apps, flashed the resize.zip. All is well, but I do have a few minor issues that you may have some guidance on...

I have installed Nova Launcher, and I believe this was an issue on the stock launcher as well. When I try to drag from the app drawer to the home screen, I am only seeing a split screen option. No way to drop the app icon on my home screen.

On the navigation bar, there are a few apps that I am not interested in keeping down there. How do I remove them from the navigation bar?

The purpose of my building this is to have a TV with an Android Pi in our little league baseball concession stand. Many of our parent volunteers run the concession stand to raise money for the team's tournaments. With this build, we will be able to stream the games to the Pi so they can watch the games while they work. This will also let the concession customers keep up with the baseball game while they are getting food!

I have not been able to install the streaming app on any Roku, FireStick, or SmartTV. This Pi will do what I need it to do!
You can't know your limits until you exceed them.

User avatar
Konsta
Posts: 682
Joined: Thu Aug 16, 2018 3:55 pm

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Thu Nov 30, 2023 3:42 pm

duckredbeard wrote:
Thu Nov 30, 2023 2:03 am
I have installed Nova Launcher, and I believe this was an issue on the stock launcher as well. When I try to drag from the app drawer to the home screen, I am only seeing a split screen option. No way to drop the app icon on my home screen.

On the navigation bar, there are a few apps that I am not interested in keeping down there. How do I remove them from the navigation bar?
I think it's been a known issue for years that you can't use Nova Launcher with a mouse. You would need to report it to the Nova developer(s).

With the stock launcher both work just fine, drag & drop.
KonstaKANG.com

duckredbeard
Posts: 205
Joined: Mon Apr 29, 2019 1:53 am

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Fri Dec 01, 2023 2:26 am

Are you familiar with the Android app called Tasker? It would be awesome if you and Tasker's Dev (Joao) got together and worked out a way for us to use GPIO inputs as Tasker profiles.
You can't know your limits until you exceed them.

User avatar
Konsta
Posts: 682
Joined: Thu Aug 16, 2018 3:55 pm

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Fri Dec 01, 2023 12:00 pm

duckredbeard wrote:
Fri Dec 01, 2023 2:26 am
Are you familiar with the Android app called Tasker? It would be awesome if you and Tasker's Dev (Joao) got together and worked out a way for us to use GPIO inputs as Tasker profiles.
Tasker is not open source so there's nothing I could in any case. You would need to report your feature request to Tasker developer(s).
KonstaKANG.com

duckredbeard
Posts: 205
Joined: Mon Apr 29, 2019 1:53 am

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Mon Dec 04, 2023 4:24 pm

I'd like to run this headless. I have VNC enabled and have been able to use it if the Pi is booted with an HDMI connection in place. If I try to boot it without a monitor, I cannot get into it using VNC.

I have found that if I connect power and ethernet and wait, it never shows up in RealVNC. If I connect the HDMI, the monitor shows the ANDROID boot screen and then proceeds with "Tablet is starting". After that boots up, I am able to get to it using VNC.

How can I get it to boot up fully without the monitor?
You can't know your limits until you exceed them.

User avatar
Konsta
Posts: 682
Joined: Thu Aug 16, 2018 3:55 pm

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Mon Dec 04, 2023 5:39 pm

duckredbeard wrote:
Mon Dec 04, 2023 4:24 pm
I'd like to run this headless. I have VNC enabled and have been able to use it if the Pi is booted with an HDMI connection in place. If I try to boot it without a monitor, I cannot get into it using VNC.

I have found that if I connect power and ethernet and wait, it never shows up in RealVNC. If I connect the HDMI, the monitor shows the ANDROID boot screen and then proceeds with "Tablet is starting". After that boots up, I am able to get to it using VNC.

How can I get it to boot up fully without the monitor?
Yes, booting headless is broken in current Android 14 releases because of the same HDMI-CEC related issue that is already listed under 'Issues' (https://github.com/raspberry-vanilla/an ... /issues/37). It's already been sorted and will be fixed if/when there's another release.

In addition to DSI displays, it affects running headless (i.e. without any HDMI display connected), or if you have the HDMI display connected on the port that is not used for HDMI-CEC (i.e. you have display connected on HDMI1 while HDMI-CEC is set to HDMI0 or vice versa).
KonstaKANG.com

duckredbeard
Posts: 205
Joined: Mon Apr 29, 2019 1:53 am

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Mon Dec 04, 2023 7:10 pm

Looks like we can disconnect the HDMI after it boots. This is only a bandaid, because I expect it will be rebooted in the future. Mine will be mounted in a garage ceiling, not exactly convenient for carrying a monitor there just for a reboot.
You can't know your limits until you exceed them.

User avatar
Konsta
Posts: 682
Joined: Thu Aug 16, 2018 3:55 pm

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Tue Dec 05, 2023 10:24 am

duckredbeard wrote:
Mon Dec 04, 2023 7:10 pm
Looks like we can disconnect the HDMI after it boots. This is only a bandaid, because I expect it will be rebooted in the future. Mine will be mounted in a garage ceiling, not exactly convenient for carrying a monitor there just for a reboot.
As already mentioned, It's already been sorted and will be fixed if/when there's another release.

So, you can wait patiently for another release. Or you can build Android 14 image from Raspberry Vanilla sources yourself if you're in a hurry. Or you can use Android 13 based releases.
KonstaKANG.com

duckredbeard
Posts: 205
Joined: Mon Apr 29, 2019 1:53 am

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Wed Dec 06, 2023 8:55 pm

I'm sorry if it feels like I'm trying to hijack this thread, but this is the best place I can see discussing this.

I posted something on a tasker enthusiast subreddit and got the following reply from a pi enthusiast.

"Adafruit had a lot of how-to guides, and the raspberry pi forums also have several post on configuring the gpio pins to do various things. I'm not sure if the android 14 pi page has a forum on making use of the gpio pins. If they have a reddit page you may try asking about how to configure the gpio to send a keystroke, once the pins you want to send a keystroke are set, the tasker part is simple enough."

It sounds like all we have to do is assign a keystroke to a GPIO, similar to what the volume and power buttons already have incorporated. Can we get a few GPIO to be assigned keystrokes? Perhaps "Button 1" through "Button 14" as that is an example of how Tasker and AutoInput see some of the keystrokes..
You can't know your limits until you exceed them.

User avatar
Konsta
Posts: 682
Joined: Thu Aug 16, 2018 3:55 pm

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Thu Dec 07, 2023 10:43 am

duckredbeard wrote:
Wed Dec 06, 2023 8:55 pm
I'm sorry if it feels like I'm trying to hijack this thread, but this is the best place I can see discussing this.

I posted something on a tasker enthusiast subreddit and got the following reply from a pi enthusiast.

"Adafruit had a lot of how-to guides, and the raspberry pi forums also have several post on configuring the gpio pins to do various things. I'm not sure if the android 14 pi page has a forum on making use of the gpio pins. If they have a reddit page you may try asking about how to configure the gpio to send a keystroke, once the pins you want to send a keystroke are set, the tasker part is simple enough."

It sounds like all we have to do is assign a keystroke to a GPIO, similar to what the volume and power buttons already have incorporated. Can we get a few GPIO to be assigned keystrokes? Perhaps "Button 1" through "Button 14" as that is an example of how Tasker and AutoInput see some of the keystrokes..
Yes, this is the only appropriate place to discuss anything related to this build on this forum. :)

Please see /boot/config.txt under 'Keys' section. There's one line per button and you can use any free GPIO pin for additional buttons. You can find the keycodes e.g. in https://github.com/raspberry-vanilla/an ... Generic.kl.
KonstaKANG.com

duckredbeard
Posts: 205
Joined: Mon Apr 29, 2019 1:53 am

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Thu Dec 07, 2023 1:28 pm

Can I get to that file without root access?

Would putting the SD card in a PC allow me to get to that file?

I'm at work right now so I'm unable to test this. (Currently under a Boeing 737 installing a temperature monitoring system on the pressurization and air conditioning system)
You can't know your limits until you exceed them.

duckredbeard
Posts: 205
Joined: Mon Apr 29, 2019 1:53 am

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Fri Dec 08, 2023 1:53 am

So this works! I shut down the Pi, put the SD card in my PC, opened the /boot/config.txt and added GPIOs and associated them with "BUTTON_x" and also edited the key numbers to match the reference you gave me. Followed the format of what was there for volume and power buttons. I connected a push button to GPIO26 (it is BUTTON_7).

Rebooted and configured Tasker to give me a toast with "GPIO pressed" and set up a profile for AutoInput to detect Button 7. Backed out and took a breath. Pressed the button and got the toast when I released (I had designated the key up/down backwards), so I went back to tasker and designated the proper key, also added a profile to flash "GPIO released" to correspond to the releasing of the button.

Pressed the button - got the "GPIO26 pressed" toast
Released the button - got the "GPIO26 released" toast

SUCCESS! Except I also noticed that the pressing the button caused my screen to highlight an app on my home screen. Subsequent presses and releases also did a few things like changing the focus, opening apps, showing extended menus...apparently Button 7 already has an assignment in Android. I need to associate GPIO26 with a different key that is not already monitored by Android! I see in your link that BUTTON_1 through BUTTON_16 are listed twice. What is the difference?

Overall, I'd say this has taken a HUGE leap forward in what I was trying to do. I look forward to learning more and refining this. You are AWESOME for taking the time to develop this and supporting us!
You can't know your limits until you exceed them.

duckredbeard
Posts: 205
Joined: Mon Apr 29, 2019 1:53 am

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Fri Dec 08, 2023 3:03 am

Important to note this: When creating a profile in Tasker and using AutoInput to detect a key event, it registers GPIO26 (which is designated as Key 294 and BUTTON_7 in the config.txt) as Key 194. This was discovered as Tasker and AutoInput have a function where it listens for a key press and records the keypress by code, populating a line in a popup when the key is pressed.

I am wondering which keys have no real function when the Android Launcher is just sitting on the launcher home screen. No foreground apps, no media playing, just idle...
You can't know your limits until you exceed them.

duckredbeard
Posts: 205
Joined: Mon Apr 29, 2019 1:53 am

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Sat Dec 09, 2023 1:58 am

I totally have this working with two GPIO. I am using key 195 and key 196. After getting wonky stuff using BUTTON_x, I decided to use undefined keys. Since there are only about 8 in the list, I'm wondering if I can go rogue and assign new (unused) keycodes. Since I don't intend to use the power and volume buttons, I started using GPIO26 for one of my Tasker jobs.

# Keys
#dtoverlay=gpio-key,gpio=21,keycode=116,label="POWER"
#dtoverlay=gpio-key,gpio=26,keycode=115,label="VOLUME_UP"
#dtoverlay=gpio-key,gpio=20,keycode=114,label="VOLUME_DOWN"

dtoverlay=gpio-key,gpio=26,keycode=195,label="GPIO26"
dtoverlay=gpio-key,gpio=16,keycode=196,label="GPIO16"

I wonder what would happen if I went rogue and made a new keycode...maybe in the 900s. Since Tasker is intercepting the "keycode" and setting a variable to the keycode value, then reacting to that value, I think this could work. Tasker does not seem to detect the label value, I have to go off the keycode, and it works.

dtoverlay=gpio-key,gpio=26,keycode=926,label="GPIO26"
dtoverlay=gpio-key,gpio=16,keycode=916,label="GPIO16"

What I do have working now, as a proof of concept, is that when I press GPIO26's button, I get a notification that the button is pressed. The notification shows "GPIO26 pressed" and releasing the button cancels the notification. The response time is pretty quick and adequate for my project.

I will take this pretty far tomorrow and put together a video showcasing these developments.
You can't know your limits until you exceed them.

duckredbeard
Posts: 205
Joined: Mon Apr 29, 2019 1:53 am

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Mon Dec 11, 2023 8:21 pm

Installed on a 4GB pi 4, using an SD card. I've installed a few games but they are a bit laggy. Would I have better performance if I ran this from a USB drive?
You can't know your limits until you exceed them.

daveheart14
Posts: 97
Joined: Thu Mar 25, 2021 6:08 pm

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Thu Dec 14, 2023 6:04 pm

Hello,

First of all, thank you Konsta for your Android roms and their follow-ups. I've tried them all since the Pi 3.
I'm not ready to receive my pi5 in the next few weeks...
I'm not very patient, has anyone tried Geforce Now for daily use?
Thank you for this feedback.
Pi0w : Camera/motion, Pi02w : PINN/System/Test, Pi2B : Standby, Pi3B : PINN/Bartop/System, Pi4B : PINN/Recalbox/System
Pi5 8Go : Test

dlang
Posts: 4
Joined: Mon Oct 01, 2012 3:44 am

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Mon Dec 18, 2023 7:36 am

I installed AOSP14-20231123-KonstaKANG-rpi5.zip (unzip, then dd to sd card) for my pi 5 and it is showing nothing when I go into raspberry pi options in settings, so I cannot set it to go to TWRP to try and install mind the gapps

right now I am doing this with a touchscreen (forgot to bring a keyboard with me this trip)

User avatar
Konsta
Posts: 682
Joined: Thu Aug 16, 2018 3:55 pm

Re: [DEV] AOSP (Android 14) for Raspberry Pi 4 & Pi 5

Thu Dec 28, 2023 4:25 pm

duckredbeard wrote:
Mon Dec 11, 2023 8:21 pm
Installed on a 4GB pi 4, using an SD card. I've installed a few games but they are a bit laggy. Would I have better performance if I ran this from a USB drive?
GPU on the Raspberry Pis (even on Pi 5) is really not that powerful. You can't expect it to run 3D games like on current high-end mobile chipsets (that can also cost 10 times more).

I doubt storage I/O speed matters that much during gameplay. You could try overclocking CPU/GPU (make sure to take care of active cooling).
dlang wrote:
Mon Dec 18, 2023 7:36 am
I installed AOSP14-20231123-KonstaKANG-rpi5.zip (unzip, then dd to sd card) for my pi 5 and it is showing nothing when I go into raspberry pi options in settings, so I cannot set it to go to TWRP to try and install mind the gapps

right now I am doing this with a touchscreen (forgot to bring a keyboard with me this trip)
Likely something strange with your setup. I haven't received any reports of similar issues. What display resolution are you running? Simply just scroll down the settings menu to the bottom to find the option?
KonstaKANG.com

Return to “Android”