Category Archives: Software

Volumio: a Raspberry Pi jukebox

Volumio playing aerodynamisk neger

Last Sunday, I spent some time tinkering with my Raspberry Pi 3, trying to get some sort of jukebox software up and running.

I finally settled on something called Volumio. It is a complete distribution that you install on the Pi and then it becomes a machine that plays many audio formats and that you can control from other devices, using a web interface.

And thanks to the Raspberry Pi 3’s WiFi, I just need to connect the audio jack and the power cable, and then the little machine can hide under the table with the rest of cables and other devices I don’t want to look at generally (NAS, modem, etc).

Volumio is installed by flashing a complete distribution onto a mini SD card. I had a small 4GB one roaming around so I used that. It’s cool because I can just swap SD cards and boom! I have a completely new environment without destroying the previous one.

The “official stable” builds that you’re directed to from their website won’t work with the Pi 3. They get stuck at the colourful loading pattern. I found someone had had the same problem, and the solution was to flash another image for Volumio 2 RC2. I flashed this new version, which is very hard to locate unless you know that such a thing exists or read the forum, and the initial boot didn’t show up the device on Bonjour, but after a reboot I could see it and start using it.

I configured it using the web interface, accessible at volumio.local. I told it to use WiFi (it worked!) and also to use my NAS music library (which also worked!). Then I shut it down again, moved everything out of my desk, and turned it on again to enjoy some music.

Apparently the initial Volumio front-end was built with PHP. Now they are rebuilding everything from scratch as Volumio 2, using Node.js, Socket.IO and Angular. I was excited about the node.js bit! But although there’s plenty of documentation around, I felt like I couldn’t understand where things were in the source, in the distribution, how to get a developer environment running, etc. Maybe it’s because I came back from holidays on Saturday and I’m still pretty jetlagged and my brain is not very functional yet, but maybe it’s also for the best: I surely don’t need to contribute to yet another project.

Anyway, I have a working jukebox. It can even play modules! It’s a bit basic at points (e.g. you cannot navigate by ‘genre’ or other MP3 metatags) but it is getting the job done so I’m happy.

Why is Instagram not a website (yet)?

Rem was wondering about this yesterday in Twitter:

A couple years ago I had to do some analysis of popular apps (basically peeking inside their guts, so to speak). What we found is that Instagram used a lot of native libraries for dealing with video and audio.

Rem suggests that Instagram could be almost 100% a website nowadays, and not the strange hybrid it is. I would love to see that, but the web platform needs a lot more features we don’t have yet, for example:

  • reliably being able to select which camera to use, and also being able to focus
  • encoding into a certain type of video format, in a performant non-draining-your-battery way
  • manipulating videos in real time, sounds included
  • accessing the ‘photoroll’ easily

You can access a camera stream with getUserMedia, but for privacy reasons you cannot see details about the devices so your code cannot know if they’re back or front cameras, and so the UI cannot respond appropriately. When running in phones, which use better camera hardware than webcams, we cannot access the camera settings from JavaScript (we can, with Firefox OS, but the APIs haven’t been standardised as no other vendor was interested in implementing them).

As usual, video is a huge issue in the web. Encoding is complex and expensive in battery terms, but thanks to MediaRecorder it is becoming more accessible. Still the formats MediaRecorder outputs are only viewable in browsers (vp8/webm); if you encode a video using the browser you have to convert it locally to something else like mp4 if you want to upload it to sites like Twitter, and unless you’re a tech-savvy person and have installed VLC or similar you cannot even watch the video you generated in your desktop if using the default video viewers in your system.

Similarly, handling video and audio post processing in real time is possible with WebGL + Web Audio but recording is not supported in anything other than Firefox. Chromieum/Opera won’t give you a stream from canvas or record a stream from a Web Audio context either.

And being able to access the photoroll in mobile or a directory in desktop would require that the APIs for exposing directory listings are available so the app could do things such as building thumbnails of the images, but they aren’t.

It’s not impossible—it’s “just” a matter of implementation and adoption.

If apps such as Instagram were 100% web based, and had a reliable chance of working reasonably well on every device, there would be no distinctions between device operating systems, and we could just focus on the device features (price, camera quality, battery life, storage, design…). This would be huge for the users and quite probably for the app makers which would need only one team to build the app, not one per operating system.

But would it be huge for Google and Apple?

Securing your self-hosted website with Let’s Encrypt

Continue reading Securing your self-hosted website with Let’s Encrypt

Securing your self-hosted website with Let’s Encrypt, part 8: more cool things about Let’s Encrypt

PHEW! That was a lot of blog posts in just a couple of days, but I wanted to make sure that individual ‘topics’ had their own URL so people can link to the bit that they find more interesting and ignore everything else.

To finish, I would like to present together a number of interesting and cool facts about Let’s Encrypt which I omitted before because they were not directly related to using it.

Continue reading Securing your self-hosted website with Let’s Encrypt, part 8: more cool things about Let’s Encrypt

Securing your self-hosted website with Let’s Encrypt, part 7: a workflow to migrate from HTTP to HTTPS

If you’ve followed along the previous posts you will have noticed that I didn’t get into details when mentioning how to migrate–I just assumed that you knew how to do that and eventually your site would be serving HTTPS using a certificate from Let’s Encrypt.

But turns out that finding a good workflow to do this was one of the things that consumed most of my time initially! That, and the sheer fear of repetition.

Continue reading Securing your self-hosted website with Let’s Encrypt, part 7: a workflow to migrate from HTTP to HTTPS