Skip to content

Instantly share code, notes, and snippets.

@mzero
Created October 29, 2019 17:08
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mzero/b8d772cd78867a3215fcd7a0e42add51 to your computer and use it in GitHub Desktop.
Save mzero/b8d772cd78867a3215fcd7a0e42add51 to your computer and use it in GitHub Desktop.
digitakt usb audio driver on RaspberryPi

building the linux digitakt usb driver

needed to install

sudo apt install flex bison libssl-dev libncurses5-dev bc

clone kernel sources

cd
mkdir kernel
cd kernel/
git clone --depty=1 --branch raspberrypi-kernel_1.20190819-1 https://github.com/raspberrypi/linux.git
    # branch number needs to match installed version of raspberrypi-kernel

config & prepare

cd ~/kernel/linux
KERNEL=kernel7
make bcm2709_defconfig
    # default for RPi3+ 
    # for other models, see https://www.raspberrypi.org/documentation/linux/kernel/configuring.md
vi .config
    # find the CONFIG_SND_USB section
    # add a line: CONFIG_SND_USB_DIGITAKT=m
make prepare
make scripts

get and copy things from snd-digitakt repo

cd
git clone https://github.com/droelfdroelf/snd-digitakt.git
cd ~/kernel/linux/sound/usb/
cp ~/snd-digitakt/sound/usb/Kconfig .
cd misc
cp ~/snd-digitakt/sound/usb/misc/Makefile .
cp ~/snd-digitakt/sound/usb/misc/digitakt.c .

build

cd ~/kernel/linus/sound/usb/misc
make -C ~/kernel/linux  M=$(pwd) modules
# after this there should be a snd-digitakt.ko file in this directory

install

sudo make -C ~/kernel/linux  M=$(pwd) modules_install
sudo depmod

load into Kernel

sudo modprobe snd-digitakt

test

# connect Digitakt
# put it in Overbridge mode
#       Settings (gear button) > System > USB Config
#       select Overbridge, press Yes
#       select Int to Main, set to Off
aplay -l
arecord -l
    # both commands should list the Digitakt as a card

# start jack
/usr/bin/jackd -R -P 75 -d alsa -d hw:Digitakt -r 48000 -n 2 -p 256 -s &

play through Supercollider

sclang
# following commands are to sclang, not the shell
s.options.numInputBusChannels = 12
s.boot
{ SoundIn.ar([0, 1]); }.play

load it into the kernel

@yuncam
Copy link

yuncam commented Apr 20, 2020

typos:

  • git clone --depth=1 --branch raspberrypi-kernel_1.20190819-1 https://github.com/raspberrypi/linux.git

  • cd ~/kernel/linux/sound/usb/misc

@yuncam
Copy link

yuncam commented Apr 20, 2020

I had some issues with make -C ~/kernel/linux M=$(pwd) modules because the header files "usbaudio.h" and "midi.h" couldn't be found.
Solution: I just copied these two header files from /kernel/linux/sound/usb/usbaudio.h and /kernel/linux/sound/usb/midi.h to the folder /kernel/linux/sound/usb/misc/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment