Sound-reactive Sideboard

Sound-reactive sideboard
Sound-reactive sideboard

A project that I had planned for quite some time came to fruition last year, now I finally found time to document the result. My livingroom sideboard looked messy and kind of boring while not blending in anymore with the updated style of my living room. I wanted to turn it into a striking centerpiece of the room.
The plan was to install a sound-reactive lighting system. I wanted the light effects to be detailed and not disturbed by ambient sound in the living room, i.e. it sound not react to people’s voices, just the music playing.

My living room sideboard is an off-the-shelf product from IKEA that I bought many years ago. It didn’t have doors installed, but I was delighted that I could still buy matching doors with windows in them.
To realize the light effects, I’ve installed frosted plexi glass inside the windows.

Getting technical…

To control the LEDs, I’m using an ESP32-based LED controller with a line-in module and an ADC (analog-digital converter). After some experimenting, I’ve found this board to work well. I’ve connected 6 WS2812B LED strips to 3 pins and installed them with an aluminium profile into the doors. The frosted windows and profiles diffuse the light nicely so you can’t make out individual LEDs really.
On the software side, I’m using a sound-reactive port of the WLED project. WLED is Free and Open Source software, of course. Though its user interface can be a little unwieldy, it’s also very powerful and integrates nicely with homeassistant, so it can be controlled automatically.

Inside view
Inside view

The ESP32, being a rather powerful dual-core microcontroller, can process the incoming audio signal on one core (using fast-fourier transformation) and compute complex LED effects on the other core. Rendering up to 200 frames per second to 2 times 210 LEDs is no problem while power consumption of just the controller stays well under 1W. Pretty impressive! Depending on the LED effects (number of LEDs lit up at a given time and their colors), the whole thing hardly ever reaches 10W of power consumption.

ESP32-based LED controller
ESP32-based LED controller

Another functional goal of this project was to solve cooling issues of my amplifier once and for all. The amp would run really hot and shut off after playing at higher volume for some time. I installed a bunch of 12cm fans which suck air through the amplifier and blow it out on the backside. Both amp and and fans are connected to smartplugs. I turned to my homeassistant and set up an automation which turns the fans on whenever the amp’s power consumption reaches a certain level. This works really nicely, since the fans never spin at lower volumes (when you could hear them through the music) and keep everything cool and running stable at higher volume when it’s necessary — without human interaction.

Cooling system
Cooling system

Walnut finish

The outer shell of the sideboard is made of walnut wooden panels with an oil and varnish finish, thanks to my friend Joris. The oil gives it a darker look and accentuates the grain, matching the speaker system. The matte varnish finish (Skylt, highly recommended for its durability and natural look) allows me to sleep well even if people put their drinks on it.

Done and dusted
Done and dusted

I love it when a plan comes together!

I’m really happy with the result. While I had thought it out for a long time already, it’s always a lot more impressive when you see the final result in action.
The WLED firmware allows me to create interesting light effects. I can run the 3 doors as one, but also easily split them up into segments so each door panel renders its own effect. WLED has ca. 200 different LED effects, many of them react to sound. Each effect can be combined with one of 50 color palettes, some of the palettes are sound-reactive in their own right leading to a very dynamic display.
One cool feature is that the processed sound data can be broadcast across the network (over UDP) and received by other WLED controllers, so I can have multiple LED displays in the house, each rendering their own effect to the music, creating a more immersive experience.



Streaming audio from Plasma to a Chromecast

Chromecast devices in the sound settings

This morning, while browsing the web, I wanted to listen to a Podcast from my laptop, and thought “Hey, can I stream this to our stereo?”. As it turns out, that’s rather easy to achieve, so I thought I’d share it here.
The media devices in our home are connected using Chromecasts, which are small dongles that allow playing media on them, meaning you can play for example a video from your phone on the projector in the living room: very convenient.

I didn’t know if that was easily achievable with audio from my Plasma/Linux laptop and a quick search turned up “pulseaudio-dlna” which adds Chromecast devices on the local networks as output devices.

On my KDE Neon laptop, it’s as easy as installing pulseaudio-dlna from the standard repositories and then starting “pulseaudio-dlna” from the commandline. Then, I can pick an output device from the panel popup and the audio stream changed to my stereo.

$ sudo apt install pulseaudio-dlna
[...]
$ sudo pulseaudio-dlna
[...]
Added the device "Stereo (Chromecast)".
[...]

