Commit graph

6474 commits

Author SHA1 Message Date
Barnabás Pőcze e362a66880 pw-link: do not leak memory 2024-02-27 08:32:56 +00:00
Barnabás Pőcze ca5a342e92 pw-link: use the regex_t objects in struct data 2024-02-27 08:32:56 +00:00
Barnabás Pőcze 431a201d6c pw-link: make mode a proper enum 2024-02-27 08:32:56 +00:00
Barnabás Pőcze 8947ba504e pw-link: use a simple boolean flag to control monitor mode
Monitoring does not interact with the normal modes of pw-link,
so separate it from them.
2024-02-27 08:32:56 +00:00
Barnabás Pőcze 241346d887 pw-link: use union for type specific data
This is safer than using a bare array of `uint32_t` with hard-coded indices.
2024-02-27 08:32:56 +00:00
Barnabás Pőcze 6160615726 pw-link: use proper enum for object types
Using an enum provides better debugging experience and
indicates the purpose better than a bare `uint32_t`.
2024-02-27 08:32:56 +00:00
Barnabás Pőcze 5218afc7e8 pw-link: pass false instead of NULL for bool parameter 2024-02-27 08:32:56 +00:00
Barnabás Pőcze d84101d97f pw-link: free target_link objects at the end 2024-02-27 08:32:56 +00:00
Wim Taymans 09e0113b6a stream: FORCE_RATE should just contain the rate 2024-02-26 22:18:14 +01:00
Wim Taymans c0966f026a modules: prefix network-utils methods with pw_net 2024-02-26 15:17:48 +01:00
dsee 4888b35284 Support IPv6 link-local addresses
Use `getaddrinfo` in `parse_address` instead of `inet_pton`.
Display Ipv6 addresses with scope identifiers correctly in `get_ip`
functions using `if_indextoname`.
2024-02-25 18:20:54 +00:00
Pauli Virtanen 69d69ce757 examples: add MIDI example
There wasn't a MIDI example, so add one.
2024-02-24 20:47:05 +02:00
Wim Taymans 86af9de739 adapter: remove factory.mode property
We can deduce this from the way the node is configured with the
PortParam now.
2024-02-23 16:28:11 +01:00
Wim Taymans 9b4b34b78b conf: add pulse-server option to minimal.conf 2024-02-22 16:14:34 +01:00
Wim Taymans 3c27dcd868 pulse-server: Make sure peer_sink name is filled
Use 'unknown' when we can't find the peer_name. Otherwise we will just
get a protocol error when the node.name is missing.
2024-02-19 17:39:39 +01:00
Wim Taymans 915539e6d4 stream: add n_buffers to debug log 2024-02-19 15:00:04 +01:00
Wim Taymans 94861eb3d6 doc: remove stray \code 2024-02-19 11:06:45 +01:00
Ruben Gonzalez 15bdab89c3 logger: minor performance improvement to avoid syscall done by isatty 2024-02-17 11:42:12 +00:00
Wim Taymans 764ae650e2 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-16 18:16:30 +01:00
Wim Taymans c37c6b0789 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-16 12:53:54 +01:00
Wim Taymans e15b9e7f71 module-rtp: fix debug log 2024-02-16 12:37:40 +01:00
Wim Taymans 09feb8a18c module-rtp: improve ipv5 support
Use the IPV6 versions for loop and ttl. Improve debug.
2024-02-16 09:54:09 +01:00
Wim Taymans 5082e9f458 module-rtp: only stop timer when it was running 2024-02-15 17:48:58 +01:00
Wim Taymans 49e7e3a0f0 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-15 15:31:54 +01:00
Wim Taymans 320eb935a3 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-15 15:18:13 +01:00
Wim Taymans f1a6fabb6c 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-15 11:53:32 +01:00
Wim Taymans a9c0eb993e jack: add jack.other-connect-mode property
Add a new property that controls how connections between other ports are
handled. This can be used to block jack apps from connecting or
disconnecting port they don't own.
2024-02-14 15:09:55 +01:00
Wim Taymans 2807a1eafd impl-node: add node.rules and device.rules
To be able to modify properties of nodes and devices. This is
interesting in the minimal config to give the nodes better defaults.
2024-02-14 12:33:41 +01:00
Dmitry Sharshakov fcea3eee01 pipewire-aes67: clarify comments 2024-02-13 16:47:56 +00:00
Julian Bouzas 0e5bbea36c pw-dot: group nodes by node.link-group 2024-02-13 16:38:48 +00:00
Julian Bouzas 20de0ab96a pw-dot: truncate escaped string values to 128
This avoids objects in the graph being too big if one of their properties has
a long value (Eg 'pipewire.sec.label' in the client objects).
2024-02-13 16:38:48 +00:00
Wim Taymans 59ea4ef897 adapter: move node.params to impl-node.c
Move configuration of initial Params from the adapter to the node to
make it more generally useful.

Add the same device.param config to devices.

This makes it possible to configure the default settings statically
while creating the nodes and devices.
2024-02-13 16:01:10 +01:00
Wim Taymans 4ab3ab6081 impl-device: set quantum-limit correctly
Pass the quantum limit also to the main node.
2024-02-13 15:55:07 +01:00
Wim Taymans 1dc822c999 impl-device: add support for adapter
Make it possible to wrap nodes created by a device in a wrapper such
as adapter.

