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

Search This thread

KonstaT

Senior Member
Jan 20, 2016
655
389
KonstaKANG.com
I use 2560x1440 (Advanced settings) and have fonts set to Small and interface set to Smallest.
I am referring to the arrow while typing overlapping with the 'Virtual buttons' settings (Power, volume)
The power button overlaps the keyboard arrow keys.
I doubt it's ever going to be possible to guarantee that each and every UI element is exactly where it is supposed to be when it's possible to use different display resolutions (not what Android is designed to do). User having more freedom also means having more responsibility.
Surprising considering I've rarely had to do so on custom builds haha! Even The 18.1 build worked just fine when i flashed once without any wiping.
Shouldn't be anything new or surprising here. It's always been this way on every Android device that ever existed. I highly doubt everything "worked just fine". Also see the important note under https://wiki.lineageos.org/gapps#installation.
 

Cypher2

Senior Member
Jan 20, 2011
137
16
Montreal
github.com
I doubt it's ever going to be possible to guarantee that each and every UI element is exactly where it is supposed to be when it's possible to use different display resolutions (not what Android is designed to do). User having more freedom also means having more responsibility.
Agreed, although it worked fine on 18.1 - is the addition of the virtual power button one of your specific rpi4 features? UI elements should be able to order themselves in the same manner the status bar icons do, no?
Shouldn't be anything new or surprising here. It's always been this way on every Android device that ever existed. I highly doubt everything "worked just fine". Also see the important note under https://wiki.lineageos.org/gapps#installation.
OK
 

KonstaT

Senior Member
Jan 20, 2016
655
389
KonstaKANG.com
Agreed, although it worked fine on 18.1 - is the addition of the virtual power button one of your specific rpi4 features? UI elements should be able to order themselves in the same manner the status bar icons do, no?
No, even the whole navigation bar placement is different depending on the resolution let alone the buttons on the navigation bar. If you use resolution other than 1080p you would also in reality need to adjust display density ('ro.sf.lcd_density' property) to adapt.
 

Cypher2

Senior Member
Jan 20, 2011
137
16
Montreal
github.com
No, even the whole navigation bar placement is different depending on the resolution let alone the buttons on the navigation bar. If you use resolution other than 1080p you would also in reality need to adjust display density ('ro.sf.lcd_density' property) to adapt.
Interesting... thought it was programmed to be a little smarter than that.
Thanks for the insight.
 

KonstaT

Senior Member
Jan 20, 2016
655
389
KonstaKANG.com
Interesting... thought it was programmed to be a little smarter than that.
Thanks for the insight.
You can consider Android as an OS for embedded devices. It needs to work just on the hardware that the device has built-in and nothing else. It's not designed to support every possible hardware and configuration in the world at the same time.

I could of course just force 1080p for everyone to guarantee consistent UX but I just personally prefer to give the user the option rather than dumb it down because of some users.
 

Cypher2

Senior Member
Jan 20, 2011
137
16
Montreal
github.com
You can consider Android as an OS for embedded devices. It needs to work just on the hardware that the device has built-in and nothing else. It's not designed to support every possible hardware and configuration in the world at the same time.
I see
I could of course just force 1080p for everyone to guarantee consistent UX but I just personally prefer to give the user the option rather than dumb it down because of some users.
Of course! it is good to keep things documented as well, to help the community. I'll play around with ro.sf.lcd_density and find something that works. If I am not mistaken, it is the same setting as the 'Density' section available in the Developer Options, or is it completely different?
 

Tom33231

Member
Jan 16, 2022
27
1
It's not possible to use displays that use SPI for the display interface. IMO these displays are not even suitable for any modern OS that displays dynamic content because resolution is low and the display refresh rate is even worse. I actually have one similar display laying around and haven't bothered with it. The touchscreen part of it already works (just uncomment 'dtoverlay=ads7846...' line in /boot/config.txt) if you wanted to create e.g. a dummy track pad for swipe/pinch gestures.

