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

Search This thread

mohamedbk

Senior Member
Aug 11, 2015
235
61
beni khalled
Samsung Galaxy S20
Out of these two you'd probably want to use exFAT for a storage device this size. Simple Google search would have been a lot quicker, though. :)
Dear my friend,
Your build have some problems :

1) you can't format external usb or hdd in setting them storage , you can't use it as external storage , it's just a media drive only .

2) The media servers apps ( kodi , emby , plex media want detect external storage .
That's why i contacted you , i tried to config my rp4 android tv as a media server and it didn't work because of this
 

KonstaT

Senior Member
Jan 20, 2016
807
466
KonstaKANG.com
Dear my friend,
Your build have some problems :

1) you can't format external usb or hdd in setting them storage , you can't use it as external storage , it's just a media drive only .

2) The media servers apps ( kodi , emby , plex media want detect external storage .
That's why i contacted you , i tried to config my rp4 android tv as a media server and it didn't work because of this
Neither of these have anything to do with my build. There is nothing out of the ordinary here to how external storage devices are managed in Android in general. With recent Android versions storage access for apps is limited to the apps' own directory for security reasons.

Apps having limited access to external storage is by design in Android. VLC/Kodi/etc access to external storage has been discussed e.g. https://forum.xda-developers.com/t/...raspberry-pi-4-b.4139059/page-5#post-83816985
 
  • Love
Reactions: mohamedbk

Xenox003

New member
Dec 19, 2022
4
1
Hi guys, i might need some help getting LineageOS 20 running on the official 7" Touchscreen.

As mentioned in the "docs" there is an option in Settings: --> System --> RPI Settings --> Touchscreen, which is supposed to config the OS to properly run with the official 7" >Touchscreen.

When applying this setting and rebooting the PI i end up with
1. A Blackscreen on the Touchscreen (backlight on obviously)
2. A Blackscreen on the HDMI0 output (previously worked fine, probably its not supposed to work cause the touchscreen config is active, i don't need it anyways once i get the touchscreen running)

After taking a look at the boot/config.txt and resolution.txt i noticed the dtoverlay=vc4-kms-dsi-7inch line is uncommented and the resolution is set to 800x480, which seems right to me.

After a little bit more fiddling around i found out that if it boots into TWRP it displays fine on the Touchscreen, although the touch input does not work (which could also be a general thing wor TWRP, idk)

Am i missing something here? I don't seem to be getting, why its not properly booting into android/displaying the actual image.

if i should include some more info or whatever else, feel free to ask me ;)

Thanks in advance for the help.
 
Last edited:

KonstaT

Senior Member
Jan 20, 2016
807
466
KonstaKANG.com
Hi guys, i might need some help getting LineageOS 20 running on the official 7" Touchscreen.

As mentioned in the "docs" there is an option in Settings: --> System --> RPI Settings --> Touchscreen, which is supposed to config the OS to properly run with the official 7" >Touchscreen.

When applying this setting and rebooting the PI i end up with
1. A Blackscreen on the Touchscreen (backlight on obviously)
2. A Blackscreen on the HDMI0 output (previously worked fine, probably its not supposed to work cause the touchscreen config is active, i don't need it anyways once i get the touchscreen running)

After taking a look at the boot/config.txt and resolution.txt i noticed the dtoverlay=vc4-kms-dsi-7inch line is uncommented and the resolution is set to 800x480, which seems right to me.

After a little bit more fiddling around i found out that if it boots into TWRP it displays fine on the Touchscreen, although the touch input does not work (which could also be a general thing wor TWRP, idk)

Am i missing something here? I don't seem to be getting, why its not properly booting into android/displaying the actual image.

if i should include some more info or whatever else, feel free to ask me ;)

Thanks in advance for the help.
You need to disconnect any HDMI display when you're using the DSI display.

Touch also works in TWRP if boot to recovery through the Android power menu (touchscreen driver gets enabled separately as TWRP doesn't use hw accelerated graphics).
 

Xenox003

New member
Dec 19, 2022
4
1
You need to disconnect any HDMI display when you're using the DSI display.

Touch also works in TWRP if boot to recovery through the Android power menu (touchscreen driver gets enabled separately as TWRP doesn't use hw accelerated graphics).
Seems like disconnecting the HDMI Monitor woked fine, Touchscreen is displaying an Image, Touch input also works fine.

I really tried a lot of stuff before like changing the boot/config.txt to load additional/fewer drivers and whatever else. I guess i overcomplicated my view to the problem a bit, causing me not to try the most simple things like "Hey, how about i remove my HDMI cable and see if it works".

Thanks for creating this awesome custom kernel, prob helps out a lotta ppl. (y)
 
  • Like
Reactions: KonstaT

KonstaT

Senior Member
Jan 20, 2016
807
466
KonstaKANG.com
Seems like disconnecting the HDMI Monitor woked fine, Touchscreen is displaying an Image, Touch input also works fine.

I really tried a lot of stuff before like changing the boot/config.txt to load additional/fewer drivers and whatever else. I guess i overcomplicated my view to the problem a bit, causing me not to try the most simple things like "Hey, how about i remove my HDMI cable and see if it works".

Thanks for creating this awesome custom kernel, prob helps out a lotta ppl. (y)
Yes, could be worth pointing it out in the FAQ that you need to disconnect HDMI displays in this case.

This is an entire custom Android OS, but yes, it also contains a custom Linux kernel.
 

haruka-k

New member
Dec 21, 2022
1
0
Hey, thanks for your amazing work, everything works wonderfully.

Is there a way to turn off/on the HDMI output from a shell? The screen I use does not support CEC, so the only way would be turning off the actual output so the screen goes into "no signal" and shuts off; something like tvservice --off etc., but none of the commands I can find around on the internet seem to work.
Is any special command available for this here?

What I've tried:
Code:
rpi4:/ # tvservice --off
tvservice is not supported when using the vc4-kms-v3d driver.
Similar features are available with standard linux tools
such as modetest from libdrm-tests.
rpi4:/ # vcgencmd display_power 0
display_power=1
rpi4:/ # setterm --powersave off
/system/bin/sh: setterm: inaccessible or not found
127|rpi4:/ # vbetool dpms off
/system/bin/sh: vbetool: inaccessible or not found
127|rpi4:/ # cd /sys/b
block/  bus/
127|rpi4:/ # cd /sys/class/backlight/
rpi4:/sys/class/backlight # ls
rpi4:/sys/class/backlight #
 

KonstaT

Senior Member
Jan 20, 2016
807
466
KonstaKANG.com
Hey, thanks for your amazing work, everything works wonderfully.

Is there a way to turn off/on the HDMI output from a shell? The screen I use does not support CEC, so the only way would be turning off the actual output so the screen goes into "no signal" and shuts off; something like tvservice --off etc., but none of the commands I can find around on the internet seem to work.
Is any special command available for this here?

What I've tried:
Code:
rpi4:/ # tvservice --off
tvservice is not supported when using the vc4-kms-v3d driver.
Similar features are available with standard linux tools
such as modetest from libdrm-tests.
rpi4:/ # vcgencmd display_power 0
display_power=1
rpi4:/ # setterm --powersave off
/system/bin/sh: setterm: inaccessible or not found
127|rpi4:/ # vbetool dpms off
/system/bin/sh: vbetool: inaccessible or not found
127|rpi4:/ # cd /sys/b
block/  bus/
127|rpi4:/ # cd /sys/class/backlight/
rpi4:/sys/class/backlight # ls
rpi4:/sys/class/backlight #
Short press on the power button will switch the display on/off like on any other Android device. If you want to do this in shell:
Code:
input keyevent KEYCODE_POWER

There's currently an issue with display blanking so the display is not switched off entirely. It looks like this is now fixed on upstream drm_hwcomposer so this should work again if/when there's another release.
 
  • Like
Reactions: haruka-k

KonstaT

Senior Member
Jan 20, 2016
807
466
KonstaKANG.com
New builds. H.264 hardware video decoding & encoding.


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

Xenox003

New member
Dec 19, 2022
4
1
Hi guys, i just discovered a new problem regarding to the Raspberry PI Build of LineageOS 20

Let me take it a little short here: Bluetooth Low Energy does not appear to work
Let me give a little more context here:

I use my Behringer Flow 8 Digital Mixer together with the FLOW Mix app in order to do live audio processing, i want to run the FLOW Mix app on my raspberry PI running with this build here.
Once i tried to connect i noticed some strange behaviour when attempting to establish the BLE connection.

See the attached Video: https://streamable.com/678a2d

It seems to be activating and deactivating bluetooth all the time, when trying to connect to the Mixer with my Phone it works fine.

After diving a little bit deeper into the problem i could also exclude the FLOW Mix app itself. I tested the BLE connection with some BLE tester app, again on my phone it worked fine, on the raspberry it could not connect.

Phone:
Screenshot_20230119_193452.jpg


Raspberry:
20230119_193631-min.jpg



Anyone ever had simmilar issues? Do yall have a working fix for that?
 
Last edited:

KonstaT

Senior Member
Jan 20, 2016
807
466
KonstaKANG.com
Hi guys, i just discovered a new problem regarding to the Raspberry PI Build of LineageOS 20

Let me take it a little short here: Bluetooth Low Energy does not appear to work
Let me give a little more context here:

I use my Behringer Flow 8 Digital Mixer together with the FLOW Mix app in order to do live audio processing, i want to run the FLOW Mix app on my raspberry PI running with this build here.
Once i tried to connect i noticed some strange behaviour when attempting to establish the BLE connection.

See the attached Video: https://streamable.com/678a2d

It seems to be activating and deactivating bluetooth all the time, when trying to connect to the Mixer with my Phone it works fine.

After diving a little bit deeper into the problem i could also exclude the FLOW Mix app itself. I tested the BLE connection with some BLE tester app, again on my phone it worked fine, on the raspberry it could not connect.

Phone: View attachment 5814627

Raspberry:
View attachment 5814629


Anyone ever had simmilar issues? Do yall have a working fix for that?
Android 13 switched to new gabeldorsche bluetooth stack so I'm not sure if everything is configured correctly just yet (see https://github.com/raspberry-vanilla/android_device_brcm_rpi4/blob/android-13.0/vendor.prop#L8-L32). Logcat would likely help to figure out the issue.

I've tested BLE on some previous Android version and it was working then at least.
 

Xenox003

New member
Dec 19, 2022
4
1
Android 13 switched to new gabeldorsche bluetooth stack so I'm not sure if everything is configured correctly just yet (see https://github.com/raspberry-vanilla/android_device_brcm_rpi4/blob/android-13.0/vendor.prop#L8-L32). Logcat would likely help to figure out the issue.

I've tested BLE on some previous Android version and it was working then at least.

Here is a Logcat dump of the point in time i tried to connect to the device with BLE: https://pastebin.com/WE7Pt3HE

Just from looking at it it seems the bluetooth service dies quite often like this:
Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 5353 (bt_stack_manage), pid 5307 (droid.bluetooth)

...

Abort message: 'assertion 'status == HidlStatus::SUCCESS' failed'
 

KonstaT

Senior Member
Jan 20, 2016
807
466
KonstaKANG.com
Here is a Logcat dump of the point in time i tried to connect to the device with BLE: https://pastebin.com/WE7Pt3HE

Just from looking at it it seems the bluetooth service dies quite often like this:
Yes, I was able to reproduce this with my BLE heart rate monitor as well. I don't have any quick fix for this, though.

I know BLE has worked in some older version because I've tested this before. You can try some of the older versions if you need BLE support or dig into the Raspberry Vanilla sources (https://github.com/raspberry-vanilla) and try to fix it with Android 13.
 

KonstaT

Senior Member
Jan 20, 2016
807
466
KonstaKANG.com
It seems Gapps 13 for Android TV are available:


BTW, has anybody tried using Geforce Now?
I tested this but it seems to be broken as it fails to copy the files.

This is because https://gitlab.com/MindTheGapps/vendor_gapps_tv/-/commit/6c102b26b149076b482ea9c18e39cafa654c7653 and if you revert that change (edit update-binary that's inside the zip) it seems to work. I don't know why that change was made and why it doesn't work with TWRP included in my builds.
 

Top Liked Posts

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


    -Android 13 QPR1
    -fix pixel format on H.264 hardware video decoding
    -enable H.264 hardware video encoding
    -update to Mesa 22.3.2
    -update to Linux 5.15.78 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    -Android security patch level: 5 January 2023 (merged)
    1
    hey i hope you are doing ok, i tried to edit the file as you mention but it fails to install, i got a black screen after factory wipe, also the GApps for android 12 it has been updated and is not possible to use those
    GApps any longer is giving the same issue that is not installing, any idea what other source can be used instead ether for Android 12 or 13 or if can you share the update-binary that had worked for you? thanks in advance mate.

    Hi viteliogt. I am just confirming that I have the same behaviour as you. I edited update-binary to roll back the change, and after factory wipe it shows the Lineage boot animation but stops there at a black screen and then bootloops. As far as the GApps for android 12 goes, is the prior release no longer available? I am sure there are many people who have a copy of that (including myself) in the worst case.
    1
    hey i hope you are doing ok, i tried to edit the file as you mention but it fails to install, i got a black screen after factory wipe, also the GApps for android 12 it has been updated and is not possible to use those
    GApps any longer is giving the same issue that is not installing, any idea what other source can be used instead ether for Android 12 or 13 or if can you share the update-binary that had worked for you? thanks in advance mate.

    Hi viteliogt. I am just confirming that I have the same behaviour as you. I edited update-binary to roll back the change, and after factory wipe it shows the Lineage boot animation but stops there at a black screen and then bootloops. As far as the GApps for android 12 goes, is the prior release no longer available? I am sure there are many people who have a copy of that (including myself) in the worst case.
    Old Android TV MindTheGapps releases are here: https://androidfilehost.com/?w=files&flid=335898

    Yeah, you're right. It wasn't quite that simple. I probably had some of the files copied to system partition from the original unmodified zip and some from the modified one. This needs further looking into.
    1
    Old Android TV MindTheGapps releases are here: https://androidfilehost.com/?w=files&flid=335898

    Yeah, you're right. It wasn't quite that simple. I probably had some of the files copied to system partition from the original unmodified zip and some from the modified one. This needs further looking into.

    It looks like it was also related to the changes regarding "Don't guard package removals and correct locations https://gitlab.com/MindTheGapps/vendor_gapps_tv/-/commit/ad363131a55c23b91dcebbf98cc8a960f1edcf68 as well.

    I did a diff of the "update-binary" from the old 12.1 release and the 13.0 release and this is the change that shows up aloing with the "/*" --> "/system/*" change. As an experiment I tried just using the old "update-binary" from old 12.1 (the same as in your link) and putting that in the package and IT SEEMS TO WORK NOW.
    It booted into ATV setup successfully.
  • 4
    Here’s my build of LineageOS 20 for Raspberry Pi 4 Model B, Pi 400, and Compute Module 4. It is unofficial and unsupported by the LineageOS team. It’s for advanced users only. Pi 4 model with at least 2GB of RAM is required to run this build.

    Important! This image includes parts that are licensed under non-commercial license (Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International). You may use this build freely in personal/educational/etc use. Commercial use is not allowed with this build! You can contact me by email to discuss creating customized Android builds for commercial purposes.

    Screenshot_20221109-122731_Settings.png


    There is also Android TV version available.

    Screenshot_20221109-103339_Settings.png


    Working:
    • Audio (HDMI, 3.5mm jack, USB microphones, bluetooth speakers/headphones, etc)
    • Audio DAC (using GPIO DACs e.g. Hifiberry DAC+)
    • Bluetooth (and bluetooth tethering)
    • Camera (using official Pi camera modules & UVC USB webcams)
    • GPIO
    • GPS (using external USB modules e.g. U-Blox 7)
    • Ethernet
    • Hardware accelerated graphics (V3D, OpenGL & Vulkan)
    • Hardware video decoding & encoding (H.264)
    • HDMI display (and HDMI-CEC)
    • I2C
    • IR remotes (using external GPIO IR modules e.g. TSOP4838)
    • RTC (using external GPIO I2C modules e.g. DS3231)
    • Sensors (using external GPIO I2C modules e.g. MPU6050, LSM6DS3, LSM303DLHC, BME280/BMP280, and APDS9930 accelerometer, gyroscope, magnetometer, temperature, pressure, humidity, ambient light, and proximity)
    • Serial console (using external GPIO serial console adapters e.g. PL2303)
    • SPI
    • Touchscreen/multi-touch (official 7" touchscreen, USB touchscreens, Waveshare SPI touchscreens)
    • USB (mouse, keyboard, storage, etc)
    • USB-C (ADB, MTP, PTP, USB tethering)
    • Wifi (and wifi tethering)

    Not working:
    • Hardware video decoding & encoding (H.265, software decoding & encoding works)

    Issues:
    • H.264 hardware video decoding is still glitchy (encoder seems to perform better)
    • Camcorder (i.e. recording videos) & some third party camera apps don't work with official Pi camera modules (works with UVC USB webcams)
    • SELinux is in permissive mode
    • Encrypting userdata is not supported
    • and more…

    Sources:

    Thanks:
    • Roman Stratiienko and GloDroid project
    • Peter Yoon and android-rpi project
    • AOSP reference board developers (dragonboard, hikey, yukawa)
    • Android-x86 project
    • LineageOS team and everyone who has contributed to LineageOS 20
    2
    I am an avid user of the Android app Tasker and it would be awesome if you and Joao (Tasker dev) got together and found a way for Tasker to use GPIO pins as contexts or outputs.
    I'm not a Tasker user so I'm not exactly sure what you mean by "contexts or outputs". AFAIK you can make Tasker execute shell scripts that you can use to control the GPIO.
    One of the issues listed is
    • SELinux is in permissive mode
    I have an issue with my Google Chromecast with Google TV as it runs Android 10 which introduced a SELinux policy to stop the Android 'sendevent' command from working. Why do I need that? I'm integrating the stick into home assistant home automation

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

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

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

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

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

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

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

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

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

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

    9.11. changelog:
    • initial LineageOS 20 release
    • Vulkan 1.2 (thanks to people at Igalia for Vulkan 1.2 conformance and Roman Stratiienko for latest Mesa fixes)
    • fix Vulkan related issue on Chromium-based browsers
    • add support for virtualization
    • enable multi-gen LRU
    • update to TWRP 3.7.0_11-0-KonstaKANG
    • update to Mesa 22.2.3
    • new Raspberry Pi Android kernel bring-up based on AOSP android13-5.15-lts
    • update to Linux 5.15.74 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    • Android security patch level: 5 November 2022 (merged)

    Previous builds:
    1
    Thanks for your work!

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

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