[DEV][ROM][UNOFFICIAL] LineageOS 20 (Android 13) for Raspberry Pi 4 B

Search This thread

KonstaT

Senior Member
Jan 20, 2016
801
463
KonstaKANG.com
Here’s my build of LineageOS 20 for Raspberry Pi 4 Model B, Pi 400, and Compute Module 4. It is unofficial and unsupported by the LineageOS team. It’s for advanced users only. Pi 4 model with at least 2GB of RAM is required to run this build.

Important! 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_20221109-122731_Settings.png


There is also Android TV version available.

Screenshot_20221109-103339_Settings.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.264)
  • 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 (H.265, software decoding & encoding works)

Issues:
  • H.264 hardware video decoding is still glitchy (encoder seems to perform better)
  • 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
  • LineageOS team and everyone who has contributed to LineageOS 20
 
Last edited:

KonstaT

Senior Member
Jan 20, 2016
801
463
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. OTA updates pushed through the built-in Updater app are stored at /data/lineageos_updates/.
  1. Download lineage-20.0-xxxxxxxx-UNOFFICIAL-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 lineage-20.0-xxxxxxxx-UNOFFICIAL-KonstaKANG-rpi4-ota.zip from your selected storage
  4. (Flash 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
  • GApps
Changes that are not backed up and restored flashing OTAs:
  • Manual changes to /boot/config.txt (and any other manual changes to /boot partition)
  • Magisk

FAQ:

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

KonstaT

Senior Member
Jan 20, 2016
801
463
KonstaKANG.com
Merged commits not mentioned in the changelog.

9.1. 2023 changelog:
  • Android 13 QPR1
  • fix pixel format on H.264 hardware video decoding
  • enable H.264 hardware video encoding
  • update to Mesa 22.3.2
  • update to Linux 5.15.78 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 January 2023 (merged)

9.11. changelog:
  • initial LineageOS 20 release
  • 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
  • add support for virtualization
  • enable multi-gen LRU
  • update to TWRP 3.7.0_11-0-KonstaKANG
  • update to Mesa 22.2.3
  • new Raspberry Pi Android kernel bring-up based on AOSP android13-5.15-lts
  • update to Linux 5.15.74 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 November 2022 (merged)

Previous builds:
 
Last edited:
  • Like
Reactions: lee99

nhat.nguyen

New member
Nov 16, 2022
2
0
Hi @KonstaT ,

Thanks for the ROM, it is great, how ever, how can I disable app drawer button to goes completely full screen?
I have already switched to Gesture navigation.

I did search the setting, but could not find one => Found it "System => Button:"

Thanks for the help.
 

Homeye

Senior Member
Nov 19, 2015
86
13
Thanks for your work!

1. Maybe it's a lame question, but what about Netflix? Can it run with at least in 1080p?
2. I don't have atm any wireless remote/mouse/etc. Is there any app for my phone that I can use to navigate in the menus/apps on the Android/AndroidTV roms?
 
Last edited:

KonstaT

Senior Member
Jan 20, 2016
801
463
KonstaKANG.com
Thanks for your work!

1. Maybe it's a lame question, but what about Netflix? Can it run with at least in 1080p?
2. I don't have atm any wireless remote/mouse/etc. Is there any app for my phone that I can use to navigate in the menus/apps on the Android/AndroidTV roms?
1. Due to Widevine L3 video playback is capped at standard definition on apps that provide DRM protected content.

2. You need input device of some sort of course. Mouse/keyboard/touchscreen on regular tablet UI Android builds - remote (USB remote, Bluetooth remote, IR remote, TV's remote using HDMI-CEC, arrow keys on your keyboard, etc) on Android TV. Google TV remote app (https://www.androidpolice.com/2021/09/27/hands-on-how-to-android-tv-new-remote/) might work on regions where Google TV is available and depending on the gapps you've install (I'm not aware of there currently being any Android TV 13 gapps). I haven't tested any third party remote applications but there seems to more than few.
 
Last edited:
  • Like
Reactions: Verhuel15

duckredbeard

Senior Member
Aug 21, 2010
1,439
189
I am an avid user of the Android app Tasker and it would be awesome if you and Joao (Tasker dev) got together and found a way for Tasker to use GPIO pins as contexts or outputs.
 

backball

Member
Oct 17, 2007
6
0
One of the issues listed is
  • SELinux is in permissive mode
I have an issue with my Google Chromecast with Google TV as it runs Android 10 which introduced a SELinux policy to stop the Android 'sendevent' command from working. Why do I need that? I'm integrating the stick into home assistant home automation

and the default 'input' command (for an on-screen remote) is super slow... Worked with Android 9 but there's no way for me to go back to 9.

So if the above issue means SELinux is not 'active' and is not enforcing policies this could be a good thing and work for me using one of my Pi 4

What do you think?
 

KonstaT

Senior Member
Jan 20, 2016
801
463
KonstaKANG.com
I am an avid user of the Android app Tasker and it would be awesome if you and Joao (Tasker dev) got together and found a way for Tasker to use GPIO pins as contexts or outputs.
I'm not a Tasker user so I'm not exactly sure what you mean by "contexts or outputs". AFAIK you can make Tasker execute shell scripts that you can use to control the GPIO.
One of the issues listed is
  • SELinux is in permissive mode
I have an issue with my Google Chromecast with Google TV as it runs Android 10 which introduced a SELinux policy to stop the Android 'sendevent' command from working. Why do I need that? I'm integrating the stick into home assistant home automation

and the default 'input' command (for an on-screen remote) is super slow... Worked with Android 9 but there's no way for me to go back to 9.

So if the above issue means SELinux is not 'active' and is not enforcing policies this could be a good thing and work for me using one of my Pi 4

What do you think?
Very possible but that's something you need to test yourself.

You can also install LineageOS on Google Chromecast with Google TV (https://wiki.oddsolutions.us/devices/sabrina/) and set SELinux permissive since you can also have root access.
 
  • Like
Reactions: g000n and backball

KonstaT

Senior Member
Jan 20, 2016
801
463
KonstaKANG.com
@KonstaT

how can i add support for a 4g lte modem from waveshare? I just need the internet access and gps, no sms or phone
You can't without building Android from source and adding the necessary support for the hardware. If you want to build AOSP (or something AOSP-based) for Raspberry Pi, you can look into the Raspberry Vanilla source code (https://github.com/raspberry-vanilla) I've recently released.

My builds are configured as wifi only tablet so they don't even have Android telephony framework or drivers to support any modem hardware. I have builds (of older Android versions) that have support for Sixfab modem HAT and Quectel EC25. LTE data and SMS works fine. It's also possible to make/receive calls but in-call audio is not working. It's not something that I plan to include in public releases as practically no one has the hardware.
 

Homeye

Senior Member
Nov 19, 2015
86
13
1. Due to Widevine L3 video playback is capped at standard definition on apps that provide DRM protected content.

2. You need input device of some sort of course. Mouse/keyboard/touchscreen on regular tablet UI Android builds - remote (USB remote, Bluetooth remote, IR remote, TV's remote using HDMI-CEC, arrow keys on your keyboard, etc) on Android TV. Google TV remote app (https://www.androidpolice.com/2021/09/27/hands-on-how-to-android-tv-new-remote/) might work on regions where Google TV is available and depending on the gapps you've install (I'm not aware of there currently being any Android TV 13 gapps). I haven't tested any third party remote applications but there seems to more than few.
Oh yeah, i totally forgot the official atv remote. Guess it's not working with the tablet version of the rom.

So, right now i'm downloading the 19.1 version, since the 20 isn't available with your link. Is there an other mirror for it that i can't find?

Edit: download links are working now
 
Last edited:

Homeye

Senior Member
Nov 19, 2015
86
13
Can't find GApps-13.0-arm64-ATV-xxxxxxxx.zip mentioned in LineageOS 20 Android blog.
Also links in this post lead to OS 19 but OS 20 is mentioned:
View attachment 5766037
Can you please tell where to dl aforementioned Gapps for OS 20 if they exist?
There are no Android TV 13 GApps at the moment, flashing the 12 version is not working.

My question about that for the dev:
Can i use the atv13 ota zip to upgrade the atv12 rom with gapps to use the google services?
 
  • Like
Reactions: mavru

KonstaT

Senior Member
Jan 20, 2016
801
463
KonstaKANG.com
Oh yeah, i totally forgot the official atv remote. Guess it's not working with the tablet version of the rom.

So, right now i'm downloading the 19.1 version, since the 20 isn't available with your link. Is there an other mirror for it that i can't find?

Edit: download links are working now
No, it's only for Android TV.

I added AndroidFileHost links as that seems to be working again (they've had tons of issues last couple weeks). This seems to generate enough traffic to get blocked on Google Drive every other day so that's not ideal either.
Can't find GApps-13.0-arm64-ATV-xxxxxxxx.zip mentioned in LineageOS 20 Android blog.
Also links in this post lead to OS 19 but OS 20 is mentioned:
View attachment 5766037
Can you please tell where to dl aforementioned Gapps for OS 20 if they exist?
I'm not aware that there is any Android TV 13 gapps packages available at the moment. There is for the regular tablet UI Android 13, though, which is also linked in the FAQ. I don't have anything to do with any gapps release so this is something you would need to ask where you generally get your gapps.
There are no Android TV 13 GApps at the moment, flashing the 12 version is not working.

My question about that for the dev:
Can i use the atv13 ota zip to upgrade the atv12 rom with gapps to use the google services?
No, you need gapps for the right Android version in any case.

Updating 19->20 is not possible due to reasons stated in http://disq.us/p/2ru05g7
 
Last edited:
  • Like
Reactions: g000n and Homeye

duckdown

Senior Member
Feb 27, 2009
65
3
peel region
Greetings! I have a Raspberry Pi 400 and always wanted to run Android on it. After seeing a headline on a news site this week about this thread and Android 13 becoming available, I was delighted.

However, the instructions warn that it’s for advanced users only, which I am not. My main use for this would be IPTV and a handful of Android TV based streaming apps amongst various other APKs. Not working mentions hardware video decoding, does this mean something like TiviMate would not be working? Just trying to determine if a novice user like myself would be able to use this reliably

thank you!

edit - it seems I am late to the party and Android has been installable even previous to this, on a Raspberry Pi 400? Is that correct? If so, is there a reliable version you recommend that has a working Google Play store? I don’t mind earlier Android TV versions if needed! Thanks again
 
Last edited:
  • Like
Reactions: KonstaT

KonstaT

Senior Member
Jan 20, 2016
801
463
KonstaKANG.com
Greetings! I have a Raspberry Pi 400 and always wanted to run Android on it. After seeing a headline on a news site this week about this thread and Android 13 becoming available, I was delighted.

However, the instructions warn that it’s for advanced users only, which I am not. My main use for this would be IPTV and a handful of Android TV based streaming apps amongst various other APKs. Not working mentions hardware video decoding, does this mean something like TiviMate would not be working? Just trying to determine if a novice user like myself would be able to use this reliably

thank you!

edit - it seems I am late to the party and Android has been installable even previous to this, on a Raspberry Pi 400? Is that correct? If so, is there a reliable version you recommend that has a working Google Play store? I don’t mind earlier Android TV versions if needed! Thanks again
Thanks, hadn't even noticed that this had made into XDA news! :)

Lack of hardware video decoding/encoding means that Pi's dedicated hardware for H.264/H.265 video dec/enc is not used but this is done on the CPU with software video dec/enc instead (some explanation here https://forum.xda-developers.com/t/...3-for-raspberry-pi-4-b.4481977/#post-87316981). Software video decoder normally manages to keep up 1080p30 videos just fine. This also depends on the video codec that is used. Some services (e.g. Youtube) have switched to using VP9 for which Pi doesn't even have hardware dec/enc to begin with. There's also some limitations with streaming services that provide DRM protected content (e.g. Netflix) due to Widevine L3, but that's another story. I don't see any specific reason the app mentioned wouldn't work but that's something you need to test yourself.

UI on all the Android TV releases looks pretty much the same. You probably don't even know what Android version you're running unless you go specifically looking for it in the settings. There could be some issues with HDMI audio on Android 12/13 builds that is not an issue on Android 11 (see e.g. http://disq.us/p/2r2wh1w). There's currently no GApps available Android TV 13, for Android TV 12 you only have MindTheGapps, as for Android TV 11 there's also option to use OpenGApps which gives you the Google's Android TV launcher as well. Choice is entirely your of course and GApps are not part of my releases in any case. You can see the list of all the available builds here (https://konstakang.com/devices/rpi4/).
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    New builds. H.264 hardware video decoding & encoding.


    -Android 13 QPR1
    -fix pixel format on H.264 hardware video decoding
    -enable H.264 hardware video encoding
    -update to Mesa 22.3.2
    -update to Linux 5.15.78 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    -Android security patch level: 5 January 2023 (merged)
  • 4
    Here’s my build of LineageOS 20 for Raspberry Pi 4 Model B, Pi 400, and Compute Module 4. It is unofficial and unsupported by the LineageOS team. It’s for advanced users only. Pi 4 model with at least 2GB of RAM is required to run this build.

    Important! 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_20221109-122731_Settings.png


    There is also Android TV version available.

    Screenshot_20221109-103339_Settings.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.264)
    • 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 (H.265, software decoding & encoding works)

    Issues:
    • H.264 hardware video decoding is still glitchy (encoder seems to perform better)
    • 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
    • LineageOS team and everyone who has contributed to LineageOS 20
    2
    I am an avid user of the Android app Tasker and it would be awesome if you and Joao (Tasker dev) got together and found a way for Tasker to use GPIO pins as contexts or outputs.
    I'm not a Tasker user so I'm not exactly sure what you mean by "contexts or outputs". AFAIK you can make Tasker execute shell scripts that you can use to control the GPIO.
    One of the issues listed is
    • SELinux is in permissive mode
    I have an issue with my Google Chromecast with Google TV as it runs Android 10 which introduced a SELinux policy to stop the Android 'sendevent' command from working. Why do I need that? I'm integrating the stick into home assistant home automation

    and the default 'input' command (for an on-screen remote) is super slow... Worked with Android 9 but there's no way for me to go back to 9.

    So if the above issue means SELinux is not 'active' and is not enforcing policies this could be a good thing and work for me using one of my Pi 4

    What do you think?
    Very possible but that's something you need to test yourself.

    You can also install LineageOS on Google Chromecast with Google TV (https://wiki.oddsolutions.us/devices/sabrina/) and set SELinux permissive since you can also have root access.
    2
    Oh yeah, i totally forgot the official atv remote. Guess it's not working with the tablet version of the rom.

    So, right now i'm downloading the 19.1 version, since the 20 isn't available with your link. Is there an other mirror for it that i can't find?

    Edit: download links are working now
    No, it's only for Android TV.

    I added AndroidFileHost links as that seems to be working again (they've had tons of issues last couple weeks). This seems to generate enough traffic to get blocked on Google Drive every other day so that's not ideal either.
    Can't find GApps-13.0-arm64-ATV-xxxxxxxx.zip mentioned in LineageOS 20 Android blog.
    Also links in this post lead to OS 19 but OS 20 is mentioned:
    View attachment 5766037
    Can you please tell where to dl aforementioned Gapps for OS 20 if they exist?
    I'm not aware that there is any Android TV 13 gapps packages available at the moment. There is for the regular tablet UI Android 13, though, which is also linked in the FAQ. I don't have anything to do with any gapps release so this is something you would need to ask where you generally get your gapps.
    There are no Android TV 13 GApps at the moment, flashing the 12 version is not working.

    My question about that for the dev:
    Can i use the atv13 ota zip to upgrade the atv12 rom with gapps to use the google services?
    No, you need gapps for the right Android version in any case.

    Updating 19->20 is not possible due to reasons stated in http://disq.us/p/2ru05g7
    1
    Merged commits not mentioned in the changelog.

    9.1. 2023 changelog:
    • Android 13 QPR1
    • fix pixel format on H.264 hardware video decoding
    • enable H.264 hardware video encoding
    • update to Mesa 22.3.2
    • update to Linux 5.15.78 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    • Android security patch level: 5 January 2023 (merged)

    9.11. changelog:
    • initial LineageOS 20 release
    • 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
    • add support for virtualization
    • enable multi-gen LRU
    • update to TWRP 3.7.0_11-0-KonstaKANG
    • update to Mesa 22.2.3
    • new Raspberry Pi Android kernel bring-up based on AOSP android13-5.15-lts
    • update to Linux 5.15.74 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    • Android security patch level: 5 November 2022 (merged)

    Previous builds:
    1
    Thanks for your work!

    1. Maybe it's a lame question, but what about Netflix? Can it run with at least in 1080p?
    2. I don't have atm any wireless remote/mouse/etc. Is there any app for my phone that I can use to navigate in the menus/apps on the Android/AndroidTV roms?
    1. Due to Widevine L3 video playback is capped at standard definition on apps that provide DRM protected content.

    2. You need input device of some sort of course. Mouse/keyboard/touchscreen on regular tablet UI Android builds - remote (USB remote, Bluetooth remote, IR remote, TV's remote using HDMI-CEC, arrow keys on your keyboard, etc) on Android TV. Google TV remote app (https://www.androidpolice.com/2021/09/27/hands-on-how-to-android-tv-new-remote/) might work on regions where Google TV is available and depending on the gapps you've install (I'm not aware of there currently being any Android TV 13 gapps). I haven't tested any third party remote applications but there seems to more than few.