How does a stream detect a newly connected node and which node it is connected to?
When I choose Default
as the target in the user interface of a program that users OpenAL, OpenAL sets target.object
for a pipewire stream to default.audio.*
which is either null-sink or null-source on my system.
I expected target.object
to be null. I have to use OpenAL pulseaudio backend for now.
OpenAL author said if OpenAL can figure out when a stream is connected to a new node and which node a stream is connected to, then OpenAL doesn't have to set target.object
when a user picks Default
as target in user interface.
The author and I could not easily figure out when a stream is connected to a new node and which node the stream is connected to.
According to OpenAL author, param_changed
callback on https://docs.pipewire.org/structpw__stream__events.html was not called when there was a change in SPA_PARAM_PortConfig
. When a stream is connected to a new node whose port configuration is incompatible with the stream, PortConfig
for the stream has to change, and param_changed
callback should be called with SPA_PARAM_PortConfig
. But, it wasn't.
Apart from that issue, we could not easily figure out when a stream is connected to a new node and which node the stream is connected to. If OpenAL can figure these out, game over.
How does a stream figure these out?