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

Search This thread

KonstaT

Senior Member
Jan 20, 2016
723
438
KonstaKANG.com
Attaching the 2 logcats on paramount plus. And also attaching the logcat on AppleTV.
Thanks for the logs.

Apple TV seems to be DRM releated issue. It also seems that there is no regular mobile version of Apple TV app available. Android TV versions usually have more restrictions on device certification (e.g. regular mobile Netflix works while the Android TV version doesn't).

With a quick glance not sure what's up with Paramount Plus. There seems to be one native library missing (libbrotli_native.so) that is gapps related. Likely unrelated if it's only choppy playback/buffering you're experiencing.
 

kunjalr

Member
Dec 29, 2006
5
0
@KonstaT - First off - thanks a million for your work. So so so helpful for the community!

I'm having a peculiar problem. I'm using a Waveshare 7.9" 400x1280 HDMI display. I have both, a RPi 3B as well as a 4B. While the 3B boots perfectly, I cannot boot the 4B with the same settings.

With the 3B,
- with your 3B LOS 17.1 image
- with the manufacturer timings
I am able to boot perfectly

With the 4B
- with your 4B LOS image (17.1, 18.1, 19 - regular and ATV variants)
- with the same manufacturer timings
I am simply unable to get to the LOS boot animation. I will see the RPi boot screen (Raspberry+text), which fades away as though the HDMI timings were wrong.

Note: I am able to boot the official Debian based RPi OS perfectly fine on the 4B with the same timings.

I've compared the 3B LOS and 4B LOS Config files and they look identical (of course except 4B has HDMI 0 and 1)
I've also used a microHDMI-HDMI adapter instead of the PCB adapter to rule out faulty traces.

Any thoughts on what might be going wrong?
 

KonstaT

Senior Member
Jan 20, 2016
723
438
KonstaKANG.com
@KonstaT - First off - thanks a million for your work. So so so helpful for the community!

I'm having a peculiar problem. I'm using a Waveshare 7.9" 400x1280 HDMI display. I have both, a RPi 3B as well as a 4B. While the 3B boots perfectly, I cannot boot the 4B with the same settings.

With the 3B,
- with your 3B LOS 17.1 image
- with the manufacturer timings
I am able to boot perfectly

With the 4B
- with your 4B LOS image (17.1, 18.1, 19 - regular and ATV variants)
- with the same manufacturer timings
I am simply unable to get to the LOS boot animation. I will see the RPi boot screen (Raspberry+text), which fades away as though the HDMI timings were wrong.

Note: I am able to boot the official Debian based RPi OS perfectly fine on the 4B with the same timings.

I've compared the 3B LOS and 4B LOS Config files and they look identical (of course except 4B has HDMI 0 and 1)
I've also used a microHDMI-HDMI adapter instead of the PCB adapter to rule out faulty traces.

Any thoughts on what might be going wrong?
Please read the FAQ. You need to use a HDMI display that reports resolutions it supports via EDID.

hdmi_* options in config.txt have no effect with KMS driver that is used hw accelerated graphics on Android builds (LineageOS 17/18/19 on Pi 3 or Pi 4).
 

kunjalr

Member
Dec 29, 2006
5
0
Please read the FAQ. You need to use a HDMI display that reports resolutions it supports via EDID.

hdmi_* options in config.txt have no effect with KMS driver that is used hw accelerated graphics on Android builds (LineageOS 17/18/19 on Pi 3 or Pi 4).

The display is, in fact, an HDMI display that reports resolution via EDID.

I figured it out over the weekend. The way the HDMI section in config.txt is written, makes it seem like all settings are applied to both HDMI0 as well as HDMI1.

[HDMI:0] [HDMI:1] Default configs [all]

This is incorrect and misleading. Any settings added/adjusted here will only apply to HDMI1.

After adding the required timings, I found the OS would still only boot when a TV was connected, but it wouldn't complete the boot until I connected the Waveshare display. Commenting out #[HDMI:1] allowed the system to apply all settings to [HDMI:0] and boot fine.
 

KonstaT

Senior Member
Jan 20, 2016
723
438
KonstaKANG.com
The display is, in fact, an HDMI display that reports resolution via EDID.

I figured it out over the weekend. The way the HDMI section in config.txt is written, makes it seem like all settings are applied to both HDMI0 as well as HDMI1.

[HDMI:0] [HDMI:1] Default configs [all]

This is incorrect and misleading. Any settings added/adjusted here will only apply to HDMI1.

After adding the required timings, I found the OS would still only boot when a TV was connected, but it wouldn't complete the boot until I connected the Waveshare display. Commenting out #[HDMI:1] allowed the system to apply all settings to [HDMI:0] and boot fine.
That should apply to both (https://www.raspberrypi.com/documentation/computers/config_txt.html#combining-conditional-filters).

hdmi_* options in config.txt have no effect KMS driver that is used hw accelerated graphics on Android builds (these are only here for TWRP that doesn't use hw accelerated graphics). Only option that matters there is the overscan. Likely something else was wrong at your end.
 

Nagispace

New member
Aug 20, 2018
3
0
Hello I have an issue
Install is successful but it seems I can't get into system setting menu.
It always opens network settings
 

KonstaT

Senior Member
Jan 20, 2016
723
438
KonstaKANG.com
Hello I have an issue
Install is successful but it seems I can't get into system setting menu.
It always opens network settings
Assuming you mean the Android TV build.

Android TV is not intended to be used with a mouse or a touchscreen. You need to have a remote to navigate the system (USB remote, Bluetooth remote, IR remote, TV's remote using HDMI-CEC, arrow keys on your keyboard, etc).
 

andele78

New member
Jun 17, 2022
3
0
Hello, everyone,
I connected a KY-040 with a Raspi 4B (LineageOS 18.1) for volume and switching off.
This is also enabled in the settings, if I turn the controller back and forth it moves much too slowly.

Does somebody has any idea?

rasp4b_ky040.jpg
 

KonstaT

Senior Member
Jan 20, 2016
723
438
KonstaKANG.com
Hello, everyone,
I connected a KY-040 with a Raspi 4B (LineageOS 18.1) for volume and switching off.
This is also enabled in the settings, if I turn the controller back and forth it moves much too slowly.

Does somebody has any idea?

View attachment 5683771
Hardware power/volume keys use gpio-key driver which is not intended for rotary encoders. It just sends a key event when the GPIO pin it uses is connected to ground. I guess that would depend how the hardware is implemented on the rotary encoder.
 

Strel0ka

Member
Jan 11, 2018
25
5
When i try to setup AuroraDroid and grant the "External Storage Manager" Permission, the app crashes with this error in the log:

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.MANAGE_ALL_FILES_ACCESS_PERMISSION }
Since this is LineageOS 18.1, which itself is based on Android 11, shouldn't this work?

Also, when I try to setup a VPN app, the app hangs and/or crashes, I get this error in the log:

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.EditText.setText(java.lang.CharSequence)' on a null object reference

This results in your Android 11/12 AndroidTV ROMs for the Raspi 4 (had the same issue with your LOS 19 ROM) being basically unusable for me. I installed Magisk, patched signature spoofing and installed MicroG thinking that maybe the ROM depends on GAPPS, but the issues persist. Any idea why that could be?


Edit:

It all works on your regular Android ROM, this seems to be a limitation of AndroidTV in general. Very unfortunate for my use case, but with the right launcher it should still be fine.
 
Last edited:

KonstaT

Senior Member
Jan 20, 2016
723
438
KonstaKANG.com
When i try to setup AuroraDroid and grant the "External Storage Manager" Permission, the app crashes with this error in the log:


Since this is LineageOS 18.1, which itself is based on Android 11, shouldn't this work?

Also, when I try to setup a VPN app, the app hangs and/or crashes, I get this error in the log:



This results in your Android 11/12 AndroidTV ROMs for the Raspi 4 (had the same issue with your LOS 19 ROM) being basically unusable for me. I installed Magisk, patched signature spoofing and installed MicroG thinking that maybe the ROM depends on GAPPS, but the issues persist. Any idea why that could be?


Edit:

It all works on your regular Android ROM, this seems to be a limitation of AndroidTV in general. Very unfortunate for my use case, but with the right launcher it should still be fine.
As you already figured out Android TV is trimmed/dumbed down version of Android designed for its specific purpose. Use the regular tablet UI builds if you want to do anything productive.
 

Mingala

New member
Sep 4, 2022
1
1
For some reason I cannot get my Google TV remote to pair on my RPi 4.
When I start searching for accessories, the Google TV remote is detected but when I click on it to pair, after a few seconds it says 'Couldn't pair'.

Already did a factory reset on the remote but no success.
Remote still works with my Google TV dongle.

Any ideas on how I can fix/troubleshoot this?
Same problem, but found a workaround to make pairing work after a "minimal" custom install of tvmini OpenGApps.
Please see my post in OpenGApps Github issue 915
 
  • Like
Reactions: KonstaT

kyo-kusanagi

Member
Sep 5, 2022
6
1

LineageOS 18.1 (Android 11) for Raspberry Pi 4 B with hifiberry-digi:​

Thanks for this great rom for rpi. I have followed all the threads and despite all the various configurations I have not been able to activate my hifiberry-digi card with lineage OS 17 & 18. It gives me the idea that it is disabled on the kernel side although I hope I'm wrong because trying to recompile the kernel (https://github.com/lineage-rpi/android_kernel_brcm_rpi/issues/10) I am having problems recompiling. By the way, the "android_kernel_brcm_rpi" kernel (from GitHub) has "lineageos_rpi4_defconfig" already configured correctly. Hope you can help me activate it.
This is my config.txt:

# Audio
dtparam=audio=on
audio_pwm_mode=2
disable_audio_dither=1
#hdmi_force_edid_audio=1
hdmi_ignore_edid_audio=1
[all]

# Audio DAC
dtoverlay=hifiberry-digi

With or without Comment "dtparam = audio = on" hasn't changed anything

Thank you and hear from us
 

KonstaT

Senior Member
Jan 20, 2016
723
438
KonstaKANG.com

LineageOS 18.1 (Android 11) for Raspberry Pi 4 B with hifiberry-digi:​

Thanks for this great rom for rpi. I have followed all the threads and despite all the various configurations I have not been able to activate my hifiberry-digi card with lineage OS 17 & 18. It gives me the idea that it is disabled on the kernel side although I hope I'm wrong because trying to recompile the kernel (https://github.com/lineage-rpi/android_kernel_brcm_rpi/issues/10) I am having problems recompiling. By the way, the "android_kernel_brcm_rpi" kernel (from GitHub) has "lineageos_rpi4_defconfig" already configured correctly. Hope you can help me activate it.
This is my config.txt:

# Audio
dtparam=audio=on
audio_pwm_mode=2
disable_audio_dither=1
#hdmi_force_edid_audio=1
hdmi_ignore_edid_audio=1
[all]

# Audio DAC
dtoverlay=hifiberry-digi

With or without Comment "dtparam = audio = on" hasn't changed anything

Thank you and hear from us
Kernel already has drivers enabled for all Hifiberry DACs.

You shouldn't be modifying config.txt manually. Select Settings -> System -> Raspberry Pi settings -> Audio device -> DAC & Settings -> System -> Raspberry Pi settings -> DAC -> Hifiberry Digi/Digi+.

If that doesn't work, attach 'dmesg' output on booting the device and 'cat /proc/asound/cards' to check that the DAC is detected as an ALSA device.
 

kyo-kusanagi

Member
Sep 5, 2022
6
1
Kernel already has drivers enabled for all Hifiberry DACs.

You shouldn't be modifying config.txt manually. Select Settings -> System -> Raspberry Pi settings -> Audio device -> DAC & Settings -> System -> Raspberry Pi settings -> DAC -> Hifiberry Digi/Digi+.

If that doesn't work, attach 'dmesg' output on booting the device and 'cat /proc/asound/cards' to check that the DAC is detected as an ALSA device.

Thank you so much for your quick reply, I refleshed for safety, I set from Settings -> System -> Raspberry Pi settings -> Audio device -> DAC & Settings -> System -> Raspberry Pi settings -> DAC -> Hifiberry Digi / Digi +. It does not work. From the terminal I started "cat" and it doesn't actually load hifiberry-digi.
 

Attachments

  • img.jpg
    img.jpg
    169.9 KB · Views: 3

KonstaT

Senior Member
Jan 20, 2016
723
438
KonstaKANG.com
Thank you so much for your quick reply, I refleshed for safety, I set from Settings -> System -> Raspberry Pi settings -> Audio device -> DAC & Settings -> System -> Raspberry Pi settings -> DAC -> Hifiberry Digi / Digi +. It does not work. From the terminal I started "cat" and it doesn't actually load hifiberry-digi.
Did you reboot your device in between?

Then 'dmesg' to give clues as for why it's not detected.
 

KonstaT

Senior Member
Jan 20, 2016
723
438
KonstaKANG.com
Yes, I rebooted, I don't know how to extrapolate the demsg output of the terminal in full, meanwhile I'll show you a detail if it can help you
If you're using some terminal application you can write to a file (e.g. 'dmesg > /sdcard/dmesg.txt'). If you're using ADB/SSH/serial console you can also copy the full output from the terminal window on your computer.
 

kyo-kusanagi

Member
Sep 5, 2022
6
1
If you're using some terminal application you can write to a file (e.g. 'dmesg > /sdcard/dmesg.txt'). If you're using ADB/SSH/serial console you can also copy the full output from the terminal window on your computer.
from the local terminal tells me
dmesg > /sdcard/dmesg.txt
/ system / bin / sh: cant´t create /sdcard/dmesg.txt: operation not permitted
su
/ system / bin / sh: inaccessible or not found
lsblk
/ system / bin / sh: inaccessible or not found
 

KonstaT

Senior Member
Jan 20, 2016
723
438
KonstaKANG.com
from the local terminal tells me
dmesg > /sdcard/dmesg.txt
/ system / bin / sh: cant´t create /sdcard/dmesg.txt: operation not permitted
su
/ system / bin / sh: inaccessible or not found
lsblk
/ system / bin / sh: inaccessible or not found
Writing to sdcard works in 'adb shell' even without root. Apps apparently can't as they're not allowed to write outside their own directories in recent Android versions. if you need root (su) please read the relevant FAQ section how to achieve that.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    For some reason I cannot get my Google TV remote to pair on my RPi 4.
    When I start searching for accessories, the Google TV remote is detected but when I click on it to pair, after a few seconds it says 'Couldn't pair'.

    Already did a factory reset on the remote but no success.
    Remote still works with my Google TV dongle.

    Any ideas on how I can fix/troubleshoot this?
    Same problem, but found a workaround to make pairing work after a "minimal" custom install of tvmini OpenGApps.
    Please see my post in OpenGApps Github issue 915
    1
    Great thanks, fine with ADB / SSH / serial console.
    There he is:
  • 24
    Here’s my build of LineageOS 18.1 for Raspberry Pi 4 Model B, Pi 400, and Compute Module 4. It is unofficial and unsupported by the LineageOS team. It’s for advanced users only. Pi 4 model with at least 2GB of RAM is required to run this build.

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

    Screenshot_20210104-104810_Settings.png


    There is also Android TV version available.

    Screenshot_20210306-163341_Settings.png


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

    Not working:
    • Hardware video decoding & encoding (software decoding & encoding works)

    Issues:
    • Stock camera app is not working - many third party camera apps seem to work
    • SELinux is in permissive mode
    • and more…

    Sources:

    Thanks:
    • Peter Yoon and android-rpi project
    • Roman Stratiienko and GloDroid project
    • AOSP reference board developers (dragonboard, hikey, yukawa)
    • E. Anholt for V3D graphics driver
    • Maxime Ripard for Pi 4 KMS driver
    • Android-x86 project
    • LineageOS team and everyone who has contributed to LineageOS 18.1
    5
    New build.

    -add support for LSM303DLHC accelerometer & magnetometer sensor
    -add separate TWRP flashable su add-on (see FAQ)
    -allow switching display off with power button
    -add support for USB-C (ADB, MTP, PTP, USB-tethering)
    -enable bluetooth tethering
    -add settings option for mouse back button feature
    -update to TWRP 3.5.0_9-0-KonstaKANG
    -update to Mesa 20.3.4
    -update to Linux 5.4.98 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    -Android security patch level: 5 February 2021 (merged)
    4
    How to install:
    1. Follow the official Raspberry Pi instructions for writing the image to the SD card.
    If you’re running a recent build (20220121 or newer) you can also update to newer builds using TWRP flashable OTA packages. OTA updates pushed through the built-in Updater app are stored at /data/lineageos_updates/.
    1. Download lineage-18.1-xxxxxxxx-UNOFFICIAL-KonstaKANG-rpi4-ota.zip and save it to your device’s internal storage or use an external USB drive
    2. Boot to TWRP recovery (see FAQ)
    3. Install lineage-18.1-xxxxxxxx-UNOFFICIAL-KonstaKANG-rpi4-ota.zip from your selected storage
    4. (Flash Magisk/other add-ons you had previously installed)
    5. Boot out of recovery (see FAQ)
    Changes that are backed up and restored flashing OTAs:
    • Device specific settings changed using Settings -> System -> Raspberry Pi settings
    • Manual changes to /boot/resolution.txt and /boot/rc_keymap.txt
    • USB boot configuration in /boot/config.txt
    • GApps
    Changes that are not backed up and restored flashing OTAs:
    • Manual changes to /boot/config.txt (and any other manual changes to /boot partition)
    • Magisk

    FAQ:

    FAQ is getting quite long and difficult to maintain in several different places. You can find the always up-to-date FAQs here:
    https://konstakang.com/devices/rpi4/LineageOS18/
    https://konstakang.com/devices/rpi4/LineageOS18-ATV/
    4
    New builds.


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

    ---


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

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