[DEV][ROM][UNOFFICIAL] LineageOS 19 (Android 12L) for Raspberry Pi 4 B

Search This thread

KonstaT

Senior Member
Jan 20, 2016
668
422
KonstaKANG.com
Here’s my build of LineageOS 19 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_20220313-200456_Settings.png


There is also Android TV version available.

Screenshot_20220114-084413_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)
  • 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 & some third party camera apps don't work with official Pi camera modules
  • SELinux is in permissive mode
  • and more…

Sources:

Thanks:
  • Peter Yoon and android-rpi project
  • Roman Stratiienko and GloDroid project
  • AOSP reference board developers (dragonboard, hikey, yukawa)
  • E. Anholt for V3D graphics driver
  • Maxime Ripard for Pi 4 KMS driver
  • Android-x86 project
  • LineageOS team and everyone who has contributed to LineageOS 19
 
Last edited:

KonstaT

Senior Member
Jan 20, 2016
668
422
KonstaKANG.com
How to install:
  1. Follow the official Raspberry Pi instructions for writing the image to the SD card.
If you’re running a recent build (20220114 or newer) 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-19.1-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-19.1-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
  • 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/LineageOS19/
https://konstakang.com/devices/rpi4/LineageOS19-ATV/
 
Last edited:

KonstaT

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

11.5. changelog:

  • add support for Compute Module 4
    • fix HDMI/DAC audio device selection on CM4 & Pi 400 that don’t have 3.5mm audio jack
    • fix USB storage (Pi 400 as well?)
    • fix issue with webview/browser
    • add support for the RTC on the I/O board
    • use OTG mode for USB to support ADB, MTP, PTP, USB tethering on the micro-USB port on the I/O board
  • add support for APDS9930 ambient light/proximity sensor
  • update to TWRP 3.6.1_11-1-KonstaKANG
  • update to Mesa 22.0.3
  • update to Linux 5.10.112 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 May 2022 (merged)

7.4. changelog:
  • automatically set density based on display resolution
  • add option to disable tablet taskbar and show traditional navigation bar instead
  • update to TWRP 3.6.1_11-0-KonstaKANG
  • update to Mesa 22.0.1
  • update to Linux 5.10.109 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 April 2022 (merged)
14.3. changelog:
  • Android 12L / LineageOS 19.1
  • update to TWRP 3.6.0_11-2-KonstaKANG
  • update to Mesa 22.0.0
  • update to Linux 5.10.102 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 March 2022 (merged)

11.2. changelog:
  • also available as OTA package
  • various drm_hwcomposer updates e.g. support for dual-HDMI displays and headless mode (thanks to Roman Stratiienko)
  • update to Mesa 21.3.6
  • update to Linux 5.10.99 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 February 2022 (merged)

14.1. 2022 changelog:
  • add new options to Raspberry Pi settings (force rotation & CPU governor)
  • fix GPS issue caused by incomplete location data
  • small improvements to HDMI audio support
  • prepare for OTAs
  • update to TWRP 3.6.0_11-1-KonstaKANG
  • update to Mesa 21.3.4
  • update to Linux 5.10.90 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 January 2022 (merged)

