Final Report - Porting CTAG face2|4 Audio Card drivers to BB-X15 / Create library to make use of C66x DSPs

Initial goals:

  • Porting CTAG face2|4 Audio Card drivers to BeagleBoard-X15 (TI AM5728)

  • Before the GSoC project, the soundcard driver was only compatible with BeagleBone Black/Green- Create library to make use of C66x DSPs (especially for audio applications)
    Development Process:

    1. Before I started with development I did some research and planning for both project parts:
  • Part 1: Porting CTAG face2|4 Audio Card drivers to BB-X15

  • AM5728 pin multiplexing (e.g. calculated offset addresses for device tree)

  • Multichannel Audio Serial Port (McASP)

  • Standard audio drivers of BB-X15 (i.e. simple-audiocard, hdmi)

  • Device tree (dra74x.dtsi, am57xx-beagle-x15.dts)a- Part 2: Create library to make use of C66x DSPs

  • Remote Processor Framework (remoteproc)

  • TI OpenCL

  • TI DSPLIB- 1. First I focused on soundcard driver development

  • Created device tree for SPI, McASP and ASoC soundcard configuration

  • Tested SPI with new device tree:

  • No SPIDEV device tree available for BB-X15 for testing

  • When hw_params() is triggered in ASoC machine driver, SPI changes have to occur

  • No changes detected with oscilloscope (serial debug) on Chip Select and MOSI

  • Turned out that problem was caused by breakout board and bug in device tree (pin offset address)- Tested McASP (I2S) interface:

  • Master clock for McASP is configured differently (compared with BeagleBone Black/Green (BBB/BBG))

  • Added device tree node property to distinguish between BBB/BBG and did some modifications in probe function to configure clocks differently

  • Kernel crash occured when DAI of McASP (bitclock / frameclock) is triggered (biggest problem in my whole GSoC project)

  • By disabling recovery in remoteproc kernel crash can be avoid and everything works fine- 2. Library (libdsp-x15) to make use of C66x DSPs (especially for audio applications)

  • Began with small DSP tests (e.g. TI OpenCL examples)

  • Had some problems with IFFT which was caused by wrong generated twiddle factors- Integrated Fast Fourier Transformation (FFT) and Inverse Fast Fouriere Transformations (IFFT)

  • A plot of FFT/IFFT test can be found here- Integrated Biquad filter

  • A Plot of biquad filter (200Hz cutoff / 0.707 Q factor / 6 dB gain) test with 1 kHz sine input signal can be found here- Created demo applications for spectrum plotting in real time

  • Created multi channel crossover demo application with finite impulse response biquad filter (not completely finished yet)
    What I have achieved in comparison with initial goals:

  • Porting soundcard drivers to BeagleBoard-X15:

  • This project part was achieved completely (except that remoteproc recovery has to be disabled to avoid kernel crash)- Create library to make use of C66x DSPs:

  • One sub goal was to continuously calculate the spectrum of an audio input channel

  • Has been realized with Jack Audio Connection Kit (JACK) and SDL1- Moreover an additional demo application which implements a frequency crossover with a biquad filter has been created (nearly):

  • Still some problems with real time audio signal via JACK (which I want to fix before final GSoC deadline)

Short feature description of both projects parts:

  1. CTAG face2|4 Audio Card can be used with BB-X15 and is still backwards compatible BBB/BBG (if device tree node of SBC is not set, BBB/BBG probe routine is called by default)
  • All channels / features of audio card (AD1938 audio codec) can be used
  • Pull Request for beagleboard kernel has been created already1. C66x DSP lib (libdsp-x15) offers the following operations:
  • Fast Fourier Transformation (efficiency is linear to input samples). FFT with N=16384 takes about 2 milliseconds.
  • Inverse Fast Fourier Transformation (efficiency is equal with FFT)
  • Biquad filter (takes about 0.3 ms for 512 input samples)

Future Work:

  • In the future I want to extend / improve the DSP library (libdsp-x15) and use the BB-X15 in connection with CTAG face2|4 Audio Card for a modular synthesizer modul in Eurorack format together with my mentor Robert Manzke
  • Here are some of the ideas I want to implement with my library:
  • Multi channel convolution reverb with FFT
  • Additive synth (user can “draw” spectrum which is transformed to time domain with IFFT)
  • GUI should be created with QT and be run without X11 or Desktop environment for performance
  • Still some problems with QT (runtime errors due to OpenCL type conflicts of TI llvm) which I want to fix
  • Realtime plots should be implemented with QT as well- Demo video

Project References: