Using LineageOS For Phones And DIY Smart TVs Is Pretty Nifty

Although Android is essentially just another Linux distribution, most people only experience it in the form of the rather restrictive and proprietary versions found on smartphones, tablets and smart TVs. While this is probably fine for the average person, there’s also a lot to be said for the more pure Android experience in the form of LineageOS.

With this fully open and community-supported version of Android you’re free to muck about with your hardware to your heart’s content, without annoyances like unremovable bloatware apps and restrictions on e.g. enabling developer mode.

Even more fun is that there are ports of LineageOS to systems such as the Raspberry Pi SBC, including in the Android TV configuration. This means that not only can your ten year old Android phone get a make-over with a recent version of Android, you can also create your own Android TV-based smart TV without all the spying and other nasty things that commercial smart TVs love to do.

The LineageOS Lineage

The history of LineageOS is slightly messy, being a fork of CyanogenMod, which itself was based on the Android Open Source Project (AOSP). Since Android is classified as Yet Another Linux Distribution, it’s got the same GPL license foundation and naturally a few dozen customized Android distros based around this AOSP.

Although CyanogenMod is no more, LineageOS is its effective successor, featuring probably the largest number of supported phones, tablets and other hardware. You also get most of the benefits of running an OEM-blessed Android distro, such as over-the-air (OTA) updates within a single major version of LineageOS.

When it comes to disadvantages, the closed nature of smartphone platforms means that initial installation and updating to a new major version requires an intimate experience with Fastboot mode, the Android debug bridge (ADB) and other aspects that make even me as a slightly more technically inclined Android – and Arch Linux – user and developer slightly nervous when looking at the installation steps.

A Smartphone Revival

Welcome to Xiaomi's high-end offerings in 2016. (Source: GSMArena)
Welcome to Xiaomi’s high-end offerings in 2016. (Source: GSMArena)

It’s been said that the primary reason why smartphones are the way they are is due to computer manufacturers missing the boat on locking down the PC and Mac ecosystems back in the day, including the very hardware that the OS runs on. Unlike with installing a new OS on that old x86 or PowerPC-based system, smartphones – with very few exceptions – feature locked bootloaders and other obstacles designed to protect the children deter you from doing things with your own hardware that corporate disapproves of.

Consequently, getting LineageOS on the average smartphone is a bit of an ordeal, with my 2016-era Xiaomi Mi 5 being no exception. Fortunately Xiaomi does offer an official way to unlock the bootloader when you ask them nicely, so that was one of the first thing I did shortly after receiving my shiny new phone. This is also the first and most cumbersome step in the whole LineageOS installation procedure for the phone, so I’m grateful that I got that annoyance out of the way already.

This particular phone was left behind by Xiaomi in 2018, freezing it on Android 8.0 and consequently rendered it effectively useless for a wide range of apps as time moved on. Theoretically LineageOS would here bump the version up to Android 15, with regular OTA updates. I even had recently replaced its battery, which is still fairly easy on this era of smartphone, so it should be basically a brand new phone.

All I had to do now was follow the instructions.

Fast Fastboot Frustrations

Welcome to the Xiaomi fastboot mode, comrade.
Welcome to the Xiaomi fastboot mode, comrade.

Unfortunately, after dutifully deleting all Google accounts on the phone and booting into Fastboot mode I ran into a seemingly unsurmountable obstacle: fastboot devices listed zero devices and a quick look at the Device Manager in Windows showed why, with the Yellow Triangle of Meh.

As it turns out, Xiaomi devices aren’t happy with the regular USB driver, but require a special Fastboot driver. This is where I’d spend the next few hours chasing a seemingly endless number of dead ends and useless advice. Rather than download sketchy driver installers or run some .bat file from six years ago off a GitHub page, I went with the Xiaomi Mi Unlock Tool, the same that is used to unlock the bootloader.

Here I ran around in circles for a bit with the version offered by Xiaomi being the ancient 6.x version without the needed driver and the update link being dead. Finally XDA Forums came to the rescue as usual, with someone having squirreled away a copy of the .zip file from which I could extract the driver and install it.

With this done the rest of the process was fairly easy, with the fastboot command from my existing Android SDK installation happily pushing the recovery image to the phone, followed by rebooting into the LineageOS recovery mode by keeping the power and volume up buttons pressed until the Mi logo appears.

