Audio over IP interface bord
Uit Embed
|
Audio over IP interface bordIn a recent project a large number of remote inputs and outputs had to be interfaced over IP. Especially the device needed to be able to playback audio. Moreover several devices (up to 25) had to be able to stream audio simultaneously. 100mbit Ethernet is very useful in such a setting as it provides more then enough bandwidth for this task. However there are number of challenges which made realization of the firmware interesting. As a setup Pure Data was used to stream audio from a PC to the devices. Pure Data sends the raw audio using UDP packets to the device at a sampling rate of 44100 Hz. Playback was done on a PIC32 running at 80Mhz. First issue is that a buffer is needed to be able to playback audio while receiving it at the same moment. The buffer has to be large enough to handle jitter in the incoming data packets. Second issue lies in the fact that the PC playback clock 44100 Hz will not correspond to the device's playback clock. This will cause the overruns in the device's buffer if the PC's clock is faster. On the other hand it will cause buffer underruns if the PC's clock is slower then the device's playback clock. Both underrun and overrun events cause glitches in the played back sound. This was solved by adding a dynamic resampling routine in the device. If it sensed that the buffer is filling up some samples are thrown away. In effect the sample rate of the incoming signal is lowered. If the buffer is becoming empty samples are added using interpolation. The effect is that the sample rate of the incoming signal is increased. In order for the dynamic resampling to work well the sampling rate of the incoming data has to be estimated. The firmware keeps a sample rate estimate which is increased if the buffer fills up to a certain threshold. The estimate is lowered when a low 'watermark' is reached. During tests it was interesting to listen to the effects of different watermark levels and estimate adaptation rates. Some settings caused the sampling rate estimate to oscillate more than 5 Hz. This was clearly audible if a sine wave was played! By choosing the right values a very stable playback algorithm was achieved with no audible artifacts.
|
Technieken
Externe links
|
Contact
t. +31 (0)20 700 9426
t. +31 (0)50 210 3333
|







