Using Docker to run Norns
Please see this updated repo by @winder winder/norns-dev
Also see the messages from him down thread too.
Old contents
See this GitHub repo:
If you have Docker running on your computer (tested with Linux and OS X), then you can run this command:
docker run --rm -it \
--ulimit rtprio=95 --ulimit memlock=-1 --shm-size=256m \
-p 5000:5000 -p 5555:5555 -p 5556:5556 \
samdoshi/norns-test-dummy
(FYI: it will download 500MB-1GB of data)
and visit http://127.0.0.1:5000/maiden/ in your browser. There is no audio.
Type ctrl-b d
to exit.
For working audio and grid on Linux see norns-test-dummy
.
Audio on OS X
Iāve had a brief experimentation trying to run NetJack2 on OSX, but I couldnāt get the client inside the Docker container to see the host. According to this it works in principle. The issue might be due to how networking works with Docker for Mac.
An alternative idea might be to run scserver
and crone
outside the container, but run matron
and maiden
inside. In particular matron
is the one that is heavily dependant on a Linux base.
(A futher note, SuperCollider wonāt build with the default 2gb RAM that Docker for Mac allocates to the VM it uses, I had success with 4gb.)
Data dump
Audio experiments with containers
See this gist for an example using ALSA and SuperCollider (Linux only).
See this gist for an example using NetJack2 and SuperCollider (Linux only so far).
Useful jack
commands
Iām using jack2-dbus
on my host computer ā Arch Linux FYI.
Iām also using catia
to manage connections, once Iāve got some name stability with the containers Iāll try to automate connections with jack_connect
.
jack_control stop # stop jack
jack_control start # start jack
jack_load netmanager # load the NetJack2 plugin
# or combined (jack can get itself in a funk and sometimes needs a kick)
jack_control stop && jack_control start && jack_load netmanager
jack_lsp # list ports (i.e. inputs, outputs and apps)
jack_lsp -c # list ports and connections
Using names with ALSA
ALSA hardware numbers can (and do) change, you can use hardware names instead of numbers when starting jackd
.
$ cat /proc/asound/cards
0 [Crimson ]: USB-Audio - SPL Crimson
Ploytec GmbH SPL Crimson at usb-0000:00:14.0-1, high speed
1 [PCH ]: HDA-Intel - HDA Intel PCH
HDA Intel PCH at 0x13ffff10000 irq 47
2 [HDMI ]: HDA-Intel - HDA ATI HDMI
HDA ATI HDMI at 0xfbd60000 irq 51
3 [PC4 ]: USB-Audio - Faderfox PC4
Faderfox Faderfox PC4 at usb-0000:00:14.0-3.2, full speed
Using the above info, you can change a .jackdrc
from:
/usr/bin/jackd -R -d alsa -d hw:0
to:
/usr/bin/jackd -R -d alsa -d hw:Crimson
X11 forwarding
How to show X11 windows with Docker on Mac
Debugging inside a container
To run gdb
against a process inside a container you must add --cap-add=SYS_PTRACE --security-opt seccomp=unconfined
to your docker run
command.
As an example, here is how to debug matron
, if we wish to debug an interaction with maiden
we need to attach to a running process due to using ws-wrapper
.
$ docker exec --user=root -it <container name> bash # get a privileged user inside a running container
# fyi, the following commands are now running in the container
$ cd norns
$ ps ax | grep matron # find the matron process (choose the one without ws-wrapper)
$ gdb ./build/matron/matron <ps number>
(gdb) continue # gdb will pause the process when it starts, so type 'continue' to start it again
Useful links
- This GitHub repo has SuperCollider running inside a docker container, albeit with the sound card passed directly.
Changelog
-
2021-10-15: Add notice about
winder/norns-dev
-
2018-09-08: Added link to the
norns-dev
GitHub repo, shortened old sections -
2018-09-03: Added some OS X notes, X11 notes, and
gdb
notes - 2018-09-01: Created this first post