why pipewire and not pulseaudio #
Short answer: Because you have no other choice if you want to share your screen in a video conferencing tool, like BigBlueButton under a wayland session compositor, like e.g. sway.
list default recording device #
I could not find a simple method to determine the default sink and source yet, but at least the following two command lines work for now:
pw-dump | jq -r ".[$(pw-cat -r --list-targets | egrep -o '^\*\s[0-9]+' | cut -f2)].info.props.\"node.description\""
pw-cat -r --list-targets | egrep '^\*\s[0-9]+' | grep -o "\".*\"" | tr -d "\""
list default playback device #
The only nice thing about both commands is, that changing one character is enough to display either the default recording or playback device.
pw-dump | jq -r ".[$(pw-cat -p --list-targets | egrep -o '^\*\s[0-9]+' | cut -f2)].info.props.\"node.description\""
pw-cat -p --list-targets | egrep '^\*\s[0-9]+' | grep -o "\".*\"" | tr -d "\""
Is default sink or default source muted? #
pw-dump | jq -r ".[$(pw-cat -r --list-targets | egrep -o '^\*\s[0-9]+' | cut -f2)].info.params.Props|.[].mute"
pw-dump | jq -r ".[$(pw-cat -p --list-targets | egrep -o '^\*\s[0-9]+' | cut -f2)].info.params.Props|.[].mute"
volume of the default input and output device #
This is getting insane, but do not know the number of channels. It could be a
surround system or a stereo microphone. I am also not sure if this calculation
is correct. It uses channelVolumes
as input, but that differs (a little) from
what pavucontrol
for values different than 0%
or 100%
.
pw-dump | jq -r ".[$(pw-cat -r --list-targets | egrep -o '^\*\s[0-9]+' | cut -f2)].info.params.Props|.[].channelVolumes|select(.)|[.[] * 100|floor|tostring + \"%\"]|join(\" \")"
pw-dump | jq -r ".[$(pw-cat -p --list-targets | egrep -o '^\*\s[0-9]+' | cut -f2)].info.params.Props|.[].channelVolumes|select(.)|[.[] * 100|floor|tostring + \"%\"]|join(\" \")"
Problems and solutions #
Problem:
wireplumber[687895]: spa.alsa: The decibel volume range for element 'PCM' (-9999999 dB - -500 dB) has negative maximum. Disabling the decibel range.
wireplumber[687895]: default: Failed to get percentage from UPower: org.freedesktop.DBus.Error.NameHasNoOwner
Solution:
mv ~/.local/state/wireplumber/ /tmp/
systemctl --user restart pipewire{,-pulse} wireplumber
Thanks to V1del from the Arch Forum!