client side environment variable PIPEWIRE_AUTOCONNECT= is missing documentation, seems broken. But would really love it to work!!! (tears of desperation)
- PipeWire version:
0.3.71
- Distribution and distribution version:
Ubuntu 23.04
- Desktop Environment: KDE Plasma,
plasmashell 5.27.5
- Kernel version (
uname -r
):6.3.8-x64v3-xanmod1
Description of Problem:
Long story short:
Can the environment variable PIPEWIRE_AUTOCONNECT
be set to true
value on a per-client application basis? When the global server configuration is set to false
? This this an undocumented feature currently. But can it be fixed / improved / and documented? And can it have a true both ways settable functionality? Because ATM it seems like it does not work. Or was never fully implemented to be both ways.
However I would dearly love to try out this feature. To see how well it resolves my issues here.
Detailed description:
Definately cannot use here node.autoconnect = true
in my global pipewire daemon / server settings. It just causes far too many crashes. Either my DAW's audio engine to crash, or other types of client crashes. This is just how it is for the set(s) of applications I am currently running. And that is not going to change very much.
Now this is where things gets difficult:
Since many client programs will do a whole routine whereby they probe / test the available audio endpoints when they startup for the first time ever. And so (most of those times) am there chasing, trying to catch those nodes appearing before they timeout in qpwgraph. Which is never successful or even possible. Since for most of these programs, they will have a very short duration timeouts (not to delay program load times too much). And although visible it seem that every created test node is left just hanging there, suspended or frozen state (waiting to be connected). But in reality, the client app has already have internally timed that one out, and moved on to creating the next variation(s) of test node(s). Many times with some other channels configurations etc. To test for the surround etc. It cannot be intervened manually.
This translated into a critical need to first launch a program with node.autoconnect
property = true. To pass these challenges for the client. Even though my DAW's audio engine might crash. But anyhow let the client program and pwgraph to go through those probe tearup / teardown test dummy nodes. And have pipewire always trying to be autoconnecting them up the default virtual sink. As soon as they appear. But then (for all other stable, long term clients, and all other default behaviour). Have node.autoconnect
property set false. Just in the global server settings.
Can we have this? Is this an achievable goal (dynamically runtime). Without having to restart the whole pipewire server? Because if yes, then you already created some PIPEWIRE_AUTOCONNECT
env var to be set... on starting of the client process? If could have that settable to a TRUE
state. or 1
instead of 0
. Things like this. But it's not ever been documented.
How Reproducible:
YES 100%. Here is how:
Steps to Reproduce:
Server Pre-configuration:
- Set the property
node.autoconnect = false
into all pipewire server configurations
Control case, to check the server pre-configuration:
-
Launch client program, WITHOUT any special overrides. To double check it's defaulting to
false
setting at runtime. 2.2. For example:paplay long-enough-lasting-sound.ding.mp3
-
Then go to another terminal (while the client application is still running). And check the client's properties by greping / searching within the whole
pw-dump
command. For example:
clear
_program_name="paplay"
pw-dump | grep -C20 -i $_program_name | grep -C20 -i autoconnect
So that was the default global case tested (should =false
).
If not =false
, then you cannot yet proceed to perform the actual test case.
Actual Test Case:
- Set env variable
PIPEWIRE_AUTOCONNECT=true
on the client program at process creation. For example:
PIPEWIRE_AUTOCONNECT=true paplay long-enough-lasting-sound.ding.mp3
- Check output of
pw-dump
below:
Actual Results:
"application.process.host": "apex",
"application.process.id": 528958,
"application.process.machine-id": "d9bcdde265724512acdd4fed8edd4a9a",
"application.process.session-id": 4,
"application.process.user": "id",
"audio.adapt.follower": "",
"client.api": "pipewire-pulse",
"client.id": 444,
"clock.quantum-limit": 8192,
"factory.id": 6,
"factory.mode": "split",
"library.name": "audioconvert/libspa-audioconvert",
"media.artist": "Zoo",
"media.class": "Stream/Output/Audio",
"media.comment": "LAME settings: 320 kbps qval=2",
"media.date": 1984,
"media.format": "MPEG-1/2 Audio",
"media.name": "11-12 Where Have All the Good Times.mp3",
"media.software": "LAME 3.98 (Max 0.9.1)",
"media.title": "Where Have All the Good Times Gone?",
"node.autoconnect": false, <------------------------------- HERE <==========================
"node.latency": "256/96000",
"node.lock-quantum": true,
"node.name": "paplay", <----------------------------------- HERE <==========================
"node.pause-on-idle": false,
"node.rate": "1/44100",
"node.want-driver": true,
"object.id": 254,
"object.register": false,
"object.serial": 1612,
"pulse.server.type": "unix",
"stream.is-live": true,
"window.x11.display": ":0"
},
"params": {
"EnumFormat": [
{
"mediaType": "audio",
"mediaSubtype": "raw",
"format": "F32LE",
"rate": 44100,
And to double check it was set PIPEWIRE_AUTOCONNECT=true
within the client's process environment space:
θ62° [id:~] [venv] 2 $ ps -aux | grep -i paplay
id 538659 0.0 0.0 84284 6568 pts/1 S+ 15:32 0:00 paplay 11-12 Where Have All the Good Times.mp3
θ64° [id:~] [venv] 1 $ grep --binary-files=text -i -o "pipewire_autoconnect=...." /proc/538659/environ
PIPEWIRE_AUTOCONNECT=true
Expected Results:
Well (for this feature)... would dearly like it to behave in the following way:
For the stream property "node.autoconnect": true,
to appear in the output of pw-dump
for that client process. If it's environment variable was set to be PIPEWIRE_AUTOCONNECT=true
Additional Info (as attachments):
-
[pw-dump.log](/uploads/de51197833e4bdcb028d60b780765f07/pw-dump.log)
:
Attached.
References / Links
https://github.com/PipeWire/pipewire/blob/master/src/pipewire/stream.c#L2010