Linux-Based Low-Latency Multichannel Audio System

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi there,

Together with my professor, I've developed a multichannel audio system based on the AD1938 audio codec by Analog Devices and the BeagleBone Green (TI AM335X SoC).
The audio system offers 2 stereo inputs and 4 stereo outputs.
The whole project is based on open source software.
To demonstrate the possibilities of the audio system, I've created a surround delay effect with the open source C++ library DSPatch by Marcus Tomlinson.
Moreover I've created an automatic test based on GNU octave to evaluate the audio system characteristis, such as latency, THD+N, DNR, crosstalk and frequency-response.
face24.jpg

The full article is published here.
Everybody who's interested and has some questions or feedback, feel free to contact me.
 
Hi there,

Together with my professor, I've developed a multichannel audio system based on the AD1938 audio codec by Analog Devices and the BeagleBone Green (TI AM335X SoC).
The audio system offers 2 stereo inputs and 4 stereo outputs.
The whole project is based on open source software.
To demonstrate the possibilities of the audio system, I've created a surround delay effect with the open source C++ library DSPatch by Marcus Tomlinson.
Moreover I've created an automatic test based on GNU octave to evaluate the audio system characteristis, such as latency, THD+N, DNR, crosstalk and frequency-response.
face24.jpg

The full article is published here.
Everybody who's interested and has some questions or feedback, feel free to contact me.

This is interesting. Thanks for posting about it.

I did not see any information about the "low latency" that you claim. When you say "low" what is that?

What are the capabilities of the crossover? Is it IIR, FIR, or can both types be used at the same time? Can you please describe the maximum capabilities for each type (IIR, FIR)?

Thanks, I am looking forward to your responses.

-Charlie
 
The idea of the project is to create an open source audio platform offering a multi-channel driver platform and corresponding hardware. It provides the audio drivers for the Beagle Bone and the design of the codec schematic/PCB (done with KiCad and to be released shortly). The demo app we created uses DSPatch to illustrate some capabilities. It allows one to focus on the DSP code design (if developer) or just to use it as a multi-channel application e.g. as a home-cinema CODEC (simply user).

One could implement own FIR/IIR filters e.g. for a audio crossover application. The processing power of a Beagle Bone is somewhat limited, however, the RAM is certainly big enough to store large FIR impulse responses. We think of re-adapting the drivers for other platforms, e.g. the Beagle Bone X15 once released or any other multi-core board which has a reasonably sized community and TDM audio hardware support in the SoC. Any suggestions are highly appreciated towards that extent. Another interesting application would be phase correction for multiple audio speakers (we have not taken a stab at that).

If we talk about low latency, we refer to round trip time when feeding analog in and immediately returning it to the output at the smallest buffer size possible. Of course that time would vary by adapting buffer sizes needed by whatever filters / audio apps one would create with this. For us the application as a "real-time" multi-channel audio efx box was interesting or a synth app, which has low enough latency to be played by a musician. 10ms are probably good enough for that. Attached a graph of the roundtrip experiment with the smallest possible buffer size of 34 frames at <4ms, we were able to achieve.
 

Attachments

  • rtt-AD1938-68-frames-latency.png
    rtt-AD1938-68-frames-latency.png
    21.4 KB · Views: 476
I took a look at the AD1938 datasheet and was wondering why this particular codec was chosen for your project. I immediately see two somewhat common shortcomings in the DAC specifications - the maximum output voltage from the DACs is rather low, and the THD and noise floor is not all that impressive:

Full-Scale Output Voltage: 0.8775 (2.482) V rms (V p-p)

Total Harmonic Distortion + Noise @ 0 dBFS:
Single-Ended Version: Two channels running −92 dB typical
Single-Ended Version: Eight channels running −86 dB typical, −70 max

These two specifications are important for DSP system that will implement a loudspeaker crossover system. If high sensitivity drivers are used, e.g. a horn tweeter with a compression driver, the noise floor will likely be noticeable and obtrusive. Also, the max output voltage is low enough that it may not be able to drive some consumer amplifiers to full power and/or offers little "headroom" for peaks. Since music is dynamic in nature and peaks can be 10dB or more above the average level, this is a very significant problem that seems to be very common among consumer DACs. There are only a couple that have a more liberal 2Vrms output capability.

If the noise level was much lower, you (or the user) could add a gain stage to each channel but this will also boost the noise signal by the gain factor, and may contribute its own noise signal. I found this was a problem, for instance with the ADAU1701, which is a popular DSP chip that is found in some DIY friendly crossover platforms.

Do you have solutions for the above problems?

I think your concept is nice, and it makes a nice project for a upper-level student. If you choose a different DSP processor with improved specifications it would really be something fantastic.
 
I fully admit that the codec is not to be considered high end HIFI. We had a look at other ones, but didn't find any reasonable priced multi-channel alternative at the cost point of approx $10. Our decision points were:
  • Multichannel codec, reasonably priced, reasonable performance
  • Ideally Linux driver base available, to shorten development cycle, we had only 3 months for everything, including learning curve
  • Audio quality good enough to fit "live" musician demands + hobby studio, not highest demand HIFI
  • Compromise of overall cost vs. audio quality
  • One codec, instead of separate ADCs DACs due to cost plus simplicity of driver development
  • Battery voltage supply, unipolar analog design, overall input voltage <=5V (probably compromising head-room)
In retrospect we have learned a lot through this project and certainly may do some things differently;) We had a look at several Cirrus Codecs which seemed promising but then no basic driver support, or BGA package (hard to solder as a DIYer) etc. For high end HIFI one would probably anyways choose separate ADC/DAC e.g. like in the reference design of XMOS here xCORE-200 Multichannel Audio Platform. Interestingly, they use relatively cheap OpAmps, and in fact our design strangely performed best also with rather cheap OpAmps (we are still puzzled why).

Again, we did not have an audio crossover application in our minds in the first place, real-time musician efx / synth was more our focus.

The cost of the PCB + components in the minimal power supply configuration is around €65, when buying individual components e.g. at Mouser.

Appreciate your comments:)
Robert
 
Interestingly, they use relatively cheap OpAmps, and in fact our design strangely performed best also with rather cheap OpAmps (we are still puzzled why).

Perhaps price is not the right criterium of performance :)

I very appreciate your endeavour, IMO pretty advanced for bachelor thesis. I am looking forward to the open source materials should you decide to release them.
 
Hi ctag,

I'm leading the development of a sound therapy system and found your AD1938 based design very interesting.

WE basically need 10 DAC channels but 8 will be sufficient at this stage and it seems like your design may very much be our solution.

The plan is to run two channels streaming audio at high bit-rate either from a webserver, Bluetooth or from internal storage and the other 6 channels can run on lower bit rate (44.1kHz or evan lower). For those 6 channels we're planning to use SuperCollider implementing 6 different (simple) synthesizers that has to be well synchronized (latency is not an issue as long as they both have the same).

The control of both will be done either through the network or through

I have few questions and I'll appreciate your insights.

1. Do you think that the BeagleBone Black have enough power to run those streams?
2. Do you have instructions on how to implement your solution on BeagleBone-X15?
3. What's the best way to install SuperCollider on the BBB with all of its dependencies?
4. Since price is less of an issue at this point, can you point me to other multi-channel solutions that may be supported by BeagleBone (through USB, I guess)?

Thank you for your help.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.