[DEV][ROM][UNOFFICIAL] LineageOS 18.1 (Android 11) for Raspberry Pi 4 B

Search This thread

KonstaT

Senior Member
Jan 20, 2016
907
549
KonstaKANG.com
Here’s my build of LineageOS 18.1 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_20210104-104810_Settings.png


There is also Android TV version available.

Screenshot_20210306-163341_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 (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)

Issues:
  • Stock camera app is not working - many third party camera apps seem to work
  • 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 18.1
 
Last edited:

KonstaT

Senior Member
Jan 20, 2016
907
549
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 (20220121 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-18.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-18.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/LineageOS18/
https://konstakang.com/devices/rpi4/LineageOS18-ATV/
 
Last edited:

KonstaT

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

12.5. changelog:
  • also available as OTA package
  • add support for Compute Module 4
    • fix DAC audio device selection on CM4 & Pi 400 that don’t have 3.5mm audio jack
    • fix USB storage (Pi 400 as well?)
    • 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
  • update boot firmware for newer Pi 4 hardware revisions
  • various drm_hwcomposer updates e.g. support for headless mode (thanks to Roman Stratiienko)
  • automatically set density based on display resolution
  • add support for APDS9930 ambient light/proximity sensor
  • update to TWRP 3.6.1_11-1-KonstaKANG
  • update to Mesa 21.3.8
  • update to Linux 5.4.191 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 May 2022 (merged)

21.1. 2022 changelog:
  • 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)
  • add new options to Raspberry Pi settings (force rotation & CPU governor)
  • prepare for OTAs
  • update to TWRP 3.6.0_11-1-KonstaKANG
  • update to Mesa 21.3.4
  • update to Linux 5.4.173 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 January 2022 (merged)

23.11. changelog:
  • add support for BME280/BMP280 temperature/pressure/humidity sensors
  • add option to select HDMI-CEC device
  • add option to show virtual volume down, volume up, and power keys on navigation bar
  • add option for old TCP-based ADB over network
  • show IP address and port for ADB/SSH/VNC options
  • fix resizing data partition that broke with previous build
  • 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)

26.10. changelog:
  • switch to 64-bit kernel & userspace
  • switch to minigbm gbm_mesa and gralloc@4 API (thanks to Roman Stratiienko)
  • update to Mesa 21.2.4
  • update to Linux 5.4.155 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)

11.10. changelog:
  • add support for Vulkan
  • rework bluetooth (thanks to android-rpi)
  • update to Mesa 21.1.8
  • update to Linux 5.4.152 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 1 October 2021 (merged)

20.7. changelog:
  • switch to using HDMI-CEC HAL
  • update to Mesa 21.1.5
  • update to Linux 5.4.132 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 July 2021 (merged)

11.4. changelog:
  • add initial support for HDMI-CEC
  • add built-in VNC server
  • update to Mesa 21.0.2
  • update to Linux 5.4.111 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 April 2021 (merged)

14.2. changelog:
  • add support for LSM303DLHC accelerometer & magnetometer sensor
  • add separate TWRP flashable su add-on (see FAQ)
  • allow switching display off with power button
  • add support for USB-C (ADB, MTP, PTP, USB-tethering)
  • enable bluetooth tethering
  • add settings option for mouse back button feature
  • update to TWRP 3.5.0_9-0-KonstaKANG
  • update to Mesa 20.3.4
  • update to Linux 5.4.98 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 February 2021 (merged)

4.1. changelog:
  • initial LineageOS 18.1 build
  • add support for sensors (LSM6DS3 & MPU6050 accelerometer & gyroscope on I2C)
  • add support for more serial USB GPS devices
  • drop support for SwiftShader software renderer which also means dropping support for the official 7” touchscreen for now
  • update to Mesa 20.3.2
  • add option to switch between gbm and minigbm gralloc
  • update to TWRP 3.4.0-2
  • update to Linux 5.4.86 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
  • Android security patch level: 5 December 2020 (merged)

Previous builds:
 
Last edited:
  • Like
Reactions: Raiz and polfrank

KonstaT

