yashsingh1/xdaforums huggingface dataset:
[Raspberry Pi Original Development] KonstaT:
Discussed earlier on this same page (https://xdaforums.com/t/dev-rom-aosp-android-13-for-raspberry-pi-4-b.4481977/page-4#post-88109253 and forward).

If this is critical for you, you can use Android 12 releases for now.
[Raspberry Pi Original Development] adioph:
Thanks @KonstaT
[Raspberry Pi Original Development] adioph:
I also would like to ask how to fix cut off of audio in HDMI? Thanks
[Raspberry Pi Original Development] KonstaT:
HDMI audio on builds with Linux kernel >=5.10 (i.e. Android 12 and above) has been discussed e.g. http://disq.us/p/2r2wh1w

This should be fixed if/when there are new releases (https://github.com/raspberry-vanilla/android_device_brcm_rpi4/pull/1).
[Raspberry Pi Original Development] adioph:
Thanks
[Raspberry Pi Original Development] KonstaT:
New build for the Pi day!

AOSP (Android 13)

for Raspberry Pi 4

konstakang.com

update to latest AOSP release (Android 13 QPR2 - android-13.0.0_r35)

HDMI audio improvements

implement audio HAL that uses alsa directly to get rid off using alsa loopback for HDMI audio (thanks to nename0)

update alsa-lib and alsa-utils to v1.2.8

update to libcamera master/v0.0.4

fix camcorder (i.e. recording videos) with Pi camera modules

add support for Pi camera module v3 (untested)

fix H.265 hardware decoding on HEVC Main 10 profile videos

update to Mesa 22.3.7

update to Linux 5.15.94 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)

Android security patch level: 5 March 2023

Linux 6.1 kernel: (optional add-on)

update to Linux 6.1.15 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
[Raspberry Pi Original Development] aclinical:
Awesome, can't wait to try. I noticed that audio PR on github and since then have been daily refreshing your website hoping for that next release. 😂 Cheers.

Edit: Gave it a try, audio over HDMI is working great. Keep in mind you need to restart to switch between analog and HDMI audio (which is fine, just different behavior from previous releases). I didn't really play with much else, but this project is feeling very solid overall.
[Raspberry Pi Original Development] KonstaT:
Yeah, as stated in the FAQ, most options in Raspberry Pi settings menu require you to reboot your device for the setting to take effect. Audio device option was one of the exceptions but not anymore.
[Raspberry Pi Original Development] belock75:
Hi, one question, how do I also record audio while making a video? why don't you use the logitechw ebcam microphone?

thank you very much in advance.
[Raspberry Pi Original Development] beastbrain:
Hello, thanks for your work, I get Bluetooth has stop responding when I try to pair a device, any tips?
[Raspberry Pi Original Development] KonstaT:
It depends on the camera app what audio source it used. E.g. Open Camera (https://play.google.com/store/apps/details?id=net.sourceforge.opencamera) has an option in the settings to change the audio source (select 'External mic').

I now also modified the included camera application to use default audio source so it will also record from USB audio input. Will be included if/when there are any new builds.

Already discussed e.g. https://xdaforums.com/t/dev-rom-aosp-android-13-for-raspberry-pi-4-b.4481977/page-4#post-88109253 and forward.

Android 13 switched to new gabeldorsche bluetooth stack and there's reports of issues with BLE devices. If this is too much of an issues for you, you can use Android 12 builds where this is working.
[Raspberry Pi Original Development] beastbrain:
ok thanks, I will give A12 a try

keep up the good work!
[Raspberry Pi Original Development] KonstaT:
In case anyone is interested in testing bluetooth with BLE devices, you can download the latest bluetooth firmware from https://github.com/RPi-Distro/bluez-firmware/tree/master/broadcom (BCM4345C0.hcd and BCM4345C5.hcd) and copying them to /vendor/firmware/brcm/ on Android.

This seems to fix it for the BLE devices I have but it's still bit of a horror show to follow it in the logs as the Android 13's new bluetooth stack seems to crash pretty randomly on occasions.
[Raspberry Pi Original Development] beastbrain:
yeah some devices are problematic with A13, with A12 it worked ok for some devices but for example it can not see my smartband. I know it might not be very common to use smart devices with raspberry but it is convenient for a home gym :p
[Raspberry Pi Original Development] safetyp1:
Im trying to install Android TV on a fresh RPI4, but this link is dead:

AOSP13-20230314-KonstaKANG-rpi4.zip

https://www.androidfilehost.com/?fid=4279422670115728390

md5:7390bc560ecfa9d5634d1a82939bea26

Edit: Its back up now.
[Raspberry Pi Original Development] KonstaT:
This is not Android TV of course. There's LineageOS Android TV builds available, though.

Raspberry

Pi 4

konstakang.com
[Raspberry Pi Original Development] safetyp1:
Yeah I figured it out in the end. It’s all working. Just a bit slow, Tivimate app is really slow to render its TV Guide and Menus, and some video streams play very choppy compared to my fire stick 4k. Otherwise the install was simple.

HDMI CEC just worked.

PS5 DualSense just worked via Bluetooth.

HDMI audio worked, after switching to it.

Not sure if display res is switching to 4K from 1080p.

Ethernet & wifi just worked.

Not sure how to get Netflix app.
[Raspberry Pi Original Development] KonstaT:
Wrong place to discuss Android TV so please continue in the relevant topic.

Most TVs/displays will also show the actual resolution you're using somewhere. There's not much point in switching to 4k display resolution since you really can't play any videos in 4k either for various reasons (local H.265 files are the only exception). GPU on the Pi not that powerful and it will only slow things down as there's four times more pixels to render.

Regular mobile version of Netflix app is reported working. Android TV versions tend to have more restrictions (SafetyNet API, etc. IIRC Netflix even requires Android TV device to be specifically whitelisted for their servers). You would need to sideload Netflix using .apk file since it's not available on Play Store for that reason.
[Raspberry Pi Original Development] beastbrain:
Hello, I am using AOSP 12 rom and I have the HDMI on and off problem on a certain TV, in my other one it never does it, is there a fix for A12 too or only on A13? thanks in advance
[Raspberry Pi Original Development] KonstaT:
If you need Android 12 for some reason, you can use my LineageOS 19 builds that include the latest HDMI audio implementation.

If you insist on AOSP, you would need to compile yourself from Raspberry Vanilla sources (https://github.com/raspberry-vanilla/android_local_manifest/tree/android-12.1). Source code for AOSP 12 is still maintained but I have no plans to release any further builds.
[Raspberry Pi Original Development] KonstaT:
New build.

AOSP (Android 13)

for Raspberry Pi 4

konstakang.com

update to latest AOSP release (android-13.0.0_r41)

use USB audio input for camcorder videos with the built-in camera application

add support for AV1 software video decoding using FFmpeg and dav1d

update to FFmpeg 6.0

update to Linux 5.15.98 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)

Android security patch level: 5 April 2023

Linux 6.1 kernel: (optional add-on)

update to Linux 6.1.23 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
[Raspberry Pi Original Development] 716:
Hi, I have been trying to install Android on a Raspberry Pi 4. And your releases look like my only chance. My RPi can run Raspberry Pi OS and bootloader seems to be working fine. But when I flash an lineageos image from your website, The RPi just crashes after plugging in the usb/sdcard(I tried both). With tweaking few configs on config.txt and changing the values on resolution.txt or removing it the furthest I can get is a rainbowscreen for a second and then crash again. My monitor. I also tried using the kernel add-on from your website but result is the same. I can't seem to find any useful configurations to make it work. I am running out of options and I have to make this work in a week because I will compete in the biggest technology contest in my country. I hope you can help, thanks in advance.

My config.txt so far (removed comments)

arm_64bit=1
kernel=Image
gpio=21=ip,pu
[gpio21=1]
initramfs ramdisk.img followkernel
[gpio21=0]
initramfs ramdisk-recovery.img followkernel
[all]
hdmi_safe=1
camera_auto_detect=1
otg_mode=1
dtoverlay=android-sdcard
disable_overscan=1
[gpio21=1]
[all]
[gpio21=1]
[all]
dtparam=i2c_arm=on
over_voltage=0
arm_freq=1500
enable_uart=1
dtparam=spi=on
dtoverlay=dwc2,dr_mode=peripheral
[cm4]
dtoverlay=dwc2,dr_mode=otg
[all]
include config_user.txt
[Raspberry Pi Original Development] KonstaT:
It's certainly not going to work without any GPU driver at least. ;) Please follow the instructions in the FAQ instead of modifying the config.txt.

You can also see if e.g. this discussion is any help.

LineageOS 20 (Android 13)

for Raspberry Pi 4

disq.us
[Raspberry Pi Original Development] 716:
With more edit on config.txt I was able to get android boot animation but it got stuck there. If it requieres GPU driver, how am I suppesed to use it on a non-installed os I am new to this stuff
[Raspberry Pi Original Development] KonstaT:
Just saying, don't remove lines from the config.txt that are definitely needed. :)

If you can see the Android boot animation, I see no reason it wouldn't boot all the way to the OS. As stated in the OP you need a Pi 4 model with at least 2GB of RAM (won't work with 1GB of RAM). General advice is to use proper sdcard (at least class 10) and power source (3A in case of Pi 4). Impossible to say without seeing any logs in any case.
[Raspberry Pi Original Development] deepakmcachd:
Hi All,

i am using an Raspberry Pi 4 ,8GB board and have installed lineage-20.0-20230321-UNOFFICIAL-KonstaKANG (Android-13) .

All thing are working fine but stuck in Video Calling via IMO, Jitsi, Zoom and other recommended VC Apps as it is unable to deliver any sound.

I Have tried 3 different Webcam of Logitech which of course comes with MIC but no one able to deliver MIC sound

I also attach one USB Mic of Zebronics as well... which is recognised while voice calling and voice recording but still not helping in VC.

kindly let me know is it a known issues or some DIY can help the cause .
[Raspberry Pi Original Development] KonstaT:
Topic for discussing my LineageOS 20 builds is here:

https://xdaforums.com/t/dev-rom-unofficial-lineageos-20-android-13-for-raspberry-pi-4-b.4516545/

There's been some mixed reports with various video conferencing apps with previous Android versions. Please attach appropriate logs ('logcat' in this case) as it's impossible to say otherwise.
[Raspberry Pi Original Development] rabbited:
KonstaT, if I wanted to compile your version of Android 13 but make certain alterations to accommodate new hardware, is there any available way to do that or am I limited to compiling Vanilla AOSP with the new hardware but without the additional customizations you've made?
[Raspberry Pi Original Development] KonstaT:
That would entirely depends on the hardware and what modifications you need to make to support it.
[Raspberry Pi Original Development] 716:
There was strange with my RPi from the beginning. It also wouldn't boot easily with the official rpios images, I would still need to do some configs and modify (The RPi got burnt anyways🙁). Whatever I don't think that was a problem with your build sorry to bother!
[Raspberry Pi Original Development] erikcas:
Nice work Konstat! With little modifications I built Aosp 13, Android TV version, and after registering the device with Google my first impressions are: impressive. It installed F1TV out of the box so the rpi will be connected at my parents tv Friday so they can watch free practices (the tv provider does not have viaplay linear on Fridays, so they are always watching on a tablet 🤣)

I will report any findings if they occur, maybe this is a nice project to dust of my very rusty Android skills
[Raspberry Pi Original Development] KonstaT:
MSM7227, never forget! :ROFLMAO: How it started, how it's going now...
[Raspberry Pi Original Development] KonstaT:
New build.

AOSP (Android 13)

for Raspberry Pi 4

konstakang.com

update to latest AOSP release (Android 13 QPR3 - android-13.0.0_r52)

update to libcamera master/v0.0.5

update to dav1d 1.2.0

update to alsa-lib/alsa-utils v1.2.9

update to Mesa 23.1.2

update to Linux 5.15.106 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)

