Generalkidd
Posts: 26
Joined: Thu Jan 05, 2012 5:28 pm

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Tue Jan 28, 2020 5:46 am

How's the performance with Android 9 on the Pi 3 B+? I'm looking into buying a Raspberry Pi for game streaming and other media streaming, but I saw in other older posts that performance is iffy with Android on the Pi 3 B+ but that Android 7 runs great on the Pi 3 non plus model. Should I go with a non plus model and just run Android 7 version of LineageOS or go with the plus model and run Android 9?

Konsta
Posts: 372
Joined: Thu Aug 16, 2018 3:55 pm
Location: Finland
Contact: Website Twitter

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Tue Jan 28, 2020 7:17 am

Generalkidd wrote:
Tue Jan 28, 2020 5:46 am
How's the performance with Android 9 on the Pi 3 B+? I'm looking into buying a Raspberry Pi for game streaming and other media streaming, but I saw in other older posts that performance is iffy with Android on the Pi 3 B+ but that Android 7 runs great on the Pi 3 non plus model. Should I go with a non plus model and just run Android 7 version of LineageOS or go with the plus model and run Android 9?
Performance on LineageOS 16.0 is superior to both previous versions (14.1 & 15.1) and it also supports Pi 3 B+.

None of these builds support hardware video decoding/encoding so I'm not sure if this is best suited for the use case you had in mind. It depends on the app and what video formats it uses.
KonstaKANG.com

Trespasser
Posts: 3
Joined: Wed Nov 18, 2015 4:36 pm

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Thu Feb 06, 2020 4:41 am

Hi Konsta,
I have a question. Does LineageOS 16.0 for a RPi 3 have bash installed within it? I have a few bash scripts that I'd like to run. Plus, I have a RemotePi (a device that allows you to shutdown a RPi in an orderly manner) which also uses a couple of bash scripts.

Thanks in advance.

Best regards.

Konsta
Posts: 372
Joined: Thu Aug 16, 2018 3:55 pm
Location: Finland
Contact: Website Twitter

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Thu Feb 06, 2020 6:30 am

Trespasser wrote:
Thu Feb 06, 2020 4:41 am
Hi Konsta,
I have a question. Does LineageOS 16.0 for a RPi 3 have bash installed within it? I have a few bash scripts that I'd like to run. Plus, I have a RemotePi (a device that allows you to shutdown a RPi in an orderly manner) which also uses a couple of bash scripts.

Thanks in advance.

Best regards.
Yes, LineageOS has bash but it's not the default shell. There's also tools like vim and nano text editors, that are usually not included in Android, that can make your life a bit easier with scripts.

You can place your scripts inside /system/etc/init.d/ directory if you want that your scripts are executed on boot (don't forget to set permissions on your scripts to 755 and system partition needs to be mounted rw before editing, too).
KonstaKANG.com

Trespasser
Posts: 3
Joined: Wed Nov 18, 2015 4:36 pm

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Fri Feb 07, 2020 1:44 am

Hey Konsta,
I will say one thing about LineageOS 16.0...it ran smooth as silk. Much smoother than 15.0. I really liked it. Great work.

Thanks for your reply, and help.

Best regards.

Bob

Konsta
Posts: 372
Joined: Thu Aug 16, 2018 3:55 pm
Location: Finland
Contact: Website Twitter

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Fri Feb 07, 2020 4:18 pm

New build. A lot of new stuff in this one. :)

https://konstakang.com/devices/rpi3/LineageOS16.0/

-add camera HAL to support Pi camera modules and USB webcams (thanks to Android-x86)
-update to MESA 19.3.3 and latest upstream versions of minigbm gralloc, drm_hwcomposer, and libdrm
-enable hardware overlays (improves graphics performance)
-add option to switch to SwiftShader software renderer e.g. to use official 7" touchscreen or to boot without any display connected (see FAQ)
-fix portrait apps on forced landscape orientation (thanks to Ladehunter)
-update GPS HAL
-option to use DIY hardware power button to boot to TWRP recovery (see FAQ)
-initial support for IR modules and remotes (tested with TSOP4838)
-update to Linux 4.19.102 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
-Android security patch level: 5 January 2020 (merged)
KonstaKANG.com