Senior Member
Jan 20, 2016
907
549
KonstaKANG.com
Will you share an atv variation 18.1?

Thanks for your hard work. 😊
What does Android TV 11 offer that is not already available in the latest Android TV builds for the Pi 4 (https://konstakang.com/devices/rpi4/LineageOS17.1-ATV/)? Yeah, I know - big version number, much WOW! But besides that, what's the point?

From user perspective I highly doubt you're going have the slightest clue whether you're running Android TV based on Android 8, 9, 10, or 11 unless you go specifically into the about device settings. Android TV builds are also pretty much useless without installing Google Apps. There's currently hardly any working Android 11 gapps packages available and there's certainly no Android TV gapps for Android 11.

From technical perspective I'm currently not aware of any reason why Android TV 11 builds wouldn't work just as much as before but there's just not going to be much reason for it in a long long time.
 

dhtm15

Member
Aug 4, 2018
16
2
Here’s my build of LineageOS 18.1 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!

Screenshot_20210104-104810_Settings.png


https://konstakang.com/devices/rpi4/LineageOS18/

lineage-18.1-20210104-UNOFFICIAL-KonstaKANG-rpi4.zip
https://www.androidfilehost.com/?fid=17248734326145708986
md5:4775eb4b2a89859ebf4d16dbf306cea2

Working:
  • Audio (HDMI, 3.5mm jack, USB microphones, bluetooth speakers/headsets, etc)
  • Audio DAC (using GPIO DACs e.g. Hifiberry DAC+)
  • Bluetooth
  • 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)
  • HDMI display
  • 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. LSM6DS3 & MPU6050 accelerometer & gyroscope)
  • Serial console (using external GPIO serial console adapters e.g. PL2303)
  • SPI
  • Touchscreen/multi-touch (USB touchscreens, Waveshare SPI touchscreens)
  • USB (mouse, keyboard, storage, etc)
  • Wifi
  • Wifi tethering
Not working:
  • Hardware video decoding & encoding (software decoding & encoding works)
Issues:
  • Stock camera app is not working - many third party camera apps seem to work
  • SELinux is in permissive mode
  • and more…
Sources:
Thanks:
  • Peter Yoon and everyone who has contributed to android-rpi
  • Roman Stratiienko and GloDroid project for graphics fixes
  • brobwind for bluetooth fixes
  • Eric Anholt for V3D graphics driver
  • Maxime Ripard for Pi 4 KMS driver
  • Android-x86 project
  • LineageOS team & everyone who has contributed to LineageOS 18.1

BITGAPPS ARM Android 11


Its portability is incredible, everything works fine, but the only problem I'm having is that version 17 and 18 doesn't work with the mouse in the GeForceNow application, the right button just doesn't work. I tested the OMNI Android 11 version and it works perfectly, however it is full of bugs and poorly optimized. Can you fix this for us? Having a Raspberry PI 4 that works GeForce Now is incredibly awesome!

Another suggestion is how to disable the physical keyboard shortcut keys like F1-F5, because when we try to play on GeForce Now they simply close the application, at least give a function to remap the buttons.
 
Last edited:

KonstaT

Senior Member
Jan 20, 2016
907
549
KonstaKANG.com
Its portability is incredible, everything works fine, but the only problem I'm having is that version 17 and 18 doesn't work with the mouse in the GeForceNow application, the right button just doesn't work. I tested the OMNI Android 11 version and it works perfectly, however it is full of bugs and poorly optimized. Can you fix this for us? Having a Raspberry PI 4 that works GeForce Now is incredibly awesome!

Another suggestion is how to disable the physical keyboard shortcut keys like F1-F5, because when we try to play on GeForce Now they simply close the application, at least give a function to remap the buttons.
If it helps md5sum for BiTGApps-arm-11.0.0-R19_signed.zip I've used to test is 299182a2d72b977a04360439ed06db8a. It's of course entirely your decision if you trust a download source you can find. You can find more mirrors e.g. in the BiTGApps XDA thread (https://forum.xda-developers.com/t/custom-gapps-bitgapps-for-android.4012165/).

My recent builds map right mouse button to back key. Are you saying that there's Android apps that actually make a difference between left/right mouse clicks? I could add a setting option for that feature in future releases (that's actually already been on my endless list of TODOs).

