Follow EasyEffects' links to Bluetooth sinks too
EasyEffects plays into Bluetooth headphones through the same direct port links as into a card, but only alsa_output targets were followed, so with headphones on the keys fell back to the settings file -- which can still name the speakers -- or to easyeffects_sink. Match bluez_output sinks as well, and compare the configured device name literally rather than as a regex. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
91fd24c2b1
commit
357d84f17a
2 files changed
+20
-4
No files matched your search
@@ -54,14 +54,14 @@ fi
|
||||
# own: its output node links its ports straight to the sink's playback ports,
|
||||
# so the sink-input search above finds nothing and the keys would move the
|
||||
# EasyEffects sink -- whose volume its monitor, the input of the processing,
|
||||
# does not follow. Follow the port links instead: the first alsa_output sink
|
||||
# any EasyEffects output port is linked to.
|
||||
# does not follow. Follow the port links instead: the first ALSA or Bluetooth
|
||||
# sink any EasyEffects output port is linked to.
|
||||
if [[ $sink == "easyeffects_sink" ]]; then
|
||||
linked="$(pw-link -l 2>/dev/null |
|
||||
awk '
|
||||
/^[^ ]/ {src = $0}
|
||||
/^[[:space:]]*\|->/ {
|
||||
if (src ~ /^ee_/ && $2 ~ /^alsa_output\..*:playback_/) {
|
||||
if (src ~ /^ee_/ && $2 ~ /^(alsa|bluez)_output\..*:playback_/) {
|
||||
sub(/:playback_.*$/, "", $2); print $2; exit
|
||||
}
|
||||
}')"
|
||||
@@ -71,7 +71,7 @@ if [[ $sink == "easyeffects_sink" ]]; then
|
||||
if [[ -z $linked ]]; then
|
||||
configured="$(sed -n 's/^outputDevice=//p' \
|
||||
"${XDG_CONFIG_HOME:-$HOME/.config}/easyeffects/db/easyeffectsrc" 2>/dev/null)"
|
||||
if [[ -n $configured ]] && pactl list sinks short 2>/dev/null | awk '{print $2}' | grep -qx "$configured"; then
|
||||
if [[ -n $configured ]] && pactl list sinks short 2>/dev/null | awk '{print $2}' | grep -qxF -- "$configured"; then
|
||||
linked="$configured"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -61,6 +61,22 @@ LINKS
|
||||
[[ $(resolve) == "$physical" ]] || fail "easyeffects_sink resolves through the port links to the card"
|
||||
pass "easyeffects_sink resolves through its port links"
|
||||
|
||||
# EasyEffects 8 playing into Bluetooth headphones: the live links win over a
|
||||
# settings file that still names the speakers.
|
||||
headphones=bluez_output.00_11_22_33_44_55.1
|
||||
reset_scenario
|
||||
printf '301\t%s\tPipeWire\ts16le 2ch 48000Hz\tRUNNING\n' "$headphones" >>"$test_home/data/sinks"
|
||||
cat >"$test_home/data/links" <<LINKS
|
||||
ee_soe_output_level:output_FL
|
||||
|-> $headphones:playback_FL
|
||||
ee_soe_output_level:output_FR
|
||||
|-> $headphones:playback_FR
|
||||
LINKS
|
||||
mkdir -p "$test_home/.config/easyeffects/db"
|
||||
printf '[StreamOutputs]\noutputDevice=%s\n' "$physical" >"$test_home/.config/easyeffects/db/easyeffectsrc"
|
||||
[[ $(resolve) == "$headphones" ]] || fail "easyeffects_sink resolves through its port links to Bluetooth headphones"
|
||||
pass "easyeffects_sink resolves through its port links to Bluetooth headphones"
|
||||
|
||||
# EasyEffects 8 idle: no links, but its settings name the output device.
|
||||
reset_scenario
|
||||
mkdir -p "$test_home/.config/easyeffects/db"
|
||||
|
||||
Reference in new issue
Block a user