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

Search This thread

KonstaT

Senior Member
Jan 20, 2016
984
608
KonstaKANG.com
New build. H.265 hardware video decoding, H.264 hardware video decoding and encoding!


  • H.265 hardware video decoding, H.264 hardware video decoding and encoding
    • FFmpeg 5.1.2 (thanks to John Cox for Raspberry Pi hw codecs support and Android-x86 for AOSP build patches)
    • implement codec2 plugin to integrate FFmpeg into Android multimedia framework (thanks to Michael Goffioul)
    • FFmpeg hevc_v4l2request hwaccel H.265 hw decoding (default), h264_v4l2m2m H.264 hw decoding (optional)
    • v4l2_codec2 H.264 hardware video decoding and encoding (default)
    • FFmpeg software decoders support
  • update to Mesa 22.3.4
  • update to Linux 5.15.81 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
Linux 6.1 kernel: (optional add-on)
  • forward port ion memory allocator
  • update to Linux 6.1.8 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
 
  • Like
Reactions: adioph and lee99

KonstaT

Senior Member
Jan 20, 2016
984
608
KonstaKANG.com
Some good sources for test clips to try H.264/H.265/VP8/VP9 hardware/software video decoding.

AOSP doesn't seem to support .mkv file extension (but still supports matroska container) so rename to .mp4 first. HEVC 10-bit i.e. 'H.265 Main 10 Profile' doesn't seem to play currently. Edit. Main 10 Profile fixed so also this will be working if/when there's new releases.
 
Last edited:
  • Like
Reactions: lee99

duckdown

Senior Member
Feb 27, 2009
96
11
peel region
Google Pixel 2
Is there any Raspberry Pi 400 owners out there who have encountered the HDMI audio problem where the sound stops working system wide ? It seems to be affecting me really bad. I didn't think the system was over heating or super maxed out, this can happen just by navigation

If there's any logs needed I can certainly try to provide them, just let me know how

Secondly. Assuming this is no easy fix, what is the next best way to provide audio to a modern Sony TV ? How do you use the 3.5mm output that supposedly is not affected on a TV set?

Thanks very much!

Edit - guess I didn't look before posting. No audio jack on Pi 400

I have set this SD card aside and am going to go back to Raspberry Pi OS for now. I absolutely love the idea of running Android on it and will be the first one back as soon as the issue is resolved. But I'd mark this as not working on Raspberry Pi 400 as I'd consider HDMI audio to be mandatory functionality

I will anxiously be watching for a fix
 
Last edited:

KonstaT

Senior Member
Jan 20, 2016
984
608
KonstaKANG.com
Is there any Raspberry Pi 400 owners out there who have encountered the HDMI audio problem where the sound stops working system wide ? It seems to be affecting me really bad. I didn't think the system was over heating or super maxed out, this can happen just by navigation

If there's any logs needed I can certainly try to provide them, just let me know how

Secondly. Assuming this is no easy fix, what is the next best way to provide audio to a modern Sony TV ? How do you use the 3.5mm output that supposedly is not affected on a TV set?

Thanks very much!

Edit - guess I didn't look before posting. No audio jack on Pi 400

I have set this SD card aside and am going to go back to Raspberry Pi OS for now. I absolutely love the idea of running Android on it and will be the first one back as soon as the issue is resolved. But I'd mark this as not working on Raspberry Pi 400 as I'd consider HDMI audio to be mandatory functionality

I will anxiously be watching for a fix
You're welcome to fix this anytime. :)

There's been one similar report on Sony Bravia TV (https://konstakang.com/devices/rpi4/LineageOS19-ATV/#comment-6080895434) so try with a different TV/display. I don't have any hardware I could use to reproduce such issue, whatever that may be, and you haven't provided any useful information (logcat, dmesg) to even figure that part out.
 

duckdown

Senior Member
Feb 27, 2009
96
11
peel region
Google Pixel 2
You're welcome to fix this anytime. :)

There's been one similar report on Sony Bravia TV (https://konstakang.com/devices/rpi4/LineageOS19-ATV/#comment-6080895434) so try with a different TV/display. I don't have any hardware I could use to reproduce such issue, whatever that may be, and you haven't provided any useful information (logcat, dmesg) to even figure that part out.

I am a novice user, my apologies since you seem offended in some way!

I do not think it's related to Sony Bravia, I'm back on Raspberry Pi OS and it's working perfectly, I can't imagine Sony Bravia being the root cause of anything but I am happy to confirm the issue on another TV. I am quite positive it would happen regardless of device!

Regarding the logs, I already mentioned I would be happy to provide them. I don't know how!

I sincerely appreciate your work and your assistance, my apologies if it seemed like anything otherwise. Once your build has working audio as good as Raspberry Pi OS, I would never use anything else again. I definitely want this fixed. The difference in sound is instantly evident, though. Even just from clicking around - there's not a single "lost click" in movement anywhere, I never noticed how severe it was in the Android build until going back to Raspberry Pi OS and hearing the difference
 

