Commit graph

13651 commits

Author SHA1 Message Date
Wim Taymans
f7fdafc203 loop: add method to run a function with the lock
Convert some _invoke to _locked
2025-05-29 10:17:16 +02:00
Wim Taymans
fb49e0795c loop: move thread-loop to support loop
Add more synchronization primitives to spa loop so that we can replace
the thread-loop with it.
2025-05-29 10:17:16 +02:00
Wim Taymans
cd1d9ceff1 context: make data loop prio-inherit 2025-05-29 10:17:16 +02:00
Wim Taymans
65cbbf1a02 spa: add locking to the loop
We can add a PTHREAD_PRIO_INHERIT lock to the loop to protect the
callbacks and then use this to update shared data in an RT-safe way.

This can avoid some invoke calls that require a context switch but
also due to the nature of epoll cause locking in the kernel with non-RT
guarantees.

Because we use PRIO_INHERIT, the code executed in the lock must not use
any RT-unsafe functions.
2025-05-29 10:17:16 +02:00
Carlos Rafael Giani
d258892392 module-rtp: Retry starting stream if this failed with ENODEV errno
ENODEV is not a fatal error, and trying again later to set up the
socket usually succeeds. Do such retries with a timer.
2025-05-28 17:19:57 +02:00
Carlos Rafael Giani
71c0c8e34c module-rtp: Rename timer to standby timer in rtp source
This results in clearer code, and makes it easier to add more timers
to the module in the future.
2025-05-28 17:19:57 +02:00
Carlos Rafael Giani
023525eca2 rtp: aes67: Document sess.ts-direct property and set it to true for AES67 2025-05-28 17:19:57 +02:00
Carlos Rafael Giani
2fe77c47e1 spa: tools: spa-inspect: Output more detailed dlopen and dlsym errors
When writing a custom SPA plugin, it is very useful to get more detailed
errors related to libdl. One common error is that a symbol is not present
because a related library was not properly linked into the plugin. With
this change, the error will tell the user about the exact missing symbol.
2025-05-28 17:19:57 +02:00
Wim Taymans
d9b742cfda bluez: avoid some compiler warnings 2025-05-28 15:15:25 +02:00
Wim Taymans
a1be639894 filter-graph: add log feature to lv2 plugins 2025-05-28 15:02:53 +02:00
Wim Taymans
3f99c6f259 filter-graph: use new map/unmap URIs
Don't use the legacy ones.
2025-05-28 15:02:53 +02:00
Jonas Holmberg
51d9bdd9cb pod: declare offset as unused in spa_pod_builder_bytes_end()
Fixes compiler warning:

/usr/include/spa-0.2/spa/pod/builder.h:357:69: error: unused parameter 'offset'
[-Werror=unused-parameter]
2025-05-28 09:56:11 +02:00
Wim Taymans
e126f9bcbf adapter: only clear the NEED_CONFIGURE flag when mode != none
As long as we are in the 'none' PortConfig mode, we set the NEED_CONFIGURE
flag.

This fixes early start in audioadpter nodes because PortConfig is set to
none at init time and this used to clear the NEED_CONFIGURE flag, which
would start the node before the session manager could to a PortConfig
and cause a -22 error.
2025-05-27 15:38:51 +02:00
Wim Taymans
548fa0ec48 adapter:handle -ENOENT when enumerating buffers
When the follower has no buffer suggestion, it can return -ENOENT, which
should not generate an error but simply use the converter buffer
suggestion instead.
2025-05-27 15:00:43 +02:00
Wim Taymans
417a72365e adapter: negotiate from target to follower
Now that the filter functions prefer the filter default value, use the
target object as a filter for buffer allocation as well.
2025-05-27 09:30:52 +02:00
Wim Taymans
96007dc576 pw-cat: mode SYSEX mode out of ffmpeg define 2025-05-26 19:24:23 +02:00
Robert Mader
e81fb77322 gst: src: Change DEFAULT_MIN_BUFFERS back to 1
The change from 1 to 8 was done without justification in the commit
message and possibly for debug purposes. Unfortunately it breaks
negotiation with the libcamera virtual pipeline, which defaults to
4 buffers.

Set the the value to 1 again as successful negotiation - even with an
unusually low number of buffers - is usually more desirable than an
error.

Fixes: 98b7dc7c0 ("gst: don't do set_caps from the pipewire callback")
2025-05-25 04:03:06 +02:00
Wim Taymans
737ca4ee7b tools: add sysex play option in pw-cat
This makes it possible to upload raw midi (sysex) into the graph.
2025-05-23 16:52:22 +02:00
Wim Taymans
564c9b1ba5 Use "8 bit raw midi" for control ports again
There is no need to encode the potential format in the format.dsp of
control ports, this is just for legacy compatibility with JACK apps. The
actual format can be negotiated with the types field.

Fixes midi port visibility with apps compiled against 1.2, such as JACK
apps in flatpaks.
2025-05-23 16:46:13 +02:00
Wim Taymans
617f1b8a38 pod: add bytes start/append/end functions
Add functions to dynamically start and build a bytes pod.
2025-05-23 16:41:00 +02:00
Wim Taymans
d37f213236 docs: fix some typos 2025-05-23 16:40:20 +02:00
Wim Taymans
5e81ff8ede filter-chain: manage graph from source only
Only react to the capture stream state change and format changes. The
playback and capture streams change state somewhat concurrently and so
the graph state might not be consistent.

Because only the capture stream will trigger the playback stream and
start the processing, we can safely react to capture stream changes
only.
2025-05-21 15:23:00 +02:00
Wim Taymans
ccb7a51c3a filter-graph: add support for lv2 State
If the lv2 plugin supports State restore, use it to load state from the
config section in the lv2 plugin definition.
2025-05-21 15:19:23 +02:00
Wim Taymans
f7eab4172e client-node: let all events go to the node
Just pass all events to the node and only error out when they return an
error value.

Make sure we pass the result values of the command around.
2025-05-20 11:47:10 +02:00
Wim Taymans
12f8ca664b adapter: log command errors when no converter 2025-05-20 10:42:59 +02:00
Wim Taymans
7dc1d28b2c node: add User command and event
Add a User command and event id with a String property called 'extra' to
make it possible to send arbitrary User defined commands and events.
Also makes it possible to make User commands in pw-cli.

pw-cli c 86 User '{ extra="{ test: foo }" }'
2025-05-20 10:32:10 +02:00
Christian Glombek
5a54ecd8df daemon/pipewire.conf.avail: Add snippet enabling module-raop 2025-05-19 18:28:10 +02:00
Wim Taymans
b80189c3dd adapter: handle -ENOTSUP for commands
When using custom commands, the converter might return -ENOTSUP and
we should ignore this.
2025-05-19 17:23:30 +02:00
Wim Taymans
b9a8bb15a4 impl-link: fix feedback handling
If a link is a feedback link, we just need to swap the input/output
scheduling dependency.

Don't swap input/output nodes (without swapping ports) because then we
will be querying the wrong node/port pair when negotiating and cause
errors.

See #4706
2025-05-19 09:45:05 +02:00
Arun Raghavan
9ff1c93ab1 media-sink: Set up ASHA source after setting transport state
We need to make sure the state is available when the source starts, so
that it does not assert in flush_data()
2025-05-17 10:25:37 -04:00
Wim Taymans
e5afc939e8 libcemara: take care of index offset when enumerating controls
Add an index offset when enumerating controls. We insert 2 properties
before enumerating the controls so the index of the first control needs
to have an offset of 2.
2025-05-17 14:05:23 +02:00
Robert Mader
e387772dc2 v4l2: Re-enable first buffer skip for jpeg types
The workaround is typically needed with usb-cameras using jpeg streams.
Re-enabling the skip shouldn't affect what the commit was trying to do,
i.e. fix encoded streams like h264 etc.