Update the minimal.conf to use udev to detect and configure devices and
nodes. Add a config switch to switch back to hardcoded config.
2024-02-13 12:03:53 +01:00
Wim Taymans c08c335264 impl-device: add device.object.properties
Instead of copying all the device properties to the child object,
only copy the ones in device.object.properties and add the
ones from the object info.

Clean up the object handles when something goes wrong.
2024-02-13 11:37:21 +01:00
Wim Taymans ee5e1a92be impl-device: add device.id to objects
Add the device.id to the objects created from this device.
2024-02-13 10:01:02 +01:00
Wim Taymans 490d540177 modules: avoid invalid properties access
pw_spa_node_load() takes ownership of the properties so we must not
access it it afterwards, so make a copy of it.
2024-02-12 17:53:44 +01:00
Wim Taymans 513e8fa56f adapter: move adapter.auto-port-config to adapter
Move the handling of the default adapter port config to the adapter
itself.
2024-02-12 17:24:22 +01:00
Wim Taymans efd22efff8 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-12 17:14:33 +01:00
Dimitrios Katsaros 8f59508ecb 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 08:40:49 +00:00
Dimitrios Katsaros 17e6a0709b metadata: handle removed globals in impl 2024-02-12 08:40:49 +00:00
Gleb Popov 571fa73455 Fix uninitialized variable usage 2024-02-10 20:52:31 +03:00
Gleb Popov 6b73cc15da FreeBSD compatibility for module-rtp-sap 2024-02-10 20:52:20 +03:00
Gleb Popov 4ea02f5c80 Fix building module-netjack2 on FreeBSD 2024-02-10 20:52:15 +03:00
Julian Bouzas 64eaaf27ab pw-dot: fix modules not being linked correctly
This fixes a regression caused by commit 0b5cdf3f
2024-02-09 10:54:21 -05:00
Julian Bouzas 02050ae812 pw-dot: support properties with quotes
If a pipewire property has quotes, the DOT graph fails to be generated because
they are not escaped. This patch fixes this by escaping the quotes from a
pipewire property value before adding it to the graph
2024-02-09 14:46:40 +00:00
Julian Bouzas 0b5cdf3fd8 pw-dot: improve allocation of the DOT data string
This changes avoids constantly reallocating the DOT data string every time
someting is added. We now always allocate a DOT data string of size 2048, and
we only reallocate by size * 2 if we need more data.
2024-02-09 14:46:40 +00:00
Demi Marie Obenour 30419c37df Ensure all globals have PW_KEY_OBJECT_SERIAL prop
This avoids the caller having to set this property.
2024-02-09 14:45:05 +00:00
Wim Taymans ac28abbadf 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-09 12:50:46 +01:00
Wim Taymans 27dbbd40c9 tools: improve indentation 2024-02-09 10:24:34 +01:00
Wim Taymans 858d4e9e1c 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-08 18:09:08 +01:00
Jonas Holmberg 4715fa1775 module-rtp: Add source/destination.ip to props
Make it possible to change source.ip in module-rtp-source and
destination.ip in module-rtp-sink.
2024-02-08 09:30:58 +00:00
Wim Taymans 0ea736e144 protocol-native: use props in server and data
Add props to the protocol_data and server. Instead of storing the
server_info, just add the relevant properties for the server to the
props.

When we get a new client, we can simply copy the server props to the
client props. This makes it possible to create specific servers later
that create clients with specific properties.

Use a subset of the context properties to create servers. We only need
the CORE_NAME for now.
2024-02-08 09:53:13 +01:00
Wim Taymans 92f6239597 protocol-native: set error when add_event fails 2024-02-08 09:48:33 +01:00
Wim Taymans 0594b3ac82 metadata: fix indentation 2024-02-08 09:42:13 +01:00
Wim Taymans 1b6370ace1 meson: fix compilation when spa-plugins is disabled
Fixes #3811
2024-02-06 11:50:54 +01:00
Wim Taymans 8657caa0ac 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-06 11:10:27 +01:00
Barnabás Pőcze 5bb2224da3 pipewire: module-rt: add missing static 2024-02-05 20:01:21 +01:00
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
Wim Taymans 306c90618f 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-24 11:22:52 +01:00
Wim Taymans bffcb2e6f1 pulse-server: implement subscribe in device-restore
Add a client that subscribes to the list of subscribers and make the
client watch for EnumFormat changes.

When a subscribed client sees an EnumFormat change for a sink, emit EVENT
to the client.

This will send the EVENT to pavucontrol when the supported IEC958
formats change so that it can update the gui.
2024-01-23 18:08:32 +01:00
Wim Taymans 979eb0278f pulse-server: reset spa_param_info.user after events
After we emited all changed events, reset the user field. This way the
event handlers can check what params are changed.
2024-01-23 18:06:45 +01:00
Wim Taymans ac91c0dc1c pulse-server: implement stream-restore EVENT
Add method to update the client routes. Add an event when the client
routes changed.

Listen for route_changed events on clients that do a subscribe on the
stream-restore extension. Emit an EVENT when the routes change.

This keeps the system notifications volumes in sync between
gnome-control center and pavucontrol and probably in other tools
as well.

Fixes #3805
2024-01-23 13:31:05 +01:00
Wim Taymans d71fb40989 pulse-server: move extension to modules
Add extension support to modules. This is a list of extension commands
that can be performed on the module.

