Fixing poping noise on TP-link tl-wr703n router

I bought one of those fabulously cheap router (the TP-link Tl-wr703n) for a whopping $21,- on ebay, it comes pre-loaded with Chinese firmware.. As my mandarin is quite rusty, I decided to flash openwrt on it (read, this is THE reason to buy those little devices).

I wanted te make an audio-player of it.

First I installed Shairport on it, via this nice tutorial: Shairport+wr703N  which is a nice how-to to build your own image.

Unfortunately after flashing the device… it was dead, turns out.. I flashed the wrong image :S, as the web interface refused to write flash the by-me presented image, I did it the hardware, so flashing using “`mtd write image.bin firmware“` which bricked it… So I had to solder within 5 minutes the mailman passed me the package.. bummer :), luckily my soldering iron is always standby.

So after building the image it worked-ish.. however there was a lot of hiccups in the audio, litte ‘clicks’ and ‘pops’, VERY annoying..

After trying squeezelite and a dozen of different usb-dacs (c-media/pcm2704).. I concluded that is had to be the wr703n..

 

Today I stumbled upon this page: https://forum.openwrt.org/viewtopic.php?id=39956&p=9 Which implied there was an error in the usb-bus, as a result of a hardware bug. The solution posed, was found in some obscure registers that need to be set each time the WIFI chip was reconfigured (eg, when hopping to a channel, connecting etc.).

So after I had included the patch into my crow-compile setup, and executed a rebuild of the tree (actually mac80211 bit is sufficient), I now have a very smooth sounding audio for $28 (the wr703n for $21 inc. shipping, and a PCM2704 dac), which is well known for a astounding output 🙂

So for a quick wrap-up:

  1. create a file <root>package/mac80211/patches/566-ath9k_usb_hang_workaround.patch
  2. put the content of 566-ath9k_usb_hang_workaround.patch (github)in there
  3. make package/mac80211/{clean,prepare} V=s QUILT=1
  4. make -j3 (if you have 3 cores)

than flash the newly image into the router.

Until this patch is merged into the latest attitude adjustment of OpenWRT you’ll need to apply it manually.