UCM devices can require local data from use_case_mgr_open() but since
we do that in a separate process, make sure we reopen the use case
manager in case we are passed a UCM device so that the config is
available.
See #1251
Just like the real free() we should just ignore a NULL pointer, makes the
caller code easier for those instances where properties are optional.
Patch generated with concinelle with a few manual fixes.
For boolean properties:
- passing in NULL no longer crashes and instead returns false
- passing in a string starting with 1 (e.g. "1xyz") no longer resolves to true
For int-based properties:
- passing in NULL no longer crashes and instead returns 0
- passing in invalid numbers no longer resolves to whatever number prefix
could be parsed (e.g. "123foo" was 123)
When the server or client goes away, detach the client
from the server to avoid potential use-after-free issues
that might occur if the client causes the
unloading of the server it is connected to.
E.g.:
pactl load-module module-protocol-native-tcp port=4713
pactl -s localhost:4713 unload-module module-native-protocol-tcp
See #1240.
When we enable a device, the node will be created and its software
volume will be set to 100%. Update the device volume with this as
well so that changing the volume has an effect.
Fixes#1198
If any of those two branches are taken, the connection
cannot make forward progress since no data will be read/sent
from/to the client.
For example, sending just 21 invalid bytes to the server
causes the first 20 bytes (client descriptor) to be read,
then rejected, leaving `client->message == NULL`. But since
polling is level triggered, `on_client_data()` and thus
`do_read()` will continue to be called ceaselessly,
thereby spamming the log and wasting resources.
According to the alsa-info.txt in the pipewire issues of #747 and #1206,
the Front Playback Volume is shared by Headphone and Lineout or
Headphone and Speaker, But Headphone, Lineout or Speaker they all have
independent Playback Switch, change to only use switch to mute the
Lineout or Speaker. This could resolve the issues of #747 and #1206.
See #1206 and #747
Check if the port has latency param and only try to set the
latency param when it appears available. This avoids sending unknown
latency params to an old client and erroring out.
RLIMIT_RTTIME is Linux specific, there is no equivalent replacement
for FreeBSD. Save trouble and build module-rt for Linux only, rtkit
WIP fork should be fine on FreeBSD for now.
If `struct pw_map::free_list` is not initialized to `SPA_ID_INVALID`,
then `pw_map_insert()` will try to read `map->items.data[0]` when
inserting the first element, but `data` is a `NULL`
pointer after initialization.
Emitting events using the listener_list can not be done from multiple
threads at the same time. For this reason, make a copy of the events
with the process event and call it explicitly from the data thread.
See #1122
If the message was too long, then the `vsnprintf()` call would
fill up `location`, leaving no space for the color escape sequence
and the newline, causing a stack buffer overrun here:
size += snprintf(p + size, len - size, "%s\n", impl->colors ? suffix : "");
Fix that by reserving the last 24 bytes of the message buffer.
Add support for listening on IPv6 addresses.
The following address formats are supported:
* tcp:[<ipv6-addr>]:<port>,
* tcp:<ipv4-addr>:<port>,
* tcp:<port>, and
* unix:<path>.
The IP addresses are parsed using `inet_pton()`,
only the formats supported by that function
are accepted.
The IPv6 address must be surrounded by square brackets,
they do not mean "optional" here. Specifying only the
port is equivalent to the following two addresses:
* [::]:<port>, and
* 0.0.0.0:<port>.
Address parsing has been made stricter: the port
must always be specified explicitly.
Fixes#1216.