You can revert to the default keyboard mappings by removing /vendor/usr/keylayout/Generic.kl (or edit that file to change the keymappings to whatever you want).
 

dhtm15

Member
Aug 4, 2018
16
2
If it helps md5sum for BiTGApps-arm-11.0.0-R19_signed.zip I've used to test is 299182a2d72b977a04360439ed06db8a. It's of course entirely your decision if you trust a download source you can find. You can find more mirrors e.g. in the BiTGApps XDA thread (https://forum.xda-developers.com/t/custom-gapps-bitgapps-for-android.4012165/).

My recent builds map right mouse button to back key. Are you saying that there's Android apps that actually make a difference between left/right mouse clicks? I could add a setting option for that feature in future releases (that's actually already been on my endless list of TODOs).

You can revert to the default keyboard mappings by removing /vendor/usr/keylayout/Generic.kl (or edit that file to change the keymappings to whatever you want).

I think I saw something related to this, that the function of the right mouse button when programmed to return can affect applications that use the right button, this is the case with GeForce Now, which does not recognize the right mouse button in any way, all other buttons are functional. I also tried to see how to remap the keyboard buttons and tried to change these files by adding another one, but it didn't solve the problem, I opened it to edit and I didn't find the F1 function until F5, can you show me where exactly i can edit to remove this?

I found this GApps on the 4PDA forum, I think it's safe because it was a topic dedicated to that.


edit: Correction, I had entered the / root / system / usr / keylayout folder so I hadn't seen the changes.
 
Last edited:

KonstaT

Senior Member
Jan 20, 2016
907
549
KonstaKANG.com
I think I saw something related to this, that the function of the right mouse button when programmed to return can affect applications that use the right button, this is the case with GeForce Now, which does not recognize the right mouse button in any way, all other buttons are functional. I also tried to see how to remap the keyboard buttons and tried to change these files by adding another one, but it didn't solve the problem, I opened it to edit and I didn't find the F1 function until F5, can you show me where exactly i can edit to remove this?

I found this GApps on the 4PDA forum, I think it's safe because it was a topic dedicated to that.


edit: Correction, I had entered the / root / system / usr / keylayout folder so I hadn't seen the changes.
Yeah, I checked the md5sum and it's the same what I have for the file I downloaded about a month ago.

I uploaded a TWRP flashable patch that will restore the default mouse button behavior and adds an option to Settings -> System -> Advanced settings to enable back key on right mouse click.
Edit. removed, not needed with latest builds anymore.

Deleting custom Generic.kl from vendor partition will use the default unmodified one from system partition. These are the changes that have been made https://github.com/lineage-rpi/andr...001-rpi3-modify-generic-keyboard-layout.patch
 
Last edited:

myspac

Senior Member
Jan 22, 2013
300
64
Hello, I try to use this great rom (and others) since 3 days with my PI4 , and "Location" (with waze and maps) never works instead of version 17.
Someone knows why ?
Thank you
 

williamparker

New member
Nov 1, 2020
2
0
Enable root access, was a switch under developer options in 17.1 nowhere to be found in 18.1. Tried flashing a SU from TWRP, nothing shows up. Am I missing something here?
 

KonstaT

Senior Member
Jan 20, 2016
907
549
KonstaKANG.com
Hello, I try to use this great rom (and others) since 3 days with my PI4 , and "Location" (with waze and maps) never works instead of version 17.
Someone knows why ?
Thank you
You would need to be a bit more specific. Are you using actual GPS hardware or do mean e.g. Google network location (which depends on gapps being installed)?

Enable root access, was a switch under developer options in 17.1 nowhere to be found in 18.1. Tried flashing a SU from TWRP, nothing shows up. Am I missing something here?
Please read the FAQ on how to have root access. It's still under consideration if I'm going to bring back built-in su because there's no specific need for it anymore.
 
Last edited:

myspac

Senior Member
Jan 22, 2013
300
64
Thank you for your answers !

