Commit graph

11932 commits

Author SHA1 Message Date
Dimitrios Katsaros
1f578e858c resampler: Only use copy when rate is 1.0
The rate we get from dlls can have a subsample precision. However,
the check for using process_copy is in sample precision. This means
that an adaptive stream will oscillate rather then lock into the
exact rate.
2024-02-19 09:01:30 +01:00
Dimitrios Katsaros
e25f7716b5 resample: use a float phase in update_rate
My making the phase into a float, the resampler can do finer grained
adjustments, which should improve the stability of adaptive
resampling
2024-02-19 09:01:22 +01:00
Wim Taymans
ffd9a8b892 conf: fix override directory order
We need to load and apply the overrides in the order:

If absolute config path, use only that.
If environment variable, use only that.
Else
 /usr/share/pipewire/*.conf.d/
 /etc/pipewire/*.conf.d/
 $HOME/.config/pipewire/*.conf.d/

Before this patch we would first apply $HOME and then /etc and /usr,
which is not expected.
2024-02-19 08:58:17 +01:00
Wim Taymans
791455c83f module-rtp: fix SAP header parsing for IPv6
If the originating source is IPv6, the A bit is set and the source is 16
bytes compared to 4 bytes for IPv4.

Fixes #3851
2024-02-19 08:57:29 +01:00
Pauli Virtanen
de617697be doc: sync with master branch
Update doc/ from master branch.

tutorial: fix s16 scale and add some docs
doc: add 'Configuration' page
doc: disable deprecated list
doc: fix some doxygen warnings
doc: put new pulse modules to right place
doc: filter some constructs that confuse doxygen
doc: Fix typo 'statis' -> 'static'
doc: include pipewire-pulse modules explanations also on man page
doc: add pw-v4l2.1 and spa-*.1
doc: add pw-reserve.1
doc: internals/access: update documentation vs current state
2024-02-16 21:53:23 +02:00
Wim Taymans
4a04d59c52 Update .gitlab-ci.yml file 2024-02-16 09:05:31 +00:00
Wim Taymans
0fba5537ed module-rtp-sink: improve source.ip default
Use the default source.ip from the same address family as the
destination.ip.

See #3851
2024-02-16 10:01:24 +01:00
Wim Taymans
346264f7a4 module-rtp: handle ipv6 sap.ip
Make a socket of the same address family as the address we're going to
bind it to.

When the source.ip is not specified, use the default in the same address
family as the sap.ip.

Probe the interface for addresses of the same family as the sap.ip.

Makes pactl load-module module-rtp-recv sap_address=:: work.

See #3851
2024-02-16 10:01:07 +01:00
Wim Taymans
f5c85478a7 meson: add options to set server and client RT priority
Make a rtprio-server and rtprio-client option. Leave the server
priority by default to 88 but lower client priority to 83. JACK
does something similar by setting clients to rtprio-server - 5.

Make module-rt use the client priority by default and bump the server
priority explicitly in the config file.

Leave the pulse-server to the default rtprio-client, there is no reason
to lower this any further because it is really just a regular client.

Bump the ffado packetizer thread to rtprio-server + 5 because that is
also what JACK does.

88 is still much higher than the value of 60 that JACK uses in
Fedora but now this is at least configurable.
2024-02-16 10:00:45 +01:00
Wim Taymans
119636cb3f alsa: split irq and timer wakeup functions
Because it's easy to do and avoids some runtime checks.
2024-02-16 10:00:35 +01:00
Dimitrios Katsaros
32f507d687 alsa: Reduce jitter in irq based software timestamping
We would timestamp within an unlikely block, which would introduce
additional jitter to current_time, which would have an impact on
the performance of the timer sensitive code.
2024-02-16 09:59:32 +01:00
Wim Taymans
4e24b6e265 pw-link: improve port and node names
don't leave the port and node names blank but fill in some defaults that
include the node/port id.
2024-02-16 09:57:43 +01:00
Wim Taymans
151a2f0dea spa: use errno values in warnings
Propagate the errno values from syscalls and use them in the warning
messages to give info about what is going on.
2024-02-12 10:55:14 +01:00
Dimitrios Katsaros
72b41e5067 metadata: Added context monitor for removed globals
impl-metadata would not monitor for globals being removed.
This would cause stale metadata to remain in the
store, causing future objects on the same ids to have invalid data.
2024-02-12 10:53:07 +01:00
Dimitrios Katsaros
b2c3ee5d8d metadata: handle removed globals in impl 2024-02-12 10:52:54 +01:00
Gleb Popov
d1b1202592 Use portable shebang in input-filter-h.sh 2024-02-12 10:52:41 +01:00
Gleb Popov
6f7be356f5 FreeBSD compatibility for module-rtp-sap 2024-02-12 10:51:50 +01:00
Gleb Popov
86ae379e55 Fix building module-netjack2 on FreeBSD 2024-02-12 10:51:41 +01:00
Wim Taymans
c972405cfe metadata: handle removed globals as well
When we remove a global, we set NULL,NULL,NULL as its metadata. This
then results in the implementor of the metadata to emit the property
change event for the subject.

When we decide to propagate this event to the listeners we not only
need to check if the client can see the global but also if the global
was removed and this is a remove metadata event.

Fixes metadata remove events when a global is removed.
2024-02-12 10:50:27 +01:00
Wim Taymans
acf9b67067 buffer: add MAPPABLE data flag
Add a MAPPABLE data flag that hints that the fd in the data is mappable
with a simple mmap/munmap. Normally, DmaBuf is not mappable like that
unless explicitly indicated with this flag.

Set the MAPPABLE flag on the DmaBuf from v4l2 and libcamera fd.

When asked, mmap the buffer memory in all cases when the MAPPABLE
flag is set.

This solves the case where v4l2 has exported DmaBuf and is streaming to
node A and then node B links but doesn't get automatically mmaped
memory.

Fixes #3840
2024-02-12 10:49:56 +01:00
Dimitrios Katsaros
3d5b9ce3e8 Jack: Added missing lock to jack API call 2024-02-12 10:48:58 +01:00
Wim Taymans
51e0720113 protocol-native: set error when add_event fails 2024-02-12 10:48:43 +01:00
Dimitrios Katsaros
9cb234dda9 Jack: Fix jack_remove_property(ies) to use proxy id
These functions were using the object serial as the object id
2024-02-12 10:48:08 +01:00
Wim Taymans
0bc42d71e0 pw-cli: set quit flag on -EPIPE
When the server closes the connection in non-interactive mode, we need
to set the quit flag to avoid going into second mainloop_run() that will
just block forever.

See #3837
2024-02-12 10:43:31 +01:00
Stefan Ursella
97777f173a module-protocol-simple: do not cleanup client when send returns EAGAIN or EWOULDBLOCK 2024-02-12 10:42:13 +01:00
Pauli Virtanen
fc6f8e3448 client-node: clear buffers always when freeing mix
Avoid leaking buffers when freeing mix, in case the port was not cleared
properly.

These leaks don't seem to be occurring currently, but better be sure.
2024-02-12 10:41:39 +01:00
Pauli Virtanen
0a1afa698e client-node: handle releasing mix for destroyed port
The remote end may destroy the port via client_node_port_update(),
before corresponding pw_impl_port_mix are released.

clear_port() removes all struct mix, but this prevents the
pw_impl_port_mix from being removed from io_map, which causes stale mix
ids be left in io_map, so we end up continuously allocating new io
areas.

Make lifecycle of io_map entries match port_init_mix/release_mix
exactly, separately from the lifecycle of the port and struct mix.

When freeing struct mix in port_release_mix(), make sure it corresponds
to the mix being released.
2024-02-12 10:41:30 +01:00
Wim Taymans
15a4d9a9df stream: fix param emission for Props
Props set on the node directly should also result in emission of changed
notify when required, just like we do for params set on the port.

This accidentally used to be done because stream_update_params()
unconditionally used to emit this for us. But commit
94cde3090e changed that.

Fixes #3833
2024-02-12 10:40:43 +01:00
Pauli Virtanen
f1d2d40748 mem: track fd invalidation of imported memblocks
When a memblock closes its fd, have it emit signal to other memblocks
possibly sharing the fd, so they know it is now invalid.

When a memblock has an invalidated fd, it'll not allow mapping more
memory, nor match against fd searches.

This avoids bugs where kernel fd reuse causes already invalid memblocks
to be used.  Generally, higher level code should make sure memblocks get
freed in right order so that this situation does not occur, but try to
keep mempool in consistent state regardless.
2024-02-12 10:39:51 +01:00
Wim Taymans
6ab86209f2 1.0.3 2024-02-02 14:09:07 +01:00
Wim Taymans
0b6d763ed5 module-pipe: warn underrun only once 2024-02-02 14:06:45 +01:00
Wim Taymans
b147753554 alsa: always reevaluate matching when driver changed
Always reevaluate the rate matching even when we did not change the
follower state.

It is possible that we were a follower from some node with the same
clock and now become a follower of a node with a different clock. The
follower state doesn't change but we need to activate the rate matching
logic in that case.

Fixes rate matching in pro audio (playback) when capture and playback
are moved to another driver.
2024-02-02 14:06:45 +01:00
Michael Tretter
9996dfb791 conf: escape @DEFAULT_SINK@
Variables enclosed with @ are replaced with the value of the variable.
The sink.name should remain @DEFAULT_SINK@.

Escape the enclosing @ to prevent substitution of DEFAULT_SINK with an
empty string while generating pipewire.conf.
2024-02-02 14:06:45 +01:00
Wim Taymans
1e763b928f alsa: fix version check
See #3711
2024-02-01 21:43:39 +01:00
Wim Taymans
9ba18c15ae 1.0.2 2024-01-31 10:37:35 +01:00
Wim Taymans
1c9c3e3553 jack: fix version check 2024-01-31 10:37:09 +01:00
Wim Taymans
bf87fdbd70 filter-chain: connect atom ports to an empty atom
Or else the lv2 plugin might crash.

Fixes #3815
2024-01-30 18:43:34 +01:00
Wim Taymans
565f560722 module-raop: don't start record in state change
We first need to do the setup, which we start when setting the Format
param.

This causes the module to unload when starting pavucontrol because it
tries to start the record in the wrong state.

See #3778
2024-01-30 18:43:30 +01:00
Arun Raghavan
1f40695b69 node-driver: Log when we resync 2024-01-30 18:43:08 +01:00
Wim Taymans
c690aedc89 v4l2: probe EXPBUF and disable alloc_buffer flag
After we set the format, probe if we can do EXPBUF and enable/disable
the ALLOC_BUFFERS flag on the port.

This should gracefully handle the case where EXPBUF is not available.

Fixes #3821
2024-01-30 18:42:58 +01:00
Wim Taymans
18b112bcfe v4l2: clear support for alloc_buffers on failure
When we try to alloc buffers but EXPBUF is not supported, make sure to
clear the alloc_buffers flag so that the caller can try again with
allocated buffers instead.

See #3821
2024-01-30 18:42:53 +01:00
Wim Taymans
3e49e056ef module-netjack2: improve channel positions
If the manager gave us a different channel count than we had by
default or configured, assume everything is AUX channels.

Also handle the case where the manager is sending more than our
MAX_CHANNELS channels.
2024-01-30 18:42:07 +01:00
Dmitry Sharshakov
31a08028ee pipewire-aes67: resync when offset is more than 1.5 ms
2 ms is typically considered to be late for most AES67 implementations
2024-01-25 12:08:05 +01:00
Dmitry Sharshakov
73cda0c152 node-driver: allow fractional resync-ms 2024-01-25 12:07:11 +01:00
Wim Taymans
c28311fc97 support: add resync.ms option to node.driver
Move some of the tracking code for the DLL to where it is used.

Add resync.ms (default 10) option at which we give up rate adjusting
and instead do a hard resync. This results in a jump in the position
of the graph clock.
2024-01-25 12:06:50 +01:00
Mersad Jelacic
5f531e7fe6 thread: Change warning to info
Change warning to info in impl_acquire_rt() and impl_drop_rt().
2024-01-25 12:03:36 +01:00
Wim Taymans
13511e9295 jack: improve running check
When we get a node info about our own state, we can use the active state
of the node to decide if we are running or not.

Otherwise, we will try to hide ports from JACK clients that suspend
(while still active).

See #3794
2024-01-25 12:02:01 +01:00
Wim Taymans
c298d7faef pulse-server: the device changed when EnumRoute changes
We use EnumRoute of the card to fill in the ports of the device so when
EnumRoute changes, the associated devices also needs a change event.
2024-01-25 12:00:35 +01:00
Wim Taymans
6ee48f0562 alsa: increase buffers when using small buffer
We can increase the MAX_LATENCY again if we increase the amount of
buffers when we are using a small buffer.

Normally we ask for 4 * quantum-limit as the buffer. This should be good
to use 1 buffer and quantum-limit as the quantum with enough headroom
to not run out of buffers.

If we are however using less buffer-frames we need to be careful and
allocate an extra buffer. Imagine using a buffer of 4096 frames, we can
support a quantum of up to 2048 frames if we use 2 buffers.

See #3744
2024-01-22 16:05:52 +01:00
Wim Taymans
7e1e05f0da alsa: improve max-latency property
Half of the buffersize is not enough to support as a max-quantum, we
need to divide by (4 * frame_scale) to allow some headroom and account
for the DSD scaling. We do the same calculation to suggest a buffer size
using the quantum-limit.

See #3744
2024-01-22 16:04:38 +01:00