LADI
/
spa
1
Fork 0
Commit Graph

10857 Commits

Author SHA1 Message Date
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
Wim Taymans bcec0ad103 impl-node: implement pw_impl_node_trigger
The trigger operation decrements the activation count on a node and
signals the eventfd when 0.

Implement pw_stream_trigger_process() with this new function.
Make the 3 types of trigger operations on a stream more explicit.

trigger:       -> do node_trigger()
driver/driving -> start graph with ready callback
other:         -> emit request trigger event.
2023-05-02 14:32:21 +02:00
Wim Taymans 953876bd58 impl-node: always wake up nodes with the eventfd
Don't call into the node process directly but use the eventfd to wake up
the node.

This is slightly slower and causes some change in behaviour
because we now need to go back to the poll loop and then let the node be
scheduled.

It is however nicer to have a uniform way to wake up nodes and it
opens up some new possibilities such as scheduling nodes in their own
threads on the server.
2023-05-02 14:14:45 +02:00
Wim Taymans 6bbe64a64b node: small cleanups and debug improvements 2023-05-02 14:11:37 +02:00
Wim Taymans dd36352a5c stream: move from dequeued to queued for capture stream flush
When flushing a capture stream we move all dequeued buffers to the
queued queue for recycling. The dequeued queue is filled again when
captured buffers become available. Otherwise we might never recycle
some dequeued buffers.
2023-05-02 13:41:00 +02:00
Wim Taymans b1a80a8f46 impl-node: call process_node directly
Don't go through the signal_func when we need to complete the graph
or when we need to process the node, do directly to process_node.

The signal_func is really only for nodes activating peers.
2023-05-01 13:42:50 +02:00
Wim Taymans adb7559359 impl-node: fix timing for client-nodes using trigger
For client-nodes that use trigger, set the signal and wakeup time when
they start the server node. Also set finish time before we resume the
peers on the server.

Client-nodes should really resume the peers directly without going
through the server but this is something to improve later.
2023-05-01 13:37:44 +02:00
Wim Taymans c23c27b566 module-raop: fix warning on uninitialised res variable 2023-05-01 09:59:55 +02:00
Christian Glombek 0bb0b524c7 raop: Deduplicate sink creation
Currently, RAOP sinks referencing the same remote ip and port may be created multiple times:
One each for IPv4 and IPv6, times the number of network interfaces used for mDNS discovery.

A recent change added `(IPv4)`and `(IPv6)`identifiers to the sinks' pretty names, however that
is misleading, as often times the service advertised through an mDNSv6 record is actually an
IPv4 service (i.e. the IP reference contained in the IPv6 record may be an IPv4 address).

With this change, sink creation is skipped if a sink with the same advertised name already exists.
2023-05-01 07:48:19 +00:00
Pauli Virtanen 0e831c52d8 module-access: determine trusted application executable
Determine application executable file so that the result can be trusted,
and the file exists in the current namespace.

Don't use /proc/pid/cmdline, since that contains whatever was specified
by the exec() call.
2023-05-01 07:44:08 +00:00
Wim Taymans 64235419a6 impl-node: handle ready callback correctly
Only stop processing the ready callback if we are a driver and not currently
driving the graph.

Streams that use trigger will also emit the ready callback and are not
driving the graph (but also are not a driver) and should therefore be
allowed to continue to resume_node to schedule the peer nodes.

See #3184
2023-05-01 09:22:56 +02:00
Pauli Virtanen a6481c48aa module-combine-stream: propagate latency
Propagate latency information from the target streams to the combine
stream.
2023-04-30 19:02:52 +00:00
Pauli Virtanen 04951ac15f bluez5: make set transport volume calls async
The transport set volume call may take a long time or never complete, so
make them async to not block main loop.

Also reduce log level to info for the failed volume setting, as this is
something the user can do nothing about.
2023-04-30 18:44:33 +03:00
Pauli Virtanen 9c788d0c7e bluez5: unref pending calls after cancel
Cancel doesn't decrease refcount, so needs unref too.
2023-04-30 18:38:30 +03:00
Wim Taymans 90c8cb42ff meson: fix filename 2023-04-30 10:39:06 +02:00
Wim Taymans 4a81c17b68 modules: add jackdbus-detect module
Loads jack-tunnel based on jackdbus state.
2023-04-30 10:34:19 +02:00
Wim Taymans 39f9fa9c05 jack-tunnel: let client cleanup continue in on_shutdown
We should close the client eventually so don't set the client to NULL.
2023-04-30 10:19:51 +02:00
Wim Taymans 663e6f1bf5 impl-node: set driving state correctly
If a node becomes a driver and it had itself as the driver, it also
becomes a driving node.
2023-04-30 10:16:29 +02:00
Wim Taymans 7c5b61295d JACK: update to newer headers
Fixes #3181
2023-04-28 17:32:04 +02:00
Wim Taymans 56c59630c9 Revert "jack-tunnel: run graph from JACK thread"
This reverts commit d89df144f0.

This is not better than using a semaphore and the regular data thread.
2023-04-28 17:17:04 +02:00
Wim Taymans d89df144f0 jack-tunnel: run graph from JACK thread
Stop our own data-loop and enter/iterate/leave it from the jack thread.
This runs all our nodes in the JACK thread and removes 2 context
switches (jack to and from pw thread).

We can possibly do this nicer by only pushing our own streams onto a
new custom data-loop but that's for later.
2023-04-28 17:06:29 +02:00
Wim Taymans 2112216d28 context: hide data_loop_impl 2023-04-28 17:04:29 +02:00