Commit graph

12202 commits

Author SHA1 Message Date
Pauli Virtanen
823fb91756 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-03 15:58:22 +00:00
Sergio Costas Rodriguez
4d3658b271 snap-policy: fix memory leak
This patch fixes a memory leak when there is a snap with an
invalid ID.
2024-02-03 13:08:38 +00:00
Sergio Costas
fed1432172 snap-policy: ensure audio works with .deb snapd 2024-02-03 13:07:56 +00:00
Wim Taymans
16479acc60 alsa: fix version check
See #3711
2024-02-01 21:42:07 +01:00
Wim Taymans
d7e48f3042 module-pipe: resync when ringbuffer too full
When the ringbuffer has too much data, do a resync or else we would just
have a huge delay and would try to resample to get back to the target
fill level.
2024-02-01 16:00:25 +01:00
Wim Taymans
0bc7f3f48c module-pipe: warn underrun only once 2024-02-01 16:00:25 +01:00
Théo Lebrun
28df14859a pw-link: handle link proxy removal 2024-02-01 13:35:30 +01:00
Théo Lebrun
ecffe3cbd6 pw-link: handle link proxy destruction
If for some reason the proxy gets destroyed, we make sure to remove
listeners and forget the proxy pointer. We do not however delete the
target_link; we consider the proxy destruction as an error.

If another definitive state occured on the link (got to paused state,
got an error), then that event will be ignored. Else we consider it an
error.
2024-02-01 12:08:15 +01:00
Théo Lebrun
7ebc1b05d2 pw-link: --wait: allow linking with nodes
Previously, on new node event, we registered a core sync. Linking was
attempted at core sync done  but the node did not yet have time to
register its ports.

Only listen to new ports. This delays the linking attempt to when nodes
have had time to create their ports.
2024-02-01 10:47:49 +00:00
Théo Lebrun
6a7d83f051 pw-link: listen to link info events to detect link creation
Stop using sync for link creation detection. Instead, listen to link
events.

We still listen to errors, link info events are not enough. For example,
if a link already exists, we only get a proxy error and no link info
event.
2024-02-01 10:47:49 +00:00
Théo Lebrun
5169941908 pw-link: add --wait option
Now that we have a create_link_proxies() that looks for our matching
nodes/ports and creates proxies if they exist, implementing --wait is
easy.

We move the call to create_link_proxies() the core done event. If it
finds no potential nodes/ports, we keep running our loop, monitoring
new objects.
2024-02-01 10:47:49 +00:00
Théo Lebrun
54662ad209 pw-link: refactor do_link_ports() to not run the event-loop
Make do_link_ports() only create proxies. Previously it ran the event
loop once per attempted link to detect link creation errors. Rename it
to create_link_proxies() to make things clear.

Created proxies are stored into a list (data->link_targets).
create_link_proxies() returns the number of link proxies created. This
can be zero when the two matching nodes have zero ports.

Refactor main() to use create_link_proxies(), ask for a sync then run
the event loop. It will stop on sync done, and we will have received
all potential link proxy errors.

Cleanup all proxies and listeners at the end of main().
2024-02-01 10:47:49 +00:00
Théo Lebrun
e8d104f7bc pw-link: move output/input option checking before main event loop run 2024-02-01 10:47:49 +00:00
Wim Taymans
0b67c10a9c 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-01 11:07:18 +01:00
Pauli Virtanen
db7b764bf2 bluez5: deprioritize AAC-ELD since it's untested
The AAC-ELD support was not properly tested on devices.  In theory it
should be OK, but it's untested.

Bump it down in priority so it won't be selected by default.
Also log info on FDK-AAC AAC-ELD support status.
2024-02-01 08:06:06 +00:00
Michael Tretter
c224010773 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-01-31 14:12:30 +01:00
Wim Taymans
07f7bda1fe jack: fix version check 2024-01-31 10:36:05 +01:00
Arun Raghavan
0c37adb665 module-rtp: Add some sender latency validation
Just a sanity check on config.
2024-01-30 21:26:14 +00:00
Dmitry Sharshakov
c6bae2742e pipewire-aes67: re-enable sess.latency.msec for sender
78055736a2 fixes jitter for multiple packets in one quantum
2024-01-30 21:41:40 +03:00
Wim Taymans
6ea9825cd1 filter-chain: connect atom ports to an empty atom
Or else the lv2 plugin might crash.

Fixes #3815
2024-01-30 16:16:56 +01:00
Wim Taymans
b157d417af 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 15:04:01 +01:00
Wim Taymans
9c02a1df17 alsa: use debug types instead of custom function 2024-01-30 12:19:13 +01:00
Sergio Costas
e8fcaa5157 snap-policy: Manage ENOPROTOOPT error in aa_getpeercon() 2024-01-30 10:28:27 +00:00
Christian K
726e22311e Update German translation 2024-01-30 10:26:02 +00:00
Wim Taymans
78055736a2 module-rtp: add packet timer
When multiple packets need to be flushed (because sess.latency is set
and larger than ptime) use a timer to space the packets uniformly in
the current quantum to avoid bursts.

