8

I am about to start working on a project which involves real-time audio processing for an audio effects application. The application is supposed to acquire and process audio from 8 individual audio input channels at a sample rate of 48kHz. The audio processing algorithm generates audio for 8 individual audio output channels. The audio sample format is 16-bit signed LPCM. Since it's for a real-time audio effects application, latency is also important. If audio is looped from input to output without any processing, the round-trip latency should not exceed 12ms.

The application should receive 256*8 input samples every 5.33ms (via an audio callback), process those samples and transmit 256*8 output samples (also via callback). The 256*8 samples are received/sent in some kind of "interleaved" format.

I am currently researching different hardware platforms and I was wondering if the Raspberry PI 2 B could be a suitable choice. The board itself seems to have a lot of horse power (900MHz Quad Core ARM CPU), but it only has audio input. So my questions are:

  1. Is the Raspberry PI 2 B suitable for real-time audio processing?
  2. If the answer to 1 is yes, then I would like to know if there are any add-on audio boards for the Raspberry PI 2 B on the market with 8 input channels and 8 output channels? The board must support 48kHz sample rate.
  3. If the answer to 1 or [2] is no, which HW platform would you recommend?

The reason why I'm looking at the Raspberry PI 2 B is the attractive price, but there might be other types of boards on the market which are more suitable for this kind of application.

Block diagram

1
  • "the round-trip latency should not exceed 12ms" .... "samples every 5.33ms" Are you sure this is even feasible on a PC? It is not the processing power that's an issue, it's doing this completely in userland software on a non-realtime operating system. I think the latency is going to be a lot more than 12ms. If you are not certain about that question, then the answer is probably no and there aren't any alternatives amongst general purpose SBCs. However, if you know for a fact it can be done with a PC, then there is a chance.
    – goldilocks
    Commented Jan 5, 2016 at 2:59

1 Answer 1

4

The short answer is yes, no and depends, the long answer is probably no, but might be yes depending on your approach. As a piece of hardware, the Pi is quite fast, and can probably handle the shifting of data from input to output reasonably quickly. However, the default setup, of raspian linux, is not a realtime platform. What's more, you've not specified what DSP you want to do. Back when I was at university, in the days of 386s and Windows 3.1, if you wanted to do serious sound processing you needed an external DSP chip to be able to make it all work.

If this were to work on the Pi, you've got a few options. First option, probably the best way to do it, would be in hardware, using interrupts, and a separate DSP module. I'm not sure what's out there, but it's worth considering that mostly the Pi interfaces with USB and that has bandwidth limitations, so you might be out of luck anyway. Secondly try coding it as a kernel module and see what kind of throughput/processing power you can get out of the Pi, User mode linux is not realtime, and while it'll be a useful proof of concept (doing it in usermode with a high process priority) you may need to go into the kernel to squeeze more speed out of it. Finally the linux kernel, even in it's cut down pi version, does a lot of stuff, you don't need for a simple DSP device. I think I saw a kernel out there somewhere that would turn your PC into a network router. Something that basic is all you need, but you'll have to get down and dirty with some C kernel hacking.

If you want to do the sums and try to work it all out, you need to write the assembler for whatever your processor is going to do with the data, and work out how many process instructions will be needed to load the data, change it and write it out, and see if that multiplied by the 48k*2 is going to exceed 900M, and if not, by what margin (everything else the device does, has to function in that margin, hence my suggesting you minimise that by losing the normal kernel stuff). I think it highly likely that it'll not work, but it really depends on what processing you want to do. You might be able to compile your own kernel with nothing in it, except your own kernel module, and have just enough space. You'll have to try it and see.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.