Using Networked Audio to Develop Audio Hardware


You've got a audio board you're developing - what is the simplest way to test the signal chain ?

The easiest way to debug and test your audio designs is to use a network audio chain between your computer and the embedded system. The development cycle is as simple as updating hardware and or software and rebooting :
  • write code or alter the hardware
  • update the firmware if necessary
  • reboot the embedded system
  • the audio analyser auto updates without requiring a restart or changes - nice and easy!
This document will show you how to get this minimal effort development cycle working for audio developers.

The networked audio signal chain

In this scenario, the signal path is shown in the following image :
jack network audio for embedded systems
The signal chain : using netjack for network audio, then ALSA to i/o over the audio device you are testing

Your software audio analyser running on your development computer interfaces jackd and netjack. This carries the audio to and from the embedded system where it is output and input over ALSA to and from the DAC and ADC. An analogue loopback cable connects the DAC tot he ADC and thus we can output audio and capture if back again.

As long as your ADC is high enough in quality you will have a very good indication of the performance of the system. Once your are happy with what you see, you can test again with some off board rig, such as an Audio Precision or RME soundcard.

For the embedded system 


We can start jackd as follows :

# kill existing jackd sessions
killall jackd

# start jackd
jackd -R -d alsa -r 192000 -Chw:0 -i2 -Phw:0 -o2 &
sleep 2

# load netjack and connect the inputs and outputs to the network
jack_load netmanager
sleep 4
jack_connect dev:from_slave_1 system:playback_1
jack_connect dev:from_slave_2 system:playback_2
jack_connect dev:to_slave_1 system:capture_1
jack_connect dev:to_slave_2 system:capture_2

Now the embedded system is serving realtime audio to and from the network. We can setup the developer's computer.

For the developer's computer

Here we start qjackctl and set it up to use the net driver, shown in the following images :
qjackctl : Click the setup button first. Once setup click start.

In the qjackctl settings, choose the net driver.

Now we need to start the audio analyser, such as jaaa and then we connect the jaaa and system together in the qjackctl graph user interface :

Patch the system and JAAA together in a full duplex manner (both inputs and outputs).

Tuning the audio analyser

Typically the noise floor should be very low (-120 dB or better for a good quality device). We need to setup jaaa to help us visualise the audio data correctly. To do this click the bandwidth button "bandw" on the right and scroll your mouse wheel till is it below 10 Hz. Now increase the visible dynamic range by clicking on the "Range" button on the right and again scroll until you can clearly see the noise floor. It should look something like the following image :
jaaa showing the noise floor of the device

Lets now put a 1k Hz tone through the system. To do this select Sine 1 On. Then select output 1. Alter the Amplitude (Ampl button on the right) until the audio level is just below clipping. Here you will see the 1 kHz tone at full scale (0 dB) and the harmonic noise (due to nonlinearity) will appear on the higher side of the tone. Your jaaa should look like so :
The total harmonic distortion and noise of the device under test.


In the case of this device, the third harmonic is the worst and well down at -115 dB. A very good device !

jackd session management

One other element which is essential for fast development using networked audio is to use a session manager. In my case I have chosen to use agordejo. agordejo will auto plug the network audio device once the embedded system is rebooted. This saves manual plugging in the qjackctl graph.

Comments