Commit graph

6495 commits

Author SHA1 Message Date
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
Peter Hutterer
c8c0a152b7 man: drop --name documentation from pipewire.1
Support for this was dropped in 80825aeaea
2021-05-27 11:27:39 +00:00
Peter Hutterer
265cad2704 pw-uninstalled: set PW_UNINSTALLED=1 so we can adjust the shell
This allows for easy configuration of the shell if we're inside
pw-uninstalled's shell, e.g. PS1="$PS1  ${PW_UNINSTALLED:+🪠}"
2021-05-27 11:27:17 +00:00
James Henstridge
733ad43d3f module-portal: direct GetConnectionUnixProcessID call to /org/freedesktop/DBus
The D-Bus specification says that the message bus accepts method calls
on other object paths for backwards compatibility, and may reject
security sensitive calls on unexpected object paths:

https://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-messages
2021-05-27 11:24:04 +00:00
Wim Taymans
de270ba87a README: Fix new IRC server link 2021-05-26 15:48:13 +02:00
Wim Taymans
653c60b7cc Change IRC server name 2021-05-26 15:41:38 +02:00
Wim Taymans
751f9a9ea0 dbus: make sure we don't unref a NULL dbus connection
See #1213
2021-05-26 10:52:38 +02:00
Wim Taymans
492caf4456 pulse-server: handle errors during create
If a stream is being created and an error occurs we always need to
reply with the pending create_tag.

Fixes #624
2021-05-26 10:44:59 +02:00
Wim Taymans
4e4294dc13 pulse-server: handle NULL dbus connection
Fixes #1224
2021-05-26 10:23:17 +02:00
Wim Taymans
f007ca475c pw-cli: handle failure to create context
Fixes #1234
2021-05-26 10:18:15 +02:00
Wim Taymans
8027c9225e context: log some more errors when config file fails 2021-05-26 10:17:40 +02:00
Peter Hutterer
e83f039833 alsa: free the strdup'd substring on error
n is the return value of pa_split()

Found by scan-build
2021-05-26 10:03:49 +02:00
Peter Hutterer
bc64b32798 bluez: fix a memleak on error
If the allocation failed, our strdup'ed path would leak.

Found by scan-build
2021-05-26 10:03:43 +02:00
Peter Hutterer
b64f0d581f doc: switch from .md to .dox files and impose some general structure
This is an attempt of breaking up the documentation, currently spread across
several pages. We're left with a few high-level topics with various things
grouped underneath those.

Further refinement is necessary, but this can now be done in incremental steps
over massive reworks.
2021-05-26 10:02:10 +02:00