In my previous post I wrote about using TL-WR703N and testing it as a wireless music player. Now I will try to provide some observations on what was working and what not in both cases.
Honestly I spent disproportionate ammount of time trying to make work the "PulseAudio" approach. That is because it leaves many options open and provides for clean separation between the "sound generator" and the "sound player".
The setup - I was using the TL-WR703N with OpenWrt (trunk)*. Connection was over WiFi, N mode, 40MHz channel. On the other side of the connection is a TL-WDR3600. The server is directly connected to the WDR3600 over gigabit ethernet.

PulseAudio approach:

audio_output { type "pulse" name "PulseAudio remote player" server "pulseaudio" #server name format "44100:16:2" }

I was running mpd on a home server with all the music files on a disk attached to this server. Alternatively I was streaming some internet radios. When listening to radios there was a small ammount of incomming traffic - compressed audio comming from the Internet, while there was a huge ammount of outgoing traffic towards the PA server running on the router. Could not conclusevely establish if it was a wifi overload issue, but the whole system was too unstable for me.

Additionally I tried rtp with pulseaudio. That was a failure. The streams never syncronized correctly.

Finally I settled on a simpler design. mpd running on the router being controlled by a computer or a phone (there are good clients for Android and iOS). As the router has some storage (8GB) it can easily be shared via SAMBA in the local network for local files. I even mounted my SAMBA share from the server with a lot of files. The indexing of all files was bringing down the router and the kernel was killing mpd, as a sacrifice :).
At some point I noticed that the router was instable and often restarting. I thought it was power issue, but after changing 3 different power adapters each less no-name that the previous there was inconclusive evidence.
I looked in the logs. When audio was played the kernel was spitting some strange errors. I added a parameter for the usb-audio module - nrpacks=1 which led to no more reboots, for now.
In the code repository I tried to share all the files that are relevant to the project.

Extras

As I had already 8GB attached to the router for extroot I decided to share it for uploading music to it as a form of local storage. It is relatively easy to enable Samba and have the unit visible in a local network.

Additionally I decided I want to add some sort of display. So I went the easiest route - grabbed an Arduino Pro Micro clone (Atmega 32u4) and Nokia 5110 display clone (PCD8544 controller) and "quickly" slapped a sketch. Additionallty I spent quite some time writing a bash script that monitors the state of mpd and sends it to the Arduino over the serial interface.

What I learned:

• After programming the Atmega board will be in some intermediate state where the serial connection will not be available (indicated by blinking RX led). This lasts 5-10 seconds.
• The library I used - U8glib uses some sort of double buffering that caused me quite a bit of trouble to figure out that it messes up with the timings in my script. Using ready Arduino libraries without understanding how they work can lead to a lot of headscratching.

Most of the important code created for this project is available here:

Pictures:

* Using OpenWrt trunk is a no-no :). You'll have trouble updating or even installing few days later when a new default kernel appears in the trunk and all the packages depend on it. Go for the last stable version instead.

This router - the 703n is useful for building various DIY gadgets based on OpenWRT with WIFI (or wired) connectivity.

I have already used several of those. One was used as a wireless bridge in order to share a network printer. Others were used to test and try wireless music transmission and different scenarios of running Linux, PulseAudio, MPD, RTP.

I have built two audio boxes with this router.

• (openwrt-pulseaudio) First was OpenWrt (head), PulseAudio server. Sound was sent from my home server via wifi. Player was mpd with pulse configured as output.
• (openwrt-mpd) Second one was OpenWrt (head), mpd-mini, samba share mounted on the router. Additionally I've added external antenna in order to improve reception.

I am going to test the stability of both systems. So far I have spent some time using the openwrt-pulseaudio system. From time to time, when I start playing music, there is audible crackle noise. After I stop and resume play several times the noise disappears. I still have to investigate where the problem comes from - the USB stack, pulseaudio caching, wifi transmission problems, or the audio output from the USB audio card (C-Media chip)

I was using an old Lenovo notebook with a broken screen for a home server. As I wanted to have more storage than the internal HDD I used two 3.5" SATA disks attached to the computer via PCMCIA SATA controller. Was it my built or the controller or a disk, but a WD Green 2TB disk was developing problems in the ext4 filesystem. Seemengly at random. Because I had my /home and my /var/www on this disk, that led to so many problems that it drived me nuts. Several times.

Anyways, now I was set to finally ditch the laptop. One of the other problems it developed was that there was no way to switch to the VGA output. Fn+F7 was not working. Or I could switch if I hit the combination at the right moment after POST and at some point when the kernel was loading. (I now think that I might have been able to put a kernel parameter in GRUB, but it's over).

I've had some sort of a home server for the past 8 years. First it was a an old, decomissioned Compaq desktop (you know, the steel box type taking most of your desk space) with Fedora 4 on it. As it was power hungry and worse than that - noisy as a busy street I took the opportunity to replace it with the old laptop. That worked well until it was time to upgrade and finally solve the HDD corruption issues.

The new system:

• motherboard: Intel DN2800MTE
• Gigabit ethernet
• 6W CPU power consumption. Total for the board probably below 15W
• ram: 8GB
• Intel never released 64bit video drivers so they provide this board to be used with 32bit OS only thus the official 4GB limit, but it can address the 8GB just fine running Fedora 64bit
• storage: 32GB mSATA SSD
• Some tuning for SSD was done: defaults,discard,noatime,nodiratime; tmpfs for /tmp

Some notes:

• The chipset runs HOT. You can not touch it. I used a small heatsink with thermal paste and I can touch the sink without burning my fingers. The chipset is the only thing in the documentation that can withstand 115°C
• During setup the Fedora kernel was trying to switch to the built in LVDS output. At some point during the boot the VGA nmonitor went blank. I had to add this

video=LVDS-1:d


to the kernel line. Turns out you can disable the LVDS in BIOS, so try this first.

When running the system with a large (12cm) slow (~900rpm) fan blowing against the CPU/chipset the system temperature is ~31°C. Without the fan: ~41°C. As the chipset is very hot, but the system is designed to run fanless and currently I have no case for it I feel it can run without the fan, but not without some heatsinking of the chipset.

Initially I wanted to add a mSATA SSD and my two SATA 3.5" classic spinning disks HDDs to the system. At the time I was selecting this motherboard it seemed perfect - 2 SATA connectors on the board. But it seems that the controller can support only 2 SATA disks and so one of the SATA ports is multiplexed with the mSATA port. Once I had my SSD I could only use one more HDD.

Enter cheap ebay solution - a PCIe expansion board with ASM1061 chipset. Seems to be running fine for now.