For kernels compiled with CONFIG_SND_VERBOSE_PROCFS=n, the pcmXX
/proc/asound entries do not exist. In that case, the "device busy"
check cannot be done, but we should still check existence of PCM devices
correctly.
Count the number of PCM devices from /dev/snd, which should work also
without /proc/asound or /sysfs/class/sound.
Alsa device acp probe results to missing profiles if some PCM devices
are busy. Currently, we retry based on a timeout and give up after some
retries. However, exposing cards with missing profiles is never
useful.
Never expose cards if some PCM devices are busy. Instead, retry adding
device on inotify fd close events, which arrive when some process has
closed a PCM device.
When probing for devices in alsa-udev, check via /proc to avoid inotify
busy loop.
When the pulse server context is being freed, only a single reference
should be alive to each sample because the pending samples
are all destroyed beforehand.
Clean everything up when the context is destroyed to avoid
problems stemming from the destruction order of objects
in the context.
Furthermore, free messages after all clients have been freed
because `client_free()` may very well call `message_free()`
which would lead to memory leaks if `impl->free_messages` were
processed first.
A stream's lifetime is tied to that of the client, it cannot outlive
the client object. Streams also do not increase the client's reference
count. It is not possible for a stream to exist after the corresponding
client has been destroyed.
Hence it is not necessary to manage the client's reference count
or lifetime in `do_destroy_stream()`. All works related to a particular
stream are cancelled in `stream_free()`, which is called
before the client is destroyed.
When the `done` flag was first added in
9f9be7d7f2, it was
actually needed because cleanup was implemented
using a per-client eventfd which was signalled when
something related to the particular client needed
to be freed. The function that ran, then, checked
each stream's `done` flag, and freed them as necessary.
However, since c70a5de526,
the stream cleanup is done using a work queue, and as
a consequence, the `done` flag is no longer needed.
When the `disconnecting` flag was first added in
d44fdabea1, a client's
streams were not explicitly destroyed when it was freed,
instead, only the client's pw_core was disconnected,
which then caused all related streams to be destroyed.
Thus there needed to be a way to determine why the stream's
state changed to PW_STREAM_STATE_UNCONNECTED as it may have
been because the client is disconnecting or because the
stream has been "killed" in some other way.
The `COMMAND_{PLAYBACK,RECORD}_STREAM_KILLED` command
only needed to be sent to the client in the second case.
However, at the moment, all streams of a client are explicitly
destroyed before it's pw_core is disconnected. This makes the
`disconnecting` flag unnecessary, thus it can be removed.
Move the reference counting from `pending_sample_free()`
into `on_sample_done()` so that the client's references
are managed in a single place.
The reason why `pending_sample_free()` cannot simply call
`client_unref()` is that `client_free()` may be called from
`manager_disconnect()` regardless of the reference count,
and, in turn, `pending_sample_free()` may be called,
which could then lead to a recursive call to `client_free()`.
Load all sections found in all prefix/name.conf.d directories and add
them to the config as overrides.
If for example jack.conf is loaded, check in:
/usr/share/pipewire/jack.conf.d/
/etc/pipewire/jack.conf.d/
$XDG_CONFIG_HOME/pipewire/jack.conf.d/
or ~/.config/pipewire/jack.conf.d/
For .conf files and also process the sections. The files are processed
in sorted order so 10-remap.conf can be used to specify the order.
When processing a section, first the global conf is applied and then the
overrides in their order.
This makes it possible to override properties or add modules,
objects and custom matching rules.
Since the merging logic is handled either internally or by the
application, we can add more syntax later to do more complex merges.
See #207
Instead of reading all config section in properties, emit a callback
for each section, allow for filtering on a particular section as
well. In the callback, update the section value in the properties.
Deprecate get_conf_section(), it can't support multiple section
updates.
When sink is follower, and no data to write is available, it should not
schedule a timeout, but wait for the driver to wake it up again.
Fixes process ending up busylooping in data thread as follower, under
some conditions.
Also, clean up the code to be more clear about timeout logic. Just loop
directly instead of setting timeout 1, if we need to just flush more
immediately.
When acting as SCO AG / A2DP sink, the remote end should decide when to
close the connection. This does not work currently properly, because
stopping sources/sinks releases the transport, which causes it to go
idle, and which then destroys dynamic nodes. The sources/sinks should
not cause the transport to be released.
Implement keepalive flag for spa_bt_transport, such that
spa_bt_transport_release does not actually release the transport when
the refcount reaches zero. Set the flag for dynamic nodes when the
transport becomes pending (remote end connects) and unset the flag when
idle (remote end disconnected, or dynamic node removed).
Add a node.force-quantum and node.force-rate property. When no global
quantum or rate is enforce with settings, the last updated node property
is used as the quantum.
Make jack use the force-quantum property when set_buffersize is used to
make sure that the quantum is not just a suggestion but a hard forced
one. This makes it possible for ardour or other jack apps to raise the
quantum above the max-quantum but also ensure that it will not change
by any other application (unless other jack apps).
Fixes#2079