Jack as primary audio driver?

307 views Asked by At

First problem I have is that once I have used ANYTHING on my computer that has sound in it (web page, media player, etc) - Jack will no longer start until I reboot. Simply put, I have to go back to Windows if I can't figure out how to use my DAW without rebooting every time.

Further, is there no way to route Pulse THROUGH Jack so that Jack is the audio GOD? Or better yet, can I just get rid of Pulse and use Jack for ALL audio?

I know this isn't a simple question, but ANY help or direction would be appreciated.

1

There are 1 answers

0
andyg0808 On BEST ANSWER

As you mentioned, the device number for your audio card will change between runs. You'll definitely want to make sure to choose the correct device in QJackCtrl. aplay -l should list the available devices in a way that will let you handle them through script.

To answer your second question, there are PulseAudio modules that enable you to use Jack as the handler for Pulse sound. Take a look at pulseaudio-module-jack for Ubuntu/Debian (it may be available for your distro; this only mentions how to do it on Debian-based systems, and as I run Ubuntu I can't immediately check on anything else). In my case, I needed to choose it in the Ubuntu Sound Settings as well for it to work (as far as I can tell). You might also take a look at http://jackaudio.org/pulseaudio_and_jack for more on using Pulse and Jack together.

Also, a free bonus snippet of messy Bash script:

get_alsa_device ()
{
    # USAGE:
    # In Bash:
    # var="$(get_alsa_device "card_name" "device_name")"

    # DESCRIPTION:
    # Parses aplay's output to find the device specified by card and device

    # ARGUMENTS: 
    # card_name The name of the card to be found
    # device_name   The name of the device to be found

    # STDOUT:
    # Writes the proper alsa device name (in hd0,0 style) to stdout

    # RETURN VALUE:
    # 0 Succeeded in generating output value
    # 1 Failed to generate output value

    aplay --list-devices | grep --fixed-strings "$1" | grep --fixed-strings --max-count 1 "$2" | sed -r 's/^card ([0-9]{1,}): .*, device ([0-9]{1,}): .*$/hw:\1,\2/; T die; q 0; :die; Q 1'
}

That's from a tool I wrote that could automatically configure Jack to run with whatever card the user desired. This function just finds an ALSA device matching the provided names and returns its name in Jack style (I'm pretty sure...).