Remove the hooks we installed on objects in the destroy/free event
or before calling _destroy. This is not really needed but it is
a nice thing to do because it calls the hook removed callbacks.
After we get the Route update, schedule subscription events when
there are changes pending. When we scheduled a volume change ourselves,
it is likely that nothing got changed by the route update but
we still have to emit the subscription event to notify the new volume.
Fixes#298
This is needed for example for Clang compiler which uses different
annotations than GCC. It will make WebRTC to happily use PipeWire
since the spa library is header-only and WebRTC defaults to use
Clang with -Wimplicit-fallthrough.
Detect if the mainloop_api is one of ours and use the loop directly in
that case. Otherwise, make a new loop and add the fd to the foreign
mainloop_api. Make sure we clean up as well.
Fixes#345
Always start ACTIVE so that negotiation can happen.
When we get a format, calculate and update the latency, cork if needed
and then go to the READY state.
This is more in line with what pulse does and should improve
compatibility.
See #341
Wait until we have linked the stream to a device or stream before
we emit the READY state. This is what pulseaudio expects.
Remove stream_index from disconnecting stream so that we don't
accidentally use it again. It is possible that we already created a
new stream with the same id before the old stream could complete the
disconnect.
This ensures we first finish all pending operations and then get
notifications of the new events. Brings pactl subscribe in line
with what it does on real PulseAudio.
First sync the globals and if no global created new pending operations,
run through the operations. This ensures no operation is run before
all globals have data.
Before the node is started, we don't get a Format parameters and we
don't know the channelmap of the node. This forces us to invent a
channelmap that might be wrong. We can do better by using the
EnumFormat param to extract some defaults for the format, rate and
channelmap. Fixes wrong channels in gnome-control-center when testing
speakers.
A sink and source can have an array of pa_format_info structures
that contain the possible formats of the device. Parse them from
the EnumFormat and return them when introspecting.
The drain operation does not complete with a sync from the server but
with an event from the stream. Set a flag in the operation that it
completes with a sync. Keep all operations without a sync around in
the list.
First move all completed operations to a new list, then complete
the operations and cancel the ones that are not completed correctly.
This ensures that new operations from the callbacks don't get
completed immediately as well.
Track the current route and the properties independently. Else we
might skip parsing the volumes/mute properties when the current
route didn't change.
Fixes#281
Use a global sync that both syncs the globals and completes the
operations.
In the case of a card profile change, first the nodes are removed
and added and then the Profile and Route info updated. We need to
be able to bind to the new node and get the device.profile.id
before we can find the active port of the node.
See #279
Implement load_module of the null sink
Keep track of sink_input/source_output linked sink/source in a
better way.
Associate the global with our streams and the streams with the
global.
Don't emit the sink_input/source_output before there is a linked device
and before our stream is READY.
Improve server info to make it more look like pulse.
Add the list of possible ports for a device.
Pass the allowed devices in the routes.
Store the active port in the device.
Fixes enumeration of ports on devices with UCM.