Remove the custom registry of extensions and make proper modules that
implement the extensions.

This is more in line with what pulseaudio does. The advantage is that the
modules actually show up in the module list and that we can use the
module user_data to implement the extension later.
2024-01-23 13:31:05 +01:00
Dmitry Sharshakov bd5af4e573 module-rtp-sap: use autobind 2024-01-22 16:41:06 +00:00
Dmitry Sharshakov 61db1f16e2 module-rtp-sap: sanity check PTP response 2024-01-22 16:41:06 +00:00
Barnabás Pőcze 1274ebe069 Apply 1 suggestion(s) to 1 file(s) 2024-01-22 16:41:06 +00:00
Dmitry Sharshakov 44f1462711 module-rtp-sap: fix strncpy bounds 2024-01-22 16:41:06 +00:00
Dmitry Sharshakov 9a0499b64d module-rtp-sap: fix fd leak 2024-01-22 16:41:06 +00:00
Dmitry Sharshakov 401df6e199 module-rtp-sap: review
Co-authored-by: Barnabás Pőcze <pobrn@protonmail.com>
2024-01-22 16:41:06 +00:00
Dmitry Sharshakov 7abb896aef module-rtp-sap: support PTP management protocol
Request current clock sync status to know the grandmaster identity for SAP announcements
2024-01-22 16:41:06 +00:00
columbarius 7d97e47e28 videoconvert: Enable loading external converter plugins
Load the converter from the video.adapt.converter property.
2024-01-22 13:59:16 +00:00
Wim Taymans 7479ff586c stream: debug added params 2024-01-17 09:55:47 +01:00
Wim Taymans 94cde3090e stream: delay emit param changes when inside emit_param_changed
When we are notifying the application of changed params, don't emit any
changes applied to the params from within the callback with
pw_stream_update_params(). This will be done after we complete the
callback.

This also avoids reseting the change counter so that we don't
accidentally think we updated the formats param when we simply changed
some other params.
2024-01-16 16:41:15 +01:00
Wim Taymans 2242ab66dc impl-port: res > 0 means the param was modified
Only log the error when the res < 0, otherwise the param was accepted bu
modified.
2024-01-16 16:35:50 +01:00
Wim Taymans a00981ec20 module-rtp: clarify some docs 2024-01-16 15:48:24 +01:00
Jonas Holmberg da8e207de9 module-rtp-source: Use source.ip for unicast
Only listen for packets from source.ip in the unicast (v4) case by
calling connect(). If packets from any source address is wanted, set
source.ip = "0.0.0.0".
2024-01-16 14:44:00 +00:00
Wim Taymans a769a014e0 stream: rename requested to size in pw_time
Now that both the expected input and output of the resampler is placed
in the rate_match, rename the 'requested' field in pw_time to 'size'
and update the docs.

See #3750
2024-01-16 15:11:08 +01:00
Wim Taymans a1ecfc8d7f tests: fix ABI check for new pw_time 2024-01-15 15:53:19 +01:00
Wim Taymans 1bbaf270f8 stream: add resample size to pw_time
Now that the resampler input size is set in the io_rate field when we
start we can add it to the pw_time struct as well.

This way we can know the required resampler input without having
to dequeue a buffer. This can be handy when the stream is a driver
and needs to know how much data to accumulate before starting the graph.

See #3750
2024-01-15 15:35:33 +01:00
Sergio Costas Rodriguez 8c3cfab17b Replace even more spaces with tabs 2024-01-12 11:35:17 +00:00
Sergio Costas Rodriguez e1571404d7 Replace more spaces with tabs 2024-01-12 11:35:17 +00:00
Sergio Costas Rodriguez 6506bb2f44 Replace spaces with tabs 2024-01-12 11:35:17 +00:00
Sergio Costas Rodriguez fda4addf1e Fix spacing when calling functions 2024-01-12 11:35:17 +00:00
Sergio Costas Rodriguez 1c9016280c Move add_permission definition inside block 2024-01-12 11:35:17 +00:00
Sergio Costas Rodriguez 67b9e9c4e8 Move context variable definition inside block 2024-01-12 11:35:17 +00:00
Sergio Costas Rodriguez 18d0e2e850 Move variable definition inside block 2024-01-12 11:35:17 +00:00
Sergio Costas Rodriguez 1728b7de59 Better error logging if getting connections fails 2024-01-12 11:35:17 +00:00
Sergio Costas Rodriguez ae11e61105 fix possible leak
If pw_check_flatpak() sets app_id, its value will leak when
calling pw_snap_get_audio_permissions(). This patch fixes
this.
2024-01-12 11:35:17 +00:00
Barnabás Pőcze abc4bd111b Apply 1 suggestion(s) to 1 file(s) 2024-01-12 11:35:17 +00:00
Sergio Costas Rodriguez b054bc2591 Use assert to check client is not NULL 2024-01-12 11:35:17 +00:00
Barnabás Pőcze c34bd9575f Apply 1 suggestion(s) to 1 file(s) 2024-01-12 11:35:17 +00:00
Barnabás Pőcze 69b093ebf1 Apply 1 suggestion(s) to 1 file(s) 2024-01-12 11:35:17 +00:00
Sergio Costas Rodriguez 5e20a2d570 Add missing files
Accidentally, I forgot to add snap-policy.* files.
2024-01-12 11:35:17 +00:00
Sergio Costas Rodriguez d568dcd64f pipewire-pulse: add snap permissions support
SNAP containers have two main "audio" security rules:

 * audio-playback: the applications inside the container can
   send audio samples into a sink

 * audio-record: the applications inside the container can
   get audio samples from a source

