• Geek Speak: How To Build A BeagleBone Black MPD Music Server

    Warning the following article contains some geeky stuff. What follows is a step by step guide to building a tiny 2.4" x 0.82" x 3.54" Linux music server. It's not rocket science and the instructions make the process fairly easy, but the article isn't for everybody. Thanks to CA readers K-man and Richard Dale for additional information and tweaks for setting up the BeagleBone Black so it runs great. Please note there are many ways to setup and configure the BBB. This is just one way using either Mac OS X or Windows. Readers are encouraged to leave comments with additional tips, tricks, and tweaks. I will update this article accordingly.
















    Introduction

    The new $45 BeagleBone Black motherboard has excited many computer audio entusiasts. This tiny board has enough power and ports to run a Linux based MPD music server. In addition, Logic Supply has released a new BeagleBone Black case in a very cool orange color as well as a more traditional black. The case is made specifically for the BBB. All the ports line up perfectly and the finished product with BBB inside looks really neat. I attached the four rubber feet to the bottom of my Logic Supply case and the BBB sits nicely on any of my audio components without scratching itself or the other device. The case is made of sturdy metal, unlike the plastic options available heretofore. If you have a BBB or are going to pick one up I'd pick up the Logic Supply case as well.






    Here is a list of requirements and step by step instructions for the BBB-MPD server running Linux from the built-in eMMC flash drive.



    Requirements:







    Step By Step Mac

    - Connect the MicroSD card using an adapter to a Mac or PC.
    - Open Disk Utility (Applications > Utilities > Disk Utility), select select all volumes under the MicroSD card, then select Unmount. In my example the volume is named 8GB. (Image Link )
    - Install The Unarchiver (App Link )
    - Download the Debian Wheezy image (Direct Link ). During the download if asked a question about the file extension .img or .xz, click "Use .xz" (Image Link )
    - Double-click the downloaded Debian Wheezy image. This will open The Unarchiver and automatically extract the needed image file (BBB-eMMC-flasher-debian-7.4-2014-03-27.img)
    - Open the Terminal app (Applications > Utilities > Terminal)
    - Type -> sudo su (without the arrow ->)
    - Enter your password if asked.
    - Type -> diskutil list
    - Take note of the disk number of the MicroSD card connected to your computer. My MicroSD card is listed as /dev/disk1. The MicroSD card should be easily identifiable by its small size. My MicroSD card is listed as 7.9 GB (Image Link )
    - Type -> sudo dd if=
    - Drag the Debian Wheezy image file on to the Terminal window to automatically fill in the path to the file (Image Link ) You can also type this in manually if desired.
    - After dropping the image file on to the Terminal window the command line should read something like this >> dd if=/Users/chris/Desktop/BBB-eMMC-flasher-debian-7.4-2014-03-27.img (Image Link ).
    - Make sure there is a single space after the path to the Debian Wheezy image file entered in the previous steps.
    - Type -> of=
    - Then enter the disk number of your MicroSD card. In my case this is /dev/disk1
    - The text should look something like this of=/dev/disk1 (Image Link ).
    - Make sure there is a single space after the path to your MicroSD card entered in the previous steps.
    - Type -> bs=1m
    - The entire line should now look something like this >> dd if=/Users/chris/Desktop/BBB-eMMC-flasher-debian-7.4-2014-03-27.img of=/dev/disk1 bs=1m
    - Here is an image of my Terminal (Image Link )
    - Hit Enter on your keyboard and wait for the image to be written to the MicroSD card. This will take several minutes and appear like your computer is stuck. Please wait for the command to finish.
    - Once the image has been written to the MicroSD card the Terminal window will list something like this
    700+0 records in
    700+0 records out
    734003200 bytes transferred in 393.606273 secs (1864816 bytes/sec) (Image Link )
    - If you receive an error message stating "Resource busy" (Image Link ) you likely skipped step 2. Please unmount the volume and try again.
    - Open Disk Utility (Applications > Utilities > Disk Utility), select the MicroSd card, click Eject or Eject Disk via the right-click menu.
    - Place the MicroSD card into the BeagleBone Black's MicroSD card slot.
    - Hold down the small Boot Switch / Button while connecting the power supply to the board.
    - As soon as one of the User LEDs illuminates, release the Boot Switch / Button.
    - The User LEDs should continue flashing while the MicroSD card image is copied to the on-board eMMC flash memory. The process should take about five minutes.
    - When all four User LEDs are illuminated steady, pull the power supply from the board and remove the MicroSD card.
    - Connect an Ethernet cable to the board and re-connect the power supply.
    - The BeagleBone Black will boot into Debian Linux.
    - Install the LanScan application from the App Store Link
    - Open LanScan and click Lan your Scan.
    - Once the network scan has completed locate the BeagleBone Black's IP address. The vendor will be listed as Texas Instruments. My BeagleBone Black's IP address is 10.0.1.179 (Image Link )
    - Open the Terminal app (Applications > Utilities > Terminal)
    - Type -> sudo su
    - Enter your password if asked.
    - Type -> ssh root@
    - After the @ symbol type the IP address of your BeagleBone Black and hit enter. Mine looks like this ssh root@10.0.1.179 (Image Link )
    - You should receive a message about the authenticity of the of and the RSA key fingerprint. Type the entire word YES and hit enter.
    - You'll then be asked for the root password to login to the BeagleBone Black. Enter root as the password.
    - Here is an image of the entire login sequence (Image Link )
    - From here the Mac OS X and Windows configuration is the same because the work is done on the BeagleBone Black. Skip to the BeagleBone Black OS configuration.







    Step By Step Windows

    - Connect the MicroSD card using an adapter to a Mac or PC.
    - Install 7-Zip Link
    - Install Win32 Disk Image Link
    - Download the Debian Wheezy image (Direct Link ).
    - Right-click the downloaded Debian Wheezy image. Select 7-Zip in the right-click menu, then select Extract Here. The file BBB-eMMC-flasher-debian-7.4-2014-03-27 will appear next to the downloaded image when the extraction is complete. (Image Link )
    - Open Win32 Disk Imager
    - Make sure the MicroSD card drive letter is selected under Device (Image Link )
    - Select the small folder to the left of the Device drive letter and browse to the file extracted using the 7-Zip program. You will need to click the drop-down arrow above the Cancel button (lower right) and select *.* to show all files (Image Link ). (The Debian Wheezy image is extract without the .img file extension). Once *.* is selected you can select the file BBB-eMMC-flasher-debian-7.4-2014-03-27 that was extracted using the 7-Zip program. Don't select the .xz compressed file. (Image Link )
    - Click the Write button and Yes to any popup questions.
    - Eject the MicroSd card when Win32 Disk Imager finishes writing the image.
    - Place the MicroSD card into the BeagleBone Black's MicroSD card slot.
    - Hold down the small Boot Switch / Button while connecting the power supply to the board.
    - As soon as one of the User LEDs illuminates, release the Boot Switch / Button.
    - The User LEDs should continue flashing while the MicroSD card image is copied to the on-board eMMC flash memory. The process should take about five minutes.
    - When all four User LEDs are illuminated steady, pull the power supply from the board and remove the MicroSD card.
    - Connect an Ethernet cable to the board and re-connect the power supply.
    - The BeagleBone Black will boot into Debian Linux.
    - Download the PuTTY application Link
    - Download the Advanced IP Scanner application Link
    - Open Advanced IP Scanner and click the Scan button.
    - Once the network scan has completed locate the BeagleBone Black's IP address. The manufacturer will be listed as Texas Instruments. My BeagleBone Black's IP address is 10.0.1.179 (Image Link )
    - Open the PuTTY application and enter the IP address of your BeagleBone Black. I've entered 10.0.1.179 (Image Link )
    - Click Open, then click Yes to the PuTTY Security Alert (Image Link )
    - Enter root at the login prompt (Image Link )
    - Enter root as the password.
    - The screen should look like this (Image Link )
    - From here the Mac OS X and Windows configuration is the same because the work is done on the BeagleBone Black. Skip to the BeagleBone Black OS configuration.






    BeagleBone Black OS configuration.

    After using PuTTY or the OS X Terminal app to connect via SSH to the BeagleBone Black you'll need to run several commands to update and configure the BBB as an MPD server.

    - Type -> apt-get update
    - Hit Enter and wait for the update to complete.
    - Type -> apt-get upgrade -y
    - Hit Enter and wait for the upgrade to complete.
    - Type -> reboot
    - Hit Enter and wait for the BBB to restart
    - Reconnect to the BBB via SSH using PuTTY or OS X Terminal app as described above.
    - Type -> apt-get install mpd ncmpc alsa-base cifs-utils -y
    - Wait for the installation to complete.
    - Type -> apt-get remove apache2 -y
    - Wait for the removal to complete.
    - Type -> apt-get autoremove -y
    - Wait for the removal to complete.
    - Type -> mkdir /mnt/music
    - Type -> nano /etc/fstab
    - Hit the down arrow to the botom of the file that was opened with the previous command.
    - You will need the IP address of your NAS drive on which your music collection is stored. Use the aforementioned IP scanning tools if necessary. You will also need the Share name of the folder on your NAS. For example when I connect to my NAS I use the IP address 10.0.1.18 and the Share name is Audio. Audio is just a folder on the NAS.
    - Add the following line to the bottom of this opened file (nano /etc/fstab), substituting your NAS IP and Share name rather than using my information. Replace the ********* with the actual password to your NAS Share. Here is an image of my file (Image Link )
    //10.0.1.18/Audio/Music /mnt/music cifs defaults,username=admin,password=********** 0 0
    - After entering this information press Control O (Control key plus the letter O) then his enter to save the file.
    - Hit Control X (Control key plus the letter X) to close the file.
    - Type -> mount -a
    - Type -> nano /etc/mpd.conf
    - Make the following changes to the mpd.conf file that was opened with the previous command.
    Remove the # symbol in front of the following lines
    zeroconf_enabled "yes"
    zeroconf_name "BBB Music Player"
    mixer_type "hardware"
    bind_to_address

    Change the line -> bind_to_address "localhost"
    to -> bind_to_address "0.0.0.0"

    Change the line -> music_directory "/var/lib/mpd/music"
    to -> music_directory "/mnt/music"

    Find the Alsa Audio Output section and make it look like this, placing # symbols in front of the bottom four options and changing the device to hw:1,0. The name can be changed to USB DAC or anything else if you'd like.

    audio_output {
    type "alsa"
    name "USB DAC"
    device "hw:1,0" # optional
    # format "44100:16:2" # optional
    # mixer_device "default" # optional
    # mixer_control "PCM" # optional
    # mixer_index "0" # optional
    }
    - After entering this information press Control O (Control key plus the letter O) then his enter to save the file.
    - Hit Control X (Control key plus the letter X) to close the file.
    - Type -> nano /etc/modprobe.d/alsa-base.conf
    - Arrow to the bottom of the file and add the following text -> options snd-usb-audio nrpacks=1
    - After entering this information press Control O (Control key plus the letter O) then his enter to save the file.
    - Hit Control X (Control key plus the letter X) to close the file.
    - Type -> nano /etc/inittab
    - Place the # symbol in fron of the following lines

    1:2345:respawn:/sbin/getty 38400 tty1
    2:23:respawn:/sbin/getty 38400 tty2
    3:23:respawn:/sbin/getty 38400 tty3
    4:23:respawn:/sbin/getty 38400 tty4
    5:23:respawn:/sbin/getty 38400 tty5
    6:23:respawn:/sbin/getty 38400 tty6

    - After entering this information press Control O (Control key plus the letter O) then his enter to save the file.
    - Hit Control X (Control key plus the letter X) to close the file.
    - Type -> nano /etc/default/cpufrequtils
    - Add the following text -> GOVERNOR="performance"
    - After entering this information press Control O (Control key plus the letter O) then his enter to save the file.
    - Hit Control X (Control key plus the letter X) to close the file.
    - Type ncmpc
    - Once the app opens hit Control U (Control key plus the letter U) to update the MPD database with all the music stored on your NAS. This may take awhile depending on how much music you have and how fast your network and NAS are.
    - Hit the letter Q to exit the ncmpc window. The Database update will continue.
    - NCMPC can be used to play music, but the interface is pretty crude compared to MPoD on the iPhone or MPaD on the iPad.

    Remote Control
    - Install MPoD or MPaD from the app store
    MPoD Link
    MPaD Link

    If using MPoD, open the app and select the target looking icon in the upper left corner of the Now Playing window. You should see the your server listed. Select the server and tap the Done button. Second, select the gear icon next to the target icon on the Now Playing Screen. Then select Refresh Local Cache to populate the app with the database of music stored on your NAS and available to the server. Now you'll be able to browse through the bottom of the app selecting Artist, Album, Song, and more.

    content/attachments/6521-mpod-1.png/ content/attachments/6519-mpod-3.png/ content/attachments/6520-mpod-2.png/







    Please let me know if you find errors in this guide. I will keep it updated as appropriate. Tips, tricks, and tweaks are also encouraged!









    Image Gallery

    content/attachments/6515-bb100-orange-beaglebone-black-metal-case_pic1.jpg/content/attachments/6512-bb100-orange-beaglebone-black-metal-case_pic4.jpg/content/attachments/6509-lgx-bb100-beaglebone-black-case.jpg/content/attachments/6516-bb100_colors_full.jpg/content/attachments/6513-bb100-orange-beaglebone-black-metal-case_pic3.jpg/content/attachments/6510-bb100-orange-beaglebone-black-metal-case.jpg/content/attachments/6507-lgx-beaglebone-black-orange-black-case.jpg/content/attachments/6514-bb100-orange-beaglebone-black-metal-case_pic2.jpg/content/attachments/6511-bb100-orange-beaglebone-black-metal-case_pic5.jpg/content/attachments/6508-lgx-beaglebone-black-orange-black-case_pic1.jpg/content/attachments/6517-product_detail_black_lg.jpg/content/attachments/6518-bbb-boot-button.jpg/


    Comments 234 Comments
    1. k-man's Avatar
      k-man -
      Wow! That's a nice set of instructions for both Mac and Windows users. And it's gracious of you to mention me and Richard in your article.

      This is one hardware tweak I encourage, particular anyone who wants to try different power supply options:

      Beaglebone Battery Cape BB-BONE-BATT-01 - CIRCUITCO - DAUGTHER CARD, BEAGLEBONE BATTERY | Newark

      This works fine with the Beaglebone Black, but the extra width of the board means it is incompatible with the current cases. Up to four AA batteries or NiMH batteries are ideal. Once it's secure, it's also not easy to get access to the Boot or Reset buttons on the Beaglebone, but there is a easy Power ON/OFF switch on the Cape.

      Attachment 6533
    1. maelob's Avatar
      maelob -
      Chris pardon my ignorance, so are you saying I can build this stuff and stream music from NAS? will it sound better than my multi tasked macbook. Will it play ALAC files? how about hi res Flac? for that price I would try it just out of curiosity.
    1. beetlemania's Avatar
      beetlemania -
      What is this device? I gather it must be used with either a PC or Mac, what are its advantages and disadvantages?
    1. Richard Dale's Avatar
      Richard Dale -
      It is best to use a linear power supply with the BeagleBone, and I think the one linked to in the article is a switching one. I bought a linear PSU from Item Audio in the UK with a UK power plug. I'm not sure where you can buy a linear PSU for American voltages or with a suitable plug for Europe or America.

      For UK readers, Farnell sell a suitable linear power supply for 10.60 UKP:
      AC-DC LINEAR PSU, 5V 1A UNIVERSAL - S2226ST - STONTRONICS

      I bought my linear power supply from Item Audio for 19 UKP:
      http://www.itemaudio.com/index.php/p....html?sef=hcfp

      It may be the same model as the Farnell one, I'm not sure.

      Tigal sell an alternative case for 29 euros + VAT:
      TIGAL - Tigal - BeagleBone Black Case (BeagleBone Black case in aluminium anodized black)

      It makes my BeagleBone look a bit like an Apple TV, and I think it is a bit prettier than the Logic Supply one.
    1. Richard Dale's Avatar
      Richard Dale -
      Quote Originally Posted by maelob View Post
      Chris pardon my ignorance, so are you saying I can build this stuff and stream music from NAS? will it sound better than my multi tasked macbook. Will it play ALAC files? how about hi res Flac? for that price I would try it just out of curiosity.
      You can play ALAC and hi res FLAC files with MPD on the BeagleBone. However, the CPU isn't very powerful compared with the Intel CPU you would find in a modern MacBook. I use AIFF files for best sound quality as they need less processing to decode them for playing. When I am playing an AIFF file and I use the Linux 'top' utility to see what percentage of the CPU that MPD is using, it is generally between about 0.7 and 2.0%, rising to 4% or so when doing NFS reads of the music tracks stored on the NAS. With ALAC or FLAC or streaming internet radio, it would be more like 6-7%. MPD doesn't read an entire track into memory before playing it, and so you need to make sure your NAS NFS setup is well tuned to avoid drop outs as the music plays.

      I have replaced my 7 year old MacBook with Decibel and Bitperfect with a BeagleBone and I prefer the sound. I feel the treble is higher resolution, but I needed to spend quite a bit of time tuning the Linux setup to get to that state. I am not sure if it would sound better than a modern MacBook or MacMini with Audirvana and tuned for exclusive integer mode etc.
    1. kaka's Avatar
      kaka -
      And what does it sound like? Is anything sacrificed for the small form factor?
    1. cmiu's Avatar
      cmiu -
      On Android devices you can use Droid MPD Client.

      As shell client ncmpcpp is way better but it needs a little time to learn the shortcuts (like a text based JR or F2k). you can google arround find a nice interface setup that fits you and copy it to ~/.ncmpcpp/config
      You can see some examples here https://bbs.archlinux.org/viewtopic.php?id=66488

      You can find a list of Clients Windows and OSX on mpd home page Music Player Daemon - Clients

      PS: you forgot to add
      dsd_usb "yes" in the mpd.conf device configuration
      for dsd capable dacs.
    1. ron spencer's Avatar
      ron spencer -
      Nice article...so one could stream 192/24 files to this thing without any issues? Audio is HDMI only right? If you had an old amp in basement with no HDMI could this still work?
    1. ron spencer's Avatar
      ron spencer -
      So this item will play up to 192/24 files ok?

      Also, if an amp does not have HDMI, is there an adapter for the microHDMI to move the audio to RCA?

      thanks for this!!!
    1. ron spencer's Avatar
      ron spencer -
      Where can a north american get a linear power supply? Is it necessary?
    1. andyv's Avatar
      andyv -
      Will this work with an asynch USB DAC?
    1. silverarrows's Avatar
      silverarrows -
      This is exactly what I was looking for. I ordered a BeagleBone Black not really knowing what I was going to do with it but had something like this in mind, and along comes this. Lots to learn. Hopefully my Halide Bridge will work in this setup. Anxiously waiting for all the parts to come through in the mail.
    1. The Computer Audiophile's Avatar
      The Computer Audiophile -
      Quote Originally Posted by andyv View Post
      Will this work with an asynch USB DAC?
      Certainly. Not every async DAC but most with the XMOS chip.
    1. The Computer Audiophile's Avatar
      The Computer Audiophile -
      Quote Originally Posted by silverarrows View Post
      This is exactly what I was looking for. I ordered a BeagleBone Black not really knowing what I was going to do with it but had something like this in mind, and along comes this. Lots to learn. Hopefully my Halide Bridge will work in this setup. Anxiously waiting for all the parts to come through in the mail.
      Halide will work just fine.
    1. The Computer Audiophile's Avatar
      The Computer Audiophile -
      Quote Originally Posted by ron spencer View Post
      Nice article...so one could stream 192/24 files to this thing without any issues? Audio is HDMI only right? If you had an old amp in basement with no HDMI could this still work?
      24/192 is no problem. I use a USB DAC for digital output not the HDMI output.
    1. The Computer Audiophile's Avatar
      The Computer Audiophile -
      Quote Originally Posted by beetlemania View Post
      What is this device? I gather it must be used with either a PC or Mac, what are its advantages and disadvantages?
      Actually this can be used without a PC or Mac. Use a control point like an iPhone or iPad to select music on a NAS and send it to a BeagleBone Black. This solution is really anti PC or Mac.
    1. slowdown5646's Avatar
      slowdown5646 -
      Is there any way to make this wifi-capable without hogging up the USB port? It'd be a really nice little music server if it wasn't restricted by ethernet.

      Also is there a way I could share [music] files with the BBB and another computer? I don't actually have a NAS so this would be extremely convenient as well.
    1. _rcadog_'s Avatar
      _rcadog_ -
      Hello there,
      this is my first post here on CA so sorry about my lameness...
      I have thinking about these days: is there any simple, configurable, embedded like solution to connect in some remarkably good USB dacs in my network without the feeling of wallet emptying pain?
      It so simple to answer, just go up on coputeraudiophile.com and you get many many solutions like this BBB thing. I have ordered it in a sec when i read your article.

      I em using Mac these days and i think there is a simpler solution to put a system image on a device on this system. The Disk Utility has a panel called "Restore" (if you select a device on left side you can see it). Select the system image for source and select the SD card for destination. Click restore and you are done.

      Many thanks for sharing us this brilliant solution!!!

      There is one more thing with the commands "sudo" and "su". There is no need to be used like "sudo su" (however it is working). i do not want to go in deeply how a unix like system working here, just su is for switch to super user is enough where you write "sudo su".

      have a good Sound!
    1. andyv's Avatar
      andyv -
      This looks like an absolutely superb project.

      What are the chances of something being developed for this device that makes it a DLNA renderer with (asynch) USB output?

      With such a thing, people who like JRiver could then stream straight to it, rather than tie up a pc/laptop. Or if you had a UPnP server running on a NAS you'd be able to stream.

      I notice there is such a project on the Beagle Board contest site here - anyone know anything about it?
    1. Richard Dale's Avatar
      Richard Dale -
      Quote Originally Posted by slowdown5646 View Post
      Is there any way to make this wifi-capable without hogging up the USB port? It'd be a really nice little music server if it wasn't restricted by ethernet.

      Also is there a way I could share [music] files with the BBB and another computer? I don't actually have a NAS so this would be extremely convenient as well.
      If you want more USB ports to use with a WiFi dongle, then maybe the BeagleBone isn't the best solution.

      I use a Raspberry Pi as a NAS with my BeagleBone, but I could have used another BeagleBone instead.

      Debian Linux works fine with both the SMB and NFS file sharing protocols (and Apple AFP too). So it should be possible to set up any other computers that you have, to share their files.