As for GPIO displays it would be interesting to get some DPI display working. AFAICT it should be pretty straight forward as Pi folks recently added easier way to use DPI panels with KMS (https://github.com/lineage-rpi/andr...mmit/0f6b9a3650b6823de5cc5362f338bfcb2fb863c3). Displays on HDMI and DSI ports are already possible so it would be nice to have that possible on GPIO as well. I don't have any hardware myself.
Alright I mean you definitely have a point but mainly just mentioned this as a proof of concept if the screen worked with the touchscreen. What other higher resolution displays could fit the phone concept of about 3.5 or even 4-5 inches for testing and as a concept of using this soc/single board computer with touch and screen output?
 

Tom33231

Member
Jan 16, 2022
27
1
Ok!

I use 2560x1440 (Advanced settings) and have fonts set to Small and interface set to Smallest.
I am referring to the arrow while typing overlapping with the 'Virtual buttons' settings (Power, volume)
The power button overlaps the keyboard arrow keys.

Good to know.

Surprising considering I've rarely had to do so on custom builds haha! Even The 18.1 build worked just fine when i flashed once without any wiping.

Thanks for the responses!
Yea speaking of hardware compatibility do you know of any good tools for decompressing the system.img and recompressing it after doing modifications like adding my favorite apps to the pre installed apps folder with I think would be in the pre install folder in the root, than a android.mk. Was looking at this but need more up to date information on doing my own embedded mods or at least some direction.



I know this forum is mainly for your rom and raspberry pi 4 android dev but how can I go about this and extracting the system.img and than after modifications extract back to a working system.img. Android versions I’m after are android 9.0-12. Also arch I’m going for is arm-64, and x86-64. Hopefully I made sense on my question.
 

Cypher2

Senior Member
Jan 20, 2011
137
16
Montreal
github.com
Yea speaking of hardware compatibility do you know of any good tools for decompressing the system.img and recompressing it after doing modifications like adding my favorite apps to the pre installed apps folder with I think would be in the pre install folder in the root, than a android.mk. Was looking at this but need more up to date information on doing my own embedded mods or at least some direction.



I know this forum is mainly for your rom and raspberry pi 4 android dev but how can I go about this and extracting the system.img and than after modifications extract back to a working system.img. Android versions I’m after are android 9.0-12. Also arch I’m going for is arm-64, and x86-64. Hopefully I made sense on my question.
I just set it up the way i want it then do a TWRP backup with compression.. you can decide which partitions to save or eventually edit the restoration manifest to only write the partitions you'd like automatically
 

Cypher2

Senior Member
Jan 20, 2011
137
16
Montreal
github.com
You can consider Android as an OS for embedded devices. It needs to work just on the hardware that the device has built-in and nothing else. It's not designed to support every possible hardware and configuration in the world at the same time.

I could of course just force 1080p for everyone to guarantee consistent UX but I just personally prefer to give the user the option rather than dumb it down because of some users.
So i've calculated the density for my monitor and played around with several resolutions and lcd_density settings: the virtual power button always overlaps the keyboard arrows. This is definitely an asset placement issue.
 

KonstaT

Senior Member
Jan 20, 2016
655
389
KonstaKANG.com
Of course! it is good to keep things documented as well, to help the community. I'll play around with ro.sf.lcd_density and find something that works. If I am not mistaken, it is the same setting as the 'Density' section available in the Developer Options, or is it completely different?
There's tons information available about Android that applies to all devices running it. It would be practically impossible for me to maintain documentation that covers everything. I try to do it for the stuff that applies to my builds specifically. IMO I have a pretty good FAQ which unfortunately too few bother to read (maybe it's already getting too lengthy) because half of my replies usually include "please read the FAQ" (*grrhmm* you certainly didn't read the FAQ on installing gapps ;)).

I'm not aware there being any display density related options in developer settings. Settings -> Display -> Display size does similar thing.
So i've calculated the density for my monitor and played around with several resolutions and lcd_density settings: the virtual power button always overlaps the keyboard arrows. This is definitely an asset placement issue.
Which manifests itself when you use non-standard resolution/density. LOL, maybe just adjust your settings to something that doesn't cause them to overlap then.

Any IMO the whole 'Show arrow keys while typing' feature is utterly useless on non-touchscreen devices and how often do you ever need to press (virtual) power button while typing anyway (BTW, Android 12 now has one in notification shade as well).

I take things are going pretty well if this is the biggest issue you can come across. :)
 

