Henrik Carlsson's Blog

It works!

Posted by api-poster on

with permalink

Time to test the HiFiBerry as well.

Posted by api-poster on

with permalink

The Raspberry Pi Camera module does seem to work for the music player, but it did cause me some headaches initially.

The first problem I encountered seemed to stem from a sloppy physical installation of the camera. Once I removed it from the Pi and inserted it back in, it worked.

The second problem seems to be that by default the camera cropped the sensor data, so the QR code couldn’t be read as close to the camera as I wanted. Adding --prescale=640x480 as and argument to zbarcam appears to have solved the problem.

Tomorrow I’ll try using the HiFi Berry Amp2 as well.

Posted by Henrik on

Inga kommentarer

with permalink

It appears that I was quite good at documenting my work on the music player, so I’m up and running again now.

Previously I’ve used an old USB webcam (actually a PlayStation eyeToy Camera) as the scanner and it has worked fine. However I wanted something different in the long run, so yesterday I bought a camera module for the Raspberry Pi.

The main thing I’m doing tonight, apart from getting back to where I were, is to test whether this particular camera works or not. So far it has not been plug and play but maybe it was foolish of me to expect that. As I’m writing this I’m doing a apt-get update and apt-get upgrade and then I’ll have to do some configuration in raspi-config.

Also, I’m starting to get reaaaaaaally tired so I’ll probably call it a night pretty soon. I blame daylight savings time.

Posted by Henrik on

Inga kommentarer

with permalink

Linn and I finished watching Stranger Things Seasons 2 and 3 yesterday and since we don’t have any other show queued up, now seems like a good time to resume my work on a music player for the kids.

Right now I’m mostly trying to figure out how far I got the last time I worked on it.

Posted by Henrik on

with permalink

I made a slight mistake in a previous post. There needs to be two lines in the terminal to play from Spotify:

And yes, things are progressing nicely now.

Posted by Henrik on

with permalink

Right now is my favorite time of the year.

The kids are asleep after a long day of playing in the sun and I’m sitting on the deck, programming and blogging.

Posted by api-poster on

with permalink

Apparently it’s more or less impossible to install additional software on an instance of Pi MusicBox, so I’ll try to get Mopidy working on a ”vanilla” Raspian Lite instead.

Posted by Henrik on

with permalink

My somewhat ridiculous setup for listening to music outdoors today; a Raspberry Pi running PiMusicBox and Spotify Connect connected to an external speaker and being powered by a power bank.

Posted by api-poster on

with permalink

More progress on the music player for the kids

Slightly simplified the music player for the kids has two jobs:

  1. Scan for QR codes using the camera and identify the ones that contains a Spotify URI (using zbarcam) and
  2. send that URI to the MPD that plays the music from Spotify.

At the moment I am able to set up separate tests for the two jobs and both works, on there own. The problem is that I’m currently not able to set up MPD with Spotify and the zbar tools at the same time. It seems to have something to do with different operating systems and/or other kinds of conflicting requirements that I need to lock into.

For the tests right now, I use standard Raspbian plus zbar for bullet point number one and Pi MusicBox for point number two.

For my own memories sake, this is the very simple (and probably quite brittle) shell script that I’m using for bullet point 1:

Posted by Henrik on

En kommentar

with permalink

I’m making progress on the music player for my kids. Using Pi MusicBox on the Pi, I can control playback using mpc on my Mac.

Posted by Henrik on

Inga kommentarer

with permalink

A music player for the kids

My kids, Iris and Ebbe, are four and a half, and two years old respectively. Both of them loves to listen to music and dance. Compared to when I was a kid they have access to tremendous amounts of music. If I wanted to listen to a song as a child, I had to have it on a cassette or later in life a cd. Today’s kids have access to ”all the world’s music” in Spotify, Apple Music or similar.1

The problem with the modern world in this regard is that a cassette deck and a box of cassettes is much more kid friendly than a smart device like a phone or tablet with Spotify and possibly also a smart speaker connected via bluetooth, AirPlay or a Chromecast.

Spotify has a nice solution for this in there Spotify Codes. It wouldn’t be to hard to make a whole box of cards, one for each album and/or playlist that the kids want, and teach them how to scan the cards with Spotify. The problem is that it requires them to use their iPad (or my phone, or their mother’s phone).

Why is that a problem? Because if they use the iPad they will undoubtable be sidetracked by YouTube or something similar. Sometimes having them watching videos is great. I’m certain that the reason Iris know quite a few words in English, despite being a Swede with Swedish parents, is that she’s watched a lot of English videos on YouTube. But sometimes I want them to just listen to music and not having to have a discussion about why they are allowed to use the iPad but not the apps they want.

So I’ve started toying with the idea of building them a music player that works as simple or simpler than Spotify Codes but that is a dedicated hardware device, a Raspberry Pi. The plan is for it to use either QR codes or NFC tags to control what is being played, so that way the kids can have a box of cards with artwork, similar to the box of cassettes that I had as a kid.

I think it will work.

Right now I’m going to test various setups for it and document my progress here on the blog, under the tag The Kid’s Music Player.

Some links to similar projects


  1. Yes, I am being Captain Obvious here, I know. 

Posted by Henrik on

2 kommentarer

with permalink