Building a Karaoke Machine with Linux and UltraStar

Lately, the blog posts here have been quite serious: SSH keys, fuzzing, integrity checks, etc. However, those things are not the best thing about computers. The best thing is doing something fun, and what’s more fun than music combined with the embarrassment of inadequate singing skills? To bring this idea to life, I decided to build a karaoke machine. This blog text is going to be a long-winded story of how I installed Linux on an ancient computer and downloaded a binary file to it. Let’s go. And fear not, there won’t be any singing so your ears are safe.

The Hardware

The first thing that a karaoke machine needs is a machine. I recently got my hands on a Dell Optiplex desktop for a tolerable price of zero euros. Wikipedia describes OptiPlex machines as “a line of business-oriented desktop and all-in-one computers made for corporate enterprises, healthcare, the government, and education markets”, so it sounds like a perfect fit for our entertainment/gaming system. The 8GB of RAM should be more than enough, but the i3-2120 CPU is quite ancient, and even back in the Stone Age it wasn’t a beast. Fortunately, UltraStar Deluxe (our karaoke software) lists 512MB and 1GHz as the minimum requirements, so we should be safe.

The harbinger of doom.

The Operating System

The karaoke machine machine requires an operating system. In theory, Windows 7 which was present in the machine would have sufficed. In practice, I don’t want to work with Windows 7. I considered a few different Linux distros but decided to go with NixOS. I had never tried it, but I had heard primarily two things about it:

  1. It’s the bee’s knees
  2. It’s difficult

I asked ChatGPT if NixOS is a good choice for a karaoke machine operating system, and it responded “it may be a good choice”. This is the kind of thing I usually say in a code review when I think something definitely isn’t a good choice.

The installation of NixOS was a breeze. I could even install it with my favourite desktop environment, XFCE. It’s my favourite because it works on the ancient clunkers that I tend to use as Linux machines. I also like the mouse mascot. At this point, I was thinking that the difficulty of NixOS is heavily over-emphasized by n00bs who have never seen a terminal.

The Karaoke Software

For the karaoke software, I chose UltraStar Deluxe. For all intents and purposes, it is the same as the good old SingStar games, except that it works on PC and you can add custom songs to it. Technically it is “a singing game”, not “a karaoke software”, but I’m not really a technically oriented person so it doesn’t matter.

Another good thing about UltraStar Deluxe is that it’s open-source, and you can download the releases from GitHub. This warms my software developer’s heart. I downloaded the .AppImage, tried to launch the game, just to be greeted with the following error:

NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box.

Something like this was to be expected from a “declarative” and “reproducible” operating system. If I understood correctly, I would have had to build the UltraStar Deluxe from source and write a Nix expression for it. To do this, I first would have had to go through the Nix language tutorial, then the Hello World derivation tutorial, and then I could have attempted to write an expression for UltraStar. The estimated duration just for the tutorials was three hours, not to mention the time it would have taken to get UltraStar itself working.

Maybe I am the n00b.

I can see the value in this, and learning Nix would help me in the long run. However, I chose to do what any sane human being would do in this situation and installed Linux Mint.

The Operating System, Part 2

So yes, I downloaded the Linux Mint XFCE edition ISO and attempted to flash it to a thumb drive. However, my Windows laptop totally fell apart when it tried to handle the multi-partitioned NixOS installation thumb drive. First Windows couldn’t format it. Then Windows couldn’t unpartition it. Then Windows couldn’t even assign a drive letter to it. In the end, I had to dig my even older Linux clunker and flash the thumb drive with it.

After that, the installation was just as easy as installing Ubuntu.

The Audio Hardware

Now, for the audio hardware, I could have just chosen to use a cheap mic with a 3.5mm jack, shove it into the mic input of the motherboard and call it a day. However, there are two problems with that. First of all, professionals have standards, and I’m not going to use a cheap mic like that. But more importantly, I don’t have such a microphone, and buying anything for this project would be a bit extravagant.

Therefore, I dug up my old USB audio interface and condenser microphone from the electronic trash pile in my closet and used them instead. Hooking them up was easy, as Linux Mint was able to detect the interface and all of its inputs and outputs without a hitch. Even the input worked nicely.

However, there was a problem with the audio output. When I connected the output from the interface to the speakers, there was a constant weird buzzing noise. I tried different cables, rebooting, different adapters, speaker settings, and anything but the gold-plated cable lifters. Nothing helped. I had a good night’s sleep, and then remembered why I put that audio interface in the closet pile in the first place: the audio output started to make a weird buzzing noise.

So I decided that maybe my standards are limited to the audio input, and used the audio output from the motherboard.

I feel that this is both too expensive and too cheap for this project.

The Return of the Karaoke Software and Happy End

Now, with an operating system that has common sense, I could download the UltraStar AppImage, add execute bits to it, and just execute it. How simple and unreproducible life can be! After configuring the microphone I was ready to start singing. I sucked at it.

Thanks, I just tried my best.

But yes, that was all about this project. It works, and there’s no need to improve it in any shape or form. No, I don’t want to write a systemd service that would launch UltraStar during boot (I actually tried, but I couldn’t get the audio working so I just decided that it’s not important). It feels weird to actually complete a project for once. Maybe it is because I chose not to build a distro from scratch for once. There wasn’t that much to do, but perhaps this blog text demonstrates one possible use for an old computer waiting for it’s new purpose.

Share