Also, old SNAP containers had the "pulseaudio" rule, which just
exposed the pulseaudio socket directly, without limits. This
is similar to the current Flatpak audio permissions.

In the pulseaudio days, a specific pulseaudio module was used
that checked the permissions given to the application and
allowed or forbade access to the pulseaudio operations.
With the change to pipewire, this functionality must be
implemented in pipewire-pulse to guarantee the sandbox
security.

This patch adds support for sandboxing permissions in the
pulseaudio module, and implements support for the SNAP audio
security model, thus forbiding a SNAP application to record
audio unless it has permissions to do so.

The current code for pipewire-pulseaudio checks the permissions
of the snap and adds three properties to each new client:

 * pipewire.snap.id: contains the Snap ID of the client.

 * pipewire.snap.audio.playback: its value is 'true' if the client
   has permission to play audio, or 'false' if not.

 * pipewire.snap.audio.record: its value is 'true' if the client
   has permission to record audio, or 'false' if not.

These properties must be processed by wireplumber to add or
remove access permissions to the corresponding nodes. That
code is available in a separate patch: https://gitlab.freedesktop.org/pipewire/wireplumber/-/merge_requests/567
2024-01-12 11:35:17 +00:00
Wim Taymans adbd081b12 array: improve pw_array
Handle extend == 0 and don't expand the array but return -ENOSPC.
This makes it possible to handle static arrays, make a function to
make this easier. Remove pw_array_add_fixed() now that we support
this with extend==0 and because it was not used.

Round up the required space to next extend so that the total allocated
size if always a multiple of the extend.

Make pw_array_add_ptr() check for allocation errors instead of crashing.
2024-01-12 12:06:13 +01:00
Demi Marie Obenour 0f533c6d64 docs: Multiple clarifications to documentation
See !1817
2024-01-12 11:55:28 +01:00
Barnabás Pőcze d8ab51a9fc pw-top: use media.name as display name
Try to use `media.name` as the display name for a node
when none of the other keys are found in its properties.

For example, `pw_stream_new_simple()` only sets `media.name`
on the created node object by default.
2024-01-12 02:12:55 +01:00
Barnabás Pőcze 9d439bac06 pw-top: update name when it changes
Recalculate the display name for a given node after its properties change.
2024-01-12 01:47:05 +01:00
Wim Taymans 9a5609de2b modules: move some spa_debug_mem to the log
Instead of dumping to stderr, write it to the log file.
2024-01-11 17:49:50 +01:00
Wim Taymans 3baba76c77 pulse-server: improve message debug
Add prefix to messages to mark sent and received messages.
Send mem debug to log instead of stderr.
Log the complete message and debug the command.
2024-01-11 12:05:29 +01:00
Wim Taymans d0a2e6316b spa: small cleanups
Initialize result variable.
Use strncpy to avoid warnings about using non-NULL terminaded strings.
2024-01-10 15:51:01 +01:00
Barnabás Pőcze e2d3f9140b pw-reserve: fix potential DBusMessage memory leak
Our reference to the message must always be dropped,
even if `dbus_connection_send()` fails.
2024-01-08 10:55:02 +00:00
Barnabás Pőcze 72d5417857 pw-reserve: use arg0namespace for dbus match rule
Only names in the `org.freedesktop.ReserveDevice1` namespace
are interesting for the purposes of device reservation, so
use `arg0namespace` in the dbus match rule to filter out others.
2024-01-08 10:55:02 +00:00
Wim Taymans 3da66734bd modules: add reconnect support to module-pulse-tunnel
When the pulse connection is broken, reconnect with the given interval.

Add the reconnect_interval_ms property to the pulse modules.
2024-01-05 13:34:19 +01:00
Wim Taymans b4be094be8 doc: clarify rlimits conf file
Fixes #3760
2024-01-05 10:22:28 +01:00
Wim Taymans 370bf7206b pulse-server: add pipewire-pulse:log-level message
Add a /core message to set the log level of the pulse-server.

An alternative would be to watch the settings metadata and follow the
server settings. This is however less flexible so the custom message
was chosen.
2024-01-04 17:43:53 +01:00
Wim Taymans a3c6b3acae log: add pw_log_topic_custom_enabled()
Add a function to check if a specfic custom log level has been defined
for a topic.

We can use this to dynamically check if we need to do the connection debug
messages.

We can also get rid of the conn.* pattern hack to disable connection
messages by default.
2024-01-04 17:40:57 +01:00
Wim Taymans 5152c98789 log: store log level in topics
When there is no specific level for a topic we store the global log level
in the topic level. Make sure this invariant is preserved when the
the global log level is updated.

We can then simply update the log level after we processed the log level
string to update all topics.

This should also make it possible to just use the level from the topic
in all cases and remove a check.
2024-01-04 17:30:21 +01:00
Demi Marie Obenour 76de766cd8 Draft: Allow calling trigger_done from the RT thread
This allows streams to know when the graph is finished and they can
safely drive it again.

