In this blog post I will describe how to record audio transmitted by an AES67 compatible device to disk of a computer, using Open Source command line tools.
Rather than creating a whole new competing standard, AES67 specifies how existing internet standards can be used together in the context of professional audio. Some of the standards it is based upon are:
- IP Multicast / IGMP - RFC 2236
- Real-time Transport Protocol (RTP) - RFC 3550
- Precision Time Protocol (PTP) - IEEE 1588-2008
- Session Description Protocol (SDP) - RFC 4566
- DiffServ QoS - RFC 2474
While there is an ever-increasing number of commercial products that support AES67, there is not very much Open Source software or information. I am hoping to start changing that by writing about it.
- Audinate Dante UltimoX4 chipset
- 4 balanced audio input and output channels
- 19” rack-mountable 1U enclosure
- Can be powered by PoE
So why did I choose to buy the Glensound AOIP44 over other products?
- Dante has become one of the most common implementations of Audio over IP
- Although expensive for a personal purchase, it was cheaper than other options
- Glensound are based in the UK and have a reputation for building solid, reliable hardware
- Glensound design and build equipment for use in broadcast - which is my area of interest
Note: not all Dante devices support AES67 - double check before purchasing.
By default, Dante devices use a proprietary protocol and can only communicate with other Dante devices. However, on newer devices, it is possible to enable AES67. The following steps are what is required to set up an AES67 multicast stream.
Open Dante Controller and select the Device View menu item from the Device menu:
Select the AES67 Config tab and change the AES67 mode to Enabled. You will need to press the Reboot button after enabling it.
After the device has finished rebooting, the next step is to create a Multicast Flow. This can be done by selecting the Create Multicast Flow menu item in the Device menu.
A dialogue box will pop-up, allowing you to choose the Channels that you would like to add to the Multicast Flow. You must also tick the checkbox to make it an AES67 flow.
At this point, the RTP audio packets will start being sent out of the network port. If you have a dumb switch (that doesn’t support IGMP snooping), then those packets will be being sent to every other port on the switch.
Under the Transmit tab, you should now be able to see the Multicast Flows that have been set up. Make a note of the multicast IP address that the AES67 flow is being sent to (it will be in the format 239.x.x.x). We will use this when recording the stream.
Recording the stream
We are going to use two different command line tools to record the RTP stream:
Both these tools can be installed on Mac OS using Homebrew:
brew install rtptools sox
Sox can be installed on Debian/Ubuntu using:
apt-get install sox
RTP Tools for other operating systems are listed on the downloads page.
First we are going to verify that we are receiving the stream correctly.
rtpdump will print a very rapid stream of output, displaying one line showing the parameters for each RTP packet received:
$ rtpdump 188.8.131.52/5004 1521848203.141443 RTP len=300 from=169.254.98.63:61440 v=2 p=0 x=0 cc=0 m=0 pt=97 (????,0,0) seq=46327 ts=1526026162 ssrc=0xfe7df7a7 1521848203.141529 RTP len=300 from=169.254.98.63:61440 v=2 p=0 x=0 cc=0 m=0 pt=97 (????,0,0) seq=46328 ts=1526026210 ssrc=0xfe7df7a7 1521848203.141543 RTP len=300 from=169.254.98.63:61440 v=2 p=0 x=0 cc=0 m=0 pt=97 (????,0,0) seq=46329 ts=1526026258 ssrc=0xfe7df7a7 1521848203.141970 RTP len=300 from=169.254.98.63:61440 v=2 p=0 x=0 cc=0 m=0 pt=97 (????,0,0) seq=46330 ts=1526026306 ssrc=0xfe7df7a7 1521848203.142924 RTP len=300 from=169.254.98.63:61440 v=2 p=0 x=0 cc=0 m=0 pt=97 (????,0,0) seq=46331 ts=1526026354 ssrc=0xfe7df7a7
The multicast address
184.108.40.206 is the address that the audio is being sent to. This is the address shown in Dante Controller under the Transmit Tab of the Device View. The port
5004 is the default port to send RTP packets to and is recommended as part of AES67. I had trouble recording with my laptop because it had two network interfaces. Disabling Wifi allowed me to receive the multicast stream.
Next, we are going to record the RTP stream to disk:
rtpdump -F payload -o radio4.raw 220.127.116.11/5004
-F payload option specifies that only the payload part of the RTP packets (the audio) is written to the output file.
-o specifies the filename to write the audio to.
The output file is just the raw audio, with no wrapper/metadata to explain to other software the format of the audio. We are going to use the
sox to command to convert the raw audio into a Wav file:
sox -t s24 -B -r 48000 -c 2 radio4.raw radio4.wav
-t s24 option specifies that the input audio is in L24 format (signed integer linear 24-bit PCM samples). The
-B option specifies that the samples are ‘Big Endian’, also known as Network Byte Order. The
-r 48000 option specifies the sample rate of the audio and finally
-c 2 specifies that there are two channels (stereo).
Rather than running the commands separately, you can instead combine both commands together using a Unix pipe and write directly to a Wav file:
rtpdump -F payload 18.104.22.168/5004 | \ sox -t s24 -r 48000 -c 2 -B - recording.wav
Or you can play the stream through your local sound card using:
rtpdump -F payload 22.214.171.124/5004 | \ play -t s24 -r 48000 -c 2 -B -
Over a decade ago I was working on a Multicast Audio Streaming Toolkit (MAST). It would be fantastic to bring it up to date and working with AES67.
I have also written an AES67 Open Source Software Wishlist.