Quick Hack: Converting Phone to Streaming

0

What do you do with those old Android or iPhone phones and tablets? You have a lot of options, but it’s quite easy to create your own flow deck with a little off-the-shelf software. What is a stream deck, you ask? The name comes from its use as a controller for a live streaming setup, but it’s basically an LCD touchscreen that can trigger things on your computer.

The software I use, Deckboard, is a server for Windows or Linux and, of course, an Android application. The app is free with some limitations, but for less than $4 you can purchase the full version. However, even the free version is capable enough. You can use Android phone or tablet and you can connect to PC with USB cable or WiFi. I’ve found that even with WiFi it’s handy to keep the phone charged, so realistically you’re going to have a cable, but it doesn’t have to connect to the host computer.

Linux Setup

Setup is very simple. The biggest hurdle is that you may need to configure your firewall to allow the server to listen on port 8500 with TCP. There are a few small issues when installing with Linux that you may want to watch out for. There are 32-bit and 64-bit versions in deb, tar.gz, and the application image format. There is also a snap. The problem with the snap is that it’s sandboxed, so without effort you can’t easily launch programs, which is kind of the whole point. I finally deleted it and installed the deb file, which was fine.

There were two more wrinkles. First, although Deckboard offers a way to launch programs, it has to be a one-list program that it reads from your system. This would be acceptable, but the list was not complete. I never understood why some things appear on the list and others don’t. For example, GIMP which appears in my application menu was missing. Yet other things that were quite obscure didn’t come to light.

I thought this might be a dealbreaker until I found out that Deckboard has a well-developed plugin system and one of those plugins lets you run an arbitrary command line. I suppose it’s a bit less convenient, but it’s much more flexible since you can launch any program you want and provide options for it as well.

The only other complaint I had is that when you run the program it brings up its configuration interface and goes to the system tray. It’s great the first time you run it, but when you start the system, it would be nice to have it start quietly. If there is an option for this, I haven’t found it. I’ll tell you how I solved that later, but, for now, live with it.

Configuration

Of course, installing it on both machines is just the start. The point of something like this is to configure it to your liking. The program knows how to communicate with OBS, Spotify, Twitter and Twitch. But you can also add generic programs, URLs, etc. There are also plugins for things like Discord, Open Hardware Monitor, Steam, etc.

The media panel lets me control media and open a few apps

You can create a bunch of pages, so you don’t have to put everything on one page. The free version limits the number of buttons you can have on a page, but the upgrade lets you put way too many if you want. I found that three rows of 6 buttons in landscape mode on my old Pixel 2 XL worked fine for me.

Of course, everyone will have different ideas on how to put it together, and you’re probably better at creating something aesthetically pleasing than I am. However, I tried to keep some things constant. The top right corner of each screen is a time button that does nothing, just shows the time). This requires a plugin. The rest of the top row is for buttons that open other pages and on each screen, but the main screen, the button next to the clock takes you back to the main screen.

Creating a new button is quite easy

The button at the bottom right of each screen opens a multimedia panel, which is so useful. Again, you won’t like my setup and you’ll want yours.

Creating buttons and pages is very simple on PC. You can select actions ranging from keyboard macros to media control. You can control the mouse, open a website or take a screenshot. Of course, you can also run a program like I mentioned earlier.

Form and function

Graphical buttons can make your deck look better, but getting there isn’t easy

My buttons are a bit bland, I admit. The icons are built into the program and come from Font Awesome. However, I didn’t realize you could make each button use your own custom graphic. To do this, select the shape of the button which can be square, round or some mysterious third option which looks like an image. At first I thought it just meant “fully transparent”, but if you select that and then press the button in the edit window, it lets you choose a file for a background. Guess I’ll have to reconfigure everything now that I know.

One thing that is nice is that you can have one button to perform multiple actions. So, for example, when I press the Hackaday button, it not only switches to the Hackaday page on the bridge, but it also switches to my Hackaday desktop on the PC by sending a keyboard command. It could also run a script or file.

Buttons can perform multiple actions

It’s not quite a scripting language, but it saves you from having to bind buttons to a bash script in some cases.

The final piece

I mentioned that I didn’t like that loading the program on startup also causes the main window to appear. I found a fairly easy way to combat this, at least on KDE. First, run the minimized program. You can do this in several ways. I used a KWIN window rule to force it to iconify, but you can also use kstart to do this. Of course, if you’re not using KDE, you’ll have to find another way to do this and honestly it doesn’t really matter if you don’t mind seeing the setup screen pop up a bit at the startup. This is because in addition to setting the program to start automatically, I also ran a script file called deckboard-tidy.sh:


#!/bin/bash
sleep 5
wmctrl -c deckboard

In other words, wait for the program to start and then close its window. It always stays running in the system tray. You can also tell Deckboard not to load and then do the whole loading operation in this script. You can probably do the same on other desktops, but the details will depend on your setup.

Honestly, it’s a hack that’s more useful than difficult. But you can spend a lot of time fine-tuning that perfect setup. But it makes that old phone something you can use every day.

If you prefer a more rigorous hack, check out FreeDeck. Not that it’s the only one out there. If you want a really useful hack, it would be nice to reverse engineer the Deckboard TCP protocol so we can have a Raspberry Pi server for it.

Share.

Comments are closed.