Destroy the bound node proxies in probe() and stop() while the loop is
locked, before releasing the core. This removes the node listeners so no
node_event_info can fire after the core is gone, fixing the root cause of
the resync() NULL-deref crash and a node-proxy leak.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
basesrc will do caps negotiation if pad is reconfigured. Should check and
wait if caps negotiation is currently in progress before corking the stream.
Return true when flushing to avoid caps negotiation failure.
Make this more useful by adding the capture and playback latency.
This structure can be used to say how much latency there is between the
capture and playback hardware.
Make it possible to pass context to plugins and nodes in the
filter-chain.
We can use this to make filters aware of the graph clock or
latency, for example.
Make instantiate create all the related handles in one go.
When a processing node has 1 in/out, multiple handles are created to
support multichannel. By instantiating the handles in one go, the
implementation could do some special multichannel support or do some
optimizations, like parse the config string only once.
Instead of returning a handle (and errno on NULL), return a result code
and store the handle in a return variable.
This makes it easier to handle the errors but also makes it possible to
return multiple handles later.
A forced setup_filter_graphs() deactivates and re-instantiates every graph,
which frees and recreates the underlying plugin handles (node_cleanup sets
node->hndl[i] = NULL before re-instantiating). This was done on a graph that
was still referenced by the RT data-loop snapshot (filter_graph[]), so the
RT thread could run a graph whose handles were NULL mid-rebuild, leading to a
NULL handle dereference in the filter-graph process path.
Mirror the safe ordering already used by load_filter_graph()/clean_filter_handles():
before reconfiguring, mark the graphs not-setup and sync_filter_graph() so the
data loop drops them from filter_graph[] under the loop lock. They are
republished by the sync that follows setup. The cheap snapshot swap is done
under the lock; the heavy re-instantiation stays off the RT path.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The drawio-exported SVGs used light-dark() CSS to switch text between
black and white based on color scheme. This caused white-on-light text
when viewing in dark mode. Replace all light-dark() values with their
light-mode equivalents so text and strokes are always black.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Escape <portname>, <tensorname>, <paramname>, <port>, <rules> and
similar angle-bracket placeholders that doxygen interprets as HTML
tags. Also escape @filename (unknown doxygen command) and fix the
pw_stream::process() reference in thread-loop.h.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- modules.dox: remove references to non-existent sendspin modules
- access.dox: remove reference to deprecated pipewire-media-session
- dma-buf.dox: fix \ref EnumFormat to \ref SPA_PARAM_EnumFormat,
fix \ref struct to struct \ref for spa_meta_sync_timeline
- pipewire.conf.5.md: add explicit {#synopsis} anchor for internal links
- pipewire-client.conf.5.md: fix audio_converter to audio_adapter ref
- pipewire-jack.conf.5.md: escape <id> HTML tags
- pipewire-props.7.md: fix monitor-prop__ to props__ for card profiles ref
- pipewire-pulse.1.md: fix pipewire-env ref to full anchor name
- pipewire.1.md: fix \ref CPU to \ref spa_cpu
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prefix all pulse module source files with pulse- to give them unique
basenames, avoiding ambiguous \file suffix matching in doxygen when
identically-named files exist under src/modules/.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Handling pending RegisterProfile callbacks was wrong as it forgot that
there can be multiple profiles to be registered.
Fix the handling by allowing several concurrent register callbacks.
No params are implemented, so remove them from the emitted `spa_device_info`.
For v4l2, `n_params` was already set to 0 in 938e2b1451
("v4l2: profiles params are not implement yet"), effectively removing them.
No implementation has materialized in the last 5 years, so remove them
altogether, and do the same in the libcamera plugin as well.
When a single output port is linked to multiple input ports of the same
client and the client uses multiple threads to process the input ports,
get_buffer_output() is called from multiple threads concurrently and
causes a race.
Multiple threads will try to dequeue a buffer concurrently and set the
HAVE_DATA io status, which causes the port to run out of buffers quickly
and the io are to become corrupted.
Use CAS to make sure only one thread dequeues and sets the io status.
The other concurrent threads will spin until there is a buffer. The fast
path will be that the buffer is already dequeued and then it is simply
reused.
Fixes#5324
When inspecting the loaded modules, actually list the properties that
were used when loading the module instead of the informational generic
ones from the info.
Pulsaudio also does not list the Usage properties when listing modules.
Add some more fields like the type, default value and possible enum
values for the module_args.
Use this to generate the Usage in describe-module and the docs.
This should give more consistent and correct Usage output in all
modules.
Use spa_json_begin_array() instead of the relaxed variant when parsing
property values in pw_conf_find_match().
This prevents plain string values containing ':' (such as object.path)
from being incorrectly tokenized while preserving support for actual
JSON array properties.
`SPA_PARAM_BUFFERS_blocks` is a specific value, the plugin host should
not use any other number of data planes, so reject other values.
For example, the `buffers[i]->n_datas > planes.size()` situation was
not handled correctly, and this removes the need for handling that.
Expose the libcamera header and library versions in the device properties
similarly to `api.v4l2.cap.version` used by the v4l2 plugin.
The keys are not yet promoted into the public `keys.h` header file.
There was one file "libcamera.c" that was a C source file, which
prevents the addition of C++ functions, includes, etc. to "libcamera.h".
So compile that file as C++ as well.
This makes it possible to dynamically add / remove receivers, which is
necesary for sending to multiple receivers. Mixed multi- and unicast
receivers are possible. Example pw-cli calls (56 is the ID of the RTP
sink node):
pw-cli c 56 User '{ extra="{ \"command.id\" : \"add-receiver\" , \"destination.ip\" : \"10.42.0.1\", \"destination.port\" : 55001 }" }'
pw-cli c 56 User '{ extra="{ \"command.id\" : \"remove-receiver\", \"destination.ip\" : \"10.42.0.1\" }" }'
pw-cli c 56 User '{ extra="{ \"command.id\" : \"clear-receivers\" }" }'
Commands and their arguments:
* "add-receiver" : Adds a receiver to the sink's list. If the given
IP address <-> port combination was already added, the command is
logged, but otherwise ignored. Arguments:
- "destination.ip" : IP address to send data to. Can be a uni- or
multicast address, but must be a valid address.
- "destination.port" : Port to send data to. Must be valid.
- "local.ifname", "source.ip", "net.ttl", "net.dscp", "net.loop" :
These are all optional, and work just like in the RTP sink
module's properties.
* "remove-receiver" : Removes a receiver from the sink's list. The
receiver is identified by the given IP address. A port can optionally
be specified as well. If it isn't, then the first receiver with that IP
address is removed. If no matching receiver is in the sink's list,
this command does nothing. Arguments:
- "destination.ip" : IP address to send data to. Can be a uni- or
multicast address, but must be a valid address.
- "destination.port" : Port to send data to. This is optional. But, if
it is set, it must be a valid port number.
* "clear-receivers" : Removes all receivers from the sink's list. If the
list is empty, this does nothing. This command has no arguments.
If the RTP sink module is created with the "destination.ip" and
"destination.port" properties set, it behaves as if "add-receiver" were
called right after the module was initialized. This means that if none
of these commands are used, the module behaves just as it did prior to
this patch. Note that the "remove-receivers" command can remove this
initial receiver as well.
If no receivers are added, the module continues to work normally.
Adding and removing receivers mid-operation is supported.
NOTE: "destination.ip") handling in stream_props_changed() is removed,
since it never really did anything other than change the param value.
Always use the pffft aligned alloc function. The fftw alloc function
only aligns to 16 bytes and the AVX code uses stores that rely on an
alignment of 32 bytes. The pffft alloc alignes to 64 bytes.
Fixes#5320