KonstaT

Senior Member
Jan 20, 2016
984
608
KonstaKANG.com
I am a novice user, my apologies since you seem offended in some way!

I do not think it's related to Sony Bravia, I'm back on Raspberry Pi OS and it's working perfectly, I can't imagine Sony Bravia being the root cause of anything but I am happy to confirm the issue on another TV. I am quite positive it would happen regardless of device!

Regarding the logs, I already mentioned I would be happy to provide them. I don't know how!

I sincerely appreciate your work and your assistance, my apologies if it seemed like anything otherwise. Once your build has working audio as good as Raspberry Pi OS, I would never use anything else again. I definitely want this fixed. The difference in sound is instantly evident, though. Even just from clicking around - there's not a single "lost click" in movement anywhere, I never noticed how severe it was in the Android build until going back to Raspberry Pi OS and hearing the difference
I wasn't offended. :)

As it was explained to you elsewhere, the way HDMI audio is implemented on builds with Linux kernel >=5.10 (i.e. Android 12 and above) is because Pi Foundation chose to use IEC958 format for HDMI audio which is not supported on Android. Raspberry Pi is not an Android device to begin with and Android is not your regular Linux distribution. This discussion would also be easier for everyone else to follow if you hadn't spread it to several different topics on several different forums (my site, here at XDA, and Raspberry Pi forum). You don't get any more attention by doing that, it's actually the total opposite. So for future reference, make one single structured post where you properly describe the issue you're having and attach appropriate logs that might help to figure out the cause of the issue.

You can capture logs by e.g. typing in 'logcat' and 'dmesg' in shell (ADB/SSH/serial console/some third party terminal app/etc).
 

leonardopires

Member
Jan 13, 2011
15
6
Hi Konsta. I installed the latest aosp version for rpi4. install nikgapps and everything is ok.

i have a xbox cloud account and installed the Game Pass App from google play store.

My problem is xbox original controller is not sync with bluetooth ...

When i try to pair a new device, the xbox controller appears on android screen, i click to sync but something happens that the android refreshs the screen and nothing happens...
 

KonstaT

Senior Member
Jan 20, 2016
984
608
KonstaKANG.com
Hi Konsta. I installed the latest aosp version for rpi4. install nikgapps and everything is ok.

i have a xbox cloud account and installed the Game Pass App from google play store.

My problem is xbox original controller is not sync with bluetooth ...

When i try to pair a new device, the xbox controller appears on android screen, i click to sync but something happens that the android refreshs the screen and nothing happens...
logcat?

I don't have any hardware to test. Android 13 switched to new gabeldorsche bluetooth stack and there's reports of some other bluetooth issues as well. You could also try if this is any different on Android 12 builds.
 

leonardopires

Member
Jan 13, 2011
15
6
@KonstaT , i attached a logcat debug.

While the logcat was enabled on adb, i tried to sync the Xbox S Controller (Bluetooth)
 

Attachments

  • bluetooth-logcat-xbox-s-controller.zip
    39.8 KB · Views: 13
  • Like
Reactions: KonstaT

KonstaT

Senior Member
Jan 20, 2016
984
608
KonstaKANG.com
@KonstaT , i attached a logcat debug.

While the logcat was enabled on adb, i tried to sync the Xbox S Controller (Bluetooth)
This looks similar to what I've seen before. Will see if I have some bluetooth device I can reproduce this with.
@KonstaT , the Xbox S Controller is pairing with android aosp 12L....
Yes, like said, most likely something related to the new bluetooth stack introduced in Android 13.
 

adioph

Senior Member
May 12, 2005
988
64
I would like to thank for this great project. I got my rpi4 yesterday, installed AOSP 13, but bluetooth gamepad wont connect, any fix for this? thanks
 

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    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)
    • Hardware video decoding & encoding (H.265 decoding, H.264 decoding & encoding)
    • 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)

    Issues:
    • 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
    3
    New build for the Pi day!


    • 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)
    2
    New build. H.265 hardware video decoding, H.264 hardware video decoding and encoding!


    • H.265 hardware video decoding, H.264 hardware video decoding and encoding
      • FFmpeg 5.1.2 (thanks to John Cox for Raspberry Pi hw codecs support and Android-x86 for AOSP build patches)
      • implement codec2 plugin to integrate FFmpeg into Android multimedia framework (thanks to Michael Goffioul)
      • FFmpeg hevc_v4l2request hwaccel H.265 hw decoding (default), h264_v4l2m2m H.264 hw decoding (optional)
      • v4l2_codec2 H.264 hardware video decoding and encoding (default)
      • FFmpeg software decoders support
    • update to Mesa 22.3.4
    • update to Linux 5.15.81 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    Linux 6.1 kernel: (optional add-on)
    • forward port ion memory allocator
    • update to Linux 6.1.8 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    2
    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.
    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.