davidbashman
Posts: 1
Joined: Wed Feb 12, 2020 3:19 am

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Wed Feb 12, 2020 3:22 am

This build of Android is fantastic. It's working great on my 3B. I'm looking to use this as a CarPC. Obviously, boot times are pretty critical for that. Any recommendations on reducing the boot time (currently about 30s from cold start)? I'm looking to land directly in the AutoKit app that supports the Carlinkit CarPlay adapter. Thanks!

Keep up the awesome work.

Konsta
Posts: 372
Joined: Thu Aug 16, 2018 3:55 pm
Location: Finland
Contact: Website Twitter

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Wed Feb 12, 2020 3:32 pm

davidbashman wrote:
Wed Feb 12, 2020 3:22 am
This build of Android is fantastic. It's working great on my 3B. I'm looking to use this as a CarPC. Obviously, boot times are pretty critical for that. Any recommendations on reducing the boot time (currently about 30s from cold start)? I'm looking to land directly in the AutoKit app that supports the Carlinkit CarPlay adapter. Thanks!

Keep up the awesome work.
Storage speed is one obvious bottleneck especially during booting the device so use a sdcard that is as fast as possible. Overclocking CPU/GPU/SD is an option though I wouldn't necessarily recommend it.

You can also try to keep the system as minimal as possible for your requirements. You can even remove system apps you don't need if you have a specific purpose like that in mind. Low RAM configuration enabled on this build also sets some limitations. There's e.g. ro.config.max_starting_bg system property that you can use to set number of starting background services. It's currently one on low RAM config (8 on regular devices). I've set it to 4 on some previous builds. Maybe worth testing if different values have any impact on the time it takes to boot.

It just takes certain time to boot Android from zero so that's just something that you'll have to live with. I doubt you're taking several seconds away from that no matter what you do.
KonstaKANG.com

Wepacad
Posts: 3
Joined: Thu Feb 13, 2020 7:25 am

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Thu Feb 13, 2020 7:34 am

Hello Everybody
Sorry for my English. I have a question. Can I use IR remote control on this build? LIRC or something different. How can I configure it? Thanks

Konsta
Posts: 372
Joined: Thu Aug 16, 2018 3:55 pm
Location: Finland
Contact: Website Twitter

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Thu Feb 13, 2020 12:15 pm

