MJB Jukebox Box

MJB Jukebox Box is an OpenWRT based mpd distribution. This page documents the distro as well as the hardware it runs on. The box is basically a wall mounted audio player based on cheap off the shelf parts. It has no amp of its own and the user is supposed to supply that independantly.

Build the Hardware

You will need two types of skills to pull this project off. A regular computer geek should be properly enabled for building the actual computer. A woodworker geek will come in handy for building the case.

Buy Components

If you buy the electronics from wholesale resellers we are looking at a BOM that is slightly below 500 CHF. Most of the parts should also be available locally. I found the touchscreen to be the hardest part to source at a reasonable price.

You will need

Hookup Electronics

It is recommended that you hook up all electronics on a lab bench before building the case. This way you can test the system with all parts while they are still easy to replace. It also allows you to plan ahead for building the case, as you will know how much space the indivdual parts take up.

Install WLAN

The WLAN parts are sensitive to static shock so you should remember to discharge by touching the negative end of a plugged in power brick. Touching the (metal) case of your desktop pc will also work.

You can use either miniPCI slot for the WLAN card. You will have to slide in the card in a 45 deg. angle until its all the way in and then press down on it to make contact and snap it in place.

TODO fotos

Connect the pigtail cables to the WLAN board and screw the antennas to the end of them. You WLAN should now be ready to connect.

TODO connected fotos

If you need multiple WLAN devices you can switch over the board and repeat the above steps with the miniPCI port there.

TODO bottom miniPCI foto

USB Hub

Plug the USB Hubs uplink into one port of the Alix.

TODO image

HDD Install

We are going to connect the notebook HDD to the self powered USB hub as well as directly to the board. This way the HDD gets its power from to different power supplies.

TODO image showing both connectors

Touchscreen connection

The touchscreen comes with an SVR connector that screws into a combined VGA/USB cable. Screw together the two cables and plugin the VGA connector to the Alix board and the SVR connector to the screen. Connect the USB lead to the USB hub you added earlier.

TODO bild von monitor und kabel zu alix

More USB Devices

At this point you can plug the SD card reader and the USB cable into the hub. We’re going to use the female end of the USB cable as a flash stick port on the final device.

TODO image

In my setup there is one freee port left on the USB hub. Its for upgrading the MJB with a bluetooth module or for adding more internal storage by way of another self powered USB hub.

Networking

You will need an ethernet connection for setting up the device. You might as well plug that in right now.

Power to the device

This is the last part of building your electronics. The components get all the power they need. You should always plugin the leads to the different devices before plugging in their power brick.

You need to plug all three power bricks into the power strip you got.

TODO image w/ 3 bricks

Thats it! Basically the electronics are now built. You will want to grab an image and install the SD card in the Alix board before you power the whole shebang up for testing.

Building the Case

The case we’re building has enough space for the whole electronics withou much space to spare. You might need to redimension this depending on the size of your parts.

Calculate Case Dimensions

Cut your Wood

Try to get the wood cut at your woodworkers. He usually has a bigger and better machine than you do. If you tell the carpenter exactly what you need he’ll do a much better job than you could at home.

TODO faserung von wegen verziehen, wie auswälen

Make a Template for the Frame

Form-Press the Frame

Add the Back-Panel

Paint the Frame and Front-Panel

You might want to add some color to your design. I’m varnishing the main frame with a slick gloss varnish to protect the wood from the elements without getting an unanatural look.

TODO image

For the Front-Panel i’m going for a dark blue piano lacquer look. The sky is actually the limit on this.

TODO image of various painting steps

Add Fixtures for Mounting Electronics

You will want to wait for the frame and panel to dry before starting this step. You’ll have to mount the fixtures at the right place so screen and cables all end up in the right cutout on the front panel.

TODO image of the fixtures
TODO image with schematic drwaing showing where the electronics will go.
TODO image with see through panel and electonic schematics

Mount Electronics

Mount Front-Panel

Get the Software

You can either build you own image or grab a ready made one from the servers.

Download an Image

WRITEME

Build an Image

The build process for the MJB image is layered ontop of the OpenWRT build tools. It is fully git based and uses various soures. You start the build process in an empty dir by cloning the MJB repo:

  1. git clone git://github.com/hairmare/mjb.git

In the mjb dir there is a env that will take care of setting up and building OpenWRT for you.

  1. cd mjb
  2. make
  3. make world

If all went well, you will find an MJB image in the bin/x86 dir of the OpenWRT repo that was created by the build script.

  1. cd ../openwrt/bin/x86/
  2. ls

Image Patches

The MJB image contains various patches that are described here in detail. Chances are you might have to remove some of the patches if you swap out hardware.

eGalax Patchset

The eGalax patchset takes car of swapping ABS_X/Y coordinates with ABS_Z/RX coordinates. Its based on the patches in the discussion for a bug in redhats bugzilla. I had to change some more coords in packages not mentioned in the bug.

This patchh is a dirty hack and it should get replaced by some more or less clean quirks handling codde in usbhid.

Install the System

Flash a CF Card

You will be flashing a stock CF card with the MJB image. You can do this with any computer that takes CF cards. You can get cheap USB CF drives pretty much everywhere nowadays.

If your OS automounted the CF card you will need to unmount it before you can use dd to write the image to the card. The following command overwrites the cards current contents.

  1. dd if=openwrt-x86-generic-squashfs.image of=/dev/DISK

Configure Networking

For the next few steps you will want to hook the device up to a network that has a dhcp server using an Ethernet cable. You can then tweak networking for the needs you will have when you finally install the system.

Logging In

The device has a running ssh server. Initially the server supports passwordless logins with a private rsa key that you can get from the internet. You might have to look at the dhcp leases on your dhcp server to find the IP of the device.

  1. wget http://mjb.hairmare.ch/default.key
  2. ssh-add default.key
  3. ssh

Once you are in the device you should replace the rsa public key with your own. The authorized_keys file is located in /etc/dropbear/authorized_keys

Setup Wireless

The default setup opens a unsecured wireless network wich is used soley for connecting to the device. User may connect to the device but they cannot access the internet directly.

Depending on how wlan-busy your neighborhood is you may want to add a simple key so you can restrict access to you guests by telling them the key.

The config is in /etc/config/wireless

Setup Audioscrobbling

Hack /etc/mpdas for audioscrobbling

Configure Access to the Device

hack /etc/mpd.conf if you want a password based mpd setup
change the password in /etc/pymodtouchgui based on needs

Integrate with a PA

MJB will need to get hooked up to an existing PA or home audio setup.

Use the System

hand out infos and display qr codes so others may get clients

Clients

Touchscreen

iPhone

The recomended Client is MPoD. It is available in the App Store for free.

Links

have fun!