See !1873
2024-01-30 10:06:27 +01:00
Arun Raghavan
3958bed5c3 node-driver: Log when we resync 2024-01-29 12:08:15 -05:00
Wim Taymans
bbb83b97c5 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-29 16:38:52 +01:00
Wim Taymans
24f510b9b3 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-29 16:10:36 +01:00
Dmitry Sharshakov
06d4570ced pipewire-aes67: temporarily disable sess.latency.msec
After c37f9f9cf0 and before further improvements it won't properly work with AES67 receivers
2024-01-29 08:54:25 +00:00
Pauli Virtanen
089db6f14a doc: disable deprecated list 2024-01-29 08:50:32 +00:00
Pauli Virtanen
978dbff32f doc: fix some doxygen warnings 2024-01-29 08:50:32 +00:00
Pauli Virtanen
8e3c0f02b2 doc: bluez5: document some internals in media-codec 2024-01-29 08:50:32 +00:00
Pauli Virtanen
b1d88f5ed4 doc: put new pulse modules to right place 2024-01-29 08:50:32 +00:00
Pauli Virtanen
cdb6c5a316 doc: filter some constructs that confuse doxygen 2024-01-29 08:50:32 +00:00
shoffmeister
c25c7f7bd8 doc: Fix typo 'statis' -> 'static' 2024-01-29 08:47:37 +00:00
columbarius
3f80bc2e70 vulkan: Support MemPtr as import for compute 2024-01-29 08:44:25 +00:00
columbarius
7ffd8ff4de vulkan: Add function to upload data to a staging buffer 2024-01-29 08:44:25 +00:00
columbarius
36aa413cd7 vulkan: Add functions to create staging buffers 2024-01-29 08:44:25 +00:00
columbarius
d0e51dd066 examples: Add video-dsp-src example
This client creates the same output as video-src in the dsp format.
2024-01-29 08:44:25 +00:00
Wim Taymans
ad6e2ce480 param: clarify the internal latency 2024-01-29 09:41:11 +01:00
Pauli Virtanen
97db4a68a7 doc: explain clock/latency more
Update SPA_IO_Clock/Position documentation.

Explain some IOs are currently unused in PW.

Explain meaning of latency.
2024-01-29 08:36:15 +00:00
Pauli Virtanen
21392d327f bluez5: lowball fallback delay values
Reduce fallback delay values used when BT device doesn't provide the
information itself.

It may be better to have audio late than early, so use values that are
probably close to or below the delays of majority of headsets.
2024-01-28 18:00:04 +02:00
Pauli Virtanen
2ed0cddc57 bluez5: sco-sink: more accurate latency values
Use audio packet size for the latency, support for latencyOffsetNsec.
2024-01-28 18:00:04 +02:00
Pauli Virtanen
c0eb634156 bluez5: media-sink: more accurate latency
Don't include the quantum in latency: the latency relative to graph
cycle start doesn't depend on the quantum.  Instead, the audio packet
size determines it.
2024-01-28 18:00:04 +02:00
Pauli Virtanen
95b13391eb bluez5: media-sink: fix wrong clock
Should use position for graph clock rate.
2024-01-27 18:04:57 +02:00
Pauli Virtanen
84c5ba09dc bluez5: support api.bluez5.internal flag also for sco
Enable the /Internal media class hack also for SCO.

Session manager can use this to adjust SCO sink/source media.class when
it is going to emit front-end nodes hiding the hardware ones.
2024-01-26 11:58:30 +00:00
Pauli Virtanen
05402284c1 bluez5: backend-native: fix all rfcomm lookups to check profile
The rfcomm list may contain various AG & HF ones, so the profile must be
checked everywhere they are looked up.

Fix the rfcomm lookups everywhere to do it.

Fixes Pipewire<->Pipewire HFP connections, and sending HFP HF commands
to HSP or AG.
2024-01-26 11:57:30 +00:00
Pauli Virtanen
651cb7bd71 context: move registry generation checks to context methods
Add registry generation checks to pw_context methods that find globals,
(pw_context_find_global, pw_context_for_each_global), so that they are
made everywhere where a client acquires globals.

In addition to previously covered registry bind/destroy, this also
covers link creation (port/node ids) and metadata (subject ids).
2024-01-26 11:56:40 +00:00
Wim Taymans
a59a551202 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-25 17:59:39 +01:00
Wim Taymans
c37f9f9cf0 module-rtp: use sess.latency.msec also for sender
Use the sess.latency.msec also for the sender and use it to control the
NODE_LATENCY. Make it a float to be in line with the other time values.
Set is to a default of ptime, which was what it used to be.

This makes it possible to set the ptime to a smaller value than the
sess.latency.msec so that we send out multiple packets per quantum.
This will result in some bursty output for now but with a timer that can
be improved later.

Update the docs a little, mention the new rtp.ptime and rtp.frametime.
2024-01-25 15:49:41 +01:00