Fixes: #3759
2024-01-04 10:21:16 +00:00
Pauli Virtanen 961d0cfdc1 log: make pw_log_topic_register/unregister threadsafe
Make the topic registration/unregistration threadsafe, as they can be
called from constructors of static objects which don't necessarily run
in the main loop thread.
2024-01-04 10:02:55 +00:00
Pauli Virtanen fb2d05aa61 log: make pw_log_set_level_string public API 2024-01-04 10:02:55 +00:00
Pauli Virtanen dd8d5e1bed log: make PW_LOG_TOPIC / PW_LOG_TOPIC_STATIC magical
Have PW_LOG_TOPIC / PW_LOG_TOPIC_STATIC emit GCC constructor/destructor
functions that register/unregister the log topic as needed.
2024-01-04 10:02:55 +00:00
Pauli Virtanen 3d974d3256 pipewire: register/unregister log topics from SPA plugins
Register enumerated log topics from SPA plugins on plugin load, and
unregister them on plugin unload.
2024-01-04 10:02:55 +00:00
Pauli Virtanen 3cff30c651 log: support dynamic log levels for registered log topics
Handle log level patterns in libpipewire instead of the SPA logger.

This allows dynamically changing the log levels also for log topics,
which we do when log.level metadata changes.

The syntax for PIPEWIRE_DEBUG and log.level in config files and metadata
is now the same.
2024-01-04 10:02:55 +00:00
Wim Taymans 8f66df2f78 pulse-server: call update_object_info in manager_added
get_device_info() requires us to call update_object_info() in the added
and updated events.

Fixes a bug where the properties were invalid in the avahi txt record.
2024-01-04 10:43:03 +01:00
Wim Taymans 0fd0582514 protocol: don't allow NULL event or command
If causes crashes when the handlers try to get the ID.
2024-01-03 14:05:39 +01:00
Barnabás Pőcze 8aaba4fec3 pipewire: module-loopback: fix delay buffer memory leak 2023-12-28 16:47:23 +01:00
Barnabás Pőcze c130ec9de9 pipewire: log: fix concatenation in log topic macros
`__LINE__` was not expanded previously. Fix that.
2023-12-26 16:03:29 +00:00
George Kiagiadakis 5a130ddd73 gstpipewiresrc: break out of wait_started() also on STATE_UNCONNECTED
When the session manager sends an error to the client, it typically
also destroys the node after the error, which causes the stream to go
to STATE_UNCONNECTED via proxy_removed(). In that case, make sure
we exit the loop early, otherwise it will take 30 seconds to unblock
gst_element_set_state()

This is a revised version of the fix that was commited via !1763
and then reverted, as it was problematic. Now the code ensures
that it breaks out only if the state was previously CONNECTING
or higher.
2023-12-26 16:01:44 +00:00
Michael Tretter 03173530da gst/pipewiresink: fix dts_offset
GStreamer uses a time stamp for the decoding time, but PipeWire uses an
offset to the presentation time. Thus, the pipewiresink must not use the
DTS as dts_offset, but has to calculate the offset.

If the buffer's DTS is invalid, assume that dts is pts.
2023-12-21 15:11:56 +01:00
Wim Taymans 92ac9a355f impl-node: handle priority.driver changes
When the driver priority changes, remove and add the node into the
driver list to keep the list sorted. Also trigger a graph recalc.
2023-12-20 12:39:19 +01:00
Dmitry Sharshakov a7410fe1bf module-rtp-sap: refactor channelmap generation 2023-12-20 09:35:22 +00:00
Dmitry Sharshakov aca4d93b31 module-rtp-sap: properly serialize custom channelmaps 2023-12-20 09:35:22 +00:00
Dmitry Sharshakov 2e14f3d97a module-rtp-sap: only override NTP value in the timing line
That is indeed 0 for nearly any device. However the NTP value in the session identification part plays a crucial role for distinguishing between streams in some implementations, e.g. Dante.
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov 420ab8ed89 module-rtp-sap: add session number to the NTP value
Dante Controller does not recognize next stream having the same NTP value. Work around that by adding current number of sessions to the time and the magic value.

Co-authored-by: Dewi Seignard <dewiweb@gmail.com>
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov 57985e5aea module-rtp-sap: set source-filter up
Might enhance support for some devices or otherwise useful.

Co-authored-by: Dewi Seignard <dewiweb@gmail.com>
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov caabc074c8 module-rtp-session: remove outdated FIXME
rtp-sink already handles DSCP and uses profile 41 by default
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov 76addb3eaa pipewire-aes67: default to NTP 0
Follow other devices to ensure best compatibility
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov eab90d6029 module-rtp-sap: allow overriding NTP value
It seems like most devices use value 0 there, so for further enhanced compatibility it's preferred to do so as well
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov 065e819f18 TODO: module-rtp: buffering for sender
This should be done to match packet size requirements (e.g. 1 ms) while allowing user's software to run at higher buffer size to not stutter.

This will require scheduling multiple rtp_audio_flush_packets calls per one rtp_audio_process_capture call
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov 066e8e1c63 module-rtp-sap: add a way to add extra attributes to SDP
Useful for new device bringup without rebuilding PW
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov 1fe6feac56 module-rtp: improve logging priorities
Previous state was useless for real debug at the current implementation level
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov c75f6219dc module-rtp-sap: add notices about different channelmap formats used by different hw 2023-12-20 09:35:22 +00:00
Dmitry Sharshakov 873e6119b8 module-rtp: handle framecount attribute 2023-12-20 09:35:22 +00:00
Dmitry Sharshakov 2525a99b97 module-rtp-sap: parse ptime from incoming streams 2023-12-20 09:35:22 +00:00
Dmitry Sharshakov 6a64ec8b8f module-rtp-sap: send out a default channelmap if none specified
RAVENNA devices (at least Lawo) seem to error out on streams without this property

