2014/02/15

Beaglebone Black Music Player Controlled via Android



What you need:

What Cost From
Beaglebone Black 49,95 € www.pollin.de
CSL USB Soundcard 6,95 € www.amazon.de
microSD card ~ 10€ (16 GB) www.amazon.de
Card Reader ??? ???
USB Charger (without cable) or 5V charger ??? ???
LAN Cable ??? ???


It should be possible to do the same project with the Raspberry PI a little cheaper.


1.) Install Debian Linux on the Beaglebone Black
http://elinux.org/Beagleboard:Debian_On_BeagleBone_Black
Don't forgot to create your own user for default login without root access.

1.5) Install ssh if not already:
apt-get install openssh-server

But as  I remember this comes already preinstalled with the Debian image.
For more informations just google or http://www.cyberciti.biz/faq/debian-linux-install-openssh-sshd-server/

2.) Update and install ALSA sound and mplayer.

apt-get update
apt-get upgrade
apt-get install alsa-base mplayer

3.) Get the usb sound card to work
After installing ALSA the USB sound card should work out of the box. Just plug it in. With dmesg | tail you can verify that the sound card has been recognized by the system.

To list all sound devices type

aplay -L

4.) Run mplayer for a first test
You can copy a mp3 file via the microSD card or maybe via scp (SSH Copy).
To play the file enter:

 mplayer -ao alsa:device=hw=1.0 /your/file.mp3

If you will try to run mplayer without the -ao device option the playback will happen via the onboard hdmi output.

5.) Now the most fun part - setup remote control
This is actually extremely easy. You just need to install Coversal on your android phone:

https://play.google.com/store/apps/details?id=com.coversal.app
http://www.coversal.com/

Use the mplayer plugin. You need to change the play command in the settings menu after you setup the plugin (you will be asked for the IP, user and password of your Beaglebone Black, after you finish go back to the main menu, click long on the Remote Control profile you just created and choose settings or configuration; i don't remember the correct entry name).

You just need to add the -ao alsa:device=hw=1.0 to the predefined command directly after mplayer.

That's it. It should basically work the same way with the Raspberry PI. But you don't need to buy a USB sound card, it already has an line output.

Edit: With the Raspberry PI A the project will cost just about 35 € (Raspberry + Cable, eventually SD card)