You would need to be a bit more specific. Are you using actual GPS hardware or do mean e.g. Google network location (which depends on gapps being installed)?

Oh.. yes, I mean Google network location; so , the problem is on gapps: Ok, thank you. I use : open_gapps-arm-11.0-nano-20210104-UNOFFICIAL_TEST.zip, it was ok with open_gapps-arm-10.0-pico-20201223.zip and your "17 version". I m trying other rom (OMNI) with other gapps and I had the same specific problem: that's why I think it was a "18 rom" 's problem...


Please read the FAQ on how to have root access. It's still under consideration if I'm going to bring back built-in su because there's no specific need for it anymore.
I have and need root access, but it was ok with the FAQ.
 

Micka41

Member
Oct 28, 2019
7
2
Hello,

In Linphone, Bria, ... I can't use my USB microphone (no recorded sound), but it works well in a voice recorder application.

It is also not possible to choose a ringtone.

Do you have an idea about the microphone problem?

Thank you for your work
 

myspac

Senior Member
Jan 22, 2013
300
64
You would need to be a bit more specific. Are you using actual GPS hardware or do mean e.g. Google network location (which depends on gapps being installed)?


Please read the FAQ on how to have root access. It's still under consideration if I'm going to bring back built-in su because there's no specific need for it anymore.



Ok, this is my last tests, all without gapps:
- I take your last rom
- connect an hardware gps by bluetooth
- install by adb the app "GPS Bluetooth" to mock the location
- install waze (by adb)
- install maps (by adb)

After:
- MAPs works
- WAZE: my location is ok but the map is not displayed: I didn't know why (if works with your rom 17).

I took an old waze version: and after re set all permission in the app setting AND by Privacy menu (not same permission when I cick on All permission of waze!!!! ???) => it was Ok too, location and map.

I re take last Waze version, but I never success to display map.
In data/wifi usage of the waze app: 0 ko !!!!

I don't understand why some applications (Android Auto too) can't access to network and why permissions are not the same by app's info and by Privacy setting menu. (It was ok with version 17 of your rom).
 

non1oson

Senior Member
Feb 14, 2012
701
98
Here’s my build of LineageOS 18.1 for Raspberry Pi 4 Model B, ageOS team & everyone who has contributed to LineageOS 18.1

awesome work! i was reading your work and i have a question if you or anyone can chirp in too for ideas.

whats the benefit besides privacy using your build of lineage over raspberrys os?

if it were used offline as storage, but wake on lan when needing access using nextcloud or people recommend nextcloud alternative? also emails nextcloud isnt e2ee, but Tutanota is but i dont think its capable running on nextcloud.
some personal some work so transfering to devices its main purpose is security. maybe running a work chat system e2ee which will also be safer than online apps out there.

TL:DR: dont want to pay for storage cloud, messaging services online for work when we can do it ourselves and overall safer from uninvited guests :ROFLMAO::ROFLMAO:
 

htc_Tomi

