Booting scsynth fails to start jack (after installing

Hello.

working on arch, I installed pulseaudio-jack in order to enable streaming of server audio via zoom.
This disabled automatic start of jack when booting scserver. I get this message:

Automatic start of JACK server is disabled at configure time
jack server is not running or cannot be started

I can start jack manually from the commandline or qjackctl, but it no longer starts automatically when booting.

I probably need to edit a config file - but do not know which. Any help in fixing this would be most welcome.

Thanks,
Iannis Zannos

The simplest fix is: Do not rely on autostart.

AFAIK it has always been best practice to start JACK first, and then boot scsynth. (That is, the fact that scsynth starts JACK as a courtesy doesn’t mean that it’s recommended to run it that way.)

For one thing, if you start JACK first, then you’re guaranteed to be able to manage JACK connections in qjackctl or another tool (and if you’re piping through Zoom, you will need to manage connections). I’m not 100% certain this is the case for a JACK instance that’s owned by scsynth.

(Sometimes I think auto-starting JACK could be removed from our code, but that would confuse new Linux users even more.)

hjh

Hello,
thanks for answering. Starting Jack on login and keeping it on would be fine if that did not interfere with pulseaudio and disabled sound in apps using that such as Firefox and zoom.
I am unable to see jack in qjackctl in order to feed it to pulse audio. I installed pulseaudio-jack on arch which is supposed to enable bidirectional communication between jack and pulseaudio, but I still cannot see jack / pulseaudio connections in the Graph of qjackctl. I would be extremely thankful for help on this, because it is essential to share sound from sc over zoom (given the current situation).

Cheers,

Iannis Zannos

Consider for a moment – if you start JACK and then get no sound from PulseAudio, you will have the same problem if scsynth starts JACK. That is, the issue is the pulse/jack configuration. The issue is not the manner in which JACK is being started.

Some will disagree, but this is the way I have configured all of my Linux systems for some 10 years now.

  1. qjackctl → Setup → Misc → turn off D-Bus everything.

  2. sudo pico /etc/pulse/client.conf (or you can use another editor instead of pico) and add:

    autospawn = no
    daemon-binary = /bin/true
    

    This is to prevent PulseAudio from starting automatically.

  3. Edit ~/.pulse/default.pa and make sure it includes:

    load-module module-native-protocol-unix
    load-module module-jack-sink channels=2
    load-module module-jack-source channels=2
    load-module module-null-sink
    load-module module-stream-restore
    load-module module-rescue-streams
    load-module module-always-sink
    load-module module-suspend-on-idle
    set-default-sink jack_out
    set-default-source jack_in
    
  4. Create a bash script somewhere start-pulse.sh (I put it in ~/share/pulse-jack-scripts/ but the location doesn’t matter):

    #!/bin/bash
    pulseaudio --start
    pactl load-module module-jack-sink channels=2
    pactl load-module module-jack-source channels=2
    pacmd set-default-sink jack_out
    pacmd set-default-source jack_in
    
  5. Create another bash script somewhere stop-pulse.sh (preferably same location):

    #!/bin/bash
    pulseaudio --kill
    
  6. In qjackctl → Setup → Options, add the start-pulse script as a script to execute after startup, and add the stop-pulse script as a script to execute before shutdown.

After this, when you boot your system, you might not get any audio from any app (unless it can fall back to ALSA directly, which some apps do). But after you start JACK, then JACK apps can connect to the JACK server, and a PulseAudio server will also be started, connected to JACK.

So the only difference to my user experience from “normal” users is that I have to click the Start button when I want audio, and Stop when I’m finished with the session.

Apart from that, I’m running both JACK and Pulse all the time.

(Probably some people will tell you this is too complicated and not modern enough. I’m just reporting what works for me. It is a bit complicated, but you set it up only one time per OS install and then shouldn’t have to touch it again. I’m aware that it’s a bit of a “nuclear option” but I haven’t had good experiences with D-Bus trying to switch audio systems automagically – so I just don’t use it. This way, I have control over what’s running.)

You connect JACK client apps via JACK. The JACK server is not its own client.

qjackctl-connections

“system” is audio hardware. So, audio hardware → PA input source, and PA audio output → audio hardware.

When you boot scsynth, then you will see scsynth as a JACK client app. You want to mix scsynth’s output with the computer’s hardware input (“system:capture”) and pipe them both to PulseAudio’s audio input. The mixing happens transparently – you only need to add a connection from scsynth to PulseAudio JACK Source.

qjackctl-scsynth-to-pulse

hjh

Wow!
Thanks for the very detailed reply.
This is definitely worth a try for me.
Will have a look in the next few days and get back to you.
Iannis

PS: Question:
The Jack Audio Connection kit screenshots that you included via print screen,
are they from qjackctl? I do not get such a graphic when I open Graph on qjackctl.
Maybe because I am using i3wm, or maybe I am looking at the wrong window.

I only get system, I do not get PulseAudio Jack Source. Perhaps I need

to start some PulseAudio Jack Service?
I need to read your answer in more detail first anyway …

Any hints?

Iannis Zannos

I’m opening the “Connect” dialog. (It seems Ubuntu ships with an ancient qjackctl, so you’ll have to translate the graphics into the dialog in your environment.)

Right, you have to configure that. You won’t get it out of the box. You might note in my longer post load-module module-jack-sink channels=2 and load-module module-jack-source channels=2 – these are the PA modules that provide the JACK ports. If you’re not loading these modules then you shouldn’t expect to see them in JACK. The load-module instructions are absolutely essential here.

(This would also be consistent with the “JACK kills PulseAudio signals” observation.)

hjh

PS: Question: The Jack Audio Connection kit screenshots that you included via print screen, are they from qjackctl? I do not get such a graphic when I open Graph on qjackctl. Maybe because I am using i3wm, or maybe I am looking at the wrong window. I only get system, I do not get PulseAudio Jack…

Yes it is qjackctl.

I am using i3wm, and qjackcontrol is unable to interface with the tiling of i3wm. It is rather confusing and hard to use, I must admit.

By the way: sclang has an interesting behavior in that respect: If Window.new does not specify bounds, then the new sclang window tiles, sharing the screen area with the calling app (scide, emacs, etc.). If however one specifies bounds, then the window floats on top of the previous one. This is quite handy.

Iannis

Not to derail the thread with non-sc topics, just wanted to mention that unless you’ve changed this mapping in your i3 config you can press mod+shift+space to float the window that appears when you start qjackctl. Subsequent windows will open behind it and tile normally unless you also float them manually. You can mod+click and drag anywhere in a floating window to move it.

Thank you for this info. In the meantime I succeeded in getting Jack to appear in the graph, after installing cadence together

with several other packages

yay -S pulseaudio, pulseaudio-alsa, manjaro-pulse, pavucontrol, pa-applet, cadence

The story does not end there unfortunately. However I close the thread on my part,
so avoid derailing into linux audio territory. The exchanges above show that

documentation and best practice are sorely missing in linux audio. I hope
that solutions like pipewire will finally settle the matter. I’m all for tinkering,
but let’s be realistic, few users have the time for that and it is discouraging
when a solution relies on many factors and is not reliable. Simple reliable solutions
should be provided. Regardless whether they involve editing files,
running commands on the terminal, or just installing packages.

They should require a small number of steps and work all the time.

I will report when I get my solution to work.

Thanks to all that answered, sincere appreciation.

Iannis