16.12. changelog:
  • switch to Linux 5.10 kernel by default
  • fix VC4 HDMI audio with 5.10 kernel (3.5mm jack is now used by default so select the right HDMI device from the settings)
  • add support for the official 7" touchscreen display with hw accelerated graphics (enable configurations for the touchscreen from the settings)
  • minor brightness fixes for the official 7" display
  • add support for Pi camera modules using libcamera, preview & photos work - camcorder doesn't (thanks to Roman Stratiienko)
  • fix UVC USB webcams that use external camera HAL (camera needs to support MJPG format - preview, photos & camcorder works)
  • add option to enable currently very WIP H.264 hardware video decoding using v4l2_codec2 (enable experimental feature from the settings)
  • fix reboots related to Hotspot 2.0 networks/ANQP requests (see issue #6)
  • Vulkan 1.1 (thanks to people at Igalia for Vulkan 1.1 conformance and Roman Stratiienko for latest Mesa fixes)
  • update to Mesa 21.3.1
  • update to Linux 5.10.83 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 December 2021 (merged)

25.11. changelog:
  • add option to show virtual volume down, volume up, and power keys on navigation bar (requires reboot)
  • add option for old TCP-based ADB over network
  • show IP address and port for ADB/SSH/VNC options
  • update to TWRP 3.6.0_11-0-KonstaKANG
  • update to Mesa 21.3.0
  • update to Linux 5.4.161 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 November 2021 (merged)
Linux 5.10 kernel: (optional add-on)
  • various KMS driver improvements (DSI panel support, etc)
  • support for Pi camera modules using libcamera, preview & photos work - camcorder doesn’t (thanks to Roman Stratiienko)
  • option to test currently very WIP H.264 hardware video decoding using v4l2_codec2 (Settings -> System -> Advanced settings -> Hardware video decoding)
  • HDMI audio is not supported! (see issue #4651 & issue #4654)
  • new Raspberry Pi Android kernel bring-up based on AOSP android12-5.10-lts
  • update to Linux 5.10.81 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)

4.11. changelog:
  • initial LineageOS 19.0 build
  • switch to codec2 software decoders/encoders
  • add support for BME280/BMP280 temperature/pressure/humidity sensors
  • add option to select HDMI-CEC device
  • drop old v1 camera HAL and use external camera HAL for UVC USB webcams (camera needs to support MJPG format)
  • update to TWRP 3.5.2_11-0-KonstaKANG
  • update to Mesa 21.2.5
  • new Raspberry Pi Android kernel bring-up based on AOSP android12-5.4-lts
  • update to Linux 5.4.156 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 October 2021 (merged)

Previous builds:
 
Last edited:
  • Like
Reactions: polfrank

Spielmops

Senior Member
Dec 14, 2016
108
17
Oldenburg
Can I make a wish? If yes, I would be happy, if the system could sync time from the GPS-receiver. M y device has not always a network-connection ...

Spielmops
 

KonstaT

Senior Member
Jan 20, 2016
668
422
KonstaKANG.com

bonswouar

Senior Member
Mar 3, 2016
57
13
Wow I didn't expect latest Android being supported on the Pie, thanks for the great work!
I have two small questions though :
  • Do you know how is support for microG? It doesn't cause any problem? (was wondering about casting videos for example)
  • I know it has been asked few times already, but now that Android 12 has been released are you confident it will be possible to have support for hardware acceleration soon? Would make a big difference to have a steady 1080p/60fps
 

KonstaT

Senior Member
Jan 20, 2016
668
422
KonstaKANG.com
Wow I didn't expect latest Android being supported on the Pie, thanks for the great work!
I have two small questions though :
  • Do you know how is support for microG? It doesn't cause any problem? (was wondering about casting videos for example)
MicroG requires a patch for signature spoofing that is not included in LineageOS for security reasons. I think this is also something that can be achieved using Magisk (which is now supported) but haven't looked into it.
  • I know it has been asked few times already, but now that Android 12 has been released are you confident it will be possible to have support for hardware acceleration soon? Would make a big difference to have a steady 1080p/60fps
I'm pretty confident it will work eventually. Soon(™) is also a relative term.

Short term goal is to get some proof of concept that stateful H.264 V4L2 dec/enc can work on Android on Pi 4. Just made some minor progress with v4l2_codec2 couple of days ago and got the dec/enc codec2 component to even do something in the first place. Not sure if the current issues I'm having are due to memory allocation or the codec component negotiating with the kernel driver. There's also still some hardcoded buffer sizes, etc that depend on the video resolution you're trying to dec/enc. Only real hardware that I'm aware that just recently has this working at least to some extent is dragonboard and John Stultz has tweeted some updates on the matter so check those out if you're interested.

Sorry if this wasn't the news you were looking for but things like this take time.
 
Last edited:

KonstaT

Senior Member
Jan 20, 2016
668
422
KonstaKANG.com

bonswouar

Senior Member
Mar 3, 2016
57
13
  • Like
Reactions: KonstaT

jeff862

Senior Member
Mar 5, 2007
50
3
any solution for this build ? ... unstable.. mouse pointer keep on freezing .. and random restart
 

FL00DY

Senior Member
Jul 15, 2010
75
1
Sydney
I'm interested in this project congrats on your current work. I'm not super knowledgeable on video enc/Dec, I'm most interested in see how games play on this. How well would games play on this?
 

KonstaT

Senior Member
Jan 20, 2016
668
422
KonstaKANG.com
any solution for this build ? ... unstable.. mouse pointer keep on freezing .. and random restart
I can't reproduce such issues and haven't received other report either. Impossible to say without seeing any logs anyway.

General advice is to use proper sdcard (at least class 10) and power source (3A in case of Pi 4).
Usb dac no sound for spotify, deezer, tidal etc,, any solution plz help
Logcat? I recently tested my USB sound card and it works fine (both output & input). I'm not aware there being any changes how USB audio devices are handled in Android 12.
I'm interested in this project congrats on your current work. I'm not super knowledgeable on video enc/Dec, I'm most interested in see how games play on this. How well would games play on this?
What would hw video dec/enc have to do with gaming? It's used to offload decoding/encoding of e.g. H.264 videos to specific hardware.

There's tons of Android on Raspberry Pi gameplay videos on YouTube.
Anyone knows how to get the raspberry pi to work without a monitor. I installed the image but it is not connecting via ssh. I was able to use it with Raspberry Pi OS.
It's not possible to run without any HDMI device connected. You need to have something connected that reports EDID information. If you want to use this headless (e.g. remotely with SSH or VNC) and you can buy a dummy HDMI adapter.
 

EpicLPer

Senior Member
Aug 29, 2012
694
385
27
Scheibbs
epiclper.com
Nice!

It seems this still uses an earlier kernel, so I guess that means no official touchscreen support (yet)?

EDIT: Ah, found the FAQ entry now. Gonna link it here for ease of access and in case others are curious as well: https://konstakang.com/devices/rpi4/LineageOS19/#comment-5598552752
Btw., is there an experimental build with 5.10 kernel? Or is there an (easy) way for a build-noob like me to try it out? I've been waiting for Android 12 for the Pi to try a car entertainment thing out, even tho I get a new car in a few days which doesn't require that anymore but I may do it for others still.
 

rabbited

Member
Mar 10, 2020
37
5
any solution for this build ? ... unstable.. mouse pointer keep on freezing .. and random restart
You are most likely experiencing the WiFi boot loop issue. If you disable wifi in config.txt and use ethernet that may solve the boot loop.
Konsta, is there any current way or possible future way to manually enter our WiFi details without allowing Lineage to perform it's search? The network search appears to be the instigator of boot loop issues.
 
  • Like
Reactions: Bryanx86

Spielmops

Senior Member
Dec 14, 2016
108
17
Oldenburg
Feedback: both my cheap webcams do not work. Magisk does its job. An USB-stick will not be ejected. Rotation control is not as easy as before ( I use a landscape screen). Total Commander sometimes needs 30 seconds to load the main screen (loading ...). Emergency call can not be disabled in the power-menu (you can uncheck it, but it stays)

Do you know, that the image comes "allready startet"?

The OS is so fare working. Good job! Thanks. It will not be my working OS, because I need the camera (dashcam), so I will observe your development :)

