Commit graph

13160 commits

Author SHA1 Message Date
Arun Raghavan
71e403bbdb spa: aec: Add support for webrtc-audio-processing-2 2025-01-09 12:06:58 +00:00
Barnabás Pőcze
3752535171 hook: avoid macro expansion of the method names
Fixes #4491
2025-01-09 12:57:23 +01:00
Wim Taymans
509e769aa5 core: inherit the default.clock.quantum-limit from the server
Copy the server value to the context so that the locally allocated
buffers match the server quantum-limit and we don't cause xruns because
of too small buffers.

See #4490
2025-01-09 11:38:07 +01:00
Wim Taymans
48416b32ad audioconvert: improve Buffer params
Make sure we only make the buffer for the follower larger when we
downsample because then we need to ask for more data from the follower
to fill up a quantum.

Never try to make the follower buffer smaller than the quantum limit.
The reason is that the graph rate could be decreased dynamically and
then we would end up with too small buffers.

See #4490
2025-01-09 11:30:02 +01:00
Wim Taymans
feaa36560d pulse-server: increase max rate to 768000
Fixes #4482
2025-01-08 17:23:15 +01:00
Wim Taymans
3a65472e9e audioconvert: add support for filter-graphs
Load multiple graphs with audioconvert.filter-graph.N where N is the
order where the graph is inserted/replaced. Run the graphs before the
channelmixer.

Graphs can be added and removed at runtime.
2025-01-07 13:20:31 +01:00
Wim Taymans
1f4e8b96c2 audioconvert: fix remap stages
Merge remap with convert to simplify some things.
2025-01-07 12:58:59 +01:00
Wim Taymans
c00df67c12 audioconvert: schedule work offline
Instead of recalculating what to do every cycle, we can prepare a
static schedule and just run that. We only need to reevaluate it when
something changes.
2025-01-07 12:58:55 +01:00
Wim Taymans
3fbf84f612 audioconvert: run resampler depending on direction
For input streams, first run the resampler and then the channelmix. This
ensures that the channelmix is run with the rate of the graph instead
of the rate of the input. This is nicer because rate and quantum align
with the graph and the sample accurate volume ramps will work as
intended.

For output streams, leave the resampler after the channelmix for the same
reasons.
2025-01-07 12:03:59 +01:00
Wim Taymans
3cf9ccf4a7 filter-graph: handle NULL in and out
We need to pass exactly n_inputs and n_outputs pointers to the process
function but make it possible to set some to NULL so that the data is
ignored.
2025-01-07 10:42:04 +01:00
Wim Taymans
49f48a5fda filter-graph: separate data and size for filter graph
Remove the chunk and add separate arrays with data and n_samples. This aligns
better with other methods and makes it possible to more easily reuse
arrays of pointers as input and output.
2025-01-07 10:38:32 +01:00
Wim Taymans
d6030adada filter-graph: optimize mix function a little
Make special cases for no and 1 gain value when mixing.
2025-01-07 09:40:45 +01:00
Wim Taymans
efa615945e filter-graph: rename some properties 2025-01-07 09:35:05 +01:00
Wim Taymans
9f9e962dd6 filter-graph: pass spa_pod in get_props 2025-01-07 09:31:48 +01:00
Wim Taymans
094a45a6f7 filter-graph: make it possible to set n_inputs/n_outputs in graph
So that the graph can be a self contained object.
2025-01-07 09:26:53 +01:00
Wim Taymans
e7d61a6fdf filter-graph: cleanup up port data
An input port has at most 1 link so we can avoid the loop and the
default port data. We can then also improve the logging and log
something when we set silence.
2025-01-07 09:24:56 +01:00
Wim Taymans
c5ae456b9e filter-graph: pass dict to activate functions
This makes it possible to expand it more later.
2025-01-07 09:23:23 +01:00
Barnabás Pőcze
591c40eed4 pipewire-jack: fix property list underallocation
`(n_items) + 1 * sizeof(*items)` is not the correct size to allocate
for `n_items + 1` count of objects each with size `sizeof(*items)`,
the `+ 1` should be inside the parentheses.

Fixes #4481
Fixes: 4baa94fce2 ("thread: make it possible to set a custom create function")
2025-01-05 21:03:50 +00:00
Barnabás Pőcze
0d497a5f43 spa: debug: pod: print unsigned numbers as unsigned
Both `spa_rectangle` and `spa_fraction` store unsigned numbers,
so print them as unsigned, the same way it is already done in
`spa_debug_strbuf_format_value()`.
2025-01-05 21:33:03 +01:00
Elliot Chen
419bc600a8 pipewiresink: split buffer and send them in turn if needed
For some streams, the buffer size is changed and may exceed
the acquired buffer size which is acquired from the pool of
pipewiresink. Need split buffer and send them in turn for
this case.
2025-01-03 15:58:37 +09:00
Arun Raghavan
974117f41a module-rtp: Fix previous typo fix
We want to track the difference between the PTP timestamp (now) and the
last RTP send, not the synthesized next RTP timestamp (which will always
be smoothly incrementing).
2024-12-31 15:24:46 -05:00
Arun Raghavan
c143e89118 module-rtp: Fix typo in check for lagging sender 2024-12-31 11:58:03 -05:00
Arun Raghavan
088d8011f2 tools: Document a couple of missing short form args for pw-loobpack 2024-12-31 11:22:49 -05:00
Elliot Chen
152a6683ef pipewiresink: active stream after finishing preoll when changing state from paused to playing 2024-12-30 11:48:34 +09:00
Pauli Virtanen
90f8b0e40b spa: acp: remove some strictly not necessary SplitPCM properties
Remove some api.alsa.split.* properties that the monitor script can
figure out itself.
2024-12-23 11:46:02 +02:00
Pauli Virtanen
dcccfcab7f spa: acp: get and emit UCM information for SplitPCM devices
When api.alsa.split-enable=true for ACP device, instruct UCM to not
use alsa-lib plugins for SplitPCM devices.

Grab the information from UCM for the intended channel remapping, and
add the splitting information to the nodes emitted.

Session manager can then look at that, and load nodes to do the channel
splitting.
2024-12-21 16:03:19 +02:00
Pauli Virtanen
7c7a54dd87 doc: add options to spa-acp-tool.1 2024-12-21 16:03:19 +02:00
Pauli Virtanen
7d7019d939 spa-acp-tool: parse properties with spa_json
Fixes crash in parsing properties due to access after end of string.
2024-12-21 16:03:19 +02:00
Niklas Carlsson
51e7ed3421 filter-chain: add sqrt plugin
To take the square root of the signal.
2024-12-20 17:58:08 +00:00
Niklas Carlsson
d7718dbcb7 filter-chain: add abs plugin
To calculate the absolute value of the signal.
2024-12-20 17:58:08 +00:00
Niklas Carlsson
7785f61677 audioconvert: align low-/highpass calculations
The current biquad calculations are based on RBJ's cookbook [1],
except for low-/highpass. Since the filter configuration is also
based on using the definition of Q, it makes sense to also align
the remaining calculations to use the same filter cookbook instead
of using resonance which doesn't result in the same coefficients
as when using Q.

[1] = https://www.w3.org/TR/audio-eq-cookbook/
2024-12-20 11:03:43 +01:00
Pauli Virtanen
e4ff13a75d module-loopback: support latencyOffsetNsec Prop
Add support for latencyOffsetNsec Prop, which just controls the nsec
part of the ProcessLatency.

