ECE497 Notes on Rakarrack

Rakarrack is an open source effects processor that emulates a guitar effects pedal board. It can be run easily in Ubuntu on the BeagleBone. Below is the installation process for use with the BeagleBone Audio Cape.


 * Note: The following is tested on Ubuntu 12.10 running version 3.2.33-psp26 of the kernel.

Ubuntu Installation
To install Ubuntu on the BeagleBone follow the instructions found on the BeagleBoardUbuntu elinux site.

login: ubuntu password: temppwd

Run `sudo apt-get update` and `sudo apt-get upgrade` until there are no more updates/upgrades to install.

ALSA
In Ubuntu, to get ALSA to work with the BeagleBone Audio cape, the following modules need to be specified in '/etc/modules'

snd_soc_tlv320aic3x snd_soc_davinci snd_soc_davinci_mcasp snd_soc_evm

You can test the audio by running `speaker-test`. Also running `aplay -l` will show a list of available sound cards. If the sound card is not shown, run `lsmod` and `dmesg` and make sure the kernel modules above have loaded without errors.

Rakarrack Installation
Rakarrack uses the Jack Audio Connection Kit to route audio between applications.

JACK
Start by installing jackd2. This requires a patch for the current version (jackd-1.9.10) on ARM (see this forum post). Run the recipe below (copied from that post with a couple modifications).

wget http://jack-audio.10948.n7.nabble.com/attachment/15962/0/jack2_armel.diff apt-get source jackd2 cd jackd2-1.9.8~dfsg.4+20120529git007cdc37 patch -p1 -i ../jack2_armel.diff dpkg-buildpackage -rfakeroot -uc -b cd .. sudo dpkg -i libjack-jackd2-0_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb jackd2_1.9.8~dfsg.4+20120529git007cdc37-2ubuntu1_armhf.deb

Rakarrack
Then install Rakarrack by running the following:

sudo apt-get install rakarrack The installation should install jackd as a dependency. To check the installed jack packages run the following:

dpkg --get-selections | grep jack You should see something like this:

ubuntu@arm:~$ dpkg --get-selections | grep jack jack                                           deinstall jackd                                          install jackd1                                         deinstall jackd2                                         install libjack-jackd2-0:armhf                         install libjack0:armhf                                 deinstall qjackctl                                       deinstall

System Configuration
Before running anything we need to make sure that the BeagleBone is running at its maximum clock speed. To do this run the following:

sudo cpufreq-set -f 720MHz sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq The output of that last command should be '720000'


 * Note: The BeagleBone needs to be running off the wall adapter to reach maximum clock rate

JACK
Next, start JACK by running the following:

jackd -d alsa -p 256 -n 16 -S

This tells JACK that we wan to use alsa with a 16 period 256 samples/period buffer in 16-bit mode. This should be enough delay to not cause too many XRuns in JACK but not too big to be noticeable. The output should look somethings like the following:

ubuntu@arm:~$ jackd -d alsa -p 256 -n 16 -S jackdmp 1.9.10 Copyright 2001-2005 Paul Davis and others. Copyright 2004-2013 Grame. jackdmp comes with ABSOLUTELY NO WARRANTY This is free software, and you are welcome to redistribute it under certain conditions; see the file COPYING for details JACK server starting in realtime mode with priority 10 creating alsa driver ... hw:0|hw:0|256|16|48000|0|0|nomon|swmeter|-|16bit control device hw:0 configuring for 48000Hz, period = 256 frames (5.3 ms), buffer = 16 periods ALSA: final selected sample format for capture: 16bit little-endian ALSA: use 16 periods for capture ALSA: final selected sample format for playback: 16bit little-endian ALSA: use 16 periods for playback

Rakarrack
Now you should be able to run the rakarrack GUI. Use `ssh -X ubuntu@192.168.0.XXX` to connect to the BeagleBone with X11 forwarding and then run `rakarrack`.


 * Note: This version of the kernel does not have a working USB gadget module so ethernet over USB does not work so the BeagleBone needs to be connected to the network.

The program should be able to find jackd by itself. If not kill the JACK processes and rerun the configuration. One way to do this is run `ps -AL | grep jack`, and then run `kill -9` with the pid number.

When Rakarrack opens, it may warn you that your CPU is not fast enough to run some of the audio effects (e.g. convolutron). Don't worry about this too much.

In Rakarrack go to 'Settings->Preferences->Audio' and lower all the downsample rates to '4000' and change all the down and up sampling types to 'Linear'. We could get a little more performance out of 'Zero Order', but this sampling does not interpolate so the quality isn't great.

Conclusion
With these settings we are able to run any single effect in Rakarrack without causing XRuns in JACK. Some effects can be chained together, but others are just too computationally complex.

Future Work
An interesting follow up project would be to see if another embedded Linux board (e.g. BeagleBoard xM, PandaBoard, etc.) could run Rakarrack at its default settings (or maybe its maximum settings?).


 * Note: On multicore systems JACK may require some special setup for realtime processing