Wepacad wrote:
Thu Feb 13, 2020 7:34 am
Hello Everybody
Sorry for my English. I have a question. Can I use IR remote control on this build? LIRC or something different. How can I configure it? Thanks
Yes, you can use IR remotes on both Pi 3 and Pi 4. Latest Pi 3 build doesn't yet include ir-keytable tool that you might need for configuring your remote but latest Pi 4 build already has it. Here's a TWRP flashable zip to add it on Pi 3 (https://www.androidfilehost.com/?fid=43 ... 2261722342).

This is using gpio-ir driver instead of LIRC. There's a line in /boot/config.txt under 'IR' section that you need to uncomment after connecting your IR module. If your remote is supported by the Linux kernel (https://github.com/lineage-rpi/android_ ... rc/keymaps) you can use rc-map-name parameter (https://github.com/lineage-rpi/android_ ... #L745-L758) on that line to select the correct keymap. Otherwise you need to use ir-keytable tool to configure your remote.
KonstaKANG.com

Wepacad
Posts: 3
Joined: Thu Feb 13, 2020 7:25 am

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Fri Feb 14, 2020 8:38 am

Konsta wrote:
Thu Feb 13, 2020 12:15 pm
Yes, you can use IR remotes on both Pi 3 and Pi 4.
Thank you for your answer.
1. So, can I turn ON/OFF my Pi3B+ with remote control?
2. Sorry, I'm not programmer. And I don't understand how to configure the "IR keytable". Maybe You can explain me with "2-3 words" how to? Thank you again

Konsta
Posts: 372
Joined: Thu Aug 16, 2018 3:55 pm
Location: Finland
Contact: Website Twitter

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Fri Feb 14, 2020 8:56 am

Wepacad wrote:
Fri Feb 14, 2020 8:38 am
Konsta wrote:
Thu Feb 13, 2020 12:15 pm
Yes, you can use IR remotes on both Pi 3 and Pi 4.
Thank you for your answer.
1. So, can I turn ON/OFF my Pi3B+ with remote control?
2. Sorry, I'm not programmer. And I don't understand how to configure the "IR keytable". Maybe You can explain me with "2-3 words" how to? Thank you again
1. Well, you can invoke the power menu or put the device to 'sleep' (switch display off) i.e. exactly the same thing that happens on any Android device when you press the power button. You can't use it to power on the device of course (can wake from sleep).

2. 'ir-keytable --help' or Google search. Even that was more than 2-3 words...
KonstaKANG.com

david_1234
Posts: 441
Joined: Mon Jan 01, 2018 2:14 pm

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Wed Apr 01, 2020 11:03 am

I have a question about adding usb device :

I have a 4g modem I want to add to the pi running android
I have the drivers , but as I understadn I need to complie them with the all kernel and "create" a new image? - is this true ?
maybe there is a fastet way to load driver to the unit?

if not -
is there any way to download the android and edit it with the drivers?

Thanks ,

bunbunbao
Posts: 1
Joined: Thu Apr 02, 2020 3:41 am

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Thu Apr 02, 2020 3:46 am

Hi,
I have installed lineageOS 16, and flashed Gapps ARM 9.0 tvstock in TWRP, then I reboot back to android using recovery2boot.zip.
Now my raspberry pi 3B+ is stuck in the lineageOS startup for at least 30mins now. Is there something wrong with it?

Konsta
Posts: 372
Joined: Thu Aug 16, 2018 3:55 pm
Location: Finland
Contact: Website Twitter

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Thu Apr 02, 2020 4:24 pm

david_1234 wrote:
Wed Apr 01, 2020 11:03 am
I have a question about adding usb device :

I have a 4g modem I want to add to the pi running android
I have the drivers , but as I understadn I need to complie them with the all kernel and "create" a new image? - is this true ?
maybe there is a fastet way to load driver to the unit?

if not -
is there any way to download the android and edit it with the drivers?

Thanks ,
I think you'd need to do a lot of work to get something like that working on Android. Source code for the Linux kernel is here (https://github.com/lineage-rpi/android_kernel_brcm_rpi) if you want to try something out but you'll need a lot more than just some kernel driver.
Last edited by Konsta on Thu Apr 02, 2020 4:45 pm, edited 1 time in total.
KonstaKANG.com

Konsta
Posts: 372
Joined: Thu Aug 16, 2018 3:55 pm
Location: Finland
Contact: Website Twitter

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Thu Apr 02, 2020 4:25 pm

bunbunbao wrote:
Thu Apr 02, 2020 3:46 am
Hi,
I have installed lineageOS 16, and flashed Gapps ARM 9.0 tvstock in TWRP, then I reboot back to android using recovery2boot.zip.
Now my raspberry pi 3B+ is stuck in the lineageOS startup for at least 30mins now. Is there something wrong with it?
Please read the FAQ under 'Q: How to install Google apps?'. This is not an Android TV build so you're not supposed to install Android TV gapps (pico package recommended).
KonstaKANG.com

david_1234
Posts: 441
Joined: Mon Jan 01, 2018 2:14 pm

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Sun Apr 05, 2020 6:28 am

I think you'd need to do a lot of work to get something like that working on Android. Source code for the Linux kernel is here (https://github.com/lineage-rpi/android_kernel_brcm_rpi) if you want to try something out but you'll need a lot more than just some kernel driver.
why ,
I have the driver from the modem company ,

if I take the Linux Kernal and add the drivers like they say ?
and wouldn't change anything else -
will it work?

Thanks ,

Konsta
Posts: 372
Joined: Thu Aug 16, 2018 3:55 pm
Location: Finland
Contact: Website Twitter

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Sun Apr 05, 2020 6:34 am

david_1234 wrote:
Sun Apr 05, 2020 6:28 am
why ,
I have the driver from the modem company ,

if I take the Linux Kernal and add the drivers like they say ?
and wouldn't change anything else -
will it work?

Thanks ,
Already gave you the link for the kernel source so you're welcome to give it a try. :)

I honestly don't know without knowing the specifics of the hardware and the driver. Maybe you can control it from the command line somehow but it's not going to be hooked up to the Android UI in any way.
KonstaKANG.com

dvaitman
Posts: 20
Joined: Wed Jan 13, 2016 1:59 am
Location: Melbourne, AU

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Tue Apr 07, 2020 11:48 am

Tried this today.
Downloaded image, burn to card using balenaEtcher, put card in raspberry, plug keyboard, network, hdmi, power... And nothing. Waited for about 10 min. No signs of anything. Have I dinner anything wrong? I know the screen is 1680x1050 but it supports 1280x720. Unless I need to use one like that? Or do I need to try with a 1920x1080?
Please help. I want to try this androidTV on my old TV.

Konsta
Posts: 372
Joined: Thu Aug 16, 2018 3:55 pm
Location: Finland
Contact: Website Twitter

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Tue Apr 07, 2020 4:13 pm

dvaitman wrote:
Tue Apr 07, 2020 11:48 am
Tried this today.
Downloaded image, burn to card using balenaEtcher, put card in raspberry, plug keyboard, network, hdmi, power... And nothing. Waited for about 10 min. No signs of anything. Have I dinner anything wrong? I know the screen is 1680x1050 but it supports 1280x720. Unless I need to use one like that? Or do I need to try with a 1920x1080?
Please help. I want to try this androidTV on my old TV.
There's a FAQ section about display issues. Graphics drivers used in this build rely on the EDID data your display reports.

This is not an Android TV build...
KonstaKANG.com

Tichun
Posts: 71
Joined: Wed Jul 06, 2016 1:36 pm

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Fri May 01, 2020 8:39 am

Hello, what's the bottleneck currently?
My previous smartphone - 1/8gb MT6737M Mali-T720MP2 - has 4gb left and runs everything perfectly smooth despite worse specs than the Pi. It can hold 2-5 apps in RAM on average, can play a lot of games at 60fps without any stutter.

I can imagine VC4 driver is only a problem in video decode and games but problems don't end here. Is it emmc vs microsd? Unoptimized build?

https://source.android.com/devices/tech/perf/low-ram
I'd guess something is wrong with RAM management, as Raspbian is quite OK after disabling many background ram hogs with early-oom enabled, even though X11 is very tearing-prone and unoptimized compared to Surfaceflinger.

Thanks for the best build so far, though!

Konsta
Posts: 372
Joined: Thu Aug 16, 2018 3:55 pm
Location: Finland
Contact: Website Twitter

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Fri May 01, 2020 11:21 am

Tichun wrote:
Fri May 01, 2020 8:39 am
Hello, what's the bottleneck currently?
My previous smartphone - 1/8gb MT6737M Mali-T720MP2 - has 4gb left and runs everything perfectly smooth despite worse specs than the Pi. It can hold 2-5 apps in RAM on average, can play a lot of games at 60fps without any stutter.

I can imagine VC4 driver is only a problem in video decode and games but problems don't end here. Is it emmc vs microsd? Unoptimized build?

https://source.android.com/devices/tech/perf/low-ram
I'd guess something is wrong with RAM management, as Raspbian is quite OK after disabling many background ram hogs with early-oom enabled, even though X11 is very tearing-prone and unoptimized compared to Surfaceflinger.

Thanks for the best build so far, though!
You can't really compare this to any regular Android device. Raspberry Pi is not meant to run Android so it doesn't have any Android specific hardware drivers (GPU, hw video dec/enc, etc). Also running the OS from sdcard is much slower compared to eMMC/UFS used on modern mobile devices. 1GB of RAM on Raspberry Pi 3 is shared with the GPU. With current CMA allocations graphics can take up to 320mb of that so there's really not much left for the OS.

VC4 graphics works fairly well now. I could enable the last missing features after switching to Linux 4.19. Slow storage and lack of RAM are the biggest bottle necks. IMO overall this runs really well considering (if you don't install gapps which is another memory hog).

This build is already configured for low RAM, Android Go configuration, and it uses zRAM. You're of course welcome to create a separate swapfile or tune low memory killer parameters (https://github.com/LineageOS/android_sy ... -16.0/lmkd) if you find something that works better for you.
KonstaKANG.com

n8orz
Posts: 1
Joined: Thu May 07, 2020 9:44 pm

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Thu May 07, 2020 10:48 pm

Hello,

Thank you so much for all of your work. This is really awesome.

I am trying to interface a rotary encoder to control the volume of the pi in Android through the GPIO pins. I've added some gpis-keys lines into config.txt and the pi is reading the input, but of course can't tell if the encoder is turning the volume up or down. Is there somewhere I can interpret the logic from the encoder or a way to install a driver? I did find a line in the kernel file mentioning a rotary encoder, but I don't know how to go about accessing that or quite what it is.

Apologies in advance if this is a redundant or confusing question. Any info you can point me in the direction of is greatly appreciated.

*EDIT: I missed your post a few above. I am going to attempt to preprocess the encoder signal with a microcontroller then send a signal from there to the GPIO Pins.

Konsta
Posts: 372
Joined: Thu Aug 16, 2018 3:55 pm
Location: Finland
Contact: Website Twitter

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Mon May 11, 2020 7:36 am

n8orz wrote:
Thu May 07, 2020 10:48 pm
Hello,

Thank you so much for all of your work. This is really awesome.

I am trying to interface a rotary encoder to control the volume of the pi in Android through the GPIO pins. I've added some gpis-keys lines into config.txt and the pi is reading the input, but of course can't tell if the encoder is turning the volume up or down. Is there somewhere I can interpret the logic from the encoder or a way to install a driver? I did find a line in the kernel file mentioning a rotary encoder, but I don't know how to go about accessing that or quite what it is.

Apologies in advance if this is a redundant or confusing question. Any info you can point me in the direction of is greatly appreciated.

*EDIT: I missed your post a few above. I am going to attempt to preprocess the encoder signal with a microcontroller then send a signal from there to the GPIO Pins.
I'm not familiar with how rotary encoders work. If you wanted to use gpio-keys driver with this, you'd need to use two separate GPIO pins - one for volume up and another one for vol down.
KonstaKANG.com

H1sware
Posts: 1
Joined: Tue May 19, 2020 3:26 am

Re: [DEV] LineageOS 16.0 (Android 9) for Raspberry Pi 3 B and B+

Tue May 19, 2020 3:56 am

So I thought to help someone who still has screen rotation problems (touch screen 7 "official)

[*]after loading LineageOS 16.0 to SD you will have these files, in particular (Config.txt)
config lineageos rasppi4.PNG
config lineageos rasppi4.PNG (49.87 KiB) Viewed 3332 times
, open it and edit it with brackets, notepad ++ and the like ... if you don't want problems.

[*]in the file (config.txt) under the wording "disable_overscan = 1" insert a space and lcd_rotate=2 (
config lineageos rasppi4 (before).PNG
config lineageos rasppi4 (before).PNG (73.58 KiB) Viewed 3332 times
as in the image)

the last image will clarify everything ..
config lineageos rasppi4 (after).PNG
config lineageos rasppi4 (after).PNG (73.31 KiB) Viewed 3332 times
I hope I have been of help to someone .. :D

[*]Raspberry pi 4 model b (4gb)[*]

Return to “Android”