Commit graph

6508 commits

Author SHA1 Message Date
Arun Raghavan
f19d998906 pw-jack: Fix empty string checks
shellcheck seems to hate x"$FOO" = x checks, so let's use the
appropriate test arguments instead.
2021-05-31 12:46:18 -04:00
Wim Taymans
bc6e11d6e4 audioconvert: move some info to debug 2021-05-31 16:17:43 +02:00
Wim Taymans
a248391939 echo-cancel: set latency on the right streams 2021-05-31 16:15:37 +02:00
Wim Taymans
7f912a1cff impl-port: improve Latency param check
We can use the latency param when we have a Writable entry in the
param_info.
2021-05-31 16:13:42 +02:00
Wim Taymans
743eaf4aa2 filter: add PARAM_Latency support
Announce the Latency param in pw-filter.
Mark the latency param as writable. It becomes readable when we provide
a value.
2021-05-31 16:12:26 +02:00
Wim Taymans
8485622923 echo-cancel: reuse buffer on error
Queue the dequeued buffers when there is an error so that we can
recover.
2021-05-31 15:53:34 +02:00
Wim Taymans
b0068fd46b media-session: use direction to find the node by name
Also use the stream direction when finding a node by name. We should
only select nodes that have the right direction.
2021-05-31 15:40:26 +02:00
Wim Taymans
d37ea7851a echo-cancel: copy some more node properties 2021-05-31 15:17:00 +02:00
Wim Taymans
a2cab35365 echo-cancel: use the right node.group 2021-05-31 15:01:33 +02:00
Hui Wang
e375930813 alsa-mixer: only use switch to mute Front in the Headphone path
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
2021-05-31 13:08:19 +02:00
Wim Taymans
4dc3d79ff2 alsa: sync with pulseaudio 2021-05-31 13:03:52 +02:00
Wim Taymans
c803444123 impl-port: only send latency param when supported
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.
2021-05-31 11:31:18 +02:00
Peter Hutterer
98353560da spa: remove semicolon at end of SPA_LIST_INIT 2021-05-31 07:35:59 +00:00
Peter Hutterer
c58498bd92 config.h.meson: drop define for USE_POISONING
This isn't hooked up and takes a bit of effort to hook up across the tree.
Let's remove the define so it doesn't look like we're doing something.
2021-05-31 07:35:59 +00:00
Evgeniy Khramtsov
3cf4bf7cf7 modules: build module-rt only on Linux
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.
2021-05-30 15:30:45 +03:00
Barnabás Pőcze
2a8d511be8 pipewire: map: initialize free_list to SPA_ID_INVALID
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.
2021-05-30 00:21:43 +02:00
Wim Taymans
0eb46d8ef4 filter: call the process rt_callback 2021-05-29 08:41:37 +02:00
Huang-Huang Bao
e953bb3238
meson: fix build if bluez5 option is disabled
Don't look up codecs dependencies and don't include 'bluez5' subdir if 'bluez5' option is disabled or libbluetooth is not found.
See https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/707.
2021-05-28 21:01:38 +08:00
Huang-Huang Bao
38bcec9022
bluez5: add port latency reporting 2021-05-28 20:02:10 +08:00
Huang-Huang Bao
d8435cd5fd
bluez5: use definations to index node and port params 2021-05-28 19:40:19 +08:00
Wim Taymans
934caab1e1 stream: emit events from only one thread
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
2021-05-28 13:24:10 +02:00
Wim Taymans
a138152bef pulse-server: free message when resize fails
Based on patch by Peter Hutterer

Fixes !701
2021-05-28 11:52:29 +02:00
Oschowa
8892152b13 meson: Require bluetooth codec library dependencies only when bluez5 is
enabled
2021-05-28 09:49:46 +00:00
Barnabás Pőcze
c851349f17 spa: logger: fix potential buffer overrun when message is long
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.
2021-05-28 09:40:11 +00:00
Wim Taymans
5a186ece01 alsa: handle plugin errors better
When the plugins can't be loaded, we fail to make a main_loop.
Handle this case instead of segfaulting.

See #1239
2021-05-28 11:38:02 +02:00
Wim Taymans
913434167d modules: remove some useless device names 2021-05-28 11:20:06 +02:00
Wim Taymans
b9efb25605 pulse-tunnel: handle latency a little better
Set a limit on the buffer size.
Announce our latency on the streams.
2021-05-28 11:19:05 +02:00
Barnabás Pőcze
48f03f85a7 pulse-server: add support for IPv6
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.
2021-05-27 21:12:14 +02:00
Barnabás Pőcze
279470bc07 pulse-server: native-protocol-tcp: do not hardcode port
Use `PW_PROTOCOL_PULSE_DEFAULT_PORT` from pulse-server.h
instead of hard-coding the default port.
2021-05-27 19:32:02 +02:00
Wim Taymans
70722c0741 channelmix: provide some more upmix options
If nothing else is possible, also try to upmix from FC

