Hi Dave,DaveHoskins wrote:I presume it can go higher than 44.1Khz? Because that's so 30 years ago!
there are several factors that concurred to the choice of using a 44.1kHz sampling rate as default for Bela. The main limitation comes from the decision of packing in 8 analog ins, 8 analog outs, 16 digital GPIO, 2 audio. All of this I/O is handled by an onboard microcontroller, called the Programmable Realtime Unit, which runs at 200MHz and talks to the audio codec via the MCasp, to the ADC and DAC converters. The internal loop on the PRU currently runs at 88.2kHz, that is it takes about 11microseconds to complete. During one of the internal PRU loops the following happens:
- 1 channel of audio I/O is performed through the I2S bus
- 2 channels of analog I/O are performed through the SPI bus
- 16 channels of digital I/O are performed through the GPIOs
This loop is traversed twice for each audio sample (as we need to perform I/O for a total of 2 audio channels).
Now, communication over the SPI bus is pretty slow, as each operation takes about 1.2us and there are four of them in a loop (two writes, two reads). On top of this you have to consider the time it takes to communicate with the audio codec and the time to access the ARM memory from the PRU, and of course the time for the PRU itself to execute the instructions (which is typically 5ns each). Summing all of this together, we get to a total that is very close to 11us, so that would be no way to speed the loop up without getting rid of some of the I/Os. The loop was already pretty packed before we added digital I/O. We managed to fit them in only by doing the digital I/O while waiting for the slow SPI bus.
For this reason, 88.2kHz is the maximum speed at which we can run this loop, which is the maximum sampling rate achievable for analog I/O, as it should be by now clear from the above. Audio runs at half this sampling rate, that is 44.1kHz.
All of this said, the noise level on the Bela board is not comparable with that of a high-end piece of studio equipment. After all, in an expensive 2U rack unit, the audio board probably is not at a distance of 8mm from (and running off the same switching power supply as) the CPU.
While we are very happy with the performance Bela achieves we felt that exceeding the current specs of 44.1kHz/16bit just for the sake of it would have not brought any appreciable results for the user.
The audio codec is actually capable of 24-bit conversion, but Bela runs it at 16 bits which reduces the amount of data that needs to be exchanged between PRU and CPU. Limitations on noise floor mean that 24-bit conversion would not make an audible difference anyway. A similar argument can be made for sampling rates above 44.1kHz.
As it currently stands, the analog I/O can be performed at 22.05kHz (using up to 8 channels), 44.1kHz (using up to 4 channels) or 88.2kHz (using up to 2 channels).
You may find this post we just added to our website relevant to your question and it also explains the difference between analog and audio I/O on the board:
http://bela.io/audio-vs-analogue.html
Yes, it is true we can do 88.2kHz analog I/O (again check the post above for more clarification on what we mean by "analog") and we can do 88.2kHz digital I/O, but I feel I should specify here what we mean by digital I/O.Miles1981 wrote: Check on the page, it can do 2 channels at 88.2kHz on the non-audio parts, or 88.2kHz on the digital I/O, which is what is relevant when talking about stems .
The Texas Instruments AM3358 processor, which is the core of the BeagleBone Black, comes with a number of General Purpose Input/Output. These are ultra-fast digital I/Os which are connected straight to the processor. With Bela they can be used, i.e.: to read from switches, bit shifters, other digital devices, or to drive LEDs, multiplexers, other digital devices or, if appropriately buffered with a circuit that can provide the required current, even motors and other actuators.
The Bela API samples the GPIO at 44.1kHz or 88.2kHz, synchronously .
These are by NO MEANS usable as channels for digital audio I/O (e.g.: to interconnect to S/PDIF, TOSLINK, ADAT ... ), as those sort of connections would require bit-clocks much higher than 44.1kHz or 88.2kHz.