Fixes: bcf0c0cf8 (v4l2: only skip buffer for raw formats)
2025-05-17 10:53:08 +00:00
Pauli Virtanen
1e18cded75 bluez5: iso-io: improve latency logic
If kernel socket queues for different streams get out of sync, it will
mess up time alignment of different streams. If that happens, flush to
resync.

If total latency becomes too large, flush queue.

Get accurate queue sizes from tx timestamping.
2025-05-17 10:51:37 +00:00
Pauli Virtanen
489e4b6bd2 bluez5: latency tracking also for A2DP, use it for unsent size
Use TX timestamping to figure out the accurate amount of unsent data,
including controller buffers.  SIOCOUTQ does not report accurate data
size as it includes overheads.
2025-05-17 10:51:37 +00:00
Pauli Virtanen
897748759e bluez5: update timestamping code to match kernel & bluez
Update code to match the final version landed in mainline Linux 6.15
2025-05-17 10:51:37 +00:00
Pauli Virtanen
e375364c87 bluez5: fix device set profile/route enumerations
Now that we have ASHA & BAP, this->device_set now refers to the device
set of the active profile.  It cannot be used to produce
EnumProfile/EnumRoute.

Fix this by computing the device set for given profile(s) as needed.
2025-05-17 10:50:15 +00:00
Barnabás Pőcze
01d1e29402 spa: vulkan: simplify kernel version parsing
Use a single `sscanf()` instead of multiple `strtok()`, `atoi()` calls.
After this change all three components are required to be present.
2025-05-14 18:37:54 +02:00
Wim Taymans
2771c435fd doc: fix end of page for tag doc 2025-05-14 18:23:41 +02:00
Wim Taymans
218f25088c convert: place the right id in the portconfig format 2025-05-14 18:21:39 +02:00
Barnabás Pőcze
6712d9c3db pipewire: module-raop-discover: fix typo in documentation
roap -> raop
2025-05-14 17:59:41 +02:00
Wim Taymans
9b316f6deb filter-graph: remove port check
Remove the port number check, we never call this with an invalid port
number and the check was wrong for the sofa_plugin.

Fixes #4700
2025-05-14 17:04:06 +02:00
Barnabás Pőcze
a0eb12e4be ci: specify explicit dependencies between jobs
Use `needs` to specify job dependencies explicitly instead of relying on
stages for ordering. This allows jobs from multiple stages to run concurrently
without having to wait for unrelated jobs in earlier stages.

See https://docs.gitlab.com/ci/yaml/#needs for more information.
2025-05-14 09:41:44 +00:00
Wim Taymans
b957d74eb6 doc: fix bad filename 2025-05-14 11:40:32 +02:00
Wim Taymans
26099f4c29 doc: add doc about Tag params 2025-05-14 11:28:16 +02:00
Wim Taymans
093b3eea21 audioconvert: implement graph latency reporting
Keep per graph latency. Sum all the graph latencies together and keep
this around as the process-latency.

Refactor the port latency setter. Make a function to recalculate the
latency of all other ports. Take into account the graph latencies.

Update the port latencies when the total graph latency changes.
2025-05-14 09:21:31 +02:00
Wim Taymans
c334bfb0bb audioconvert: do params after init of the node
First do the essential properties to set up the node, then set up the
node and then parse the params. The params might do some setup that
relies on a completely configured node, such as emit events.
2025-05-14 09:19:17 +02:00
Wim Taymans
37bf571db3 audioconvert: keep the graph latency around 2025-05-13 15:27:17 +02:00
Wim Taymans
ca032152b1 doc: improve formatting 2025-05-13 15:17:56 +02:00
Wim Taymans
b71216af70 doc: add document about latency handling 2025-05-13 15:01:00 +02:00
Wim Taymans
6b3681938b pw-dump: don't do raw mode when streaming
pw-dump | less -RS is a common thing and raw mode is not helpful.
2025-05-13 14:59:51 +02:00