Commit graph

2651 commits

Author SHA1 Message Date
Wim Taymans
7a82fc7fc7 module-jack: fix compilation without fastpath 2023-05-04 09:29:51 +02: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
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
ff6a86644b client-node: take data_loop and system from node 2023-05-03 18:18:12 +02: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
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
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
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
6bbe64a64b node: small cleanups and debug improvements 2023-05-02 14:11:37 +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
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
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
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
472a948974 loop: keep loop and system around
So that we don't have to go through the context all the time.
2023-04-28 11:12:02 +02:00
Wim Taymans
9e7921b37d module-jack: improve xrun reporting 2023-04-27 18:10:41 +02:00
Wim Taymans
381aa90b54 module-jack-tunnel: improve some docs 2023-04-27 17:22:05 +02:00
Wim Taymans
ab0cee29dd doc: add jack-tunnel to docs 2023-04-27 17:03:10 +02:00
Wim Taymans
73f5f7ae65 jack-tunnel: add a new 0-latency JACK sink/source module
Add a new JACK sink/source pair that translates to a single JACK
client.

The JACK playback port appears as PipeWire source and is processed
directly, synchronously, through the complete pipewire graph into
the PipeWire sink that is then made available on the JACK capture
ports.

Because all this happens in the same JACK cycle with no delay, the
latency is 0. A jack_iodelay on the JACK server has exactly the same
latency as the jack_iodelay on the PipeWire side.

The PipeWire sink and source are forced into the same rate and
buffer_size as the JACK server and can't dynamically change.

This only supports Audio for now.
2023-04-27 16:27:54 +02:00
Wim Taymans
9eb1633b02 protocol-native: don't remove all fds in clear
When we consumed all the buffer data, don't clear all the fds but only
those that were already consumed in the message. It is possible that we
already have fds for the next message and we don't want to discard
those.

Fixes some intermittend memory map errors.
2023-04-27 11:03:53 +02:00
Wim Taymans
3cae535da0 impl-node: calculate stats at cycle start
Calculate the stats at the start of the new cycle. The results will be
about the previous cycle but this gives more accurate results because
we can also include awake and finish times of remote nodes.

Make sure not to change the status of the activation in the ready event
so that we don't overwrite the status of the last cycle yet.

This means we can always set the AWAKE and awake_time, the remote node
might update it when triggered but that's ok.

After processing we can update the FINISHED state for non-remote nodes,
the remote nodes will update it after they complete the process
function.
2023-04-27 09:34:07 +02:00
Wim Taymans
5303fced50 client-node: pass the ready status in the activation state
Pass the ready status to the client-node using the state array.

Don't just SPA_STATUS_HAVE_DATA on the server side but use the value
from the client.

This avoids some potential extra work when a driver sink pulls in data
with the NEED_DATA ready callback but then the server performs the
actions (tee) as if it were SPA_STATUS_HAVE_DATA.
2023-04-26 15:56:29 +02:00
Wim Taymans
989f597860 client-node: update the driving node status
Look at the clock and position to see if we are selected as the driver
or not.
2023-04-26 15:47:41 +02:00
Wim Taymans
12bc69a469 raop-sink: only set volume when connected
Only attempt to set the volume when connected. Apply the current
volume after connecting.

Based on patch by Tycho Haemers

Fixes #3175
2023-04-22 11:16:55 +02:00
Wim Taymans
68664adcd4 filter-chain: improve debug 2023-04-21 18:25:01 +02:00
Wim Taymans
64aae9d551 module-echo-cancel: set rec/source/play_info fields correctly
In the fallback case we need to set them all to the same format as
the playback.
2023-04-21 18:23:53 +02:00
Wim Taymans
b9cf2638b3 client-node: remove hardcoded limit for io areas
When we run out of io_areas, just allocate another memblock and continue
with the new block.
2023-04-21 15:45:25 +02:00
Wim Taymans
bf18ba839f protocol-native: add some more debug 2023-04-21 15:07:29 +02:00
Wim Taymans
0333ddff45 pod-builder: move some code around to help gcc 13
Make sure to pop the frame before returning errors to stop gcc13
from complaining with -Wdangling-pointer

Fixes #3171
2023-04-20 17:52:27 +02:00
Wim Taymans
dd21ebf6b8 module-rtp: just log generic sendmsg error debug log 2023-04-19 21:34:39 +02:00
Wim Taymans
74b1b63c3d module-raop: implement remote volume
Intercept the volume property changes and trigger a set_parameter
with the volume property to control the remote volume.

Fixes #2061
2023-04-18 11:30:57 +02:00
Wim Taymans
bbf0ed063e pulse-tunnel: proxy volume/mute
Intercept the stream volume/mute and set it as the remove volume/mute.

Listen for remote volume/mute changes and set this as the local stream
volume. Make sure the adapter is using 1.0 software volume but reports
the real channelVolume of the remote stream.
2023-04-17 17:53:23 +02:00
Wim Taymans
dad87fb3a8 module-x11-bell: move error to info
Make the XOpenDiplay call failure print an info message instead of a
warning. We usually ignore this error in the config file. Add a
suggestion for how to fix this issue in the info log.

Fixes #2918
2023-04-17 11:11:01 +02:00
Wim Taymans
647c55dba9 filter-chain: improve error reporting
Log en error message when config section is missing or doesn't have
an object.
Log warning when ignoring an unknown key.
2023-04-16 20:35:12 +02:00
Wim Taymans
381be87e37 filter-chain: config is only required for bq_raw
Fixes #3161
2023-04-16 18:38:52 +02:00
Wim Taymans
f318edb699 metadata: add support for initial metadata
Add a metadata.values property that is used to fill the metadata store
with initial values.

Fixes #3076
2023-04-14 15:07:26 +02:00
Wim Taymans
6394eb1b18 metadata: return pw_metadata from factory create
That is what the factory return value says.
2023-04-14 12:50:07 +02:00
Wim Taymans
c968259348 module-rtp: silence some debug 2023-04-14 12:17:43 +02:00
Wim Taymans
b84083a1bb pulse-server: improve echo-cancel aec_args parsing
Actually convert the aec_args argument to something that the
echo-canceler will understand. Add the beamforming and mic-geometry
and target_direction properties.
2023-04-13 17:38:26 +02:00
Wim Taymans
2a5c23c811 module-echo-cancel: support different channels per stream
Make the channels configurable for capture, source, playback and
sink streams. The playback and sink stream need to have the same number
of channels but the layout can be different.

Use init2 of the echo-cancel plugin when available to pass this info
around. The echo-canceler will then further adjust the settings to make
things work.
2023-04-11 16:55:48 +02:00
Wim Taymans
f64c21ed81 filter-chain: fix bq_raw activate
The raw biquad takes its values from the config and then updates the
control ports with them in activate. At runtime, the changes to the
ports are applied to the biquad.

Other biquads take values from the config ports in activate.
2023-04-07 16:45:28 +02:00