This is needed to support latency offset in Pulseaudio apps when using
loopbacks as front-end nodes to underlying sinks.
2024-12-15 20:10:01 +00:00
Barnabás Pőcze
c556cced91 pipewire: module-raop-sink: remove unused function 2024-12-14 23:28:43 +01:00
Barnabás Pőcze
bf43515589 pipewire: thread: fix strerror() argument 2024-12-14 23:28:43 +01:00
Barnabás Pőcze
08c7c7999b pipewire: rtsp-client: use offsetof()
Use `offsetof()` instead of `sizeof()` to correctly determine the offset
of the flexible array member.
2024-12-14 23:28:43 +01:00
Barnabás Pőcze
11e0492f79 spa: vulkan: simplify memcpy() call 2024-12-14 23:28:43 +01:00
Barnabás Pőcze
bedcbf3631 spa: filter-graph: builtin: pointer instead of copying 2024-12-14 23:28:43 +01:00
Barnabás Pőcze
bf5d5f0201 spa: define feature macro without value
This is how it is done everywhere else.
2024-12-14 23:28:43 +01:00
Barnabás Pőcze
05ec64623a pw-cli: remove unused INDENT macro 2024-12-14 23:27:45 +01:00
Barnabás Pőcze
b1443185ea gst: sink: remove unnecessary variable
`res` can be removed without changing the behaviour, so do that.
2024-12-14 23:27:45 +01:00
Barnabás Pőcze
1f06d00838 pw-container: fix indentation 2024-12-14 23:27:45 +01:00
Barnabás Pőcze
705c2a652b pipewire: module-vban: fix vban serial header
The expression `VBAN_PROTOCOL_SERIAL | vban_BPSList[14]` is assigned
to an 8 bit field of the header, but, `vban_BPSList[14]` being
115200, it does not fit. Instead, its index, 14, should be
placed in the header.

In addition to fixing the issue, add `-Werror=constant-conversion`,
and clang diagnostic that catches such issues.

Fixes: 1a5514e5cf ("module-vban: create streams per stream_name")
2024-12-14 23:09:45 +01:00
Pauli Virtanen
a4e2d9cbb0 bluez5: lc3: bump media_codec version 2024-12-14 10:57:23 +00:00
Pauli Virtanen
bf12fe6d8b bluez5: lc3: simplify parsing 2024-12-14 10:57:23 +00:00
Pauli Virtanen
8f1983d14c bluez5: lc3: fix log name conflict 2024-12-14 10:57:23 +00:00
Iulia Tanasescu
3309fa0674 doc: Document BAP LC3 codec audio capabilities
This documents the configurable values for the BAP LC3 codec capabilities.
2024-12-14 10:57:23 +00:00
Iulia Tanasescu
9a5b2d42f9 bluez5: Configure LC3 codec capabilities
Currently, the PipeWire daemon registers BlueZ LE Media Endpoints
with audio capabilities covering all settings defined in the BAP spec.
However, some scenarios might require the capabilities to be restricted
to specific configurations.

This adds a method to read LC3 codec specific capabilities from the
Wireplumber config file, and provide those settings when registering
Media Endpoint objects with BlueZ. If the values are not present in
the config file, all settings will be used by default.

Below is an example of how to set the LC3 capabilities in the config
file, to support the 16_2 setting from the BAP spec:

bluez5.bap-server-capabilities.rates = [16000]
bluez5.bap-server-capabilities.durations = [10]
bluez5.bap-server-capabilities.channels = [1, 2]
bluez5.bap-server-capabilities.framelen_min = 40
bluez5.bap-server-capabilities.framelen_max = 40
bluez5.bap-server-capabilities.max_frames = 2
2024-12-14 10:57:23 +00:00
Barnabás Pőcze
b5490954d0 spa: filter-graph: ladspa: add dl_lib dependency
The ladspa plugin uses `dlopen()`, etc. directly,
so add the `dl_lib` dependency. This is not necessary
in a new enough environment since newer glibc versions
have merged most things into libc.
2024-12-14 10:55:28 +00:00
Iulia Tanasescu
d6567ea6a2 doc: Add sync_factor config option
This adds the new "sync_factor" entry in the JSON for Broadcast Source
endpoint config parameters.
2024-12-14 10:54:38 +00:00
Iulia Tanasescu
cb000ad3dc bluez5: Configure sync_factor
For a BAP Broadcast Source endpoint, the QoS sync_factor enables the user
to adjust the Periodic Advertising interval based on the ISO interval
configured for the stream:

PA_Interval = sync_factor * ISO_Interval

Currently, this value is hardcoded to 2. This commit makes the sync_factor
configurable in the Wireplumber config file, along with the other config
parameters for BIGs.
2024-12-14 10:54:38 +00:00