Pipewire: Difference between revisions
Jump to navigation
Jump to search
Line 108: | Line 108: | ||
# the addresses this server listens on |
# the addresses this server listens on |
||
server.address = [ |
server.address = [ |
||
"unix:native" |
|||
"tcp:4713" # IPv4 and IPv6 on all addresses |
"tcp:4713" # IPv4 and IPv6 on all addresses |
||
#"tcp:127.0.0.1:8888" # IPv4 on a single address |
#"tcp:127.0.0.1:8888" # IPv4 on a single address |
||
Line 120: | Line 121: | ||
</source> |
</source> |
||
:Note: we CANNOT edit {{file|pipewire-pulse.conf}} or any system-level file (like in {{file|/etc/pipewire/pipewire-pulse.d}}) because the TCP socket would already be used, and service would fail to load. |
:Note: we CANNOT edit {{file|pipewire-pulse.conf}} or any system-level file (like in {{file|/etc/pipewire/pipewire-pulse.d}}) because the TCP socket would already be used, and service would fail to load. |
||
: |
:Now, restart pipewire-pulse, and check it works: |
||
<source lang="bash"> |
<source lang="bash"> |
||
# We must restart the SOCKET (this also restart the SERVICE) |
|||
systemctl --user restart pipewire-pulse.socket |
|||
⚫ | |||
PULSE_SERVER=unix:/run/user/1000/pulse/native pactl info |
|||
</source> |
</source> |
||
* On the '''secondary user''': |
|||
<source lang="bash"> |
<source lang="bash"> |
||
# We can either export this variable |
|||
export PULSE_SERVER=127.0.0.1 # OR ... |
|||
export PULSE_SERVER=tcp:127.0.0.1:4713 |
export PULSE_SERVER=tcp:127.0.0.1:4713 |
||
PULSE_SERVER=127.0.0.1 pactl info |
|||
⚫ | |||
:Or we can edit {{file|~/.pulse/client.conf}} like we did with PulseAudio: |
|||
⚫ | |||
default-server = 127.0.0.1 |
|||
</source> |
</source> |
||
: Note: make sure the port is allowed in the firewall as well. |
: Note: make sure the port is allowed in the firewall as well. |
||
* On the '''remote client''', use the module [https://docs.pipewire.org/page_module_pulse_tunnel.html PipeWire Module: Pulse Tunnel]: |
|||
<source lang="text"> |
<source lang="text"> |
||
# ################# NOT TESTED ############################# |
|||
context.modules = [ |
context.modules = [ |
||
{ name = libpipewire-module-pulse-tunnel |
{ name = libpipewire-module-pulse-tunnel |
||
Line 155: | Line 167: | ||
} |
} |
||
] |
] |
||
⚫ | |||
* Another method it seems is to start the daemon manually [https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Configuration?version_id=c672a24752b14fad8a33fece86f31fac55f581a7#network-transport]: |
|||
⚫ | |||
# On the server |
|||
pipewire-pulse -a tcp:4713 |
|||
# On the client |
|||
⚫ | |||
</source> |
</source> |
Revision as of 16:40, 25 April 2022
Pipewire is the new sound system on Linux, meant to replace Pulseaudio.
Links
References
Configuration files:
- /usr/share/pipewire
- /usr/share/wireplumber
Commands
# View status
systemctl --user status pipewire
# Use PipeWire instead of JACK
pw-jack SOMEAPP
# PipeWire process viewer (quantum usage...)
pw-top
# Setup sinks, sources, audio devices
pw-link
qjackctl # Graphical tool, leveraging on JACK
qpwgraph # Alternative, pipewire native
# Get settings
pw-metadata -n settings
# Set settings
pw-metadata -n settings 0 clock.rate 48000
pw-metadata -n settings 0 clock.allowed-rates '[ 48000, 96000, 44100 ]'
# Command line
pw-cli
> info all
Configuration
- Package configuration files are located in /usr/share/pipewire and /usr/share/wireplumber.
- To change them, copy and edit them in /etc/pipewire (system-wide) or ~/.config/pipewire (local changes).
- pipewire-pulse.conf
- A single section can also be updated through a file in /etc/pipewire/pipewire-pulse.conf.d/ or ~/.config/pipewire/pipewire-pulse.conf.d/
cat /usr/share/pipewire/pipewire-pulse.conf
# # PulseAudio config file for PipeWire version "0.3.50" #
# #
# # Copy and edit this file in /etc/pipewire for system-wide changes
# # or in ~/.config/pipewire for local changes.
# #
# # It is also possible to place a file with an updated section in
# # for system-wide changes or in
# # ~/.config/pipewire/pipewire-pulse.conf.d/ for local changes.
Troubleshooting
Setting and keeping bluetooth profile for headset
We want to use the profile sbc sbc_xq
for our BT headset Sony WH-1000XM3.
- Set the profile manually - profile should be persistent on reboot / reconnect.
- In principe WirePlumber should remember the last selected profile.
- See [1]
# See available profile and device id with 'pactl list'
pactl set-card-profile bluez_card.38_18_4C_4B_6A_3A a2dp-sink-sbc_xq
- Configure profile
- When using pipewire-media-session, the default profile could be selected in bluez-monitor.conf, but this file no longer exists with WirePlumber.
- (UPDATE - Archlinux - Pipewire) Edit /etc/wireplumber/bluetooth.lua.d/51-bluez-config.lua (or ~/.config/wireplumber/bluetooth.lua.d/51-bluez-config.lua):
bluez_monitor.properties = {
["bluez5.enable-sbc-xq"] = true,
["bluez5.enable-msbc"] = true,
["bluez5.codecs"] = "[sbc sbc_xq]",
}
Crackling / Stuttering audio
This applies in a VM. Not sure these apply when PipeWire is run on the host.
- https://superuser.com/questions/1646216/fedora-34-vmware-workstation-vm-upgraded-from-fedora-33-has-audio-crackling
- https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/469
Note that recent PipeWire already supports different auto-config if running in a vm [2].
Enable multi-user / network audio
- References
- https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Network
- Multi-user audio sharing with PipeWire - archlinux forum
- PipeWire issue 847
Currently PipeWire support sharing through network using Pulse, but auth-anonymous is always turned on (auth-ip-acl
not implemented).
- (pipewire 0.3.50+) On the main user, create file ~/.config/pipewire/pipewire-pulse.conf.d/listen-to-4713.conf
pulse.properties = {
# the addresses this server listens on
server.address = [
"unix:native"
"tcp:4713" # IPv4 and IPv6 on all addresses
#"tcp:127.0.0.1:8888" # IPv4 on a single address
#
#{ address = "tcp:4713" # address
# max-clients = 64 # maximum number of clients
# listen-backlog = 32 # backlog in the server listen queue
# client.access = "restricted" # permissions for clients
#}
]
}
- Note: we CANNOT edit pipewire-pulse.conf or any system-level file (like in /etc/pipewire/pipewire-pulse.d) because the TCP socket would already be used, and service would fail to load.
- Now, restart pipewire-pulse, and check it works:
# We must restart the SOCKET (this also restart the SERVICE)
systemctl --user restart pipewire-pulse.socket
PULSE_SERVER=tcp:127.0.0.1:4713 pactl info
PULSE_SERVER=unix:/run/user/1000/pulse/native pactl info
- On the secondary user:
# We can either export this variable
export PULSE_SERVER=127.0.0.1 # OR ...
export PULSE_SERVER=tcp:127.0.0.1:4713
PULSE_SERVER=127.0.0.1 pactl info
- Or we can edit ~/.pulse/client.conf like we did with PulseAudio:
default-server = 127.0.0.1
- Note: make sure the port is allowed in the firewall as well.
- On the remote client, use the module PipeWire Module: Pulse Tunnel:
# ################# NOT TESTED #############################
context.modules = [
{ name = libpipewire-module-pulse-tunnel
args = {
tunnel.mode = playback
# Set the remote address to tunnel to
pulse.server.address = "tcp:192.168.1.126"
#audio.rate=<sample rate>
#audio.channels=<number of channels>
#audio.position=<channel map>
#node.target=<remote target node>
stream.props = {
# extra sink properties
}
}
}
]
- We can also use the PipeWire Module: Zeroconf Discover, that will automatically create sinks/sources to/from remote PulseAudio servers.
context.modules = [
{ name = libpipewire-module-zeroconf-discover
args = { }
}
]