Sonic Pi 3.3.1 Binary deb for Ubuntu 20.04 (amd64) question

I am working on producing a binary deb suitable to run on Ubuntu 20.04 (amd64) and have a question.
The deb is ready to go apart from one area of uncertainty. Ubuntu 20.04 ships with pulseaudio enabled, much as the Raspberry Pi OS now does.
I can configure the deb to automatically route the jack output of SP into pulseaudio, where you can select the audio destination using Ubuntu’s sound-settings module, and you can change the sound destination on the fly even whilst Sonic Pi is running. For general use, this is fine and probably the most convenient, but it comes at a price of latency. Jack would be set to feed a dummy device at 48000 sample rate with 1024 buffer and 2 periods/buffer.

It is possible, if you have an external sound card to directly feed this using jack only, setting whatever parameters work with your interface, and bypassing pulseaudio by setting up the required configuration in QjackCtl, and starting that before starting Sonic Pi. You can then either manually, (or with a simple script) switch the links for pulseaudio to jack only. Of course your sound interface would then be unavailable to pulseaudio until you quit SP and QjackCtl, and this seems to work well.

The alternative is to leave the config as it has been for previous versions, in which case you will have to set a relevant configuration to select he required jack settings you want to use, either with QjackCtl or directly by starting jackd on the command line. You will still have to be careful about interactions with pulseaudio, unless you uninstall it completely.

My preference is for the former, which should give a working configuration out of the box. I have been using a deb install incorporating this for the past few days on a virtual Debian 20.04 installed on my mac, and it seems to work pretty well.

The other “gotcha” on Ubuntu is that you need to add your user name to the audio group in order for jack to work with realtime access and to allocate the required memory.

We hope to develop the scsynthexternal.rb script further to allow greater configuration of jack settings from a config file, as has been done for scsynth startup settings in version 3.3.1 but that is for a future release.

Robin, if I remember correctly, prior to v3.3 we first checked to see if jack is running and if so, use that, otherwise we boot our own jack and route audio through that.

Would another option to be to do something similar to that? If a jack server is already running, use that, otherwise assume the user wants to use pulse audio and route audio through our own jack to pulse.

Yes that will still be there as is now. What I want to know is will it hack people off if pulseaudio is the default if you don’t do anything else, as in RPi. I could also check if jack is running and not do pactl connections if it is. EDIT I don’t think the current setting ever started Jack properly anyway.

I would think it would be sensible to do:

  1. Use existing jack server if available
  2. Otherwise create own jack server and route to pulse

However, we could also allow for a config entry which let’s the users choose which of these to do or also to:

  1. Create own jack server with config options.

However, it’s not clear to me what sensible config options for your own jack server would be - and maybe it’s best to stick to asking users to explicitly set up their own jack servers in advance.

1 Like

Yes I think 1 and 2 are probably best. In fact I think with these we may be able to amalgamate Pi/Linux into one section for def_boot_server as they should be pretty much identical.

1 Like

Thanks for this, I had a devil of a time trying to compile from source etc. while this .deb looks to work flawlessly.

1 Like