Using adb you then sideload the main LineageOS image after mashing the appropriate buttons on the phone to accept it, with me opting to also sideload the special Google apps sauce. A reboot later and before I knew it I was busy setting up the ‘new’ phone, copying data and settings off my newer Xiaomi Note 10 Pro phone via Wi-Fi.

Mission success, with a 2016-era phone now running Android 15.

DIY Android TV

Welcome to the 'black box' Raspberry Pi 4B-based 'smart TV'.
Welcome to the ‘black box’ Raspberry Pi 4B-based ‘smart TV’.

Of course, putting Android on phones is boring, with everyone and their dog doing it these days. Which is why long before I considered putting LineageOS on this phone of mine I had already put it on a Raspberry Pi 4 SBC that I had been trying to use for NymphCast receiver purposes in various guises over the years.

While this isn’t one of the officially supported devices by LineageOS, a wonderful person called Konga has ported LineageOS to the Raspberry Pi series of SBCs, both in their regular Android and Android TV versions.

The only real difference here is that Android TV uses the – shockingly – TV-optimized interface. This I installed in order to test whether the Android port of the NymphCast Server (NCS) would also play nice with Android TV. I had previously tried to use this SBC with regular Raspberry Pi OS and kin, but always ran into issues with the proprietary video hardware that requires custom patching of FFmpeg to work for basic features like hardware acceleration.

To my delight all of this, including video hardware decoding, worked out of the box, making it probably the most functional version of Linux that I have ever run on a Raspberry Pi board. Even if the RPi 4 isn’t your thing, there are also images for the RPi 3 and RPi 5, though I haven’t tried those yet. Android versions with this port are kept up to date, with the current release of Android 16 probably being something that I should update my board with.

Installation here is stupidly easy compared to the smartphone ordeal: simply write the image to an SD card, stick it into the SBC’s card slot and congratulations, you just installed LineageOS. You can even use the typical Android box-focused remotes to use them. I can recommend the ones that have a keyboard built-in to skip the on-screen keyboard. Or just wire up a full-sized keyboard, of course.

Updates are done via OTA images, which you have to flash by hand. This makes them more of an Over-SneakerNet (OSN) update system, but it works pretty much the same otherwise.

Welcome To Open Android

Coming from many years of using Huawai, Samsung, Xiaomi and Google’s interpretations of ‘Android’ I’m somewhat anxious to see what my LineageOS experience will be like. I’ll be using it as my regular phone, with ideally there being no difference from when I last used it back in the early 2020s, other than maybe being less awfully slow.

I do appreciate that I didn’t get strong-armed into inserting a SIM card to be even allowed to enable USB debugging, which I had to work around with my newest Xiaomi phone with a sneaky hack. This is where I feel that especially for us Android developers LineageOS can be incredibly useful.

On the ‘smart TV’ side of things, I haven’t really done too much with my little box other than cast video to it from a NAS like a DIY Netflix. I’d be up for exploring this setup as a proper alternative to OEM-blessed Android TV installations, though I imagine that apps that insist on DRM for precious streaming content will throw a fit.

