2

In these days I'm trying to play my guitar through my audio interface using guitarix and JACK and they work just fine. The issue arrives when I also want to play spotify or youtube in the meantime. I'm trying to route Pulseaudio to jack executing these scripts after the startup on qjackctl:

pactl load-module module-jack-source;pactl load-module module-jack-sink

The connection works, but then the sound that I get from my speaker is just terrible, full of glitches and strange noises, it just isn't usable.

Am I doing something wrong? Should I tweak something? Is this setup usable for you?

  • if you only want audio playback from Pulseaudio and don't need to capture connection, just use 'pactl load-module module-jack-sink' – nik gnomic May 22 '18 at 14:16
  • are you just loading Guitarix, which is starting JACK ? suggest you use QjackCtl to start JACK and monitor the server. Suspect your settings for samplerate, buffer size and periods/buffer are set too low and is causing errors in audio stream (x-runs). if qjackctl confirms there are many x-run errors, increased buffer settings will stop this, but might increase audio delay through JACK – nik gnomic May 22 '18 at 14:40
-1

For playing guitar through jack a pretty low latency is required, so you will have configured jack's sample rate, period and buffer-size to reach that. This may result in problems when routing sound from pulseaudio through jack.

In this case I think the best is to use jack while pulseaudio is not running when you play guitar and pulseaudio while jack is not running when you want to playback media. This also would have the advantage that jack doesn't need to share resources with pulseaudio.

To do it this way, you will need to configure jack as well as pulseaudio.

Configure pulseaudio

pulseaudio has an autospawn feature which is enabled by default. You need to disable this feature, otherwise pulseaudio would be restarted whenever pulseaudio is stopped. To do that, create the file ~/.config/pulse/client.conf, this file needs to contain the line

autospawn = no

If this file already exists, edit it accordingly.

You also need to add an entry in the startup applications like in this example:

enter image description here

This entry in the startup applications is needed, otherwise pulseaudio will not start during boot because autospawn is disabled.

Configure jack

Open jackctl, click Setup, choose the Options-tab and add the commands pulseaudio --kill and pulseaudio --start according to this example (if you use scrips here, add the commands to the corresponding scripts):

enter image description here

That's it. I myself use this configuration in Ubuntu Studio 16.04 and 18.04 and it works fine.

  • killing pulseaudio to run JACK prevents OP wish to have audio playback through Pulseaudio when JACK is running. D-Bus control options in qjackctl (already on ubuntu studio) ensure Pulseaudio releases sound device when JACK needs it, and loads Pulseaudio to jack connections so Pulseaudio can still work via JACK – nik gnomic May 24 '18 at 22:56
  • @nikgnomic I interpreted the question a bit different, thinking sometime OP want to play guitar, another time listen to music. Probably the question is not very clear in this point. – mook765 May 25 '18 at 0:03
  • There is item shown in Session and Startup for Pulseaudio Sound System, usually loads systemd pulseaudio.service with X11 modules. Direct commands to stop and restart Pulseaudio may appear to restart Pulseaudio ok, but X11 modules usually not loaded. Low Latency in JACK is not a problem for Pulseaudio when samplerate and buffers adjusted there too. Qjackctl configuration in 18.04 usually only needs sound device selected. May need "pacmd suspend true" before starting JACK, Pulseaudio will de-suspend after starting. – nik gnomic Aug 13 '18 at 13:45

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.