Commit graph

10728 commits

Author SHA1 Message Date
Wim Taymans
f5a10cb734 filter: remove some unused code
Add some SPA_LIKELY
2023-05-05 21:33:28 +02:00
Wim Taymans
4b5b94303e loop: clear rmask after dispatching all sources
To make the unit tests work again.
2023-05-05 18:36:50 +02:00
Wim Taymans
93530df139 filter: don't copy position info
We copied the position information for the deprecated _get_time()
function. Don't do this anymore and just read the values from the
get_time() function directly.

They might race with the processing thread but that's why the
function is deprecated.

Improves performance in tight loops.
2023-05-05 17:56:01 +02:00
Wim Taymans
8452e6d28e data-loop: optimize iterate dispatch
Avoid doing the interface unref and version check for each iteration but
do this before entering the loop. Improves performance in high frequency
wakeups.
2023-05-05 17:43:27 +02:00
Wim Taymans
fbf17cf980 loop: add optimized non-cancellable iterate
Only use the more heavy cancellable loop when the loop.cancel property
was set. Makes pipewire go from 5% to 3% in high frequency wakeups.
2023-05-05 17:41:37 +02:00
Wim Taymans
67c38490a5 move some trace to trace_fp 2023-05-05 17:41:13 +02:00
Wim Taymans
0629647cb5 module-jack: load libjack.so.0 with dlopen
This way we can search for the real jack library instead of using our
custom libjack.so. Add an option to override the search path with
LIBJACK_PATH and an option to select the library name to load.
2023-05-05 15:42:14 +02:00
Wim Taymans
7da4eb13f7 pulse-server: add some module docs 2023-05-05 15:41:44 +02:00
Wim Taymans
39bba88544 jack: emit a warning when disabled 2023-05-05 15:41:18 +02:00
Wim Taymans
a77b12a024 client-node: clean up useless node object 2023-05-04 21:46:07 +02:00
Wim Taymans
ffa21d696d module-pulse-tunnel: avoid using NULL module
Set the module to NULL when unloading. Check if the module exists before
attempting to unload it.

Flush any pending invokes on the mainloop before destroying the impl.