DBus-Activated Systemtray Plasmoids

In this article, I’m describing a way to dynamically load Plasmoids into the systemtray. It’s interesting for you if you develop Plasma addons, or if you’re interested in the design of Plasma by KDE.

One of the wishes that came up during the latest Plasma sprint in Barcelona was a more dynamic way of showing functionality in the systemtray, that little notification area sitting in the panel next to the clock. The systemtray can have different kinds of “things” in them: Statusnotifiers, which are basically systray icons of applications, and Plasma widgets, which allows for much more functionality and freedom in UI development. Statusnotifiers are instantiated by applications, so their lifetime is entirely in the hands of the application they belong to. For Plasma widgets, this is a bit different, they’re currently loaded on startup. Ideally, we want to load specific services on-demand, say when a specific service becomes available.

You may have guessed by the title already, this feature has now landed in Plasma Next. It was actually quite easy to do, yet it’s a very powerful feature. First, let’s see what it looks like:

This feature allows loading and unloading Plasmoids when dbus services come and go. Applets can specify in their metadata which service should control their lifecycle.

This has the following advantages:

  • We can dynamically only load widgets when they’re useful, reducing clutter in many cases
  • Applications can provide widgets that appear and disappear based on the application running
  • We can load controls for system services dynamically as they come and go
  • It makes it easier to delay loading of widgets in the systemtray until when a specific service appears, cutting down startup time
  • It makes widgets and their features more discoverable as they’ll be able to appear automatically

One immediate user for this is the media controller widget, which will now only be loaded once an MPRIS2-compatible media player is running (as indicated by a dbus interface becoming available on the session bus.)

How do you do that? It’s quite easy. Two things need to be done: the widget should indicate to be loaded into the systemtray automatically, and it needs to specify a service which triggers loading it. That’s two lines in your metadata.desktop file, looking like this for example:

X-Plasma-NotificationArea=true
X-Plasma-DBusActivationService=org.mpris.MediaPlayer2.

That’s all. Enjoy your cleaner, more dynamic systemtray!

Tokamak 5 Photo Blog

Tokamak 5 has ended, the house is mostly clean and proper again, so time to post some photographic evidence of what has been an epic sprint.

Tulips, typical for the Netherlands. Not all of them made the end of the sprint.

Tulips, typical for the Netherlands. Not all of them made the end of the sprint.

Artur, looking into QtWebkit performance on Plasma Active

Artur, looking into QtWebkit performance on Plasma Active.

Dario and Ivan

BBQ, yes, that's a Brazilian taking care of the veggie grill.

BBQ, yes, that’s a Brazilian taking care of the veggie grill. (The tricolore shirt is for easier Visa procedures.)

Kevin, API bitch and Kanban master.

Kevin, API bitch (his words) and Kanban master.

Daily stand-up to catch up with other's activities.

Daily stand-up meeting to catch up with others’ activities.

No comment. (XKCD reference welcome.)

No comment. (XKCD reference welcome.)

We know what to do with ... pancakes.

We know what to do with … pancakes. (Don’t worry, Aaron and the pancake had a wonderful rest of the evening. Pancakes were kindly made by Adriaan.)

Groupphoto. Taken one day after Dario and Ruphy left, so we don't look like an Italian-only team.

Groupphoto. Taken one day after Dario and Ruphy had to leave, so we don’t look like an Italian-only team. Also clearly a Thursday.

Primary means of transportation. Looks more stupid in wide-angle.

Primary means of transportation. Looks more stupid in wide-angle.

OranjePop, one of the concerts.

OranjePop, one of the concerts. Verdict: Can’t really sing, but surely fun music to listen and watch.

Interview with Pardus, Nouvelle Vague

I’ve been interviewed again, and this time the resulting article is published in Turkish, in the Pardus E-Zine. There must be a theme that I always post links to interviews when only parts of the audience can read it. One day, I’ll get you all. The photo’s are universally legible, though. They’re also proof that I’m the most relaxed hacker in the world, an important thing if you ask me.

On Sunday night, I went to Utrecht to see Nouvelle Vague, a French band performing in Tivoli. It was a nice concert, musically on a very high level and with a good portion of fun. The girls, Melanie and Nadeah, were both entertaining and charming (how cute can you be, performing the Dead Kennedy’s song “too drunk to fuck“?), playing some kind of new wave version of good cop, bad cop with reversed dress colors, which gave the concert a very nice touch.