5

While working on a PPA to provide binaries for Sonic Pi, the users of the PPA binaries keep stumbling over jackd. How to make things easier for them?

Sonic Pi is an educational music tool that combines an electronic synthesizer with a programming language. It targets novice users and school children to teach coding through fun with music. The software's main install target is Raspbian where it comes pre-installed. And the code contains some built-in hacks, uh I mean, pragmatic solutions to get jackd up and running on the Raspberry Pi. But these hacks are RPi-specific and don't work well on other distributions.

Here's the situation:

  • Sonic-Pi is a graphical IDE
  • with a ruby-based server running in the background that controls the music
  • to play the music, it's using scsynth (a part of Supercollider) as the synthesizer backend
  • scsynth currently requires using jackd to play audio on Linux
  • the ruby-based Sonic Pi server starts jackd (if it isn't already running) and then scsynth

Now here the troubles begin if you're on Ubuntu (and I guess on Debian, too):

  • jackd's default config on Ubuntu doesn't seem to work for everybody, so on some systems, it just won't start and the user has to use qjackctl or dig into the logs and change the configuration files
  • when jackd does start, it blocks PulseAudio, so any program using audio already running will stop working
  • jackd prefers realtime scheduling, but Ubuntu isn't preconfigured to do this and requires changes to the user to do it

So all in all, it's a mess. This isn't the experience a novice user wants after installing Sonic Pi.

There are guides out there how to get jackd working with Ubuntu, but working through them is asking too much from a novice user or a teacher in a classroom who just want to get this software going.

So what I'm looking for is a way that will make sure that after installing Sonic Pi from the .deb, things with jackd work out of the box, trouble-free, no manual configuration required.

The wishlist is this:

  • a configuration for jackd that "just works" out of the box
  • for all non-privileged user accounts
  • that doesn't block PulseAudio/ALSA on the same system
  • on a default Ubuntu (and if possible on a default Debian and Raspbian, too)
  • and the distribution's default audio mixer and volume control hotkeys keeps working

Does this even exist?

Is there a .deb for this (or can a .deb be made) that users can just install to have it configured that way?

hez
  • 181

1 Answers1

4

I have read the Takkat comments and may be this will be ok for you:

  • From here, install "pulseaudio-module-jack" then edit /etc/pulse/default.pa (sudo gedit /etc/pulse/default.pa ) : Add the following lines, underneath the line that says #load-module module-alsa-sink
    load-module module-jack-sink
    load-module module-jack-source
    Then create or modify .jackrc in your home containing:
    /usr/bin/jackd --no-realtime -dalsa -dhw -r44100 -p1024 -n2

Restart pulseaudio running killall pulseaudio (also stop jackd if running killall jackd ) : pulseaudio will restart automatically and jackd will also start, both correctly connected so Jackd and Pulseaudio can be used at the same time .
(this works on my Ubuntu 14.04 pc ) .

  • Realtime is only needed if you want low latency for multitrack recording. The above jackd config will produce 21ms latency which is good for most audio programs (the latency can be increases setting 2048 instead 1024 in .jackrc , look jackd --help)
    So you don't have to give realtime access to users,
    (You can ignore warnings if any ("Cannot use real-time scheduling")) .
    The -dhw parameter should work on most pc, but it can be ommited to use default audio device, or changed to -d hw:1,0 to use 2nd audio device
  • May be one more step if you needed to connect manually jackd to audio in/out using "Qjackctl connect manager" (most programs connect to jackd automatically, in this case no need to do this ) : install "jack tools" and use "jack_connect" commands to script these connections (you can also use aj-snapshot to save and restore jack connections )
laugeo
  • 2,827
  • Thank you. I found that solution in another forum thread, too. Yes, it works. However, on my XUbuntu setup, this configuration breaks the mixer program. Everything works except the mixer, so I cannot change the volume with the XFCE4 mixer or the keyboard multimedia shortcuts. Any idea how to fix that issue? – hez Dec 04 '15 at 20:40
  • May be this can help : http://askubuntu.com/questions/130927/how-to-switch-default-sound-device-controlled-by-hardware-keys-in-xubuntu – laugeo Dec 05 '15 at 09:52