[DEV][ROM][UNOFFICIAL] LineageOS 19 (Android 12L) for Raspberry Pi 4 B

Search This thread

Tom33231

Member
Jan 16, 2022
27
1
how can I delete this double post or delete posts this new one was an accident typing from my google pixel 4a using firefox
 

Tom33231

Member
Jan 16, 2022
27
1
Problem with that specific display is that it uses SPI for the display interface (SPI for touch interface is fine). Not to endorse anything but e.g. Waveshare also has small displays that use DPI/DSI/HDMI as the display interface (see selection guide section at e.g. https://www.waveshare.com/7inch-hdmi-lcd-c.htm). HDMI displays are of course the most used so shouldn't require much additional effort.

My first Android phone from 10+ years ago had display with 480x800 resolution (ironically what the official Raspberry Pi 7" display also has). So, let's just say that that or anything smaller than that is not what you'd expect for device running modern Android these days. Just having a display resolution/density related discussion above. Very small resolution/density can also cause all kinds of issues (UI on the OS itself because no one else in the world uses such low resolution anymore, app compatibility issues because of missing low density drawables because no one needs them anymore, etc.). https://developer.android.com/training/multiscreen/screendensities

My Raspberry Pi builds use standard ext4 partitions (system, vendor, data - FAT is used for boot partition). You can just directly mount the sdcard on your Linux machine and edit contents of any of the partitions. There's simg2img/img2simg tools to pack sparse images most Android devices use. Mounting the image writable (and what fs it uses - ext4/F2FS/etc) is another story.

Your links refer to adding precompiled apps when building Android from source.
Yes I said I needed more information and yes what about modding compiled images by bad on that part. I’m new to the modding and mainly just curious about how to do it for compiled apps and adding them to compiled images with boot loaders and main system.img. I thank you for giving me more direction. If you find more info or have more on this my email is [email protected] also I can remove that from this post if that’s against the forum rules or just message here or directly to my xda account if possible.
 

Zyanx

New member
Feb 12, 2018
2
0
Hi

iam using your Rom on my Pi 4 2 GB and it rly work Great (using it as Homepanel Dashboard for Homeassistant).

But i have one Bug or may itz normal or my Pi is Defect , so i wanted to ask:

When I play Musik 100% Volume i got little noise/scratch on the outcome, it doesnt matter if i use the 3,5 jack or bluetooth. When i play it on 90 % or less it seems to work fine.

Someone else got this Problems? I only have 1 Pi 4 so i canot check with an other one.

Thx in Advance and Thx for the Nice Rom.

Greetings
 

Ajtaji

Member
Jan 6, 2012
28
7
Hello, can you tell me how to fix these things:

1. Search doesn't work in settings
2. Short press of navigation bar power turns screen off instead of going to lock screen.

I've read on Bluetooth jitter and gapps already.
And GPS with ublox 9 is solved with another gnss hal, which works with both ublox 7 and 9.
I have to say so far this is a very nice release. Thank you.
 

KonstaT

Senior Member
Jan 20, 2016
653
384
KonstaKANG.com
Hello, can you tell me how to fix these things:

1. Search doesn't work in settings
2. Short press of navigation bar power turns screen off instead of going to lock screen.

I've read on Bluetooth jitter and gapps already.
And GPS with ublox 9 is solved with another gnss hal, which works with both ublox 7 and 9.
I have to say so far this is a very nice release. Thank you.
1. I can't reproduce any issue with searching the settings, works fine for me. You need to be more precise than that.
2. Well, yes that's what pressing the power button does on Android devices in general. If you want to have a lockscreen when turning the display back on you need to enable one from Settings -> Security -> Screen lock.

Which GPS HAL did you use? Maybe this is something that can be included in the builds by default.
 

Ajtaji

Member
Jan 6, 2012
28
7
1. I can't reproduce any issue with searching the settings, works fine for me. You need to be more precise than that.
Well when I go to settings and type something I want to find in the search box nothing appears. It doesn't work.
2. Well, yes that's what pressing the power button does on Android devices in general. If you want to have a lockscreen when turning the display back on you need to enable one from Settings -> Security -> Screen lock.
Well when it also turns off touch response and you don't have a gpio switch its pretty counterproductive to remove the power and reboot in order to get a screen back. Thought I'd mention it.
Which GPS HAL did you use? Maybe this is something that can be included in the builds by default.

With line modifications: Obvious Line 45 & 46 and then

Line 73 changed to "static float report_time_interval = 5;"

The gps time is reported wrongly but it works with both usb modules.

if Line 73 is not changed it does the same as your supplied hal module. Perhaps yours has a reporting overload as well.

Thanks KonstaT
 

KonstaT

Senior Member
Jan 20, 2016
653
384
KonstaKANG.com
Well when I go to settings and type something I want to find in the search box nothing appears. It doesn't work.
Searching the settings works just fine so something wrong at your end.
Well when it also turns off touch response and you don't have a gpio switch its pretty counterproductive to remove the power and reboot in order to get a screen back. Thought I'd mention it.
Touch input stopping working after switching the display off is not expected behavior. It's been reproduced on both the official DSI touchscreen and USB touchscreens and was discussed at https://forum.xda-developers.com/t/...raspberry-pi-4-b.4356891/page-2#post-86008999 It works on previous Android versions so some issue with Android 12 that I haven't still looked into.

Input event from any device (mouse, keyboard, touchscreen, etc) will wake the display in any case, not just pressing the power button.

Thanks. I've been aware of this and been meaning to give it a test sometime. The antenna on my U-Blox 7 module is really bad and/or there's too many floors of concrete on top me so it's difficult to get a location fix to do any meaningful testing, though.
 

risant

Senior Member
Aug 6, 2016
293
31
no sound when using usb external dac...what tweaks to be done ?...lineage 18 there's sound with usb external dac ..please help
 

jeff862

Senior Member
Mar 5, 2007
50
3
What's the workaround for usb dac to work on lineage 19? Even the bluetooth audio crackling noise ... usb dac working on lineage 18.1 please help
 

KonstaT

Senior Member
Jan 20, 2016
653
384
KonstaKANG.com
no sound when using usb external dac...what tweaks to be done ?...lineage 18 there's sound with usb external dac ..please help
Logcat? I can't reproduce any issue with my USB sound card at least. IDK why USB DAC would be different.

There's been some reports about issues with USB DACs with Android 12 in general.
What's the workaround for usb dac to work on lineage 19? Even the bluetooth audio crackling noise ... usb dac working on lineage 18.1 please help
Why would my reply be any different that the last two times you posted this exact same thing? Still haven't seen any logs.
 

anton2k

Member
Apr 24, 2011
10
0
Hey, does composite video and audio output work via the jack? or has it been tested? just thought I would ask the question before I go out and buy the cable, thanks!
 

risant

Senior Member
Aug 6, 2016
293
31
the bluetooth audio crackling noise has been solved ,,, the location services must be turn off,,, only problem android 12 no sound external usb dac.. i think it's android 12 bug ,, no update yet
 

KonstaT

Senior Member
Jan 20, 2016
653
384
KonstaKANG.com
Hey, does composite video and audio output work via the jack? or has it been tested? just thought I would ask the question before I go out and buy the cable, thanks!
Audio through the 3.5mm jack works (please read the OP and FAQ). There's no support for composite video. You can use HDMI and DSI connectors for display with this build.
the bluetooth audio crackling noise has been solved ,,, the location services must be turn off,,, only problem android 12 no sound external usb dac.. i think it's android 12 bug ,, no update yet
No logs yet.
 

anton2k

Member
Apr 24, 2011
10
0
Audio through the 3.5mm jack works (please read the OP and FAQ). There's no support for composite video. You can use HDMI and DSI connectors for display with this build.

No logs yet.
I did look at the op and under not working I couldn't see any mention of composit video, for allot of people it's a big feature, I would add it under the not working area to avoid simular questions like mine, do you plan on adding support for it?

Do you know of generic USB touch digitizers will work with this build? I know it works with raspbian and stock Android and stuff, no sure about this setup though, was also planning on hooking up a dvb tuner to it.
 

KonstaT

Senior Member
Jan 20, 2016
653
384
KonstaKANG.com
I did look at the op and under not working I couldn't see any mention of composit video, for allot of people it's a big feature, I would add it under the not working area to avoid simular questions like mine, do you plan on adding support for it?

Do you know of generic USB touch digitizers will work with this build? I know it works with raspbian and stock Android and stuff, no sure about this setup though, was also planning on hooking up a dvb tuner to it.
Composite video is 1950s technology so it's hardly relevant these days and barely anyone uses it (nor should). I don't have any hardware so I have no plans to support it. Here the latest discussion about composite video on Android: http://disq.us/p/2lftnz2

Yes, USB touchscreens work as listed working in the OP.

There's no support for TV tuner hardware. I don't have any. There's third party Android apps to support some specific TV tuner USB dongles, though.
 
  • Like
Reactions: anton2k

Fodor Gábor

Senior Member
Jan 11, 2010
163
7
Ajka
Hi!
How can use usb bluetooth dongle? I have only Linux driver for the usb bluetooth dongle. I use this os for car pc. When bluetooth and wifi on is, than is interferenc.Musik play skipping.
Thanks for reply.
 

KonstaT

Senior Member
Jan 20, 2016
653
384
KonstaKANG.com
Hi!
How can use usb bluetooth dongle? I have only Linux driver for the usb bluetooth dongle. I use this os for car pc. When bluetooth and wifi on is, than is interferenc.Musik play skipping.
Thanks for reply.
You can't. You can consider Android as an OS for embedded devices. It needs to work just on the hardware that the device has built-in and nothing else. It's not designed to support every possible hardware and configuration in the world at the same time.

There is a know issue with bluetooth audio and Google location services after installing gapps. This only happens with gapps installed and if you've enabled location access during the gapps setup. Google location services scan nearby bluetooth devices to determine the device location which doesn't work great when your using bluetooth audio at the same time. There's also workaround available if disabling Google location access is not enough https://forum.xda-developers.com/t/...aspberry-pi-4-b.4212945/page-14#post-85769441
 

Fodor Gábor

Senior Member
Jan 11, 2010
163
7
Ajka
You can't. You can consider Android as an OS for embedded devices. It needs to work just on the hardware that the device has built-in and nothing else. It's not designed to support every possible hardware and configuration in the world at the same time.

There is a know issue with bluetooth audio and Google location services after installing gapps. This only happens with gapps installed and if you've enabled location access during the gapps setup. Google location services scan nearby bluetooth devices to determine the device location which doesn't work great when your using bluetooth audio at the same time. There's also workaround available if disabling Google location access is not enough https://forum.xda-developers.com/t/...aspberry-pi-4-b.4212945/page-14#post-85769441
Thank you!
 

s0m3f00l

Senior Member
Jul 18, 2010
94
49
Jersey City
I tried the Android TV:

lineage-19.0-20220114-UNOFFICIAL-KonstaKANG-rpi4-atv.zip

from the website on my Raspberry Pi 4 8GB Model B. It enters a bootloop when I flashed it and never makes it to the Lineage loading screen.

lineage-18.1-20220121-UNOFFICIAL-KonstaKANG-rpi4-atv.zip is working fine however.

Thanks for the build.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    So I am operating this in headless mode (no mouse or keyboard either) and I have enabled the power button on the nav bar. Accessing using RealVNC. I tapped that power button thinking it would give me a reboot menu. Nope. Blank screen. How can I regain access to the desktop without rebooting?
    E.g. ADB/SSH in and execute 'input keyevent KEYCODE_POWER' if you must do this remotely. Or just connect a mouse/keyboard and send some input event.

    Power button in the navigation bar works just like power button in Android in general. Short press to switch display on/off. Long press to invoke power menu. Android 12 has a virtual power key in the notification shade to invoke the power menu so the navbar key is redundant.
    1
    Has the default path for GPIO scripts changed in 12 from 11?
    If you mean init.d scripts they are in /vendor/etc/init.d/ now (vs. /system/etc/init.d/ in previous Android versions).
    1
    New builds. Same changelog on both.

    • add support for Compute Module 4
      • fix HDMI/DAC audio device selection on CM4 & Pi 400 that don’t have 3.5mm audio jack
      • fix USB storage (Pi 400 as well?)
      • fix issue with webview/browser
      • add support for the RTC on the I/O board
      • use OTG mode for USB to support ADB, MTP, PTP, USB tethering on the micro-USB port on the I/O board
    • add support for APDS9930 ambient light/proximity sensor
    • update to TWRP 3.6.1_11-1-KonstaKANG
    • update to Mesa 22.0.3
    • update to Linux 5.10.112 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    • Android security patch level: 5 May 2022 (merged)
  • 14
    Here’s my build of LineageOS 19 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_20220313-200456_Settings.png


    There is also Android TV version available.

    Screenshot_20220114-084413_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 (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 (software decoding & encoding works, option to test highly experimental H.264 hardware video decoding)

    Issues:
    • Camcorder & some third party camera apps don't work with official Pi camera modules
    • 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 19
    3
    New build.


    -switch to Linux 5.10 kernel by default
    -fix VC4 HDMI audio with 5.10 kernel (3.5mm jack is now used by default so select the right HDMI device from the settings)
    -add support for the official 7" touchscreen display with hw accelerated graphics (enable configurations for the touchscreen from the settings)
    -minor brightness fixes for the official 7" display
    -add support for Pi camera modules using libcamera, preview & photos work - camcorder doesn't (thanks to Roman Stratiienko)
    -fix UVC USB webcams that use external camera HAL (camera needs to support MJPG format - preview, photos & camcorder works)
    -add option to enable currently very WIP H.264 hardware video decoding using v4l2_codec2 (enable experimental feature from the settings)
    -fix reboots related to Hotspot 2.0 networks/ANQP requests (see issue #6)
    -Vulkan 1.1 (thanks to people at Igalia for Vulkan 1.1 conformance and Roman Stratiienko for latest Mesa fixes)
    -update to Mesa 21.3.1
    -update to Linux 5.10.83 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    -Android security patch level: 5 December 2021 (merged)
    2
    Wow I didn't expect latest Android being supported on the Pie, thanks for the great work!
    I have two small questions though :
    • Do you know how is support for microG? It doesn't cause any problem? (was wondering about casting videos for example)
    MicroG requires a patch for signature spoofing that is not included in LineageOS for security reasons. I think this is also something that can be achieved using Magisk (which is now supported) but haven't looked into it.
    • I know it has been asked few times already, but now that Android 12 has been released are you confident it will be possible to have support for hardware acceleration soon? Would make a big difference to have a steady 1080p/60fps
    I'm pretty confident it will work eventually. Soon(™) is also a relative term.

    Short term goal is to get some proof of concept that stateful H.264 V4L2 dec/enc can work on Android on Pi 4. Just made some minor progress with v4l2_codec2 couple of days ago and got the dec/enc codec2 component to even do something in the first place. Not sure if the current issues I'm having are due to memory allocation or the codec component negotiating with the kernel driver. There's also still some hardcoded buffer sizes, etc that depend on the video resolution you're trying to dec/enc. Only real hardware that I'm aware that just recently has this working at least to some extent is dragonboard and John Stultz has tweeted some updates on the matter so check those out if you're interested.

    Sorry if this wasn't the news you were looking for but things like this take time.
    2
    Short term goal is to get some proof of concept that stateful H.264 V4L2 dec/enc can work on Android on Pi 4.
    And that didn't even take too long. \o/ But yes, H.264 V4L2 hardware decoding can work on Android on the Pi 4!

    Something still getting messed up somewhere in the pipeline so the colors are not correct and there's a green tint on the bottom half of the playback.
    https://www.dropbox.com/s/hlvcv23ejfpinn5/VID_20211108_194739.mp4?dl=0
    2
    New build. Added optional Linux 5.10 kernel add-on to test a lot of WIP stuff.


    -add option to show virtual volume down, volume up, and power keys on navigation bar (requires reboot)
    -add option for old TCP-based ADB over network
    -show IP address and port for ADB/SSH/VNC options
    -update to TWRP 3.6.0_11-0-KonstaKANG
    -update to Mesa 21.3.0
    -update to Linux 5.4.161 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)
    -Android security patch level: 5 November 2021 (merged)

    Linux 5.10 kernel: (optional add-on)
    -various KMS driver improvements (DSI panel support, etc)
    -support for Pi camera modules using libcamera, preview & photos work - camcorder doesn’t (thanks to Roman Stratiienko)
    -option to test currently very WIP H.264 hardware video decoding using v4l2_codec2 (Settings -> System -> Advanced settings -> Hardware video decoding)
    -HDMI audio is not supported! (see issue #4651 & issue #4654)
    -new Raspberry Pi Android kernel bring-up based on AOSP android12-5.10-lts
    -update to Linux 5.10.81 kernel and patch known vulnerabilities (CVE-xxxx-xxxx, and more)