An old phone as a lounge PC: Linux, games and video calls on the TV
A retired Galaxy Note20 Ultra running a full Ubuntu desktop on the TV, with retro games and one-button Google Meet calls started from Home Assistant.
- Difficulty
- Advanced
- Parts cost
- An old phone you already own, plus a USB-C dock and a USB mic
- Build time
- Built over a few evenings, still being finished
- Skills
- Android rooting, Linux command line, Home Assistant
The problem
I had an old Galaxy Note20 Ultra sitting in a drawer. It has 12 GB of RAM, 256 GB of storage, a decent graphics chip and a 108 MP camera. That’s a better spec than plenty of mini PCs, and it was doing nothing.
I wanted two things from it. First, a little Linux box to tinker with, plugged into the lounge TV. Second, a proper video call screen. I’m away at work a lot, and the kids want to ring me. A phone held at arm’s length is fine, but the whole family on the couch, on the big screen, is better. And it had to be one button for them: press Call Dad in Home Assistant, and my phone rings.
It now boots straight into an Ubuntu desktop on the TV, runs retro games and the kids’ Roblox, and does the video calls both ways. The phone never leaves Linux to do it.
How it works
Linux on a phone. Plain mainline Linux isn’t workable on this phone’s Exynos 990 chip. So I kept Android’s own kernel and run Ubuntu 24.04 (the arm64 build) as a chroot on top of it: a full Ubuntu folder tree that programs run inside, sharing Android’s kernel. With root, Android starts it all at boot: SSH, the sound server, a graphics bridge, and an XFCE desktop styled to look like Ubuntu. A tiny launcher app of my own is set as Android’s home screen, so the phone always lands on the Ubuntu desktop.
Graphics and sound. The desktop is drawn by the Termux:X11 app. Apps that need real graphics (Chrome,
the Warp terminal) go through a small gpu wrapper that uses virglrenderer, which passes their drawing
through to the phone’s Mali-G77 graphics chip. Sound runs as PulseAudio inside the Termux app, and Ubuntu
plays through it over a local connection.
The video calls. Google Meet runs in Chrome on the Linux side. This phone’s kernel can’t do USB webcams or a fake camera device, so a script borrows the phone’s own camera and mic through scrcpy’s server, then a small script injected into Meet turns that into a camera called “Lounge camera”. A watcher on the phone listens to three button helpers in Home Assistant, starts or ends the call, and writes its status back. Home Assistant does the ringing.
What you need
- An old Android phone you’re happy to unlock. Mine is a Galaxy Note20 Ultra (SM-N986B, Exynos 990, 12 GB, 256 GB) on Android 13 / One UI 5. Unlocking the bootloader wipes it and trips Samsung’s Knox flag for good.
- A computer to flash it from. I used Thor (a Linux tool for Samsung’s Odin download mode) and Magisk for root.
- A USB-C dock with HDMI, USB-C PD charging and USB ports. A plain USB-C to USB-A adapter won’t do: the phone can’t charge through it, and the battery drains.
- A USB-C PD charger, 25 W or more, plugged into the dock.
- A USB Ethernet adapter, unless the dock has its own network port. The kernel already has drivers for RTL8152/8153 and AX88179 adapters.
- A wireless keyboard and mouse with a USB dongle.
- A USB mic. Mine is a Movo MC1000 (mic only, no speaker).
- A Google account just for the lounge, for Meet (and the Play Store if you want Roblox).
- Home Assistant with the Companion app on the phone that should ring.
The phone lives on charge behind the TV, so give it air and don’t bury it in a cabinet.
Hardware and how it’s hooked up
| Plugged into | What |
|---|---|
| Phone’s USB-C | The dock |
| Dock HDMI | The TV |
| Dock USB-C PD | The 25 W+ charger. Plug it in before the phone: some docks drop their USB devices for a moment when charging starts. |
| Dock USB port 1 | Network adapter (skip it if the dock has its own network port) |
| Dock USB port 2 | Keyboard and mouse dongle |
| Dock USB port 3 | USB mic |
Three USB devices on one dock is fine. The dongle uses next to nothing, the mic about 1.5 Mbit/s and a video call 2 to 5 Mbit/s. Even if the dock drops to USB 2.0 while HDMI is in use, that’s 480 Mbit/s, and HDMI runs on separate lanes anyway. What does matter is the charger: without it the phone powers all three from its own battery.
The phone is on charge all the time, so the boot script holds the battery at 80% instead of 100%. When the dock’s HDMI is connected, the phone screen stays awake at minimum brightness (it lives behind the TV, facing the wall) and puts the old brightness back when it’s unplugged. Off the TV it sleeps after 10 minutes, unless sound is playing.
The plan is a 3D-printed slide-out drawer on the back of the TV, with the phone lying landscape and the camera end sliding out past the TV’s edge for calls. That’s designed but not built yet. Two things I found while designing it:
- The lens sits behind the TV’s front face, so it has to stick out past the TV’s side by roughly 0.85 times the TV’s depth at that point, or the edge of the TV shows in the picture. The ultra-wide camera needs more.
- Leave air vents. The phone charges around the clock and works hard during calls.
Setting it up
These are the actual commands and settings I used. A lot of the glue is my own scripts, which I describe rather than paste in full. The scripts aren’t published yet.
Unlocking and rooting
Two traps on this phone:
- After a wipe, the Knox state can sit at Prenormal, and the long-press of Volume Up that should offer the
unlock is silently ignored. Boot it, join Wi-Fi and wait about a minute; when
dumpsys knoxguard_serviceshowssetCheckingStateToRpmb, the unlock works. adb reboot downloadgives a cut-down download screen with no unlock option. Instead: power it off, hold Volume Up and Volume Down together, and plug in the USB cable.
For root, let Magisk patch a small tar of just boot.img.lz4 and vbmeta.img.lz4, not the whole 8 GB AP
file. Then flash it with Thor (run it as root, in tmux, because it’s interactive):
sudo modprobe -r cdc_acm # unload the USB serial driver first
# then, at Thor's prompt:
connect
begin odin
flashTar <folder with the patched tar>
factoryReset
Thor’s factoryReset leaves the data partition unformatted, so recovery says it “Can’t load Android
system”. Do Factory data reset in recovery and it boots fine.
Ubuntu at boot
The Ubuntu 24.04 arm64 files live in /data/ubuntu. A Magisk boot script (in /data/adb/service.d/) does
this, in order:
- Holds the battery at 80%, and re-asserts it every 10 minutes.
- Keeps Termux and Termux:X11 out of Android’s app standby (see the lessons for why).
- Starts SSH and Tailscale inside Ubuntu. Tailscale runs in userspace networking mode.
- Starts PulseAudio in Termux, then the virgl graphics server.
- Starts the Termux:X11 display server as root, then the XFCE desktop as my user.
The two Android-side lines that matter most, run as root:
echo 80 > /sys/class/power_supply/battery/batt_full_capacity
dumpsys deviceidle whitelist +com.termux +com.termux.x11
To make the phone land on the desktop, my launcher app is made the home screen, and the lock screen is turned off. On Android 13 the usual “set home activity” didn’t stick; this did:
cmd role add-role-holder android.app.role.HOME <your.launcher.package> 0
locksettings set-disabled true
Screen settings for living behind a TV:
settings put global stay_on_while_plugged_in 7 # stay awake on any power source
settings put system screen_off_timeout 600000 # otherwise sleep after 10 minutes
My lounge-av script switches the stay-awake on and off itself: on while the dock’s HDMI shows up as
connected, or while sound is playing. Android only counts touches and key presses as activity, so without
that the screen blanked in the middle of videos.
Desktop, apps and games
- Browser: Google Chrome. Google’s apt repository has arm64 builds now. Ubuntu’s own Firefox is a snap, and snaps don’t work in a chroot.
- Graphics per app: I put small wrappers for Chrome and Warp in
/usr/local/bin, each one running the real program throughgpu. Changing only the menu shortcuts missed launches from links and the session. - Retro games: RetroArch, the Android app, launched from a “Games” icon on the Ubuntu dock. Being an
Android app, it gets the graphics chip directly and never needed the virgl bridge. ROMs go in
/sdcard/ROMs/<system>. If you copy cores into its data folder by hand, fix their SELinux labels to match the app (chcon), becauserestorecongets them wrong. - Roblox: the official Android app from the Play Store. It refuses to run old versions, so the lounge Google account is signed in on Android and it updates itself. It runs fine on a rooted phone and is best with a gamepad. A dock icon starts it:
android am start -n com.roblox.client/.startup.LauncherAliasMain
android is my helper for running commands in Android from inside Ubuntu. The Home button brings you back to
the Ubuntu desktop.
The video call pieces on the phone
| Piece | What it does |
|---|---|
lounge-av |
Camera and mic for Linux, only switched on while something is using them. The camera is the phone’s own H.264 stream on a local web address. The mic becomes a PulseAudio source called lounge_mic, and it fails closed: if anything is wrong, no mic. |
cam-inject.js |
Injected into Meet. It replaces the browser’s camera list with “Lounge camera” and decodes the H.264 with WebCodecs in about 11 to 28 ms. |
lounge-call |
Wakes the screen, checks the sound server and restarts it if stuck, opens Meet full screen, joins, turns camera and mic on, and admits me when I arrive. It leaves 15 seconds after I leave, or after 3 minutes with no answer. |
lounge-call-ha |
Logs into Home Assistant as its own user, watches the buttons, runs lounge-call, and copies the call status back into Home Assistant. |
| scrcpy server (v5.0.1) | How Linux reaches the Android camera and mic. |
The camera settings file, ~/.config/lounge-av.conf:
CAMERA_ID=0 # 0 = rear main camera, 1 = front, 2 = probably the rear ultra-wide
ROTATE=180 # the picture was upside down with the phone lying landscape
Meet runs in its own Chrome profile, signed in to the lounge account only. My own Google account isn’t signed in anywhere on the phone.
The Home Assistant side
All UI helpers, no YAML:
| Helper | Type | What it’s for |
|---|---|---|
Call Dad (input_button.example_call) |
Button | The kids or my partner press it. The TV joins the call and my phone rings. |
Call home (input_button.example_call_home) |
Button | I press it. The TV joins by itself and I get a Join link. |
Hang up (input_button.example_hang_up) |
Button | Ends the TV side. |
Call status (input_text.example_call_status) |
Text | Written by the phone: idle, fixing-sound, starting, joining, waiting, in-call, no-answer or error-… |
The phone gets its own user. I made a non-admin Home Assistant user called “Lounge TV” and gave its long-lived token only to the phone, in a file only my user can read. I checked that admin endpoints refuse it. To cut it off, delete that user (or its token) under Settings → People → Users. My own admin token is not on the phone.
The ringing automation, on a Call Dad press:
- Works out who pressed it from the press’s user, so the alert says who is calling. A press from the TV’s own icon says “Someone in the lounge”.
- Sends my phone a notification with a Join button that opens the Meet room.
- Alerts again every 15 seconds, up to 12 times, while the status is
starting,joiningorwaiting. - Clears the alert once the call is on or over, and says “Missed video call” if nobody joined.
- Ignores the button coming back as
unknownorunavailableafter a restart, and presses while a call is already on.
The notification part looks like this. I rebuilt it from my notes, and the title and message are placeholders:
action: notify.mobile_app_example_phone
data:
title: "Video call"
message: "Someone in the lounge is calling"
data:
channel: "Video calls"
importance: high
tag: lounge_call
alert_once: false
vibrationPattern: "0,1000,500,1000,500,1000"
actions:
- action: URI
title: Join
uri: "<your Meet room link>"
Call home is simpler: I get a “Calling home” notification with a Join button, and the TV answers by itself. I message the family first so it’s not a surprise.
The buttons: a Call Dad tile for the family (a conditional card by user, so it doesn’t show for me), a Call home tile only I can see, and a red “tap to hang up” tile that only shows while a call is starting or on. Every one of them asks for confirmation before it does anything. There’s also a green phone icon on the Ubuntu dock that does the same as Call Dad.
Step by step
- Back up anything you want off the phone. Unlock the bootloader and root it with Magisk (above).
- Put Ubuntu 24.04 arm64 in
/data/ubuntu, and write the Magisk boot script: battery hold, standby whitelist, SSH, sound, graphics, desktop. - Install Termux and Termux:X11, and set the launcher as home. Turn off the lock screen.
- Install Chrome, the
gpuwrappers, RetroArch and anything else you want. - Connect the dock: charger first, then the phone, then the TV, network, dongle and mic.
- Make a Google account for the lounge and sign it in to a Chrome profile used only for Meet. Make a permanent Meet room (“create a meeting for later”).
- In Home Assistant, make the helpers, the “Lounge TV” user and its token, the two automations and the dashboard tiles.
- Put the token on the phone and start
lounge-call-hawith the desktop. - Set a ringtone on your own phone (see the lessons). Then do a test call, with everyone at home in on it.
Testing it
- Don’t test it on the quiet. Pressing Call Dad really rings my phone and really turns on the lounge camera and mic. Agree a test with whoever is home.
- Over SSH, these show what’s going on:
lounge-call # join the room now (TV side)
lounge-call --end # hang up
lounge-call-ha --press call_dad # exactly what the Call Dad button does
cat /tmp/lounge-call.status # what the call is doing
tail /tmp/lounge-call.log /tmp/lounge-call-ha.log
pactl info # is the sound server answering?
- Watch the status helper in Home Assistant go
starting→joining→waiting→in-call. That’s what drives the ringing, so if it doesn’t move, nothing rings. - I tested calls both ways on 2026-10-09: the TV calling me at work, and me calling home with the TV answering by itself.
- The graphics bridge made a real difference: glmark2’s refract test went from 4 to 21 fps, and terrain from 1 to 14.
- Not checked yet: at the time of writing the phone hasn’t been tested on the real dock. Charging through the dock, the screen staying awake when the TV is connected, the wired network, the Movo mic, and the battery actually stopping at 80% are all still to confirm. Turning the TV on and switching it to the right input when a call starts isn’t built yet.
Lessons learnt
The sound stopped working. Android put the Termux app into app standby, and in standby Android
cuts off the app’s network, even local connections. PulseAudio still looked like it was listening but refused
every connection. dumpsys netpolicy | grep <termux uid> showed blocked=APP_STANDBY. The fix is the
deviceidle whitelist line in the boot script.
A call sat on “Still trying to get in…” for no network reason. The network was fine. PulseAudio had
deadlocked: two of its threads were stuck waiting on each other. Now lounge-call asks pactl info before
every call and restarts PulseAudio if it doesn’t answer within 4 seconds. If it keeps happening, I’ll swap to a
different audio output module.
Chrome crashed on the Google sign-in page. Any page that touched gamepads or sensors killed it. Ubuntu
24.04’s device library tripped over something in this chroot on the phone’s old 4.19 kernel. Running Chrome
with the older device library from Ubuntu 22.04 fixed it, and that lives in the gpu wrapper so every Chrome
launch gets it.
The first camera path lagged. I first converted the phone’s video to MJPEG frames with ffmpeg. It worked, but ffmpeg held 4 or 5 frames (about 150 ms) and ate more than a whole CPU core. Passing the phone’s own H.264 straight to Chrome and decoding it with WebCodecs got it down to about 11 ms. Before, I noticed a bit of lag compared with WhatsApp. After the change, it was gone.
scrcpy crashed with “stack corruption detected”. That message actually meant the command line was too long: about 130 characters was fine, about 300 crashed. Now the options go in a file and only non-default ones are passed. scrcpy also deletes its own server file when it exits, so the script copies it back in every time.
pkill -f over SSH killed my own session. The pattern matched the SSH command running it. Write it as
pkill -f "[x]pattern" and it can’t match itself.
The HA app can’t really ring. At first it didn’t ring at all; I just got a notification. The re-alerts every 15 seconds and the long vibration help, but a proper ringtone is a setting on your phone: Home Assistant app → Notifications → the “Video calls” channel → Sound. Android only lets the phone’s owner set that.
An invisible window ate every click. An early screensaver put a see-through “shield” over the screen so a first touch would only wake it. The quick one-off tests passed, but the long-running version left the shield behind, and the mouse moved while every click went nowhere. Test the version that runs for days, not just the one-shot.
Questions and comments
Loading comments…