See #1237
2021-05-27 18:08:07 +02:00
Wim Taymans
06cf1e1c00 module: proxy latency params 2021-05-27 16:07:25 +02:00
Wim Taymans
c319ed68d1 jack: implement more latency
Keep both input and output latency on the ports.

When setting the port latency only apply the rate latency values
and assume the node latency does not depend on buffer-size or time.
This is likely true because jack only knows about latency relative
to the rate.
2021-05-27 15:26:09 +02:00
Wim Taymans
e7eba82002 port: keep both output and input latency on port
But only emit latency changes for the latency matching the port.
2021-05-27 15:26:09 +02:00
Wim Taymans
12a3ea9539 jack: implement default latency handler
It combines all latency from one direction and sets it as the latency
for the other direction.

Also keep only one latency value per port, in the object.
2021-05-27 15:26:09 +02:00
Wim Taymans
07f8a0d275 impl-port: remove useless code
We already check for 0 as the undefined value in the combine
function.
2021-05-27 15:26:09 +02:00
Wim Taymans
9262f576d5 spa: fix unit test, add new object type 2021-05-27 15:26:09 +02:00
Wim Taymans
f383ac21dd pw-cat: remove debug 2021-05-27 15:26:09 +02:00
Wim Taymans
4af2014168 jack: add latency reporting
Rework the param handling a little.
Keep properties for ports. Use this in the client and port info.
Trigger the latency callback when the port latency changed.
Update the port latency when it changed.
2021-05-27 15:26:09 +02:00
Wim Taymans
bae0622311 filter-chain: pass latency param along
Intercept the latency param and pass it on the right stream.
2021-05-27 15:26:09 +02:00
Wim Taymans
d8e9a43b9c stream: handle Latency param
Handle the latency param and remember the latency. Add the latency
to the delay value in the time.

Also make it possible to add custom Latency params.
2021-05-27 15:26:09 +02:00
Wim Taymans
80d48ad3b6 link: recalc latency when the peer latency changed
Trigger a recalculation of the port latency when the peer port
latency changed.

This makes the latency update from a port propagate through the
pipeline.
2021-05-27 15:26:09 +02:00
Wim Taymans
cd58c51582 port: implement latency_changed event
Emit the latency changed event when the latency was updated.
2021-05-27 15:26:09 +02:00
Wim Taymans
0222e408e0 audioconvert: use the right latency param
We need to use the latency param of the port direction to configure
the other port.
2021-05-27 15:26:09 +02:00
Wim Taymans
b9b89b92b2 spa: add some latency helpers
Add more fields to the latency object.
Add methods to create, parse and process latency info.
2021-05-27 15:26:09 +02:00
Wim Taymans
0779862cda alsa-seq: add port latency reporting 2021-05-27 15:26:09 +02:00
Wim Taymans
cd32404e92 port: implement latency reporting some more
Implement a port recalculate latency method that takes the min
and max latency of all peer ports and sets that as the new port
latency.
When a link is made, let the output and input port recalculate
latencies.
Pass latency param in audioconvert.
2021-05-27 15:26:09 +02:00
Wim Taymans
b588cc6b03 jack: listen to latency updates on ports
Listen for the latency updates on ports and use this to report
latency.
2021-05-27 15:26:09 +02:00
Wim Taymans
1cd6d7b01d spa: Implement latency reporting
Implement latency reporting in alsa
Implement latency reporting on audioconf by passing on the latency
from the follower to outside of the adapter.
2021-05-27 15:26:09 +02:00
Wim Taymans
1a8f274a80 spa: add Latency param and object
Add a new latency param that contains a latency object.
The latency object contains the min and max delay from a port to
the terminal sink/source. It is also possible to express this
delay as a fraction of the quantum to avoid having to recalculate
the latency every time the quantum changes.
2021-05-27 15:26:09 +02:00
Wim Taymans
46ef88e520 spa: save the old change_mask and restore when emitting full
When we add a new listener to an object, it will emit the full state
of the object. For this it temporarily sets the change_mask to all
changes. Restore the previous state after this or else we might not
emit the right change_mask for the next listener.

Consider the case where one there are two listeners on an object.
The object emits a change and the first listener wants to enumerate the
changed params. For this is adds a new listener and then triggers the
enumeration. If we set the change_mask to 0 after adding the listener,
the second listener would get a 0 change_mask and fail to update
its state.
2021-05-27 15:21:44 +02:00