This function sends a DBusMessage on a DBusConnection
and sets the reply callback of the resulting DBusPendingCall,
as well as properly cancelling the pending call if anything fails.
before gcc 10 its not supporting pointer dereferencing in __typeof__.
so made changes according to that. Fixes#3375
clang also defines __GNUC__ and resolves '4' along with __clang__ which
resolves '1'. On any version of clang, __GNUC__ and resolves '4'.
anyway clang has this feature since version 3.
Make sure don't handle names ending in .monitor as a valid sink (because
it's a monitor on the sink).
Make sure we don't return a sink (monitor) as a source accidentally but
only when explicitly requested by name with the .monitor extension.
Makes
pactl set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo.monitor -5%
pactl set-source-volume alsa_output.pci-0000_00_1b.0.analog-stereo -5%
fail as expected.
We don't actually use this counter anywhere.
Change the counter to a mask that will contain object specific changes
to the params. This should make it possible to track what kind of
changes where done to the object and make it easier to emit the right
events later.
The wireplumber unit test sets metadata on object 15, which happens to
be a module.
Allow metadata on other objects for now. It would be nice to disallow
this in the future, though.
Tag the sink/source as HARDWARE when it's not virtual, the presence
of a DEVICE_API property is not a good check.
Make a method to check if a node is a NETWORK sink/source to make it
use the same logic everywhere.
It seems there are drivers that don't return a good values and we end up
with a lot of delay or automatic disable of htimestamp when the values
look too off.
Enable LE Audio support by default if liblc3 is present, the Pipewire
implementation should be OK. Remove unused HAVE_BLUETOOTH_BAP define,
we don't have any #ifdefs for this.
The feature is still disabled by default in BlueZ, which also now takes
care of necessary hardware feature checks, and should be safe to enable
on Pipewire side.
Add a thead-loop.start-signal option that will do a signal before
entering the thread loop. Doing the signal in all cases can confuse
apps that don't expect the signal.
Make module-rt use the thread-loop.start-signal.
Fixes#3374
Since the recent changes to the RT module in Pipewire 0.3.75, some
applications such as those using OpenAL-Soft crash on startup if
neither the session nor the system bus is available. For example:
bwrap --dev-bind / / \
--bind /dev/null /run/dbus/system_bus_socket \
--bind /dev/null $XDG_RUNTIME_DIR/bus \
openal-info
Will result in a crash with the following error message:
dbus[1626147]: arguments to dbus_message_new_method_call() were
incorrect, assertion "path != NULL" failed in file dbus-message.c
line 1373.
This is normally a bug in some application using the D-Bus library.
The RT module previously failed to load if no bus was available, but
after the recent changes, the init. logic runs in a thread, and failing
to obtain the bus no longer causes the module to fail to load.
Then, functions called later such as `pw_rtkit_make_realtime` assume
the bus is available and try to use it, causing the error above.
Put the logic for obtaining and checking the bus back to `module_init`,
so the module fails to load again if no bus is available.
When the permissions change on a node for a client, only check the
link permissions if the nodes of the link belong to the client.
Otherwise, we might destroy a link when the permissions are removed
from a node for an unrelated client.
First check if we can adjust priorities with rlimits, if we can't and we
need to use rtkit, spawn a thread-loop to handle the rtkit stuff.
First do a pw_loop_invoke() to do the rtkit setup, including getting
some properties and then setting the nice level and rlimits.
Use pw_loop_invoke to queue rtkit realtime requests, this ensures we
always perform the requests after the setup and when the properties
are fetched.
See #3357
Don't use a timer but use an event to trigger a flush of the collected
data. We are now using a per-driver buffer and we don't want to make
this too large so make sure we flush the data quickly.
Don't block on the method calls to make realtime or high priority.
Those calls don't return anything and other errors (invalid method,
invalid arguments, no service,...) can be caught differently async.
Fixes#3357
Make a ringbuffer per driver because each driver might run in a
different threads and because a shared ringbuffer can not be written to
from multiple threads. Assemble all the driver stats into one buffer
before sending out the profile info.
Remove the context_driver events and replace them with realtime node
events. The problem is that the realtime node events are emitted from
the node data thread, which can be different for each node and
aggregating them into context_driver events is not a good idea.
It's also nice for the stream drained event, which no longer needs to go
through the context_driver events.
Pass on the device numbers property of libcamera to session managers, with they
are better equipped to filter the camera/video devices across v4l2 and libcamera.
First update some stream defaults, then apply generic property updates.
Before connecting, fill in some more default with the flags and the
direction of the stream, then evaluate the rules, then overwrite with
environment values.
This ensure that the rules can also use the flags and direction used
during _connect().
See #3355
Enforce that the owner client of the output node can see the input node
and vice versa.
This works around an issue where the session manager performs a link
between nodes that should not be linked, like when doing screensharing
and the portal has set permissions to only see the screenshared stream,
wireplumber will link to the camera when the target.object is not set.
See also wireplumber#218
This has unfortunately the downside that patchbays like helvum will also
not be able to link those nodes. We should probably add a new link
permission to allow this explicitly.