[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 Note 20
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
840
491
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
840
491
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
840
491
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
840
491
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
840
491
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
840
491
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
840
491
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
840
491
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.
  • 2
    New builds.


    • Android 13 QPR2
    • HDMI audio improvements
      • implement audio HAL that uses alsa directly to get rid off using alsa loopback for HDMI audio (thanks to nename0)
      • update alsa-lib and alsa-utils to v1.2.8
    • update to libcamera master/v0.0.4
      • fix camcorder (i.e. recording videos) with Pi camera modules
      • add support for Pi camera module v3 (untested)
    • use USB audio input for camcorder videos with the built-in camera application
    • update to FFmpeg 5.1.3
    • update to Mesa 22.3.7
    • update to Linux 5.15.94 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    • Android security patch level: 5 March 2023 (merged)
    1
    I installed ATV 13 as well as 12. It boots fine but when I install gapps > factory reset > reboot to system

    I end up with a blank screen with green wallpaper, I can adjust the volume, see the mouse arrow moving but nothing else is possible.

    Need some help here please.


    NVM found that the gapps are broken. :/
    1
    Well, i used the "fixed" gapps zip for the tv version of your rom. Yesterday i flashed the update and your magisk zip. The play store is not in the app list. There's this "panel" where you can see the "get more apps" and "get more games" buttons. Only the games is present now and when i click on it, the google play games app is shows an error. I'll try to downloand and flash the gapps zip again today after work.
    Well, I don't know what "fixed" package you've used but copying the backup script was also broken until it was fixed pretty recently (https://gitlab.com/MindTheGapps/vendor_gapps_tv/-/commit/763e0a6e0e40e90e373f841d2a73d66a5d1ddc5b).

    There are new MindTheGapps Android TV releases yesterday (20230321) that are now working on the Pi 4 as well so use the latest package.
    1
    Anyone was able to pair a PS4 controller over Bluetooth with LineageOS 20.0 ? Mine hangs on pairing.. Is this related with the new gabeldorsche bluetooth stack ?
    Something with the bluetooth stack introduced in Android 13 certainly doesn't play nice with Pi bluetooth firmware. As commented on the AOSP13 topic (https://forum.xda-developers.com/t/...raspberry-pi-4-b.4481977/page-5#post-88301805) there's a new bluetooth firmware available. It seems to fix connecting BLE devices in Android 13 but overall bluetooth seems more unstable than with the older firmware that is included in this build by default.
    1
    The fixed package the one linked here or in your website's comments with the fixed install script :)

    So, I was able to test the latest mindthagapps before work today morning. Here are the results:


    Play Store is back. There was a notification that said I need to sign back in. I was able to update apps.
    Google Play Movies and Games crashed when I tried to open them. Force close, clear cache and data, still crashing. I had to uninstall them and redownload from the store. Now they are working.

    Live Channels app is the same, but after the redownload it was still crashing at the "choose source" window. After a reboot it's working angain but it see 2 GPMovies source, one of them shows an error like "no source from this app", the other is working.

    GBoard looks okay, it shows the keyboard.

    I don't have any other app from Google just like tv setup, etc. I'm using SmartTubeNext instead of Youtube, so I wasn't able to test if any other google apps has the same error.

    Spotify is working.


    Right now, it looks fine. The double source in Live Channels is bothering me just a little, but it's fine. I'll wait for the next OTA update to test if the gapps will work after the update or not. Regardless of the result, I'll reinstall everything from scratch.
    If you've booted without GApps in between, you need to do a factory reset in any case.

    There's no need to wait any new update to test this. You can just flash the OTA package of the latest build over and over again. But preserving the GApps does work with the latest MindTheGapps Android TV package.
  • 5
    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.265 decoding, H.264 decoding & encoding)
    • 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)

    Issues:
    • Hardware video decoding performance varies depending on the selected decoder option and video resolution/bitrate/profile/container/etc
    • 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
    3
    New builds. H.265 hardware video decoding, H.264 hardware video decoding and encoding!


    • H.265 hardware video decoding, H.264 hardware video decoding and encoding
      • FFmpeg 5.1.2 (thanks to John Cox for Raspberry Pi hw codecs support and Android-x86 for AOSP build patches)
      • implement codec2 plugin to integrate FFmpeg into Android multimedia framework (thanks to Michael Goffioul)
      • FFmpeg hevc_v4l2request hwaccel H.265 hw decoding (default), h264_v4l2m2m H.264 hw decoding (optional)
      • v4l2_codec2 H.264 hardware video decoding and encoding (default)
      • FFmpeg software decoders support
    • update to Mesa 22.3.5
    • update to Linux 5.15.92 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    • Android security patch level: 5 February 2023 (merged)
    2
    New builds.


    • Android 13 QPR2
    • HDMI audio improvements
      • implement audio HAL that uses alsa directly to get rid off using alsa loopback for HDMI audio (thanks to nename0)
      • update alsa-lib and alsa-utils to v1.2.8
    • update to libcamera master/v0.0.4
      • fix camcorder (i.e. recording videos) with Pi camera modules
      • add support for Pi camera module v3 (untested)
    • use USB audio input for camcorder videos with the built-in camera application
    • update to FFmpeg 5.1.3
    • update to Mesa 22.3.7
    • update to Linux 5.15.94 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    • Android security patch level: 5 March 2023 (merged)
    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