Raspberry Pi and Linux USB Audio Interfacess
For my initial prototype of recursion looper, I wanted to try to get a chuck script working on the Raspberry Pi 3. Mostly because the Pi is cheap, but also because it is small and easy to build into a pedal. Plus the linux system and wireless abilities allow for a lot of cool possibilities down the road.
The onboard audio works fine, but there is no input. Rather than try to design an interface from scratch, my first goal is making sure my looping interaction can work as designed, so I decided to use/modify an off the shelf interface. The Behringer U-CONTROL UCA222 is cheap and offers stereo line in/out and hardware monitoring (for no latency when playing over your loops).
This worked great, but like most people delving into linux audio I soon found myself desparately searching forums for advice. There’s a lot of good stuff out there, and even after properly setting real time groups, priorities and carefully managing jack settings and buffers, I would still get random pops-clicks.
The strange thing is, the Raspberry Pi 3 seemed capable of clean audio even with very low buffers and latency and hardly any CPU usage (<30%). But intermittently, the system would just start distorting and buzzing and correct itself after a few minutes.
After much searching, I found the key to solving my issue buried on the wonderful linux audio wiki (which sadly seems to have recently gone offline). The trick is very simple and may help anyone with a USB 1 soundcard (which the UCA222 apparently is) trying to get stable audio on linux. You just need to force the USB bus to operate in USB 1 mode by adding a kernel parameter to /boot/cmdline.txt
.
Simply add the line dwc_otg.speed=1
after the other parameters in the file.
Credit to the linux audio wiki for the tip, check it out for more great setup advice for linux audio and the Raspberry Pi. Linux Audio Wiki (via the Wayback Machine)