Member
Aug 28, 2009
41
2
Thanks for this ROM! I understand a lot of stuff here is still experimental, but I look forward to trying this out. I will be getting a 5-inch touch screen next week sometime so I also plan to test performance with it (it's only 800x480, so not driving millions of pixels with the Pi either.) If I had to estimate, the Pi 4 is about as fast as a Galaxy S5 or S6 was, slightly slower than a snapdragon 820. So it's not midrange or high-end, but I think it is more in the upper parts of the low range in terms of raw performance. You can safely boost the clock to 2.2 gHZ, which works well provided you have the thermal cooling to do it without a throttle. I also use a Pi 400. The Pi 400 runs a lot cooler even at the default 1.8, and I have safely pushed it to 2.2. It makes it slightly faster but not a major boost in Android by any means.
If others have had experience getting the USB Type C working on this rom, let me know. I understand it's commented in config.txt, so I plan to uncomment it there and look in /vendor/etc/init/hw/init.rpi4.rc to change it also with my Ubuntu machine. I'm fully blind, so using ADB on this to get talkback working is essential. So far I have used the network boot to do this, installed both an APK for Google TTS and Talkback, got it working just fine after adding values to securesettings. Great news. At least for now, new users wanting ADB access should connect their Pi through ethernet and then connect to ADB over the network, I think this is easiest. I have a USB type C hub here which is powered so I'm able to hook the Pi directly to my computer and do it that way a bit easier than fiddling around in the router for this stuff, and maybe more secure as it is only over USB. But the network way is probably easier for more folks to get going as well. Ups and downs, just as everything to life, right?
I also am wondering if we can get USB ADB over TWRP. This would be a huge win but I will test this and report back on this thread. Again, my only choice is to use openrecovery scripts, not really to find a sighted pair of eyes and ask them to help out reading the TWRP screens. I actually don't have that help available at the moment as my partner and I are both blind. So everything I get to do I have to do in a commandline or speaking way. But I think even despite those odds, this is doable and the disabled need to push ahead in this space anyway if they too want to be tinkerers as it is.
Thanks for working on this and making Lineage accessible to many. It's been yours and other Pi community hardware enthusiasts' effort which got this up and running. I was actually able to get one of the Pi3 builds you posted running with Talkback but at the time I just didn't find the Pi 3 that good for running Android. Certainly not with 1 gig of ram, something the Pi 4 gives us a lot of choice with at least.
 
  • Like
Reactions: KonstaT

KonstaT

Senior Member
Jan 20, 2016
907
549
KonstaKANG.com
Hello,

In Linphone, Bria, ... I can't use my USB microphone (no recorded sound), but it works well in a voice recorder application.

It is also not possible to choose a ringtone.

Do you have an idea about the microphone problem?

Thank you for your work
It's still very early days for Android 11. Many apps have not yet been updated to support new features it brings. There still could be issues with integration in upstream LineageOS as well (builds are not yet rolling out for officially supported devices so I'm not sure it can be considered feature ready). Gapps are really not ready for Android 11 yet.

There are options that are more feature ready and more thoroughly tested if you're not only after the Android version number.

Ok, this is my last tests, all without gapps:
- I take your last rom
- connect an hardware gps by bluetooth
- install by adb the app "GPS Bluetooth" to mock the location
- install waze (by adb)
- install maps (by adb)

After:
- MAPs works
- WAZE: my location is ok but the map is not displayed: I didn't know why (if works with your rom 17).

I took an old waze version: and after re set all permission in the app setting AND by Privacy menu (not same permission when I cick on All permission of waze!!!! ???) => it was Ok too, location and map.

I re take last Waze version, but I never success to display map.
In data/wifi usage of the waze app: 0 ko !!!!

I don't understand why some applications (Android Auto too) can't access to network and why permissions are not the same by app's info and by Privacy setting menu. (It was ok with version 17 of your rom).
It's still very early days for Android 11. Many apps have not yet been updated to support new features it brings. There still could be issues with integration in upstream LineageOS as well (builds are not yet rolling out for officially supported devices so I'm not sure it can be considered feature ready). Gapps are really not ready for Android 11 yet.

There are options that are more feature ready and more thoroughly tested if you're not only after the Android version number.

awesome work! i was reading your work and i have a question if you or anyone can chirp in too for ideas.

whats the benefit besides privacy using your build of lineage over raspberrys os?
I guess the main benefit is that it's a completely different operating system. It's Android - it runs Android applications.