Co-authored-by: Dewi Seignard <dewiweb@gmail.com>
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov c66aad9a7c pipewire-aes67: improve the config 2023-12-20 09:35:22 +00:00
Dmitry Sharshakov 533161a766 module-rtp: add framecount to the SDP
Required for RAVENNA hardware.

Co-authored-by: Dewi Seignard <dewiweb@gmail.com>
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov 8c4cfa57b6 pipewire-aes67: use interface name as default PHC
If it's wrong the service won't start anyway because of socket bind failure
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov e4a9f800c8 pipewire-aes67: recommend using ifname
It's better for PHC identification in multi-NIC systems. PHC numbering might be dependent on the probe order yet no bugs was observed. Still recommend this for more comfortable configuration.

Also added some guidance on what must be changed
2023-12-20 09:35:22 +00:00
Duncan Overbruck fffda6b6d1 pulse-server: fill in active port for monitors
The monitor sources also list the port of the sink and so the active
port needs to be collected as well so it doesn't fall back to the first
port (which might not be available).
2023-12-20 10:15:06 +01:00
Mark Gallagher bd87902da6 Add a build option to specify whether pulse gsettings schema should be installed 2023-12-16 21:10:00 +01:00
Mark Gallagher ee42a6868d Add pulseaudio gsettings schema 2023-12-16 21:09:17 +01:00
Wim Taymans ecf4b071e5 gst: keep track of node ports
Keep a list of ports for the node. When the node goes away, clear the
port links to the node. Handle the case where the port no longer has a
node.

This avoids a crash when, for example, the node permission is removed
and the port points to the now freed node_data.

Fixes #3708
2023-12-14 13:00:00 +01:00
Wim Taymans 5eb1f35997 gst: remove unused pending list 2023-12-14 12:59:04 +01:00
Wim Taymans 06d6551cc1 pulse-server: handle errors in echo-cancel geometry
Check for errors when loading the geometry instead of silently failing.
The points need to be given in the user locale and so might fail to
parse when given in JSON format.

Format the geometry nicely when loading the module.
2023-12-14 12:16:29 +01:00
Wim Taymans 5e750f6fb8 modules: place floats in properties in JSON format
Using %f will result in a locale dependent format and might not parse
with JSON parsers or even our own spa_atof() function.
2023-12-14 11:50:30 +01:00
Christian Glombek c386c96ff0 module-raop-discover: Skip tunnel creation for link-local addresses
Some Apple devices will advertise their link-local address via mDNS.
Ignore these mDNS entries.
2023-12-14 10:14:33 +00:00
Christian Glombek c0f018e0f4 module-raop-sink: Destroy module on RTSP error
Avoid continuation of the stream on error more rigorously.
2023-12-14 10:14:33 +00:00
Christian Glombek dc82bc5086 module-raop-discover: Remove unused raop.ip.version prop
Some AirPlay devices will announce their IPv4 addresses
over IPv6 mDNS if both are available, so the determined
IP version was not reliable.

The prop is not used by module-raop-sink, so its
removal should be safe.
2023-12-14 10:14:33 +00:00
Wim Taymans 6045ce87b1 module-pipe-tunnel: avoid bitfield data race
Move the have_sync bitfield away from the other bitfields because they
are written from different threads and might cause a data race.

Fixes #3706
2023-12-13 12:48:51 +01:00
Barnabás Pőcze 70b224f1c2 pipewire: data-loop: set thread name
Set the name of the thread running the data loop to "pw-data-loop"
for easier identification in debuggers, htop, etc.
2023-12-12 15:58:51 +00:00
Wim Taymans e4d6cca32a raop: use default 1500ms latency again
Use 1500ms as the default latency and use the raop.latency.ms to
configure a smaller value.

Fixes #3605
2023-12-11 16:33:51 +01:00
Wim Taymans cda2522384 raop: add option back to set custom latency 2023-12-11 16:10:06 +01:00
Wim Taymans ae045ef3f6 raop: use 1500ms of latency as fallback
The Pro Link 1 replies with Audio-latency=0, patch that up to
1500ms to make it work again.

Previously it configured 1500ms as the default latency but that seems
unnecessary in the usual case.

Fixes #3698
2023-12-11 16:07:57 +01:00
Wim Taymans 283c215641 stream: make empty objects remove the PARAM
Make sure that NULL params don't cause -EINVAL but ignore them.

Don't add empty param objects. this makes it possible to clear all previous
params by setting an empty object.
2023-12-11 13:01:10 +01:00
Wim Taymans 971bc8a249 modules: make sure we don't overrun our array
Limit the max number of params to 512 and make sure we don't collect
more.
2023-12-11 12:53:40 +01:00
Wim Taymans 6cda416e71 modules: always add the Props param
We always need to add the Props param because it contains the
debug.aec.wav-path key, which is always available, even when the AEC
implementation has no properties.

