Sunday, July 14, 2013

DIY AirPlay Speaker System using a Asus WL-520gu Router



In this tutorial, I'm going to show you how to re-purpose a Asus WL-520gu router into an Apple AirPlay Speaker System. I have a custom built OpenWRT image already fully configured with AirPlay so all you have to do is flash and go.

Major kudos to the Wifi Radio project on MightyOhm.com which introduced me to OpenWRT and a major inspiration for this project.

Requirements

- Asus WL-520gu Router (Stock Firmware, Tomato, DD-WRT or OpenWRT)
- Compatible USB Sound Card (USD DAC - Digital Audio Converter). See below.
- Speakers/Stereo System (or Headphones).

Flashing the OpenWRT AirPlay Firmware

Download my OpenWRT image pre-configured with AirPlay (aka ShairPort). Note that this firmware is specifically designed for the Asus WL-520gu router. If you use this firmware on any other router, you will brick it.

If you are already running Tomato, DD-WRT or OpenWRT (with Luci) on your router, you can flash directly from the web interface.

If you are running OpenWRT without a web interface, here are the commands to flash via command line:

cd tmp
wget http://goo.gl/MNkAm
mv MNkAm openwrt-brcm47xx-squashfs.trx
mtd -r write openwrt-brcm47xx-squashfs.trx linux

Otherwise if you are running the Asus stock firmware or need to recover from a bad flash, follow these instructions - Asus WL-520UG: Loving Tomato Firmware. Obviously, flash with the OpenWRT AirPlay image above.

Enjoy some Music

Plug in your USB Sound Card to the router and connect it to your speakers. Then power cycle the router.

On your iOS device, connect to the open/unencrypted 'AirPlay520gu' wireless network.

Important Note: Wireless is enabled by default within the image. However, the router requires one extra reboot after being flashed before wireless will start properly (Don't ask me why, I don't know). So basically, if you don't see the 'AirPlay520gu' wireless network, give the router a reboot/power cycle.

You should now be able to AirPlay music from your iOS device to the 'AirPlay520gu' AirPlay Speakers.

iOS 7 Beta - AirPlay to WL-520gu router from iTunes Radio


Different Modes and Use Cases

Standalone Mode (Default, no configuration needed) - Broadcast unencrypted/open SSID of "AirPlay520gu". DHCP Server enabled with no default route or DNS server to allow iPhone to maintain connection to LTE/4G network for internet radio streaming.

Wireless Client Mode - Connects to existing wireless network similar to how your iphone/ipad connects to your network. This is how most commercial AirPlay Speaker System work. HowTo: Switch to 'STA' mode

AP (Access Point) Mode - Connects to existing network via a wired Ethernet cable (or Ethernet over Powerline). Broadcast additional SSID to extend your wireless network coverage - add AirPlay and get better wireless coverage too! HowTo: Disable DHCP, change IP Address, Set SSID/Encryption type

Check the OpenWRT forums or Wiki for help on re-configuring your new AirPlay router!

Compatible/Recommended USB Sound Cards (Plug and Play)
Some additional USB DACs that I haven't tested personally, but should also work:
Note: The cheap "3D Sound" USB audio adapter may work, but there is at least two versions - one that works (C-Media chipset) and one that doesn't (6911 Chipset, JMTek, LLC 48Khz Only). My recommendation is to avoid them unless you're 100% positive you'll get the one with the C-Media chipset or to keep things simple, pick up the Syba SD-CM-UAUD USB Stereo Audio Adapter if you're on a tight budget or prefer the form factor.

DIY AirPlay Sound System for under $100

A great sounding AirPlay speaker system can easily be put together on a very limited budget and blow away anything sold at the Apple Store costing twice or three times as much. As an example, a LP-2020A+ Lepai Tripath Amplifier paired with the Dayton Audio B652 bookshelf speakers will give you awesome sound on a tight budget.

Syba USB Audio Adapter - $7
Lepai 2020A+ Amp - $23
Dayton Audio B652 Bookshelf Speakers - $52

Total cost $82 + router

What if I don't have a Asus WL-520GU Router?

Definitely do not buy one (unless you can get it super cheap, ~$10). This router has really dated hardware and is no longer manufactured.

Instead consider picking up a TomatoUSB compatible router or Pogoplug and following my other DIY AirPlay tutorials:
[Tutorial] - Pogoplug E02/V4 with Arch Linux ARM

Another option would be my Apple AirPlay AirEnabler Adapter Kit, which is a totally plug and play solution that allows you to add Apple AirPlay to any existing home stereo, car stereo, pc speaker system, ammo box portable speaker systemstereo cooler or my favorite the Boominator, "the ultimate party machine".