27 thoughts on “Using LineageOS For Phones And DIY Smart TVs Is Pretty Nifty”

  1. If you’d like to get rid of even more spyware but still run all the normal apps, have a look at microg, an OSS reimplementation of the Google sercvices.
    (Written from another liberated Xiaomi ohone ;))

    1. I, for one, am quite excited that Plasma Bigscreen got resurrected! Installed it on an old laptop as a media center/gaming PC. As far as I know it’s still beta, but it really doesn’t feel like it. Because everything is Wayland these days, it also has proper HDR and is getting color management support from upstream KDE, and on a good TV it looks incredible.

    2. I have looked at running NymphCast on LibreElec, but it feels like too much of a project to dig into right now. This is where this port of LineageOS to the RPi is quite convenient, plus it’s what comes preinstalled on so many ‘smart’ TVs these days.

  2. I don’t understand why people need smartphones in the first place. Back in 1970s all you needed to send your voice halfway across the world was a shortwave rig build with some surplus tubes. Now you need a 4 GHz ARM SoC running 50+ layers of software just to render font on a screen. It’s pathetic and it’s the road to cyber-enslavement.

    1. Back in 1970s all you needed to send your voice halfway across the world was a shortwave rig build with some surplus tubes.

      I do hope that is sarcasm.

      For those who don’t get it, short wave doesn’t scale. Given the range (kilometers) you reach, you’d have millions of people trying to use the same small frequency range simulataneously, and there’d be no private communications in all that mess.

    2. I kind of sort of agree, but for a different reason – I need cellphone (smartphone, whatever) to be phone first, everything else supplementary, messaging, etc.

      In that sense average cellphone I own is a Cray supercomputer used for email, and I wish there was an easy/simple way to downgrade mandatory Cray computer back to its basic version of perhaps Apple Macintosh on Motorola 68000 – with corresponding reduction in price for both, phone and services (as a side note, by now simple/basic phone services could easily be free – with capped monthly usage, obviously, because these literally would use microscopical chunks of bandwidth predominantly used to watch lolcat videos).

      Basic phones exist, of course, but last I looked they are still off, usually they keep dragging in useless/pointless things I don’t need, and almost all (that I’ve looked into) were non-negotiable locked-down spyware mining me for whatever it is that they are looking for to resell.

  3. I wonder if your fastboot experience would have been easier from your arch, or even a Debian SD card for the PI. None of those shady zip file download shenanigans hopefully too.

    1. The LineageOS guide indeed hinted at things being easier on Linux & MacOS with the fastboot drivers, but getting the driver from the official Xiaomi application isn’t too shady, I don’t think :)

      And Debian for RPi is basically the same as Raspberry Pi OS minus some customisation, and still no easy way to have a pre-patched FFmpeg. Got to pick your battles :)

  4. You can also boot full-fat desktop linux userspace on TV Boxes. There’s bootloader binaries for allwinner H-series, Rockckip RK33xx/RK35xx series, Amlogic S905x series and more. I shit you not, you can burn an armbian image for an older box into an SD card, shove it on a newer model that has the same SoC and it will still work! No recompiling your crap for android libc, no fiddling with OOM-killer to keep termux alive on the background, it just works.

    1. Not in my experience. I’ve had to compile drivers, specifically networking and bluetooth. I’ve also had issues with built in LCD screens on the devices (that display boot messages, time, standby etc.).

  5. I used a setup similar to this for TV stuff—Waydroid with a LineageOS-based Andorid TV image—on my Bazzite install. Worked well, but some apps wee no-gos because of DRM issues, particularly Netflix and Hulu. (Amazon Prime worked sometimes; YouTube and Paramount+ always did.) I imagine it would work way better with an ARM system. I eventually started moving to my current setup which is headless Chrome browsers to load up different video playing apps in Steam.

  6. FYI for anyone thinking about dailying one of these, RCS will not work on devices with an unlocked bootloader. RCS is exclusive to Apple and Google (there is no open alternative) and boot unlocked devices will not pass Google’s integrity checks, causing RCS messages silently fail to send or receive, and otherwise rather non gracefully degrading to SMS and MMS. There is no fix for this on the horizon. People have tried spoofing and other ‘tricks’ but Google has squished every one, and is getting faster t it, so that spoofed phones are essentially never reliable. I’ve been daily driving a custom ROM since CyanogenMod, and this has been a dealbreaker for me. I still haven’t decided whether to carry a second unmodified phone for messaging, or to just give up on owning my phone.

    1. The issue I ran into was that my bank’s banking app refused to run on a rooted phone, and then they closed all the branches near me and made certain features app-only, so using the website wasn’t a solution.

    2. Concur with Brad I was cyanogen then lineage through microg, once you need multiple opaque binaries and rootkits of unknown origin to evade Google, there’s no way to use a degoogled phone as a business device at present.

  7. Why would anyone want to run Android/Linux where GNU/Linux could run instead? For certain phones and set-top devices where some sort of Android is the only OS available it’s understandable, but on a RasPi? Android needs hacks upon hacks to get anywhere near to the openness and capabilities that GNU/Linux offers out of the box, and then with every update you’re fighting Google actively making it worse as they try to turn it into a locked-down toy OS like Apple’s iOS.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.