The Basic Network Audio System (BNAS)


Abstract

BNAS is a basic client/server solution to forward any audio stream trough a TCP connection and play it from another computer. It was developed because all other implementations (NAS, XAudio) require some kind of specific support compiled into all the audio applications.

Introduction

My Sun Sparcstation has enough horse power to decode MPEG layer 3 audio streams at full quality, but unfortunately it has no audio output. My Amiga has builtin audio, but the 25MHz 68040 CPU is not fast enough to decode MPEG layer 3 at full quality.

So I decided to try a hybrid solution: the Sparcstation decodes the audio and sends the output (stereo, 16bit, 44.1KHz linear) to the Amiga trough the ethernet LAN. On the Amiga. The result is impressive: sound plays out from the Amiga speakers as soon as I start mpg123 on the Sparcstation.

Client

To setup the client you need to create a pipe in place of the standard audio device:

mknod /dev/audio p

The client is just a simple program that makes a TCP connection to a custom service on a remote server. Then it reads from the /dev/audio pipe and forwards everything to the server.

Source code for the client is available here: audioclient.c. You should be able to compile it on most UNIX-like systems issuing the following command:

cc -lsocket -o audioclient audioclient.c

There's also a simple Makefile to do this job for you.

Server

The nice thing about the server is that you don't need to write one in most cases. A naive inetd server is enough to route the incoming audio stream to the system audio device.



Copyright © 1999 Bernie Innocenti
$Id: index.html,v 1.3 1999/04/26 22:57:15 web Exp $