Thanks for this ROM! I understand a lot of stuff here is still experimental, but I look forward to trying this out. I will be getting a 5-inch touch screen next week sometime so I also plan to test performance with it (it's only 800x480, so not driving millions of pixels with the Pi either.) If I had to estimate, the Pi 4 is about as fast as a Galaxy S5 or S6 was, slightly slower than a snapdragon 820. So it's not midrange or high-end, but I think it is more in the upper parts of the low range in terms of raw performance. You can safely boost the clock to 2.2 gHZ, which works well provided you have the thermal cooling to do it without a throttle. I also use a Pi 400. The Pi 400 runs a lot cooler even at the default 1.8, and I have safely pushed it to 2.2. It makes it slightly faster but not a major boost in Android by any means.
If others have had experience getting the USB Type C working on this rom, let me know. I understand it's commented in config.txt, so I plan to uncomment it there and look in /vendor/etc/init/hw/init.rpi4.rc to change it also with my Ubuntu machine. I'm fully blind, so using ADB on this to get talkback working is essential. So far I have used the network boot to do this, installed both an APK for Google TTS and Talkback, got it working just fine after adding values to securesettings. Great news. At least for now, new users wanting ADB access should connect their Pi through ethernet and then connect to ADB over the network, I think this is easiest. I have a USB type C hub here which is powered so I'm able to hook the Pi directly to my computer and do it that way a bit easier than fiddling around in the router for this stuff, and maybe more secure as it is only over USB. But the network way is probably easier for more folks to get going as well. Ups and downs, just as everything to life, right?
I also am wondering if we can get USB ADB over TWRP. This would be a huge win but I will test this and report back on this thread. Again, my only choice is to use openrecovery scripts, not really to find a sighted pair of eyes and ask them to help out reading the TWRP screens. I actually don't have that help available at the moment as my partner and I are both blind. So everything I get to do I have to do in a commandline or speaking way. But I think even despite those odds, this is doable and the disabled need to push ahead in this space anyway if they too want to be tinkerers as it is.
Thanks for working on this and making Lineage accessible to many. It's been yours and other Pi community hardware enthusiasts' effort which got this up and running. I was actually able to get one of the Pi3 builds you posted running with Talkback but at the time I just didn't find the Pi 3 that good for running Android. Certainly not with 1 gig of ram, something the Pi 4 gives us a lot of choice with at least.
If you/anyone wants to test ADB over USB-C there's two lines you need to uncomment for testing (both LineageOS 17 & 18 should be OK for this).

One line /boot/config.txt under 'USB-C' section:
dtoverlay=dwc2,dr_mode=peripheral

Another one in /vendor/etc/init/hw/init.rpi4.rc:
import /vendor/etc/init/hw/init.rpi4.usb.rc

I don't have any hardware that would provide enough power for the Pi to test this myself. If anyone has recommendations on powered USB-C hubs that are known to work on the Pi 4 for this purpose I'd appreciate that.

My TWRP builds don't support ADB. This is because TWRP has no network support (wifi/ethernet) and I can't test the USB-C for the above reason.
 

htc_Tomi

Member
Aug 28, 2009
41
2
If you/anyone wants to test ADB over USB-C there's two lines you need to uncomment for testing (both LineageOS 17 & 18 should be OK for this).

One line /boot/config.txt under 'USB-C' section:
dtoverlay=dwc2,dr_mode=peripheral

Another one in /vendor/etc/init/hw/init.rpi4.rc:
import /vendor/etc/init/hw/init.rpi4.usb.rc

I don't have any hardware that would provide enough power for the Pi to test this myself. If anyone has recommendations on powered USB-C hubs that are known to work on the Pi 4 for this purpose I'd appreciate that.

My TWRP builds don't support ADB. This is because TWRP has no network support (wifi/ethernet) and I can't test the USB-C for the above reason.
I can definitely say that uncommenting those lines did get me ADB over the USB type C port. So it does work in this mode successfully. I could then do adb root and at least have some access similar to TWRP minus the flashing and back-ups.
I think the problem with some powered hubs could be the power delivery. I'm not sure if you have a type-C port already on your machine, but it may provide the full 10 GBPS/3A requirement if it's a direct type C port. The 3.0/3.1 gen1 hubs only provide 1.5A of power and 5 GBps, so while the Pi could run on it, you couldn't power any attached devices and would get the reduced lightningbolt symbol performance as well. The powered hubs have dedicated charging ports, but these wire directly to the hub and not the machine, so while providing more power at a cost.
I also tried installing Gapps (BitGapps) for Android 11 but it failed once I signed in with a Google account. Oh well. 32-bit Gapps are also harder to come by anyway. For now I can always sideload apk files which don't rely on the play stuff and use Chrome for browsing. That's a good start.
The reason I need Android 11 is mostly for accessibility. Unlike for sighted folks where lower Android versions don't make an impact on how and what you can use, for the blind, each Android version introduces changes to the accessibility API. This is important as these changes can allow for things like brand new touch gestures (completely different gestures/ swipes and touches in Android 11 with Talkback ) to actual improvements on what the screen reader "sees" in the UI. So no, I'm not doing this to just have the version number myself, but to benefit from the latest changes to Android's accessibility API. I hope this makes sense.
 
Last edited:
  • Like
Reactions: KonstaT

KonstaT

Senior Member
Jan 20, 2016
907
549
KonstaKANG.com
I can definitely say that uncommenting those lines did get me ADB over the USB type C port. So it does work in this mode successfully. I could then do adb root and at least have some access similar to TWRP minus the flashing and back-ups.
I think the problem with some powered hubs could be the power delivery. I'm not sure if you have a type-C port already on your machine, but it may provide the full 10 GBPS/3A requirement if it's a direct type C port. The 3.0/3.1 gen1 hubs only provide 1.5A of power and 5 GBps, so while the Pi could run on it, you couldn't power any attached devices and would get the reduced lightningbolt symbol performance as well. The powered hubs have dedicated charging ports, but these wire directly to the hub and not the machine, so while providing more power at a cost.
I also tried installing Gapps (BitGapps) for Android 11 but it failed once I signed in with a Google account. Oh well. 32-bit Gapps are also harder to come by anyway. For now I can always sideload apk files which don't rely on the play stuff and use Chrome for browsing. That's a good start.
The reason I need Android 11 is mostly for accessibility. Unlike for sighted folks where lower Android versions don't make an impact on how and what you can use, for the blind, each Android version introduces changes to the accessibility API. This is important as these changes can allow for things like brand new touch gestures (completely different gestures/ swipes and touches in Android 11 with Talkback ) to actual improvements on what the screen reader "sees" in the UI. So no, I'm not doing this to just have the version number myself, but to benefit from the latest changes to Android's accessibility API. I hope this makes sense.
Thanks for confirming that ADB over USB-C is working. This might be something that will be enabled by default in future builds.

Latest BiTGapps (BiTGApps-arm-11.0.0-R19_signed.zip) should work just fine. I haven't received any other reports with issues.

Yes, I totally understand that new Android versions bring improvements, that's the whole point. But IMO simply having a bigger version number shouldn't be any reason for doing releases if it's not otherwise feature ready or some things are broken. This is a bit of problem in this "scene" where early utterly broken stuff is being endorsed just because of the version number.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 24
    Here’s my build of LineageOS 18.1 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_20210104-104810_Settings.png


    There is also Android TV version available.

    Screenshot_20210306-163341_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 (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)

    Issues:
    • Stock camera app is not working - many third party camera apps seem to work
    • 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 18.1
    5
    New build.

    -add support for LSM303DLHC accelerometer & magnetometer sensor
    -add separate TWRP flashable su add-on (see FAQ)
    -allow switching display off with power button
    -add support for USB-C (ADB, MTP, PTP, USB-tethering)
    -enable bluetooth tethering
    -add settings option for mouse back button feature
    -update to TWRP 3.5.0_9-0-KonstaKANG
    -update to Mesa 20.3.4
    -update to Linux 5.4.98 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    -Android security patch level: 5 February 2021 (merged)
    4
    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 (20220121 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-18.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-18.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/LineageOS18/
    https://konstakang.com/devices/rpi4/LineageOS18-ATV/
    4
    New builds.


    -add support for Vulkan
    -rework bluetooth (thanks to android-rpi)
    -update to Mesa 21.1.8
    -update to Linux 5.4.152 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    -Android security patch level: 1 October 2021 (merged)

    ---


    -add support for Vulkan
    -rework bluetooth (thanks to android-rpi)
    -switch to new two-panel settings UI (merged)
    -update to Mesa 21.1.8
    -update to Linux 5.4.152 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    -Android security patch level: 1 October 2021 (merged)
    4
    New build.

    -add initial support for HDMI-CEC
    -add built-in VNC server
    -update to Mesa 21.0.2
    -update to Linux 5.4.111 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    -Android security patch level: 5 April 2021 (merged)