Spielmops
 

skm_1

Senior Member
Apr 20, 2018
61
20
Excellent work. I played about with this a bit last night to see if I could run Zwift. My Rii I4 keyboard works fine using the 2.4GHz dongle but in Bluetooth mode I can only use the mousepad - odd, but not a huge problem since I still have the on-screen keyboard. BitGApps for Android 12 installed via TWRP and gave me a working Play Store, but Zwift was unavailable, so I blew it away and installed the Aurora Store APK. Once I had set up the spoofing correctly, Zwift installed and ran. Haven't tested it much but it seems at least as fast as under OmniROM when I apply my preferred overclocking config in config.txt.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Nvm those last 2 messages, I found out how to turn on wifi access to google play. For some odd reason, you need to enable wifi access by going to Settings > Apps > Google Play Store > Mobile data & WiFi and click on allow network access. Weird…
  • 18
    Here’s my build of LineageOS 19 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_20220313-200456_Settings.png


    There is also Android TV version available.

    Screenshot_20220114-084413_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)
    • 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 & some third party camera apps don't work with official Pi camera modules
    • SELinux is in permissive mode
    • and more…

    Sources:

    Thanks:
    • Peter Yoon and android-rpi project
    • Roman Stratiienko and GloDroid project
    • AOSP reference board developers (dragonboard, hikey, yukawa)
    • E. Anholt for V3D graphics driver
    • Maxime Ripard for Pi 4 KMS driver
    • Android-x86 project
    • LineageOS team and everyone who has contributed to LineageOS 19
    4
    New build.


    -switch to Linux 5.10 kernel by default
    -fix VC4 HDMI audio with 5.10 kernel (3.5mm jack is now used by default so select the right HDMI device from the settings)
    -add support for the official 7" touchscreen display with hw accelerated graphics (enable configurations for the touchscreen from the settings)
    -minor brightness fixes for the official 7" display
    -add support for Pi camera modules using libcamera, preview & photos work - camcorder doesn't (thanks to Roman Stratiienko)
    -fix UVC USB webcams that use external camera HAL (camera needs to support MJPG format - preview, photos & camcorder works)
    -add option to enable currently very WIP H.264 hardware video decoding using v4l2_codec2 (enable experimental feature from the settings)
    -fix reboots related to Hotspot 2.0 networks/ANQP requests (see issue #6)
    -Vulkan 1.1 (thanks to people at Igalia for Vulkan 1.1 conformance and Roman Stratiienko for latest Mesa fixes)
    -update to Mesa 21.3.1
    -update to Linux 5.10.83 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    -Android security patch level: 5 December 2021 (merged)
    3
    New build. Added optional Linux 5.10 kernel add-on to test a lot of WIP stuff.


    -add option to show virtual volume down, volume up, and power keys on navigation bar (requires reboot)
    -add option for old TCP-based ADB over network
    -show IP address and port for ADB/SSH/VNC options
    -update to TWRP 3.6.0_11-0-KonstaKANG
    -update to Mesa 21.3.0
    -update to Linux 5.4.161 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    -Android security patch level: 5 November 2021 (merged)

    Linux 5.10 kernel: (optional add-on)
    -various KMS driver improvements (DSI panel support, etc)
    -support for Pi camera modules using libcamera, preview & photos work - camcorder doesn’t (thanks to Roman Stratiienko)
    -option to test currently very WIP H.264 hardware video decoding using v4l2_codec2 (Settings -> System -> Advanced settings -> Hardware video decoding)
    -HDMI audio is not supported! (see issue #4651 & issue #4654)
    -new Raspberry Pi Android kernel bring-up based on AOSP android12-5.10-lts
    -update to Linux 5.10.81 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    3
    Wow I didn't expect latest Android being supported on the Pie, thanks for the great work!
    I have two small questions though :
    • Do you know how is support for microG? It doesn't cause any problem? (was wondering about casting videos for example)
    MicroG requires a patch for signature spoofing that is not included in LineageOS for security reasons. I think this is also something that can be achieved using Magisk (which is now supported) but haven't looked into it.
    • I know it has been asked few times already, but now that Android 12 has been released are you confident it will be possible to have support for hardware acceleration soon? Would make a big difference to have a steady 1080p/60fps
    I'm pretty confident it will work eventually. Soon(™) is also a relative term.

    Short term goal is to get some proof of concept that stateful H.264 V4L2 dec/enc can work on Android on Pi 4. Just made some minor progress with v4l2_codec2 couple of days ago and got the dec/enc codec2 component to even do something in the first place. Not sure if the current issues I'm having are due to memory allocation or the codec component negotiating with the kernel driver. There's also still some hardcoded buffer sizes, etc that depend on the video resolution you're trying to dec/enc. Only real hardware that I'm aware that just recently has this working at least to some extent is dragonboard and John Stultz has tweeted some updates on the matter so check those out if you're interested.

    Sorry if this wasn't the news you were looking for but things like this take time.
    3
    Short term goal is to get some proof of concept that stateful H.264 V4L2 dec/enc can work on Android on Pi 4.
    And that didn't even take too long. \o/ But yes, H.264 V4L2 hardware decoding can work on Android on the Pi 4!

    Something still getting messed up somewhere in the pipeline so the colors are not correct and there's a green tint on the bottom half of the playback.
    https://www.dropbox.com/s/hlvcv23ejfpinn5/VID_20211108_194739.mp4?dl=0