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

Search This thread

KonstaT

Senior Member
Jan 20, 2016
425
285
KonstaKANG.com
Two questions
1. Do I need to do anything to enable this? I was using libreelec previously and HDMI-CEC was working with my TV/remote (TCL) so I know it is at least capable, but I get no response in LineageOS
2. Does this also work in the LineagOS 18.1 Android TV version?
1. Does your TV have a CEC menu where you can select the device? That's needed with my TV at least.

There's been some other reports as well that this isn't working with some TVs. There's also another (actually the proper) way I can do HDMI-CEC but I had issues it with my TV if there was more than one CEC device connected. Maybe I'll try that in some future release if people generally have issues with the current approach.

2. If/when there's another Android TV build, it will have CEC support in some form.
 

KonstaT

Senior Member
Jan 20, 2016
425
285
KonstaKANG.com
can i use another GPIO for powerbutton ? (i already installed a button at GPIO 3 for all my other roms)
Yes, you can basically use any GPIO pin for this (unless it's already used for something else). See /boot/config.txt under 'Keys' section how this is implemented.

GPIO3 is used by I2C (which is enabled by default on my builds) so you might need to disable that as well.
 

kiai.72

Member
Apr 24, 2021
13
1
Yes, you can basically use any GPIO pin for this (unless it's already used for something else). See /boot/config.txt under 'Keys' section how this is implemented.

GPIO3 is used by I2C (which is enabled by default on my builds) so you might need to disable that as well.
it works! i had to disable i2c + set the "keys" -> works! Thank you.

May i ask you about microphone again: i noticed now:
- in chrome (dev): camera works - microphone (USB, bluetooth, i tried a lot of microphones) does not work, but
- in firefox both works!

I wonder why the apps behave so different? What i really want to do is: videoconferencing via WEBRTC. meet.jit.si finally works in firefox now. Zoom crashes as soon i start the camera. web.Skype.com does not support firefox.
So actually i should better use chrome for webrtc - since most people recommend it when it comes to webrtc. But as long i have this microphone issue, i can't.

What can i do to get the microphone i chrome working ?
 

tcberg2010

Senior Member
Apr 12, 2010
555
17
North Carolina
Installed this yesterday and I love how snappy it is. Will work perfect for my man cave. I did have a few possible problems I wanted to see if others have, or if there is a fix.

1. I can't stream content higher then 720p. Anything higher and the video freezes immediately with audio playing in background. I've tested with both wireless (50M download) and Wired (300M download) and had the same issue with each.
2. There is a thin bar on the left border of my screen that is actually what should be on the far right of the screen. I've tested on numerous screens with the same issue.

Any help is appreciated.
 

KonstaT

Senior Member
Jan 20, 2016
425
285
KonstaKANG.com
Installed this yesterday and I love how snappy it is. Will work perfect for my man cave. I did have a few possible problems I wanted to see if others have, or if there is a fix.

1. I can't stream content higher then 720p. Anything higher and the video freezes immediately with audio playing in background. I've tested with both wireless (50M download) and Wired (300M download) and had the same issue with each.
2. There is a thin bar on the left border of my screen that is actually what should be on the far right of the screen. I've tested on numerous screens with the same issue.

Any help is appreciated.
1. Stream what from where and how? You would need to a bit more precise than that and please attach appropriate logs as well (logcat in this case). E.g. YouTube streams 1080p videos just fine. This build only supports software video decoding so the performance depends on the video codec that is used.

2. The one pixel shift is a known issue with the kernel KMS driver (https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=288234). This only happens with some displays, though. IIRC someone workaround this by adjusting overscan options in config.txt.
 

tcberg2010

Senior Member
Apr 12, 2010
555
17
North Carolina
1. Stream what from where and how? You would need to a bit more precise than that and please attach appropriate logs as well (logcat in this case). E.g. YouTube streams 1080p videos just fine. This build only supports software video decoding so the performance depends on the video codec that is used.

2. The one pixel shift is a known issue with the kernel KMS driver (https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=288234). This only happens with some displays, though. IIRC someone workaround this by adjusting overscan options in config.txt.
Thanks for the response. I'll grab the logs next time I fire it up. I was streaming from both the YouTube app as well as from Twitch w/ 4GB Pi4. I did further testing later and 1080p YouTube streaming worked from Puffin TV Browser, but won't go above 720p in the app (TV Stock GAPPS).

I'll checkout the overscan fix, thanks again.
 

skero232

New member
  • Jun 15, 2021
    3
    0
    Hi, im new to raspberry pi and lineage OS. I have succesfully installed it on Rpi4 but every time i disconnect monitor, raspberry turns off. Is there any way I can keep it up and running without monitor?
     

    KonstaT

    Senior Member
    Jan 20, 2016
    425
    285
    KonstaKANG.com
    Hi, im new to raspberry pi and lineage OS. I have succesfully installed it on Rpi4 but every time i disconnect monitor, raspberry turns off. Is there any way I can keep it up and running without monitor?
    Android builds on the Pi use KMS driver which relies on EDID information from connected HDMI device to configure the display. No, your device doesn't shut down but Android graphics drivers crash if you unplug the HDMI (and keep crashing until you reconnect it).

    One option is to get a dummy HDMI adapter/plug if you don't want to have an actual display connected.
     
    Last edited:

    skero232

    New member
  • Jun 15, 2021
    3
    0
    Android builds on the Pi use KMS driver which relies on EDID information from connected HDMI device to configure the display. No, your device doesn't shut down but Android graphics drivers crash if you unplug the HDMI (and keep crashing until you reconnect it).

    One option is the get a dummy HDMI adapter/plug if you don't want to have an actual display connected.
    Okay thank you for the suggesiton and explanation, but before i get a dummy HDMI is there any way that I could make drivers not crash with a change in software? I am trying not to use physical solutions because Rpi will be left outside and I don't want random people seeing HDMI dummy and taking it...
     

    KonstaT

    Senior Member
    Jan 20, 2016
    425
    285
    KonstaKANG.com
    Okay thank you for the suggesiton and explanation, but before i get a dummy HDMI is there any way that I could make drivers not crash with a change in software? I am trying not to use physical solutions because Rpi will be left outside and I don't want random people seeing HDMI dummy and taking it...
    I'm not aware of any software solution that will work with this build. You can use earlier versions with SwiftShader software renderer which doesn't rely on any connected display (LineageOS 16 uses SwiftShader by default, LineageOS 17 has an option to use it).

    Would't they just rather take the whole Pi (or any other connected peripheral)? These types of dummy adapters seem to go for little over 1€ off of eBay.
     

    skero232

    New member
  • Jun 15, 2021
    3
    0
    I'm not aware of any software solution that will work with this build. You can use earlier versions with SwiftShader software renderer which doesn't rely on any connected display (LineageOS 16 uses SwiftShader by default, LineageOS 17 has an option to use it).

    Would't they just rather take the whole Pi (or any other connected peripheral)? These types of dummy adapters seem to go for little over 1€ off of eBay.
    Okay I will try to work with swiftshader, if I get lost I'll just get a dummy adapter. Thanks for everything.
     

    startechi

    Member
    Jun 16, 2021
    5
    0
    Hi, I have installed LineageOS 18.1 on Raspberry Pi 4 model B. I have a Duinotech NEO-7M GPIO GPS module with onboard antenna, link below.


    I can't get this GPS receiver to work. I assume this could be due to missing drivers, serial use conflict, UART config or other configuration. I have tried disable serial use by the system in advanced settings followed by reboot with no resolve. I used the following guides to try get the GPS to work. Please assist with this issue.

     

    KonstaT

    Senior Member
    Jan 20, 2016
    425
    285
    KonstaKANG.com
    Hi, I have installed LineageOS 18.1 on Raspberry Pi 4 model B. I have a Duinotech NEO-7M GPIO GPS module with onboard antenna, link below.


    I can't get this GPS receiver to work. I assume this could be due to missing drivers, serial use conflict, UART config or other configuration. I have tried disable serial use by the system in advanced settings followed by reboot with no resolve. I used the following guides to try get the GPS to work. Please assist with this issue.

    See previous discussion about using serial GPIO GPS device: http://disq.us/p/2efdofm

    So, you need to change value of 'ro.kernel.android.gps' property in /vendor/build.prop to 'ttyS0' and remove 'console=ttyS0,115200' from /boot/cmdline.txt. Necessary uevent permissions have been already added since that discussion.
     

    startechi

    Member
    Jun 16, 2021
    5
    0
    Thanks, changing the values in build.prop and cmdline.txt enables the GPS to work.

    Bluetooth becomes an issue once GPS is enabled. Has there been a fix to allow Bluetooth to work at the same time as GPS ?
     

    KonstaT

    Senior Member
    Jan 20, 2016
    425
    285
    KonstaKANG.com
    Thanks, changing the values in build.prop and cmdline.txt enables the GPS to work.

    Bluetooth becomes an issue once GPS is enabled. Has there been a fix to allow Bluetooth to work at the same time as GPS ?
    Bluetooth uses its own UART so this shouldn't be any problem.

    You're now using the UART that is normally used for serial console for GPS. There's no known problem with using serial console and Bluetooth at the same time at least.
     

    startechi

    Member
    Jun 16, 2021
    5
    0
    I also have the same understanding of system console and bluetooth using separate UART. I have tried a clean system with same outcome. Additionally I did attempt moving:
    • Bluetooth from /dev/ttyAMA0 to /dev/ttyS0 using dtoverlay=miniuart-bt
    • GPS from /dev/ttyS0 to /dev/ttyAMA0.

    This previous post you shared also ended up with a bluetooth issue: http://disq.us/p/2efdofm
     

    KonstaT

    Senior Member
    Jan 20, 2016
    425
    285
    KonstaKANG.com
    I also have the same understanding of system console and bluetooth using separate UART. I have tried a clean system with same outcome. Additionally I did attempt moving:
    • Bluetooth from /dev/ttyAMA0 to /dev/ttyS0 using dtoverlay=miniuart-bt
    • GPS from /dev/ttyS0 to /dev/ttyAMA0.

    This previous post you shared also ended up with a bluetooth issue: http://disq.us/p/2efdofm
    Check logs (logcat) if there's difference with/without the GPS enabled.
     

    startechi

    Member
    Jun 16, 2021
    5
    0
    Check logs (logcat) if there's difference with/without the GPS enabled.
    I have done two tests. One with GPS enabled by changing required values in /boot/cmdline and /vendor/build.prop. The second is the default configuration, clean install. Both have GPS hardware connected to GPIO 14, 15, 18 and power pins 2 and 14.

    Bluetooth works in the default configuration but not when GPS configuration is added. There isn't much in logcat to differentiate the two setups. Logcat on both is filled with the following messages:

    06-18 21:45:06.884 4472 4484 E ndroid.termina: failed to connect to jdwp control socket: Connection refused
    06-18 21:45:08.884 4472 4484 E ndroid.termina: failed to connect to jdwp control socket: Connection refused
    06-18 21:45:10.884 4472 4484 E ndroid.termina: failed to

    However dmesg shows bluetooth failing when GPS is enabled as shown in the following log highlights.

    GPS enabled:

    [ 44.682191] type=1400 audit(1618133784.379:82): avc: denied { open } for comm="crash_dump32" path="/dev/__properties__/u:eek:bject_r:bluetooth_a2dp_offload_prop:s0" dev="tmpfs" ino=9235 scontext=u:r:crash_dump:s0 tcontext=u:eek:bject_r:bluetooth_a2dp_offload_prop:s0 tclass=file permissive=1
    [ 44.756880] logd: logdr: UID=1002 GID=1002 PID=972 n tail=50 logMask=8 pid=521 start=0ns timeout=0ns
    [ 44.759973] type=1400 audit(1618133784.379:83): avc: denied { getattr } for comm="crash_dump32" path="/dev/__properties__/u:eek:bject_r:bluetooth_a2dp_offload_prop:s0" dev="tmpfs" ino=9235 scontext=u:r:crash_dump:s0 tcontext=u:eek:bject_r:bluetooth_a2dp_offload_prop:s0 tclass=file permissive=1
    [ 45.326802] init: Untracked pid 972 exited with status 0
    [ 45.348707] init: Untracked pid 974 exited with status 0
    [ 45.365064] binder: release 521:731 transaction 33030 out, still active
    [ 45.385143] binder: release 521:846 transaction 33392 in, still active
    [ 45.404784] binder: release 521:846 transaction 22691 out, still active
    [ 45.425833] binder: send failed reply for transaction 33392 to 212:212
    [ 45.448261] binder: 212:212 transaction failed 29189/0, size 4-0 line 2624
    [ 45.470473] binder: send failed reply for transaction 22691, target dead
    [ 45.569464] binder: release 212:212 transaction 33030 in, still active
    [ 45.572073] init: Untracked pid 990 exited with status 0
    [ 45.591166] binder: send failed reply for transaction 33030, target dead
    [ 45.605574] init: Service 'btrpi-1.0' (pid 212) received signal 6
    [ 45.625895] binder: undelivered death notification, 00000000adec0b00
    [ 45.643549] init: Sending signal 9 to service 'btrpi-1.0' (pid 212) process group...
    [ 45.686627] libprocessgroup: Successfully killed process cgroup uid 1002 pid 212 in 0ms
    [ 45.713106] init: Untracked pid 992 exited with status 0
    [ 45.729873] init: starting service 'btrpi-1.0'...
    [ 48.347980] init: Service 'btuart' (pid 510) exited with status 1
    [ 48.367558] init: Sending signal 9 to service 'btuart' (pid 510) process group...

    ...AND later in the logs

    [ 1025.245367] init: starting service 'btuart'...
    [ 1035.271782] init: Service 'btuart' (pid 5903) exited with status 1
    [ 1035.278399] init: Sending signal 9 to service 'btuart' (pid 5903) process group...
    [ 1035.286207] libprocessgroup: Successfully killed process cgroup uid 1002 pid 5903 in 0ms
    [ 1035.295696] init: starting service 'btuart'...
    [ 1045.322186] init: Service 'btuart' (pid 5904) exited with status 1
    [ 1045.329117] init: Sending signal 9 to service 'btuart' (pid 5904) process group...
    [ 1045.337095] libprocessgroup: Successfully killed process cgroup uid 1002 pid 5904 in 0ms


    Default Config:
    [ 2.069702] Bluetooth: RFCOMM TTY layer initialized
    [ 2.069731] Bluetooth: RFCOMM socket layer initialized
    [ 2.069782] Bluetooth: RFCOMM ver 1.11
    [ 2.069818] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
    [ 2.069837] Bluetooth: BNEP filters: protocol multicast
    [ 2.069863] Bluetooth: BNEP socket layer initialized
    [ 2.069883] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
    [ 2.069909] Bluetooth: HIDP socket layer initialized
     

    Top Liked Posts

    • There are no posts matching your filters.
    • 1
      Logcat on both is filled with the following messages:

      06-18 21:45:06.884 4472 4484 E ndroid.termina: failed to connect to jdwp control socket: Connection refused
      06-18 21:45:08.884 4472 4484 E ndroid.termina: failed to connect to jdwp control socket: Connection refused
      Yeah, this is something strange with Android 11 that I haven't figured out. You need to enable USB debugging in developer options and jdwp starts working and this log spam stops.

      [ 1025.245367] init: starting service 'btuart'...
      [ 1035.271782] init: Service 'btuart' (pid 5903) exited with status 1
      [ 1035.278399] init: Sending signal 9 to service 'btuart' (pid 5903) process group...
      [ 1035.286207] libprocessgroup: Successfully killed process cgroup uid 1002 pid 5903 in 0ms
      [ 1035.295696] init: starting service 'btuart'...
      [ 1045.322186] init: Service 'btuart' (pid 5904) exited with status 1
      [ 1045.329117] init: Sending signal 9 to service 'btuart' (pid 5904) process group...
      [ 1045.337095] libprocessgroup: Successfully killed process cgroup uid 1002 pid 5904 in 0ms
      btuart service should be only using /dev/ttyAMA0 so I don't know why GPS HAL using /dev/ttySS0 would cause issue with this. Difficult for me to do anything about this without having the hardware myself to test.

      On a related note, root access is missing in Developer Options in Pi's Lineage OS 18.1. Has enabling root changed from 18.1?
      Please read the FAQ. You need to install a separate su add-on.

      What Widevine Security Level has this ROM?
      Im completly new to the RPI Community
      L3.
    • 13
      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!

      Screenshot_20210104-104810_Settings.png


      https://konstakang.com/devices/rpi4/LineageOS18/

      There is also Android TV version available.
      Screenshot_20210306-163341_Settings.png


      https://konstakang.com/devices/rpi4/LineageOS18-ATV/

      Working:
      • Audio (HDMI, 3.5mm jack, USB microphones, bluetooth speakers/headsets, etc)
      • Audio DAC (using GPIO DACs e.g. Hifiberry DAC+)
      • Bluetooth
      • 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)
      • HDMI display
      • 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 accelerometer/gyroscope/magnetometer)
      • 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
      • 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 everyone who has contributed to android-rpi
      • Roman Stratiienko and GloDroid project for graphics fixes
      • brobwind for bluetooth fixes
      • Eric Anholt for V3D graphics driver
      • Maxime Ripard for Pi 4 KMS driver
      • Android-x86 project
      • LineageOS team & 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 (Linux, Mac, Windows).

      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 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)
      3
      Does somebody know if there is a noticible performance difference using the 4gb or 8gb ram version? I want do get a RPI4 and attach it to an USB touch screen.
      I only have the 4 gb model so I don't have anything for comparison. I'd say 4 gb is sufficient for running Android on the Pi. What permance gains do you expect to see by having more RAM? It would mostly affect multi-tasking perfomance (i.e. how many apps you can have open at the same time or how many browser tabs you can keep in memory before reloading). It's CPU/GPU/storage speed that matter for the general performance more than going 4 gb -> 8 gb. If the price difference is minimal the more the better of course for future proofing your device.

      @KonstaT Been wondering about this and I'm sure there's a simple answer, I just haven't found it yet, many OS Builds for this device are 32bit (including this ROM) is there a reason why the 64bit Builds haven't shown up yet (esp in regards to LOS)? I'm assuming it has something to do with too new of device with too new of OS (recompile/upstream/backport changes, etc) slowing down releases, but I could be wrong.
      Generally speaking I guess it's mostly because Raspberry Pi Foundation is moving slowly with 64-bit. Raspberry Pi OS is still 32-bit and I think this because they want to support the older Pi models with the same OS. Pi 4 is the first Pi model where it actually makes any sense to have an 64-bit OS. Pi 3 had 64-bit capable hardware but only 1 gb of RAM so that quickly defeats any architectural advantage (64-bit OS uses more memory).

      I've had 64-bit LineageOS builds running on the Pi 4 over a year so there's nothing too special about it. I've also maintained the 64-bit Android kernel for quite some time (https://github.com/lineage-rpi/android_kernel_brcm_rpi). Why I haven't relased any 64-bit LineageOS builds is because I've chosen a feature set that I want to support and I also have some internal quality standards I like to meet. There's still various things that are broken on 64-bit builds so not much point in releasing to public when you can also have builds where everything is basically working.

      It's still under consideration if there's any point in making some 'bleeding edge' release for people who are just interested in testing.