BEAGLEBONE BLACK for AUDIO
I purchased my BBB from MakerTronics. I received info that there is a new version, Rev C, with more memory [link] and $10 more.
I had ordered a BBB for no other reason that it’s better looking than the Rpi :-). That was before all the discussions at diyaudio and efforts to build an external clock board. But as it turned out, the BBB has the edge for audio application. Here is why:
|Native I2S support||Yes||Yes||Both platforms can support I2S output, but it needs to be supported in the s/w.|
|I2S Sample Rate limitation||Up to 192KHz (because the on-board clock is 19.2MHz)||Only 48KHz family (because the on-board clock is 24.576MHz and integer clock dividers)||BBB supports 48KHz, 96KHz, 192KHz and 384KHz. RPi supports 44.1KHz, 48KHz, 88.2KHz, 96KHz, 176.4KHz and 192KHz (in theory). RPi uses “fractional clock dividers” to generate the 44.1KHz sample rate family|
|Support for USB DAC||Yes (LAN9512 chip [link])||Yes (Built-in in the main processor)||USB in the RPi goes through a built-in HUB and it is shared with the LAN controller within the USB/LAN chip. USB in the BBB is natively supported by the main processor; LAN has a separate chip|
|Support for external, low jitter clocks||Unknown||Yes||The master clock in BBB may be provided externally by disabling the on-board audio-freq clock.The Master clock in the RPi seems internally generated and there is no I/O pin to feed an external master clock|
|Master clock output||No||Yes (from on-board clock)||The Master clock in BBB is provided by the on-board 24.576MHz and fixed at this frequency and can be directly accessed from the outside. The Master clock of RPi seems internally generated but un-accessible from the outside. Without Master Clock, you can only use DACs that can operate asynchronously without a Master Clock input such as the ESS DACs or DACs that can operate with the master clock = bit clock|
|Built-in rechargeable battery operation||No||Yes [link]||Rechargeable Battery operation in BBB would disable the 5V supply to the USB. Thus for USB operation, where the USB adapter takes the power from USB, BBB must be powered with 5V DC|
|Built-in Storage||No||2 GB eMMC Flash||BBB can boot from the internal storage freeing the SD card for music storage. RPi requires that the OS be stored in the SD card (although it may be possible to also store music in the SD card)|
In addition, even though the Rasberry Pi has the most community development support, the BBB is a close second, so there is ample resources available. The s/w part is a big part of the solution.
RAM Chip (512M DDR3)
Flash Storage Chip (2GB 2MMC)
Power Management Chip
The TPS65217 [link] is a single chip power management IC specifically designed to support the AM335x series of application processors in portable and 5-V, non-portable applications. It provides a linear battery charger for single-cell Li-ion and Li-Polymer batteries, dual-input power path, three step-down converters, four LDOs
Potential lower-noise mod?:
According to page 2, 30 of datasheet:
For low-noise applications the devices can be forced into fixed frequency PWM using the I2C interface.
The TPS65217 step down converters typically operate with 2.25-MHz fixed frequency pulse width modulation (PWM) at moderate to heavy load currents. At light load currents the converter automatically enters Power Save Mode and operates in PFM (Pulse Frequency Modulation).
This is a s/w mod. However I2C access to the chip seems not easy at this moment. According to this article [link]:
The TPS65217C PMIC is very programmable; it has dozens of configuration settings specifically for charging and it has safety timer capability. The PMIC is configured upon startup via I2C. There are three I2C busses on the BBB, and one is dedicated to on-board peripherals. Control of the PMIC is not normally possibly by the user; it requires driver code or possibly there is access by the device tree infrastructure. Checking the .dts file in /boot did not reveal how to control the battery charger functionality. There are two current Google Summer of Code (GSoC) projects that touch on PMIC:
Hopefully the guys working on the projects (Zubair and Thomas) can offer some advice on how to set the level to 4.2V. Zubair’s project also includes how to use the in-built ADC inside the AM3359 to monitor voltages.
According to the datasheet, “light load current” seems to be at the 1 mA range. Perhaps during operation, the device may never enter the PFM mode and therefore this mod may not be needed at all.
USB Host connector
The current preferred mode for audio is to use a USB audio interface to the DAC because BBB cannot support 44.1KHz sample frequencies with the on-board clock. The interesting part is that the 5V power in the USB host is provided by “SYS_5V”
“SYS_5V” is essentially the 5V DC input to the board. The 5V line goes through a series of solid state switches for power up/down management. Therefore a clean 5V supply to the board will also provide a clean 5V to the USB audio interface. Further filtering is provided by the FB7 ferrite.
BBB audio is generated by the main processor, the AM335x 1GHz ARM® Cortex-A8. The Multichannel Audio Serial Port (McASP) subsystem is responsible for generating the audio using and external audio frequency oscillator. In this case it is a 24.576 MHz oscillator connected to the clock input pin of the processor’s audio subsystem
According to the BBB System Reference Manual, page 75 [link]:
6.10.6 Audio Interface
There is an I2S audio interface between the processor and the TDA19988. Stereo audio can be transported over the HDMI interface to an audio equipped display. In order to create the required clock frequencies, and external 24.576MHz oscillator is used.
In order to create the correct clock frequencies, we had to add an external 24.576MHZ oscillator. Unfortunately this had to be input into the processor using the pin previously used for GPIO3_21. In order to keep GPIO3_21 functionality, we provided a way to disable the oscillator if the need was there to use the pin on the expansion header.
Therefore, since a bit-clock has to be generated from this external 24.576MHz clock, only the 48KHz family of sample rates can be supported. Notice that the most common high res sample frequencies are 96KHz and 192KHz and are fully supported by the board.
Notice that since the 24.576MHz clock is fed through an external interface, the audio subsystem is operating in SLAVE MODE. This is according to the datasheet [link]. This master clock is also available external through pin 25 of header P9.
The I2S Pins are as follows on the header P9 (clearly labeled on the board) [link]:
There is a good discussion on I2S audio output here [link]
EXTERNAL CLOCK BOARD
I don’t know about the “unfortunately” part above, but for audio, disabling this clock and having access to the clock line through GPIO3_21 allows the use of an external clock (so this turned out to be fortunate for audio applications).
The solution for bit-perfect audio for all sample rates is to provide the clocks externally through an expansion “cape”. This cape would have two clocks: one to support the 44.1KHz family of frequencies and another to support the 48KHz family of sample frequencies. Two other I/O pins are used to select the appropriate clock frequency. In addition to an external clock board, s/w needs to be developed to enable this function. More discussion here: [link], [link].
This “external clock board” is currently being discussed here
It is important to reiterate that without this not-yet-available clock cape, the BBB would not be able to support the 44.1KHz family of sample rates through its I2S interface. In the meanwhile, while we await the development of the dual clock board, the USB interface would be the preferable method for audio output.
The first thing to do is to check the board and ensure it is working. Follow the Getting Started Guide [link]. Here is what you do:
- To get started all you need is to connect the BBB board to a computer with the included USB cable. This will power the board and provide an interface to the board
- The BBB comes already loaded with an operating system (currently Angstrom) in the on-board eMMC flash memory. Once you power it on, it will boot-up.
- After boot, you will see the BBB board as a storage drive in your computer. From power-on, this booting process takes about 24 seconds.
- Following the link the the “Getting Started Guide” install the device drivers that will enable “network-over-USB” access to your BBB board
- Type http://192.168.7.2 in your browser and you will see the following screen
BBB out of the box (shows up as a storage device)
BBB after installing network-over-USB drivers (address: http://192.168.7.2)
You may want to access the BBB with a terminal session. Download “putty” [link] (for Windows) and run it. Enter BBB IP address (192.168.7.2), you will see a log-in prompt. Enter “root” for login and nothing for password.
The official getting started guide is here: [link]