Don't build by default, update the README
With pulse-server we are more flexible and compatible and we don't
have to (badly) reimplement libpulse anymore.
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.
When the custom poll function told us there is activity on the
epoll fd, don't do a blocking wait on the epoll fd. It might be
possible that the active fd is removed and then we would block
forever.
Fixes#349
The mainloop time_new is supposed to be called with wallclock time
but some apps use rttime instead. Handle the case better so that we
never end up disabling the timer.
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
We are linking against PulseAudio’s libpulse,
which adds its soname to DT_NEEDED but we are expecting
to actually use our shim with the same soname from LIBPULSE_PATH
(forced by adding the path to LD_LIBRARY_PATH).
Package managers like Nix will detect that we are linking against
PulseAudio’s libpulse and mark it as a runtime dependency by adding
its path to DT_RUNPATH entry so that it can be easily found
by the loader. LD_LIBRARY_PATH will take precedence but it will still
pull PulseAudio into the system’s closure.
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.
When we change the volume/mute of a sink/source, mark the source
as changed so that when we get the update from the server we
emit a CHANGE event. We don't do this otherwise because the server
volume update and our local volume is the same.
Fixes#298
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
When the pa_stream is destroyed we need to remove it from the
global, if any (and not when the pw_stream is destroyed).
Fixes crash in gnome-control-center when switching sinks.
See #343
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.