Also add the debug.aec.wav-path PropInfo.
2023-12-11 12:02:58 +01:00
Wim Taymans 658b624a83 modules: reuse the same code for setting properties
We can reuse the same code for setting input and output stream
properties. This also makes it possible to set the debug.aec.wav-path
on all streams, like the properties say.
2023-12-11 12:00:43 +01:00
Wim Taymans fbaf4db6b0 modules: add source ip and port in stream props 2023-12-11 10:04:14 +01:00
Wim Taymans f31d87cfee modules: return -EINVAL on invalid port 2023-12-11 10:03:51 +01:00
Pauli Virtanen 4e2057930f pulse-server: update all params only after enumeration complete
For params that don't emit change events, the param enumeration does not
start core sync, and its enumeration may be incomplete if a previous
core sync completes first.

Fix by always starting a core sync if we are updating params.

This fixes dev_info.active_port being sporadically SPA_ID_INVALID if
there is event pressure, which causes do_set_volume randomly set the
volume on the node instead of setting it on the device.  This can be
triggered e.g. by shaking the volume slider in Pavucontrol with mouse.
2023-12-09 11:23:25 +00:00
Pauli Virtanen 9d779300af context: support letter codes for log.level
Letter codes instead of numbers for log levels are allowed in
PIPEWIRE_DEBUG.

Support them also for log.level in context properties and metadata.

Add a few alias letter codes to harmonize them with what WirePlumber 0.5
supports.
2023-12-09 10:26:26 +00:00
Wim Taymans 9c6d310297 conf: fix comment node.always-driver -> node.always-process
Fixes #3696
2023-12-08 17:20:31 +01:00
Wim Taymans cfd422854f module-x11-bell: force pulse backend
The libcanberra ALSA backend has some races and causes crashes, we
should try to not use that one.

Fixes #3688
2023-12-05 16:20:40 +01:00
Michael Tretter 6a68c87b19 gst/pipewiresink: remove special case for size 0
There is no need for a special case with size 0. If size is 0, we can
also write the size instead of 0 to the buffer.
2023-12-05 14:44:56 +00:00
Michael Tretter 0bda84bca1 gst/pipewiresink: replace tabs with spaces
Tabs and spaces are mixed for indentation in the pipewiresink. Replace
all tabs with 8 spaces although indentation is 2 spaces, since that
looks like the intended indent.
2023-12-05 14:44:56 +00:00
Michael Tretter 49b971b5b1 gst/pipewirepool: change acquire/release to log messages
The messages are printed for every buffer. Therefore, they should be log
messages. Also add the bufferpool to the message to be able to identify
the bufferpool that handles the buffers.
2023-12-05 14:44:56 +00:00
Michael Tretter 5f916d8a2d gst/pipewirepool: print buffer type as debug message
The buffers are added to the pipewirepool during setup. Therefore, they
should be debug messages. As at it, use the debug helper to print the
string of the buffer type.
2023-12-05 14:44:56 +00:00
Wim Taymans 425c849042 avoid compiler warning 2023-12-04 12:24:24 +01:00
Barnabás Pőcze 539115fc59 pipewire: module-filter-chain: dsp_ops_init(): take cpu_flags
Instead of relying on the caller to initialize `dsp_ops::cpu_flags`,
take it as an argument.
2023-12-02 20:24:33 +00:00
Barnabás Pőcze 75c77b9116 pipewire: module-filter-chain: builtin_plugin: fix filename leak
The `filenames` array must be cleared before the `samples == NULL`
check otherwise the `strdup()`ed strings will be leaked in case
of failure.
2023-12-02 20:24:33 +00:00
Wim Taymans 94f898ddc5 stream: check requested before use
It can be 0 and so we should fill the complete buffer.

Fixes #3683
2023-11-30 11:10:47 +01:00
Wim Taymans 0a7f8128a3 stream: don't confuse frames/samples in docs
See #3683
2023-11-30 11:10:19 +01:00
Wim Taymans 6c772a1843 module-pulse-tunnel: don't block the main thread
Do the pulse context and stream connect async so that we don't have to
block the main thread.

Fixes #3221
2023-11-30 10:42:48 +01:00
Thomas Weißschuh 6ae9698ebc pipewire: mem: try to create non-executable memfds
Executable memfds can be a security issue.

The kernel warns about them like the following:
pipewire: memfd_create() called without MFD_EXEC or MFD_NOEXEC_SEAL set

Explicitly create all memfds a non-executable as they are not meant to
be executed, similar to the other possible backing filetypes.
2023-11-29 17:59:14 +00:00
Pauli Virtanen 08a4590070 module-access: recognize "allowed" as legacy alias for "unrestricted"
Previously, it was an alias for "unrestricted" so support that still if
access.legacy=true.
2023-11-29 18:44:49 +02:00
Dmitry Sharshakov ac3bdeba4e aes67: bump PTP0 driver priority
As reported in #3217, PTP driver has to have the highest priority for packets to arrive in time

Everything connected to AES67 should be clocked by the Grandmaster clock
2023-11-29 15:40:32 +00:00
Wim Taymans 1a83ce0908 module-loopback: improve channel remapping support
Convert capture and playback streams to any global channel position that
has been set. This can then be used to implement an upmix sink and add
such an example config.
2023-11-29 16:07:54 +01:00
Wim Taymans 088d741cda stream: notify caller of partial set_param success
When we get a Format update during a Format set_param, return > 0 to the
caller so that it knows we modified the param to something else.

