Tuesday, 9 September 2014

Controlling an AVB network from a Raspberry Pi

I’ve been playing with Audio Video Bridging (https://www.xmos.com/applications/avb) quite a bit lately and historically I’ve always used the AVDECC-Lib controller (https://github.com/audioscience/avdecc-lib) running on my laptop, either under Windows or Linux.

My intention is to create a completely standalone demo so I’ve since compiled the AVDECC-Lib controller for my Raspberry Pi.

The first thing to do is ensure that the GCC compiler is v4.7 :

sudo apt-get install g++-4.7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6 
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7 
sudo update-alternatives --config gcc

Next we need to ensure that we have all of the required applications and modules :

sudo apt-get install cmake
sudo apt-get install git
sudo apt-get install libpcap-dev
sudo apt-get install libreadline-dev

Now we clone AVDECC-Lib from github :

git clone git://github.com/audioscience/avdecc-lib --recursive

Finally we build the library and application :

cd avdecc-lib
cmake .

Now we can run the controller and manage our AVB network :

sudo controller/app/cmdline/avdecccmdline

Note, it is necessary to use sudo because the application requires direct access to the Ethernet PHY.
The controller will now give you a list of network interfaces and you need to choose the appropriate one (2).

AVDECC Controller version: v0.4.9
1 (lo, address: <>)
2 (eth0, address: <>)
Enter the interface number (1-2): 2

That’s it, we are now at the controller command line :

Enter "help" for a list of valid commands.