As I recently bough a soundsystem with a built-in USB Soundcard and I already had a Router running OpenWRT, I wanted to set this router up as a soundserver. I already knew OpenWRT has packages for usb sound support and pulseaudio a network sound server. So the idea was close to make the soundsystem availbable over the network through the Router running OpenWRT.

As there are not complete manuals on which steps to take I just want to note down the steps I took to save me the fiddling next time and also help other doing the same thing.

Preconditions: A router with an USB port running OpenWRT (tested on version 14.07 "Barrier Braker"). Preferably with USB essentials already installed. A USB soundcard (probably built into your sound system) you want to make available in the local network.

First of all of course I consulted the OpenWRT wiki which almost helped me all the way through.

Here is what needs to be done step by step:

1. Make sure you have all the necessary USB packages installed to support basic USB functionality as well as USB soundcards. See here what to install: OpenWRT Wiki USB-Audio
For easy debugging of USB devices detected I would also install usbutils, otherwise the required packages are enough.
So that would be an opkg install kmod-usb-audio kmod-sound-core usbutils

2. Connect the USB Soundcard and make sure it's powered on. Then check if it appears using lsusb. There should be (among others) a sound device in that list.

3. Once we have USB sorted out we can move on to the sound driver level. See this wiki page: OpenWRT Wiki Pulseaudio. Again I recomend the alsa-utils package for not flying blind.
So do a opkg install alsa-libs libsndfile alsa-utils to get alsa (sound drivers) working. At this point I did a reboot to make sure everything gets loaded correctly. But it might just work right away. In this case you might want to run alsactl init to load drivers for detected hardware

4. You can now run alsamixer to confirm that you indeed have a soundcard working which volumes you are able to control.

5. Once all that works, we just need our pulseaudio soundserver. Install the pulseaudio-daemon package (if not already done in the previous steps). Then you have to change the configuration file in /etc/pulse/
Unfortunately this file contains stuff that doesn't make sense for the OpenWRT package of pulseaudio (explained here). So you can strip it down to just two lines by either commenting or deleting what's already there. Add instead the two lines:

load-module module-alsa-sink device=hw:0
load-module module-native-protocol-tcp listen= auth-ip-acl=;

If your Router has anothe IP address change the listen address accordingly.

6. Do a /etc/init.d/pulseaudio restart to make sure the config is loaded. I also made sure that puleaudio gets loaded on boot (I used the Luci Webinterface > System > Startup for that). That was it. Your sound server should now be working, accepting connection from the local network!

7. Check if you can reach the sound server from another machine in the LAN. On any Linux box with pavucontrol installed (apt-get install pavucontrol for ubuntu), you can open the volume control connected to your routers soundserver with PULSE_SERVER= pavucontrol. This should display the detected soundcard on your router. If the soundcard shows up there this means it was detected by the pulseaudio server and you were able to connect to the server too. So you can move on to configuring the client(s).

Unfortunately zeroconf doesn't work on the current OpenWRT, so clients have to be configured manually. So on the client side (any linux machine that has pulse installed), run this command
pacmd load-module module-tunnel-sink server=
Then just select the sound output in the sound settings. See Client configuration on the Pulseaudio Wiki page again.

That's it. So after selecting the remote sound output you can just use any player to play some sound and it will automatically directed to that output.

Details on my Setup
Router Model: TP-Link TL-WDR4900 v1
OpenWRT Version: OpenWrt Barrier Breaker 14.07
Soundsystem: Teufel Concept E Digital 5.1 System (with integrated Soundcard)
Soundcard identifies as: C-Media Electronics, Inc. CM106 Like Sound Device
Client system: Ubuntu 15.04



  • aris  
    *I followed the tuto, I'm on bb14.07 and the client is ubuntu 16.04 lts 64 bit, on virtual box.
    The service is running on openwrt : < /usr/bin/pulseaudio --system --disallow-exit --disallow-module-loading --disable-shm --exit-idle-time=-1 --realtime=false
    and the client also find it on sound output : tunnel-sink. ..volume 89% ..muted no..
    but I cant hear any sound on testsound (in the ubuntu machine)
    On openwrt: I tested, and its just fine, using madplay to play some mp3 and the sound is working.
    Any clue ?

    • Stefan Horning  
      *Sorry, can't think of anything, as you seem to have excluded all possible sources of error I can think of (sound generally works on OpenWRT, Network detection too, unmutet...).
  • Praneet  
    *I get the following error on trying to run pulseaudio as a system daemon:

    root@OpenWrt:~# /usr/bin/pulseaudio --system --disallow-exit --disallow-module-
    loading --disable-shm --exit-idle-time=-1 --realtime=false
    W: [pulseaudio] main.c: OK, so you are running PA in system mode. Please note that you most likely sh
    ouldn't be doing that.
    W: [pulseaudio] main.c: If you do it nonetheless then it's your own fault if things don't work as exp
    W: [pulseaudio] main.c: Please read
    /User/WhatIsWrongWithSystemWide/ for an explanation why system mode is usually a bad idea.
    W: [pulseaudio] pid.c: Failed to open PID file '/tmp/run/pulse/pid': Permission denied
    E: [pulseaudio] main.c: pa_pid_file_create() failed.

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Gravatar, Twitter, Wavatars, Favatar author images supported.