I know there are already tons of media center uses of raspberry pi, so is different with this one? I wanted to replace the old mini CD player by something I could easily hack. Thus my requirements were:
- a media center able to read audio CDs and DVDs (I know I'm a dinosaur)
- easily operated by young kids
Thus I came to a solution with a USB DVD drive, a few buttons connected to GPIO, and a sound amplifier. Finding a nice and rather small box for all these pieces needed quite some thinking, and I came up with a wooden box of Port wine.
Stuffs I needed:
- a raspberry pi 2
- an audio amp. The Velleman MK190 kit graciously provided by Bastien does work, just needs 12V power
- a power adapter producing 12V and 5V. I got one from an old hard drive external case.
- an USB DVD drive, just had to care about power and noise to choose it
- an HDMI extension cable
- an ethernet extension cable
- a remote control: I chose the MX3 air mouse
- various cables
- spare push buttons and soldering tools
- a sound plug (taken from the old CD player device)
Putting it together
I cut the buttons in some pine board I had, and to get them bump back to their original position after being pushed I used the plastic thing used for keyboard keys. Here is how it looks like:
The circuit for the GPIO is rather simple, just that I needed four buttons. The board is then fixed on the buttons holder medium board. See the assembled result here:
Then I had to carve the wood with chisels to get the wholes for the buttons, the DVD tray and various outputs (HDMI, ethernet, audio).
The volume button from the MK190 kit couldn't fit in the whole setup, thus I had to make one with some old round pieces of wood (a chair foot typically).
A few nails are maintaining the DVD player in place to avoid it to slide when inserting a disk in it. I also screwed the buttons board and then wired it all. Here is the whole thing from various angles:
Inside:
Front (you will see that I still haven't painted anything on the buttons):
Back:
Software
For the media center it was rather clear to me that I'll use Kodi, I just had to decide for the distro. I chose OSMC for the while rather than minimal ones like LibreElec or OpenElec as it is easier to hack the software on it without having to rebuild it all.
I hit a few problems with Kodi:
- auto playing audio CDs and DVDs wasn't that straight forward, I had to write a small udev rule for it
- Some audio CDs aren't playing with Kodi's native player. I had to setup VLC as an external player. I know it's rather hacky, but at least it works for the time beeing
And of course I had to write some python code for the GPIO buttons. It's so ugly at the moment, that I won't release it as is... and I still hope to be able to fix that libcdio usage bug to get rid of the external player.
After some time using it, I also discovered that I need to add a power switch to gracefully turn the raspberry pi on or off. So the project is not yet finished.
EDIT: I purchased a Mausberry USB port use-your-own-switch shutdown circuit. At least the whole system can now be turned off easily.