GoXLR-on-Linux / goxlr-on-linux

Documentation and scripts to make the GoXLR and GoXLR Mini useful on Linux.
142 stars 8 forks source link

Default sound device #17

Closed VirtualJunky closed 2 years ago

VirtualJunky commented 3 years ago

The default sound device is lost for me on every restart. Unsure if this is a me thing or general issue. After some playing around I've come up with the following solutions/ideas.

For starters you tag this on the end of configure_goxlr.sh:

pacmd "set-default-sink jack_out.2"
pacmd "set-default-source jack_in.3"

To find your device name, you can use the following commands in terminal:

pacmd "list-sinks"
pacmd "list-sources"

Or, you can use the following snip I whipped together that shows only information you need to see (relating to GoXLR) and will asterisk (*) the current default sound device:

#!/bin/sh

echo "\nOutputs:"
case "${1:-}" in
  (""|list)
    pacmd list-sinks |
      grep -EB 26 'jack.client_name = "GoXLR' | grep -E 'index:|name:|jack.client_name'
    ;;
esac

echo "\nInputs:"
case "${1:-}" in
  (""|list)
    pacmd list-sources |
      grep -EB 26 'jack.client_name = "GoXLR' | grep -E 'index:|name:|jack.client_name'
    ;;
esac

The little script there could be useful in making the default option configurable during the install script. If user typed say system it could find GoXLR_Sink_System and count up 24 lines to get the device name to set the default each time configure_goxlr.sh is ran.

As far as I can tell the index and name doesn't go down but is instead of added on to (per restart), so if you plug something in after the script is ran, it's fine, but if you plug something in before, having a hard coded index or name wouldn't work. However, if the option they selected is saved, from our above example, as "system" instead of the device name, it could make the search each time so if the name or index ever changes it would always grab the current device name.

In my searching I could not find a way to change the device name when the device is "created" other then an alias which only applies on the GUI. I also could not find a way to use the property name as the set-default-X which is what makes this a tad more tricky. But alas I am only one very inexperienced person so maybe this info provided will be useful to you guys who know what you're doing.