This can be used to fixate or deny updates to Format params in the
stream and have the adapter adapt to this.
2023-11-29 15:06:05 +01:00
Wim Taymans b9e5dde4ac client-node: keep target fd up to date
Keep the target and source fd in sync when we get the new fd from the
server in remote-node.

This makes it possible to refactor some things and only schedule nodes
by triggering the target.
2023-11-28 16:23:00 +01:00
Pauli Virtanen b12119da28 pw-reserve: require valid name + check rd_reserve_new errors
Empty name in rd_device_new triggers assert inside DBus, so bail out
before that.
2023-11-28 10:26:43 +00:00
Pauli Virtanen 422c270a74 meson.build: fix compile with -Dexamples=disabled 2023-11-28 10:18:25 +00:00
Wim Taymans a336aabe43 stream: pass properties to context_new
Whe  using pw_*_new_simple(), pass the properties to the automatically
created context as well so that we can configure it.

This makes it possible to, for example, load the client-rf.conf using the
simple API as well.
2023-11-24 10:12:49 +01:00
Barnabás Pőcze d88def09bd pipewire: module-roc-{sink,source}: add rudimentary ROC_INTERFACE_AUDIO_CONTROL support 2023-11-23 17:21:39 +01:00
Barnabás Pőcze b19d0ffbc3 pipewire: module-roc-source: use SPA_NSEC_PER_MSEC instead of hard-coding 2023-11-23 15:12:50 +01:00
Barnabás Pőcze b5e898ee83 pipewire: module-roc-{sink,source}: do not remove from argument property list
The property list is destroyed and not kept around, not passed
to any other component, so this is unnecessary work.
2023-11-23 15:12:50 +01:00
Barnabás Pőcze 68c0a13694 pipewire: module-roc-{sink,source}: pass 0 to pw_properties_get_uint32()
There is no reason to use `data->rate` as the default value
since it will be zero, so just pass 0 explicitly.
2023-11-23 15:12:50 +01:00
Barnabás Pőcze 0a3bd825cd pipewire: module-roc-{sink,source}: remove props member
The `props` member was not used at all, so get rid of it.
2023-11-23 15:12:47 +01:00
Barnabás Pőcze 6d8a31a3e4 pipewire: module-roc-{sink,source}: deduplicate protocol selection 2023-11-23 14:12:35 +01:00
Barnabás Pőcze 333fd8d2ae pipewire: module-roc-{sink,source}: port to ROC v0.3.X
ROC 0.3 introduced breaking changes, so adjust the code.
Also set the minimum supported ROC version to 0.3.0.

Fixes #3667
2023-11-23 14:12:35 +01:00
Barnabás Pőcze 5d62bf5c06 pipewire: daemon: do not set G_LOG_DOMAIN
GLib has not been used for logging for a long time,
so setting this macro has no effect and is unnecessary,
so remove it.
2023-11-23 11:57:45 +00:00
Wim Taymans c4cd8fa73d impl-client: don't log warning when updating ignored keys
If a client tries to update an ignored key, don't log a warning. Only
log a warning when one of the security properties changed.

This is what we used to do before commit
0dfa05117b

It fixes a warning when a stream disconnects and reconnects because
the serial.id changed.
2023-11-23 12:29:55 +01:00
Arun Raghavan 63bb128948 rtp-stream: Set rtp.ptime on senders not receivers
The pw_stream direction is inverted from what we want (input => sender).
2023-11-23 01:28:20 -05:00
Barnabás Pőcze aa681365c3 pipewire: module-filter-chain: fix buffer memory leaks
`impl::{silence_data,discard_data}` were not freed either
in case of an initialization error or graceful shutdown.
2023-11-23 05:50:17 +00:00
Barnabás Pőcze 2738bb4cb7 pipewire: remove pw_in_valgrind()
This function is very much orthogonal in function to the usual
features provided by pipewire, and there does not seem to be any
3rd party users based on Debian Code Search and GitHub.
So let's remove it before any 3rd party users start depending on
pipewire for their valgrind detection.
2023-11-22 23:05:03 +01:00
Barnabás Pőcze 3deaa2b0df pipewire: impl-module: respect PIPEWIRE_DLCLOSE
Commit b5c21c1fbc ("pipewire: use dlclose unless PIPEWIRE_DLCLOSE is set to false")
introduced the PIPEWIRE_DLCLOSE environmental variable to
force/prevent the dlclose()ing of shared objects. However,
native pipewire modules were not adjusted to respect its value,
and instead have been still using `pw_in_valgrind()` to
determine whether or not they should be unloaded.

Fix that by adding a private `pw_should_dlclose()` function
and using that in impl-module.c:pw_impl_module_destroy().
2023-11-22 22:58:00 +01:00
Wim Taymans de954655bc modules: fix doc 2023-11-22 17:48:05 +01:00
Wim Taymans bb82ddb601 Fix a warning
../src/modules/module-rt.c:615:21: warning: suggest parentheses around
assignment used as truth value [-Wparentheses]
2023-11-22 16:17:08 +01:00
Jonas Holmberg 72323dcaf3 module-rt: Protect setrlimit() with mutex
Make sure threads initializing the module doesn't get/set RLIMIT_RTTIME
simultaneously.
2023-11-22 13:56:15 +00:00