KonstaT

Senior Member
Jan 20, 2016
655
389
KonstaKANG.com
Alright I mean you definitely have a point but mainly just mentioned this as a proof of concept if the screen worked with the touchscreen. What other higher resolution displays could fit the phone concept of about 3.5 or even 4-5 inches for testing and as a concept of using this soc/single board computer with touch and screen output?
Problem with that specific display is that it uses SPI for the display interface (SPI for touch interface is fine). Not to endorse anything but e.g. Waveshare also has small displays that use DPI/DSI/HDMI as the display interface (see selection guide section at e.g. https://www.waveshare.com/7inch-hdmi-lcd-c.htm). HDMI displays are of course the most used so shouldn't require much additional effort.

My first Android phone from 10+ years ago had display with 480x800 resolution (ironically what the official Raspberry Pi 7" display also has). So, let's just say that that or anything smaller than that is not what you'd expect for device running modern Android these days. Just having a display resolution/density related discussion above. Very small resolution/density can also cause all kinds of issues (UI on the OS itself because no one else in the world uses such low resolution anymore, app compatibility issues because of missing low density drawables because no one needs them anymore, etc.). https://developer.android.com/training/multiscreen/screendensities
Yea speaking of hardware compatibility do you know of any good tools for decompressing the system.img and recompressing it after doing modifications like adding my favorite apps to the pre installed apps folder with I think would be in the pre install folder in the root, than a android.mk. Was looking at this but need more up to date information on doing my own embedded mods or at least some direction.



I know this forum is mainly for your rom and raspberry pi 4 android dev but how can I go about this and extracting the system.img and than after modifications extract back to a working system.img. Android versions I’m after are android 9.0-12. Also arch I’m going for is arm-64, and x86-64. Hopefully I made sense on my question.
My Raspberry Pi builds use standard ext4 partitions (system, vendor, data - FAT is used for boot partition). You can just directly mount the sdcard on your Linux machine and edit contents of any of the partitions. There's simg2img/img2simg tools to pack sparse images most Android devices use. Mounting the image writable (and what fs it uses - ext4/F2FS/etc) is another story.

Your links refer to adding precompiled apps when building Android from source.
 

Cypher2

Senior Member
Jan 20, 2011
137
16
Montreal
github.com
There's tons information available about Android that applies to all devices running it. It would be practically impossible for me to maintain documentation that covers everything. I try to do it for the stuff that applies to my builds specifically. IMO I have a pretty good FAQ which unfortunately too few bother to read (maybe it's already getting too lengthy) because half of my replies usually include "please read the FAQ" (*grrhmm* you certainly didn't read the FAQ on installing gapps ;)).

I'm not aware there being any display density related options in developer settings. Settings -> Display -> Display size does similar thing.

Which manifests itself when you use non-standard resolution/density. LOL, maybe just adjust your settings to something that doesn't cause them to overlap then.

Any IMO the whole 'Show arrow keys while typing' feature is utterly useless on non-touchscreen devices and how often do you ever need to press (virtual) power button while typing anyway (BTW, Android 12 now has one in notification shade as well).

I take things are going pretty well if this is the biggest issue you can come across. :)
Pretty damn well yes!
 
  • Like
Reactions: KonstaT

maxi_power

Member
Apr 10, 2021
5
0
Perhaps, for those who are experts in this.
In which part of the faq.?

FAQ:

Q: How to find several Raspberry Pi specific settings options?
A: Settings -> System -> Raspberry Pi settings

Most options in this menu require you to reboot your device for the setting to take effect.


Q: How to enable advanced reboot options?
A: Settings -> System -> Buttons -> Advanced reboot

Q: How to enable developer options?
A: Settings -> System -> About -> Click ‘Build number’ several times.

Q: How to enable root access?
A: LineageOS no longer has built-in root management for applications. You can have root access via ADB after ‘adb root’, SSH (see FAQ below), or serial console. It is also possible to install Magisk following instructions later in the FAQ.

Q: My display is not working. I can only see the rainbow screen but no Android boot animation. What should I do?
A: This build only supports HDMI displays that report supported resolutions using EDID. 1920x1080 resolution is used by default with this build. You can change value in /boot/resolution.txt to use a different resolution that your display supports. Removing /boot/resolution.txt will use the preferred resolution of your display.

Q: Settings -> System -> Storage shows total system size of 7 GB. There’s unallocated space on my sdcard. What should I do?
A: This is a 7 GB image, remaining space on your sdcard will remain unallocated. Easiest way to extend /data partition is to simply flash my resize zip in TWRP.

Alternative option is to use e.g. GParted and extend /data partition (/dev/block/mmcblk0p4) to cover the unallocated space. Resizing the partition manually will break support for encrypting /data. Format /data in TWRP recovery (Wipe -> Format data) after resizing to leave required space for crypto footer.


Q: Raspberry Pi doesn’t have a power button. How to power off/reboot device?
A: Following keyboard keys work as Android buttons: F1 = Home, F2 = Back, F3 = Multi-tasking, F4 = Menu, F5 = Power, F11 = Volume down, and F12 = Volume up. You can also use one of many third party reboot applications.

Q: How to create a DIY hardware power button?
A: You can send power button events by connecting GPIO21 to ground.



You can enable the feature by using a settings option found in Settings -> System -> Raspberry Pi settings -> Power button.

You can also use the DIY power button to boot the device to TWRP recovery. Press and hold the button while powering on the device until you see the TWRP screen.


Q: How to enable audio through HDMI?
A: 3.5mm jack is used for audio by default. You can select the audio device you want to use by using a settings option found in Settings -> System -> Raspberry Pi settings -> Audio device.

Q: How to use IR remote?
A: You can enable the feature by using a settings option found in Settings -> System -> Raspberry Pi settings -> Infrared remote.

You can place a keymap for your remote as /boot/rc_keymap.txt to be automatically loaded on boot (see available keymaps for reference).


Q: How to use RTC?
A: You can enable the feature by using a settings option found in Settings -> System -> Raspberry Pi settings -> Real time clock.

System time is automatically read and set from the RTC on boot once you’ve enabled the feature. You need to write the system time you want to use to the RTC in rooted shell:


hwclock -w -f /dev/rtc0

Q: How to use SSH?
A: You can start/stop the built-in SSH server by using a settings option found in Settings -> System -> Raspberry Pi settings -> SSH.

Android doesn’t have user accounts with passwords so key based authentication is used with SSH instead. Necessary keys are generated on the first boot and you need to pull the private key to your computer (or alternatively you can push your own previously generated keys to the device). See Settings -> System -> About -> Status -> IP address for your device’s IP address (192.168.0.100 is assumed here). Enable Android debugging & Rooted debugging under Settings -> System -> Developer options.


adb connect 192.168.0.100
adb root
adb pull /data/ssh/ssh_host_rsa_key my_private_key

ssh -i my_private_key [email protected]

It’s recommended to disable adb after this.

Q: How to boot from USB device?
A: Warning, this is still an experimental feature. Especially TWRP seems to have some issues with USB boot.

  1. Install EEPROM that supports booting from USB
  2. Write image to your USB device as above
  3. Mount the USB device on your computer and make following changes to /boot/config.txt under ‘Boot device’ section:
    #dtoverlay=android-sdcard
    dtoverlay=android-usb

  4. Plug in the USB device to your Raspberry Pi, remove any sdcard, and boot
Q: How to boot to TWRP recovery?
A: You can boot to TWRP by selecting Settings -> System -> Reboot -> Recovery after enabling advanced restart options.

If mouse cursor doesn’t appear, try replugging your mouse.


Q: How to boot out of TWRP recovery?
A: You can boot out of recovery by simply selecting reboot to system option in TWRP.

Q: My device keeps booting into TWRP recovery. What should I do?
A: If you have GPIO21 connected to ground (or if you have something drawing power from it) your device will always boot to TWRP recovery (see FAQ section about DIY power button). If you have a hardware failure on GPIO21 you can edit /boot/config.txt to remove the GPIO21 related logic (see ‘Ramdisk’ and ‘Graphics acceleration’ sections).

Q: How to update from previous LineageOS 19.0 build without losing data?
A:

  1. Boot to TWRP recovery with the build you want to keep the data (see FAQ)
  2. Plug in an external USB storage device and select ‘Backup’
  3. Use ‘Select Storage’ to choose the USB device and ‘Swipe to backup’ (it’s only necessary to backup the data partition so you can uncheck other partitions to speed up the process)
  4. Write new LineageOS 19.0 image to the sdcard following installation instructions
  5. Boot to TWRP recovery with the new build (see FAQ)
  6. Select ‘Restore’ and find the backup you created from the USB device (‘Select Storage’)
  7. Make sure you only have data selected as partitions to restore (uncheck other partitions if available) and select ‘Swipe to Restore’
  8. (Flash Google apps package/other add-ons you had previously installed)
  9. Boot out of recovery (see FAQ)
Q: How to install Magisk?
A:

  1. Download lineage-19.0-rpi-magisk.zip and save it to your device’s internal storage or use an external USB drive
  2. Download Magisk-v23.0.apk
  3. Boot to TWRP recovery (see FAQ)
  4. Install lineage-19.0-rpi-magisk.zip from your selected storage
  5. Boot out of recovery (see FAQ)
  6. Install Magisk-v23.0.apk using Android’s built-in file manager/’adb install’/etc.
Q: How to install Google apps?
A: It’s still very early days for Android 12 so OpenGApps are not available yet. I’m not aware there currently being any GApps releases for Android TV 12.

  1. Download open_gapps-arm64-12.0-tvstock-xxxxxxxx.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 open_gapps-arm64-12.0-tvstock-xxxxxxxx.zip from your selected storage
  4. Wipe -> Factory reset!
  5. Boot out of recovery (see FAQ)
 

KonstaT

Senior Member
Jan 20, 2016
655
389
KonstaKANG.com
Perhaps, for those who are experts in this.
In which part of the faq.?

FAQ:

Q: How to find several Raspberry Pi specific settings options?
A: Settings -> System -> Raspberry Pi settings

Most options in this menu require you to reboot your device for the setting to take effect.


Q: How to enable advanced reboot options?
A: Settings -> System -> Buttons -> Advanced reboot

Q: How to enable developer options?
A: Settings -> System -> About -> Click ‘Build number’ several times.

Q: How to enable root access?
A: LineageOS no longer has built-in root management for applications. You can have root access via ADB after ‘adb root’, SSH (see FAQ below), or serial console. It is also possible to install Magisk following instructions later in the FAQ.

Q: My display is not working. I can only see the rainbow screen but no Android boot animation. What should I do?
A: This build only supports HDMI displays that report supported resolutions using EDID. 1920x1080 resolution is used by default with this build. You can change value in /boot/resolution.txt to use a different resolution that your display supports. Removing /boot/resolution.txt will use the preferred resolution of your display.

Q: Settings -> System -> Storage shows total system size of 7 GB. There’s unallocated space on my sdcard. What should I do?
A: This is a 7 GB image, remaining space on your sdcard will remain unallocated. Easiest way to extend /data partition is to simply flash my resize zip in TWRP.

Alternative option is to use e.g. GParted and extend /data partition (/dev/block/mmcblk0p4) to cover the unallocated space. Resizing the partition manually will break support for encrypting /data. Format /data in TWRP recovery (Wipe -> Format data) after resizing to leave required space for crypto footer.


Q: Raspberry Pi doesn’t have a power button. How to power off/reboot device?
A: Following keyboard keys work as Android buttons: F1 = Home, F2 = Back, F3 = Multi-tasking, F4 = Menu, F5 = Power, F11 = Volume down, and F12 = Volume up. You can also use one of many third party reboot applications.

Q: How to create a DIY hardware power button?
A: You can send power button events by connecting GPIO21 to ground.



You can enable the feature by using a settings option found in Settings -> System -> Raspberry Pi settings -> Power button.

You can also use the DIY power button to boot the device to TWRP recovery. Press and hold the button while powering on the device until you see the TWRP screen.


Q: How to enable audio through HDMI?
A: 3.5mm jack is used for audio by default. You can select the audio device you want to use by using a settings option found in Settings -> System -> Raspberry Pi settings -> Audio device.

Q: How to use IR remote?
A: You can enable the feature by using a settings option found in Settings -> System -> Raspberry Pi settings -> Infrared remote.

You can place a keymap for your remote as /boot/rc_keymap.txt to be automatically loaded on boot (see available keymaps for reference).


Q: How to use RTC?
A: You can enable the feature by using a settings option found in Settings -> System -> Raspberry Pi settings -> Real time clock.

System time is automatically read and set from the RTC on boot once you’ve enabled the feature. You need to write the system time you want to use to the RTC in rooted shell:


hwclock -w -f /dev/rtc0

Q: How to use SSH?
A: You can start/stop the built-in SSH server by using a settings option found in Settings -> System -> Raspberry Pi settings -> SSH.

Android doesn’t have user accounts with passwords so key based authentication is used with SSH instead. Necessary keys are generated on the first boot and you need to pull the private key to your computer (or alternatively you can push your own previously generated keys to the device). See Settings -> System -> About -> Status -> IP address for your device’s IP address (192.168.0.100 is assumed here). Enable Android debugging & Rooted debugging under Settings -> System -> Developer options.


adb connect 192.168.0.100
adb root
adb pull /data/ssh/ssh_host_rsa_key my_private_key

ssh -i my_private_key [email protected]

It’s recommended to disable adb after this.

Q: How to boot from USB device?
A: Warning, this is still an experimental feature. Especially TWRP seems to have some issues with USB boot.

  1. Install EEPROM that supports booting from USB
  2. Write image to your USB device as above
  3. Mount the USB device on your computer and make following changes to /boot/config.txt under ‘Boot device’ section:
    #dtoverlay=android-sdcard
    dtoverlay=android-usb

  4. Plug in the USB device to your Raspberry Pi, remove any sdcard, and boot
Q: How to boot to TWRP recovery?
A: You can boot to TWRP by selecting Settings -> System -> Reboot -> Recovery after enabling advanced restart options.

If mouse cursor doesn’t appear, try replugging your mouse.


Q: How to boot out of TWRP recovery?
A: You can boot out of recovery by simply selecting reboot to system option in TWRP.

Q: My device keeps booting into TWRP recovery. What should I do?
A: If you have GPIO21 connected to ground (or if you have something drawing power from it) your device will always boot to TWRP recovery (see FAQ section about DIY power button). If you have a hardware failure on GPIO21 you can edit /boot/config.txt to remove the GPIO21 related logic (see ‘Ramdisk’ and ‘Graphics acceleration’ sections).

Q: How to update from previous LineageOS 19.0 build without losing data?
A:

  1. Boot to TWRP recovery with the build you want to keep the data (see FAQ)
  2. Plug in an external USB storage device and select ‘Backup’
  3. Use ‘Select Storage’ to choose the USB device and ‘Swipe to backup’ (it’s only necessary to backup the data partition so you can uncheck other partitions to speed up the process)
  4. Write new LineageOS 19.0 image to the sdcard following installation instructions
  5. Boot to TWRP recovery with the new build (see FAQ)
  6. Select ‘Restore’ and find the backup you created from the USB device (‘Select Storage’)
  7. Make sure you only have data selected as partitions to restore (uncheck other partitions if available) and select ‘Swipe to Restore’
  8. (Flash Google apps package/other add-ons you had previously installed)
  9. Boot out of recovery (see FAQ)
Q: How to install Magisk?
A:

  1. Download lineage-19.0-rpi-magisk.zip and save it to your device’s internal storage or use an external USB drive
  2. Download Magisk-v23.0.apk
  3. Boot to TWRP recovery (see FAQ)
  4. Install lineage-19.0-rpi-magisk.zip from your selected storage
  5. Boot out of recovery (see FAQ)
  6. Install Magisk-v23.0.apk using Android’s built-in file manager/’adb install’/etc.
Q: How to install Google apps?
A: It’s still very early days for Android 12 so OpenGApps are not available yet. I’m not aware there currently being any GApps releases for Android TV 12.

  1. Download open_gapps-arm64-12.0-tvstock-xxxxxxxx.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 open_gapps-arm64-12.0-tvstock-xxxxxxxx.zip from your selected storage
  4. Wipe -> Factory reset!
  5. Boot out of recovery (see FAQ)
One could probably assume the part about installing Google apps is relevant to installing Google apps?
Q: How to install Google apps?
A: It’s still very early days for Android 12 so OpenGApps are not available yet. I’m not aware there currently being any GApps releases for Android TV 12.
And before you ask, I don't have anything to do with any gapps release.
 

Tom33231

Member
Jan 16, 2022
27
1
Problem with that specific display is that it uses SPI for the display interface (SPI for touch interface is fine). Not to endorse anything but e.g. Waveshare also has small displays that use DPI/DSI/HDMI as the display interface (see selection guide section at e.g. https://www.waveshare.com/7inch-hdmi-lcd-c.htm). HDMI displays are of course the most used so shouldn't require much additional effort.

My first Android phone from 10+ years ago had display with 480x800 resolution (ironically what the official Raspberry Pi 7" display also has). So, let's just say that that or anything smaller than that is not what you'd expect for device running modern Android these days. Just having a display resolution/density related discussion above. Very small resolution/density can also cause all kinds of issues (UI on the OS itself because no one else in the world uses such low resolution anymore, app compatibility issues because of missing low density drawables because no one needs them anymore, etc.). https://developer.android.com/training/multiscreen/screendensities

My Raspberry Pi builds use standard ext4 partitions (system, vendor, data - FAT is used for boot partition). You can just directly mount the sdcard on your Linux machine and edit contents of any of the partitions. There's simg2img/img2simg tools to pack sparse images most Android devices use. Mounting the image writable (and what fs it uses - ext4/F2FS/etc) is another story.

Your links refer to adding precompiled apps when building Android from source.
I mean yes very true just also curious about what’s possible as well. I mean this single board computer rocks as far as embedded projects go and etc. Wondering the implications of android being almost completely usable and almost all functions at this point working.
 

Tom33231

Member
Jan 16, 2022
27
1
I know more work has to be done for full compatibility and documentation for external and internal software mods on this pi4. Like for hardware and software compatibility and kernel drivers to make the porting process from Debian Linux to android Linux kernel modules and such easier and more possible.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Has the default path for GPIO scripts changed in 12 from 11?
    If you mean init.d scripts they are in /vendor/etc/init.d/ now (vs. /system/etc/init.d/ in previous Android versions).
    1
    New builds. Same changelog on both.

    • 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)
    1
    With the old format 'ir-keytable" -w gives "Invalid parameter on line 1 of /boot/rc_keymap.txt" and "/boot/rc_keymap.toml: missing [protocols] section" for *.txt and *.toml respectively.
    Are there any other actions I should do, apart from just placing the keymap file in /boot ? I think I'm missing something...
    Well, something invalid on the first line (table name, protocol, line ending)?

    According to the 'getevent' you posted it already works as expected. How are you testing it in Android? Are you on a screen where the arrow keys actually do something?

    Edit. Tested this again myself. I fixed the FAQ to point to the old rc_keymap format. .toml doesn't work with .txt file extension (I'll add support for separate /boot/rc_keymap.toml if/when there's another release). 'getevent' shows some events from the IR even if you don't have a right keymap. IR remote works fine, so you just need to figure out the rc_keymap.txt for the remote you're using.
    1
    Well, something invalid on the first line (table name, protocol, line ending)?

    According to the 'getevent' you posted it already works as expected. How are you testing it in Android? Are you on a screen where the arrow keys actually do something?

    Edit. Tested this again myself. I fixed the FAQ to point to the old rc_keymap format. .toml doesn't work with .txt file extension (I'll add support for separate /boot/rc_keymap.toml if/when there's another release). 'getevent' shows some events from the IR even if you don't have a right keymap. IR remote works fine, so you just need to figure out the rc_keymap.txt for the remote you're using.
    I decided to start from scratch (before I read your edited post). So, after new installation the RC was working fine after loading the keymap file from storage as .toml
    Code:
    su -c ir-keytable /storage/emulated/0/.../rc_keymap.toml
    Problems start as soon as the file is moved to /boot. After reboot the RC works only in terminal with 'ir-keytable -t'. It seems like mounting /boot messes things up, because even if the file is removed problem persists.
    My solution so far, after clean installation 'ir-keytable -r' gives the default scancode to keycode mapping, which looks like this lirc.conf file, after converting to .toml using a .py script found here. So, using IrScrutinizer, I made an RC with these scancodes to use with irplus app.
    I'll try again with the new insurrections and I'll report back.

    Edit: I placed a .txt file with the old format as /boot/rc_keymap.txt and it works! And this time mounting /boot didn't brake the Matrix...
    1
    I decided to start from scratch (before I read your edited post). So, after new installation the RC was working fine after loading the keymap file from storage as .toml
    Code:
    su -c ir-keytable /storage/emulated/0/.../rc_keymap.toml
    Problems start as soon as the file is moved to /boot. After reboot the RC works only in terminal with 'ir-keytable -t'. It seems like mounting /boot messes things up, because even if the file is removed problem persists.
    My solution so far, after clean installation 'ir-keytable -r' gives the default scancode to keycode mapping, which looks like this lirc.conf file, after converting to .toml using a .py script found here. So, using IrScrutinizer, I made an RC with these scancodes to use with irplus app.
    I'll try again with the new insurrections and I'll report back.

    Edit: I placed a .txt file with the old format as /boot/rc_keymap.txt and it works! And this time mounting /boot didn't brake the Matrix...
    Linux kernel uses rc6-mce keymap (https://github.com/lineage-rpi/andr...ge-19.1/drivers/media/rc/keymaps/rc-rc6-mce.c) by default. You could also configure RC keymaps kernel side (without using 'ir-keytable') if your remote was one supported by Linux (https://github.com/lineage-rpi/android_kernel_brcm_rpi/tree/lineage-19.1/drivers/media/rc/keymaps) but that's usually not the case.

    My builds have a script at /vendor/etc/init.d/02remote that is executed on boot that clears the default RC keymap (rc6-mce) and writes one from /boot/rc_keymap.txt if such file exist. You can also easily edit that script if you want to use the .toml format instead of the legacy format.
  • 16
    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
    3
    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)
    2
    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/
    2
    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.
    2
    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)