Fixes #3199
2023-05-04 20:28:10 +02:00
Wim Taymans
75d7c574cf impl-node: don't do output mix for remote nodes
Remote nodes already did the output mix remotely so we don't have to
attempt it on the server (and it doesn't actually have output mixers).
2023-05-04 20:26:17 +02:00
Wim Taymans
f756eebac5 impl-node: add some SPA_LIKELY 2023-05-04 20:25:50 +02:00
Wim Taymans
7f53571e0c impl-node: avoid division by zero better
Since the activation is in shared memory, a bad client could try to
modify them after we check the signal_time and prev_signal time and
cause a division by zero. Make a unique copy of the values and use
those.
2023-05-04 19:47:46 +02:00
Wim Taymans
2be49838d0 pulse-server: remove some warnings 2023-05-04 19:11:21 +02:00
Wim Taymans
b13e9f7a8d pipewire-pulse: add module-jackdbus-detect 2023-05-04 18:46:36 +02:00
Wim Taymans
37210794d8 pulse-server: rework audioinfo argument parsing
Make a new method to parse parts of the audioinfo based on custom
keys, leaving unparsed values to defaults. Implement the generic audio
parsing with this.

We can then remove some duplicate code where the audio keys didn't match
or where only parts of the info needed to be parsed.

Also make a method to serialize the audioinfo to properties and use that
when making arguments to load the modules.

Avoid doing some custom property serialization, move all key/values into
properties and serialize those with the generic functions.
2023-05-04 18:43:08 +02:00
Wim Taymans
11c478d0fa improve debug of commands and events
Add the type name in the log.
2023-05-04 13:03:40 +02:00
Wim Taymans
0b3a06192e module-jack: add jack.connect option 2023-05-04 11:55:01 +02:00
Wim Taymans
43b6054631 module-jack: add jack.client-name option 2023-05-04 11:44:55 +02:00
Wim Taymans
7ac8e29160 module-jack: handle non-duplex case 2023-05-04 11:41:17 +02:00
Wim Taymans
7a82fc7fc7 module-jack: fix compilation without fastpath 2023-05-04 09:29:51 +02:00
Pauli Virtanen
55fc2ac7ef stream: ignore latency of monitor stream ports
Have monitor streams not affect the latency calculation of the ports
they are connected to.

Connecting monitor streams to ports (e.g. volume level monitoring)
should not affect latency values of other streams connected to those
ports.

This fixes e.g. just running pavucontrol from modifying latencies of all
existing ports.
2023-05-03 18:01:00 +00:00
Pauli Virtanen
6e17962ad0 impl-port/audioconvert: add PORT_IGNORE_LATENCY
Add port.ignore-latency prop, which if true causes peer ports to ignore
the latency of the given port.

This is useful for ports that are not intended to affect latency
calculations of other ports, such as ports in monitor streams.
2023-05-03 18:01:00 +00:00
Pauli Virtanen
85d2933268 module-access: add missing include
Ensure PATH_MAX gets defined also if no glib2.
2023-05-03 18:00:03 +00:00
Wim Taymans
1d872c5cde impl-node: restore previous signal_time
So that we can save if below and do the stats correctly.
2023-05-03 19:03:16 +02:00
Wim Taymans
107061bb77 module-jack: implement with pw-filter
It is faster and allows us to add midi easily as well.
2023-05-03 18:37:43 +02:00
Wim Taymans
09994f7141 filter: add more possible params
Support Format and EnumFormat node params to make it possible to
implement a sink.
2023-05-03 18:33:46 +02:00
Wim Taymans
ff6a86644b client-node: take data_loop and system from node 2023-05-03 18:18:12 +02:00
Barnabás Pőcze
2dd3a00bb5 spa: bluez: modemmanager: fix DBusMessage leaks
A DBusMessage needs to be unref-ed after sending it regardless
whether or not it was successfully sent. So do that in
`mm_dbus_connection_send_with_reply()` so that the callers
do not need to deal with that.
2023-05-03 11:27:25 +00:00
Barnabás Pőcze
4591cfcd37 spa: bluez: modemmanager: do not log message sender as warning 2023-05-03 11:27:25 +00:00
Barnabás Pőcze
54b0886c78 spa: bluez: backend-native: use correct pointer
The yolo pointer strikes again. Pass the correc pointer to `mm_unregister()`.
2023-05-03 11:27:25 +00:00
Barnabás Pőcze
ff62eb59e2 spa: bluez: modemmanager: remove unused member 2023-05-03 11:27:25 +00:00
Barnabás Pőcze
06030ddf76 spa: bluez: backend-hsphfpd: fix dbus type
Use `DBUS_TYPE_STRING` for a string and not `DBUS_TYPE_BOOLEAN`.
2023-05-03 11:27:25 +00:00
Barnabás Pőcze
abe9615fec spa: bluez: backend-hsphfpd: use dbus_bool_t for DBUS_TYPE_BOOLEAN 2023-05-03 11:27:25 +00:00
Barnabás Pőcze
36bfd5263f spa: bluez: do not check if service is running
It is inherently racy, and we have a better way to ensure that
we won't autostart the service:

  dbus_message_set_auto_start()

So use that.

This commit also adds a missing call to `dbus_pending_call_unref()`
and indirectly fixes a type mismatch (`dbus_bool_t` vs. `bool`)
that was present in `is_dbus_service_running()`.
2023-05-03 11:27:25 +00:00
Barnabás Pőcze
4d5f3620af spa: bluez: initalize DBusError object
The DBusError passed to `dbus_set_error_from_message()` must
be initialized, otherwise libdbus aborts:

  dbus[129473]: arguments to dbus_set_error_from_message() were incorrect,
                assertion "(error) == NULL || !dbus_error_is_set ((error))"
                failed in file dbus-message.c line 4043.
  This is normally a bug in some application using the D-Bus library.
2023-05-03 11:27:25 +00:00
Pauli Virtanen
10352dbaa5 pulse-server: combine-sink: add latency_compensate option
Add option to turn on latency compensation in module-combine-stream.
2023-05-03 11:22:01 +00:00
Pauli Virtanen
cc5da73665 module-combine-stream: add option to add delays for latency compensation
Add combine.latency-compensate option, which uses delay buffers to
compensate for different latencies in the target streams.
2023-05-03 11:22:01 +00:00
Wim Taymans
e24d7cc8b7 module-jack: don't crash when NULL source/sink
It is possible that we destroyed the source/sink when we get a latency
update from jack, don't try to update the source/sink in that case or
we will crash.
2023-05-03 13:04:58 +02:00
Wim Taymans
caeaaf9c24 impl-node: work around old clients
Old clients (screencast) set the TRIGGERED state before signaling
node_ready, which causes errors in pw-top. Patch this up here.
2023-05-03 12:51:34 +02:00
Wim Taymans
ea1385ffe0 jack-tunnel: use cycle_wait/cycle_signal
Use cycle_wait and cycle_signal so that we can avoid using a semaphore
and resume the jack graph right after we finish the pipewire graph.
2023-05-03 11:51:13 +02:00
Wim Taymans
bcbb6e42e7 remote-node: don't send signal/awake time in ready
Let the server calculate signal time when it starts the graph. Otherwise
we overwrite old values and we can't do stats.

We might be able to piggyback the signal time in the prev_signal_time
field later.
2023-05-03 11:06:14 +02:00
Wim Taymans
604d60650a impl-node: call implementor of node on xrun
Signal the eventfd of the node directly to run the driver node for a
last time after an xrun
2023-05-03 10:48:29 +02:00
Wim Taymans
7edcfad7db impl-node: process_node now always run on the implementer
process_node is now always called on the process that implements the
process function and so we can always fill in the finish_time.
2023-05-03 10:42:28 +02:00
Christian Glombek
b6b8035b0d module-raop-sink: Add default PW_KEY_DEVICE_ICON_NAME prop
Default icon prop to "audio-speakers"
2023-05-02 17:08:09 +00:00
Wim Taymans
f8663ab31c client-node: activate using the node eventfd
Don't make an extra eventfd for activating the remote-node, we can
use the server side eventfd and send them to the remote side using
the transport.

The remote node already adds the eventfd to the data-loop so avoids
doing the same on the server.

This makes driver nodes trigger all remote nodes directly instead of
going through an intermediate eventfd. For resuming nodes, we already
used the node eventfd directly so this only a small optimization
for the initial cycle start.
2023-05-02 18:47:10 +02:00
Wim Taymans
8f799af6df impl-node: use the added boolean to add/remove source
There is no reason to use the loop of the source.
2023-05-02 18:47:10 +02:00
Pauli Virtanen
7d4491ce6b module-combine-stream: add latencyOffsetNsec prop
Add latencyOffsetNsec prop to the combine node.

This is mainly useful for BAP device sets; the property appears in
Pulseaudio UI only when the node is associated with a device.
2023-05-02 13:43:56 +00:00
Wim Taymans
be59d2b5d0 jack: don't emit callbacks from do_wait()
Some functions need to wait for the reply of the server before they can
complete but the JACK API does not allow us to emit notifications while
blocking a function.

Delay emiting notifications when we are in selected methods and send a
notify to an eventfd to call the queued notifications.

Fixes #3183
2023-05-02 14:41:46 +02:00