Changing sink port with pactl immediately after changing profile does not work
- PipeWire version (
pipewire --version
): 0.3.51 - Distribution and distribution version (
PRETTY_NAME
from/etc/os-release
): Arch Linux - Desktop Environment: i3
- Kernel version (
uname -r
): 5.17.9-arch1-1
Description of Problem:
I have a script which uses pactl
to change the card profile and then immediately change the sink port:
#!/bin/sh
pactl set-card-profile alsa_card.pci-0000_0c_00.4 output:analog-stereo+input:analog-stereo
pactl set-sink-port alsa_output.pci-0000_0c_00.4.analog-stereo analog-output-headphones
This works fine with PulseAudio, but does not work properly with PipeWire. With PipeWire, the sink port appears to have switched if you look at eg pactl list sinks
or pavucontrol
, but in reality the audio is still coming out of the original port.
If a short sleep (eg sleep 0.2
) is inserted between the two pactl
commands, then things appear to work reliably.
I've tried with the -git
versions of the Arch packages (pipewire-git pipewire-alsa-git pipewire-jack-git pipewire-pulse-git wireplumber-git
), which I believe just build HoT. This made no difference.
How Reproducible:
Every time.
Steps to Reproduce:
- Set card profile to "Analog Surround 5.1 Output + Analog Stereo Input".
- Set port to Speakers.
- Run the above script.
Actual Results:
Port is changed in eg pavucontrol
and pactl list sinks
, but audio continues to come from speakers.
Expected Results:
Audio should come from headphones.
Additional Info (as attachments):
-
pw-dump > pw-dump.log
: pw-dump.log