Android security patch level: 5 June 2023

Linux 6.1 kernel: (optional add-on)

add support for Waveshare DSI touchscreens

update to Linux 6.1.31 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
[Raspberry Pi Original Development] erikcas:
those were the days :p
[Raspberry Pi Original Development] princesswolfie84:
so is there anyway to get the offical rpi 7" touchscreen working without first needing an hdmi connection? i dont currently have a mini hdmi to hdmi cable and dont want to have to buy one just to enable a setting and then never use it again as most of my rpi projects are headless or use the touchscreen.
[Raspberry Pi Original Development] KonstaT:
Yes, you would need to uncomment 'dtoverlay=vc4-kms-dsi-7inch' and 'dtoverlay=rpi-backlight' in /boot/config.txt and remove /boot/resolution.txt (or change it to '800x480').
[Raspberry Pi Original Development] princesswolfie84:
ty very much! I tried all kinds of combinations and just couldn't find the right one lol
[Raspberry Pi Original Development] gcrozatti:
Hello KonsT,

Is there any other parameters to set in config.txt or resolution.txt to adjust aspect ratio and/or refresh rate?

Because I tried to use with my TV (LG 42LN5700 42" FullHD) and did not get an output with resolution.txt.

Following your FAQ (remove resolution.txt) I did get an output but with an unsatisfied resolution.

When I use my monitor (BenQ XL2411p) I have FullHD output normally.
[Raspberry Pi Original Development] KonstaT:
What exactly is the issue with it?

Settings -> System -> Raspberry Pi settings -> Display resolution list the resolutions that your TV/display reports as supported via EDID. What is listed there depends on the connected HDMI display.

You could also try using different HDMI port on you TV if that makes any difference.
[Raspberry Pi Original Development] ny-hardcore:
Am I correct that the vanilla sources don’t have the pi settings stuff?

I’ve build aosp vanilla from source and used my custom build kernel that has a edid.bin for my screen that doesn’t report edid.

Stuff boots but no pi settings in system.
[Raspberry Pi Original Development] KonstaT:
My Raspberry Pi settings app is not part of Raspberry Vanilla project but for most part you can achieve the same stuff by following the wiki (https://github.com/raspberry-vanilla/android_local_manifest/wiki).
[Raspberry Pi Original Development] Yyashu:
Hie,

I would like to thank you for your build

i have a problem My samsung Model and raspberry pi 4

shows no signal error while i try to boot

i have tried all the methods discussed in the forum

can you help me with the same Samsung UA24H4100AR this is my tv model this is the resolution 1366x768

is there anyway i cam force the resolution to 1360x768

#Raspberry pi os 64 bit works without any tweaking
[Raspberry Pi Original Development] KonstaT:
Please read the relevant FAQ section. You need to use a HDMI display that reports resolutions it supports via EDID. You can force a supported resolution by using /boot/resolution.txt or removing the said file will use the preferred resolution reported by the TV/display.
[Raspberry Pi Original Development] Yyashu:
Thank you so much for your quick reply

i have hdmi cable which supports edid and display who reports resolution via edid
[Raspberry Pi Original Development] KonstaT:
https://twitter.com/i/web/status/1683823742441365508
[Raspberry Pi Original Development] JohnMolton94:
Hi Konsta, hope you are doing well. Thanks for creating this!

I just got a WM8960 Hi-Fi Sound Card HAT For Raspberry Pi 4B from Waveshare (https://www.waveshare.com/wiki/WM8960_Audio_HAT)

I tried using it with AOSP 13 with one of the HifiBerry DAC Presets, but it didn't seem to work that way.

What steps would I need to take to get something like this working on the Pi 4 with the AOSP 13 build? Any help would be appreciated.

Let me know if this falls into your build customization category, and I'll be happy to connect.

Also, if there is another, easier way to add stereo speakers and hifi 3.5mm audio jack to the pi4 running AOSP 13, please let me know, and I'll try to build my own pcb based on the i2s protocol (but the waveshare support option is the more preferred one for me).

EDIT:

Also, how to access gpio/i2c/i2s data in general on this build, to be able to read and control HATs and other circuits available for the Pi4?

I am basically building a pi 4 based handheld, where I would want the ability to read i2c data from a power/battery management circuit, operate the WM8960 Audio HAT mentioned above and maybe some other GPIO/I2C usage down the line.

How should I approach this/ where should I begin? I can even consider helping code it, but I am looking to get a general understanding of how this all comes together, before I can begin. (I am familiar with software dev, but I am new to the Rpi Ecosystem and Android/Linux/Kernel level stuff, and even the forum...)
[Raspberry Pi Original Development] KonstaT:
Hifiberry DACs are supported (and few others that are not mentioned in the Settings). It seems that this device uses a custom driver so it's not possible to add support without compiling the kernel.

That would entirely depend on what you want to do with the GPIO exactly. You can access GPIO using sysfs and there's i2c-tools included for I2C devices. There's kernel drivers for various hardware that uses the GPIO interfaces (I2C, SPI, I2S). There is no gpio library (gpiod, wiringPi, pigpio, etc) included in my builds.
[Raspberry Pi Original Development] JohnMolton94:
Thanks for responding!

1. So basically, I will need to compile the "AOSP13-20230615-KonstaKANG-rpi4-6.1-kernel.zip" that you have mentioned in the release notes for AOSP13, and I will need to write/port the existing waveshare drivers to work with the kernel, correct? And will I need to do anything on the Android Layer as well, or will it be just the kernel that needs work?

2. Regarding GPIO using sysfs, i2c-tools, and the kernel drivers for i2C, SPI and i2S, is there a document I can access to make progress there?

I desire to do the following with GPIO/i2c/i2s:

- I aim to create a physical power button, which I can use as the main safe-shutdown and power on switch of the handheld I am building.

- Volume buttons to control system speaker/audio jack volume

- System battery reporting (and maybe do some operations based on battery level (optional))

- And I am thinking i2s and i2c will probably be required for writing the sound card drivers, right?

Also, please feel free to point me to any resources that will offer me the pre-requisite knowledge to achieve the above. I appreciate your feedback.
[Raspberry Pi Original Development] KonstaT:
This build comes with 5.15 kernel by default but you could go with 6.1 as well (see https://github.com/raspberry-vanilla/android_kernel_manifest/tree/android-13.0 and https://github.com/raspberry-vanilla/android_kernel_manifest/tree/android-14.0 respectively for build instructions). Driver they provide is pretty ancient so I don't know if it compiles/works with recent kernel versions.

After enabling the driver and checking that the DAC is detected as an ALSA device (e.g. 'cat /proc/asound/cards') you just need to set Android to use the right ALSA device for audio ouput. You can do this by selecting DAC option in Raspberry Pi settings.

You can already have power and volume buttons by simply selecting a setting option. Please see the FAQ, Settings -> System -> Raspberry Pi settings, and 'Keys' section in /boot/config.txt.

To use some UPS hardware on Android, you would need to write custom Android health HAL implementation that interacts with the hardware and does something other than just reports fake battery status (see https://github.com/raspberry-vanilla/android_device_brcm_rpi4/tree/android-13.0/health).

I don't know why you would need to write sound card drivers, but if you do, look the other drivers in the kernel for reference.
[Raspberry Pi Original Development] Yyashu:
Hello Sir,

I have found the solution to my problem.

The power adapter i received with the pi bundle was of 3 Ampere that was the issue i used a mobile charger which outputs 5 Ampere the problem was resolved.
[Raspberry Pi Original Development] JohnMolton94:
Thank you! This is extremely helpful!

Okay. Where can I find the process for installing drivers in general, onto the kernel before I flash it to AOSP? (Precisely, what should I search for in Google, to know about the process? I apologize, I am relatively new to the technical process, still picking it up but excited to learn!)

And then once installed onto the kernel, how does one enable the installed driver?

I understand the rest of the instructions that you have provided, its just this initial installation part that I need to figure out. Cheers!

Edit: And also, where exactly to look for, for the other pre-existing drivers in the kernel, if I need to refer to them to write my own? Thanks!
[Raspberry Pi Original Development] KonstaT:
Apparently support for it was added in Raspberry Pi's 5.11 kernel (https://github.com/raspberrypi/linux/commit/5a70ae00b30ced8a4f4a2fd6dd74881d8dab697a).

You would still need to compile the Android kernel with SND_SOC_WM8960 enabled (https://github.com/raspberry-vanill.../arm64/configs/lineageos_rpi4_defconfig#L4384). After that it should be detected as an ALSA device by adding 'dtoverlay=wm8960-soundcard' to /boot/config.txt.
[Raspberry Pi Original Development] moritz.hedtke:
Hi,

this is really impressive work and almost all hardware features seem to be working. As I was experimenting with writing an app that uses Wifi Direct I found out that this doesn't seem to be supported. To my understanding, the hardware of the Raspberry Pi 4 supports that though.

I experimented a bit and found that

https://source.android.com/docs/core/connect/wifi-direct seems to be missing at https://github.com/raspberry-vanill...8d6fe17a031f5732b2afcbb7e382d8/device.mk#L275

I assume there is quite a bit more to fix before this would work.

I also found https://android.googlesource.com/pl...ain/bcmdhd/config/p2p_supplicant_overlay.conf which seems related to https://github.com/raspberry-vanill...8d6fe17a031f5732b2afcbb7e382d8/device.mk#L273.

Maybe somebody finds some time to look into this, as I have no experience with AOSP. I would really love if this would be supported at some point, though I totally understand if it's not worth the effort or not even possible.

Kind regards

Moritz
[Raspberry Pi Original Development] KonstaT:
You would need to modify the defconfig (arch/arm64/configs/lineageos_rpi4_defconfig) before compiling the kernel. Change '# CONFIG_SND_SOC_WM8960 is not set' to 'CONFIG_SND_SOC_WM8960=y'.

Once you've built the kernel, you can copy the kernel (Image) to the boot partition of the Android image. You can simply mount the sdcard on your computer and replace existing files. Kernel you've built can be found in 'out/common/arch/arm64/boot' directory as mentioned in the kernel build instructions.

Wifi p2p (i.e. wifi direct) is not currently supported. There is some issue with the Pi's wifi driver (kernel/firmware) but I haven't gotten around to investigate.