Commit graph

6266 commits

Author SHA1 Message Date
Stefan Ursella
8f2a239504 module-protocol-simple: do not cleanup client when send returns EAGAIN or EWOULDBLOCK 2024-02-05 13:26:25 +00:00
Barnabás Pőcze
db3d7b88dd pipewire: module-rt: make dbus reply checking stricter
org.freedesktop.DBus.Properties.Get is supposed to return
a single variant, so check if it does.
2024-02-05 13:03:20 +00:00
Barnabás Pőcze
4da82d5475 pipewire: module-rt: do not retrieve dbus message serial numbers
They are not used, so don't query them from libdbus.
2024-02-05 13:03:20 +00:00
Barnabás Pőcze
494e6ce70e pipewire: module-jackdbus-detect: do not autostart jackdbus
There is no need to start jackdbus via dbus service activation,
because this module is only interested in reacting to the jack server
starting/shutting down, it does not actually want to make use of jack
itself.
2024-02-05 13:03:20 +00:00
Barnabás Pőcze
542e6c652c pipewire: module-portal: watch only relevant NameOwnerChanged signals 2024-02-05 13:03:20 +00:00
Barnabás Pőcze
6e609c93e5 pipewire: module-portal: do not repeat portal service name 2024-02-05 13:03:20 +00:00
Barnabás Pőcze
dcb5430ff2 pipewire: module-jackdbus-detect: watch only relevant NameOwnerChanged signals 2024-02-05 13:03:20 +00:00
Barnabás Pőcze
3a20bcadba pipewire: module-rt: use dbus helpers 2024-02-05 13:03:20 +00:00
Barnabás Pőcze
91a9f816a7 pipewire: module-rt: get rid of unused DBusError
Nothing sets it, so it can be removed.
2024-02-05 13:03:20 +00:00
Barnabás Pőcze
e0ea0574f1 pipewire: module-jackdbus-detect: cancel pending dbus call on module destroy 2024-02-05 13:03:20 +00:00
Barnabás Pőcze
67375965b6 pipewire: module-jackdbus-detect: use dbus helpers 2024-02-05 13:03:20 +00:00
Barnabás Pőcze
499468c19f pipewire: module-portal: cancel pending dbus call on module destroy 2024-02-05 13:03:20 +00:00
Barnabás Pőcze
e7c9b26001 pipewire: module-portal: use dbus helpers 2024-02-05 13:03:20 +00:00
Pauli Virtanen
c387506f63 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-04 12:40:34 +02:00
Pauli Virtanen
1196429c09 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-04 12:40:34 +02:00
Wim Taymans
841c0189df 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-04 11:04:23 +01:00
columbarius
a1615fe6a3 vulkan: Add vulkan-blit-dsp-filter 2024-02-04 09:27:56 +00:00
columbarius
3e3a13c567 vulkan: Add vulkan-blit-filter 2024-02-04 09:27:56 +00:00
columbarius
324ec9df15 stream: conditionally wrap video streams with adapter node
If the property video.adapt.videoconverter is set the video stream
will be wrapped with the videoadapter from the videoconvert spa plugin.

This allows testing the videoadapter and videoconverters while
preserving the current behaviour. Later the chack for this property can
be dropped.
2024-02-03 22:13:03 +01:00
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
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
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
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
Sergio Costas
e8fcaa5157 snap-policy: Manage ENOPROTOOPT error in aa_getpeercon() 2024-01-30 10:28:27 +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
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
978dbff32f doc: fix some doxygen warnings 2024-01-29 08:50:32 +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
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
Wim Taymans
ec825086f1 module-rtp: use helpers to convert between samples and msec
And make sure we don't do any useless float to double conversions.
2024-01-25 15:30:04 +01:00
Wim Taymans
9458367a50 module-rtp: Fix framecount vs ptime check
We should use framecount instead of impl->psamples.
2024-01-25 15:12:25 +01:00
Dmitry Sharshakov
237d282c05 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-24 20:55:03 +03:00
Wim Taymans
e7888d4ccc 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-24 17:53:15 +01:00
Wim Taymans
ccd0599702 conf: add freewheel.wait option, defauls to 10 2024-01-24 17:52:32 +01:00
Mersad Jelacic
831ab5db85 thread: Change warning to info
Change warning to info in impl_acquire_rt() and impl_drop_rt().
2024-01-24 14:52:09 +01:00