Commit graph

2424 commits

Author SHA1 Message Date
Martin Geier
98163d90df client-node: iterate the buffer datas correctly
Don't just read the first buffer data in the loop but use the loop index to
get the right one.
2023-01-19 17:22:29 +01:00
Wim Taymans
d11fb766c6 module-pipe: improve properties on nodes
Actually move the stream properties in stream.props object for the pipe
tunnel module.
Set pipe.filename on the node. Remap this to device.string in pulse.
Add some more default properties on the pipe nodes.

See #2973
2023-01-19 11:05:54 +01:00
Wim Taymans
1126fbd26c filter-chain: simplify a little
We can reuse the array of filenames for the single filename case
and remove some duplicate code.
Handle some errors better.
2023-01-18 18:22:34 +01:00
Wim Taymans
30057967dd module-filter-chain: fix array size 2023-01-18 18:06:19 +01:00
Wim Taymans
9d66de446b convolver: parse array from filename 2023-01-18 16:59:25 +00:00
Barnabás Pőcze
051d223d73 filter-chain: review suggestions 2023-01-18 16:59:25 +00:00
Dmitry Sharshakov
2251b9b1d9 filter-chain: allow multiple filters for convolver
Choose the closest match to reduce resampling loss. If match is not equal, resample.

Keep the backwards compatibility retaining `filename` property. When both set, `filenames` takes priority
2023-01-18 16:59:25 +00:00
Wim Taymans
6207d98ff1 spa: add debug log context
Make a real debug context with a log function and move it to a new file.
This way we don't need to redefine a macro.
Make a new context for debugging to a log file. Make new functions to
debug to a log file.
Move the stringbuffer to string utils.
Integrate file/line/func and topics into the debug log.
We can remove some more things from the pipewire log_object function and
also add support for topics.
2023-01-18 17:51:16 +01:00
Wim Taymans
f472fd736d fix includes
Only include debug we need. We usually only need the debug types.
2023-01-18 13:12:16 +01:00
Wim Taymans
37a5dca31e module-echo-cancel: update docs with monitor.mode property 2023-01-17 13:18:13 +01:00
Wim Taymans
edd3113c43 pulse-server: add remaining formats
The ones that have no pulseaudio equivalent will be filtered out when we
parse or create messages.

See !1499
2023-01-17 12:26:06 +01:00
Wim Taymans
ccedf1722a filter-chain: fix AVX dsp_sum index increment
Fixes #2965
2023-01-17 09:24:00 +01:00
Wim Taymans
68d9c33078 module-echo-cancel: allow per stream AUDIO_POSITION settings
Keep per stream audio info. We copy the global rate and format to
everything but allow for the channel positions to be overwritten
per stream. Invalid channel positions will revert to the default
again.

With a taget.object, this makes it possible to link the echo cancel
stream to specific pro audio sink ports.

Fixes #2939
2023-01-16 15:11:02 +01:00
Wim Taymans
e86acd8930 module-rt: improve rt settings
Refactor get_rt_priority_range().
When we can't set the requested priority, use rlimit to clamp it
and try again. If this clamped value is bigger than RT_PRIO_MIN,
we can allow this.

The result is that the RTPRIO is set to the max of the user rlimit
RTPRIO, as long as it's more than 11. Previously it would fall back
to RTKit.
2023-01-16 13:08:37 +01:00
Wim Taymans
28aa9ebe64 pulse-server: add more valid formats
Add some more formats that can be used in pipewire streams so that
pulseaudio will see them as valid devices/streams.

It is possible that this will result in an invalid format on the client
when there is no pulseaudio format defined, but that is ok.

See !1499
2023-01-16 11:05:06 +01:00
Thomas Weißschuh
6f84bef2b0 pulse-server: split device info validation into dedicated function 2023-01-16 11:05:06 +01:00
Szabolcs Szőke
bb1f595b53 adapter: support custom prefix for device ports
Prefixes can be disabled for device ports by providing an empty string
2023-01-16 08:25:41 +00:00
Dmitry Sharshakov
7b355d5628 convolver: add gain when resampling to preserve volume 2023-01-15 11:53:30 +00:00
Dmitry Sharshakov
e0cc072100 filter-chain: use equal rate for capture and playback
If only one of rates is provided, propagate it. If both are provided and are inequal, warn.

This configuration appears to be broken for obvious reasons
2023-01-14 19:52:47 +00:00
Wim Taymans
792defde27 adapter: only add port name override when not empty
This makes it possible to add an empty string to keep the original
port name.
2023-01-13 17:52:24 +01:00
Wim Taymans
cab3e3c1ce clarify deprecated use of NODE_TARGET 2023-01-10 17:21:02 +01:00
Wim Taymans
c3032c70b6 keys: move NODE_TARGET to deprecated properties
Add PW_ENABLE_DEPRECATED to some places where we can not yet
avoid removing support.
2023-01-10 17:17:34 +01:00
Wim Taymans
2254c74fb9 use TARGET_OBJECT instead of the deprecated NODE_TARGET
Clarify the docs.
2023-01-10 16:51:47 +01:00
Wim Taymans
8767e8ed97 pulse-server: handle .monitor master source 2023-01-10 16:22:39 +01:00
Wim Taymans
ff69454eb4 pulse-server: use TARGET_OBJECT
The pulse API uses either the node.name or object.serials so pass this
along in the TARGET_OBJECT instead of the NODE_TARGET now that
wireplumber handles this.
2023-01-10 16:05:55 +01:00
Wim Taymans
624e265fd6 pulse-server: clear the drained state correctly
When we start the drain, we unpause the stream. When we conplete the
drain, we unpause again, which does nothing when the stream was already
unpaused. However, this leaves the drained state on the stream and so
the stream will never be able to play new data.

Trigger a new pw_stream_set_active() with the current stream state to
clear the drained state.

Fixes #2928
2023-01-10 12:49:22 +01:00
Wim Taymans
97aafe2234 fix use_buffers checks
We can set 0 buffers even if there is no format.
Return -ENOSPC when too many buffers are set.
2023-01-10 12:30:25 +01:00
Jan Beich
6d58c73937 module-rt: fix warning when xdg-desktop-portal isn't running
$ pipewire
...
[W][1234.001] mod.rt       | [     module-rt.c:  278 pw_rtkit_check_xdg_portal()] Can't find xdg-portal: (null)
...
2023-01-08 07:29:42 +00:00
Wim Taymans
b2f43e7bad pulse-server: fix echo-cancel _master args
The sink_master and source_master should be set on the capture and
playback streams so use the new properties on module-echo-cancel to do
this.
2023-01-07 15:00:40 +01:00
Wim Taymans
feac9f1c70 module-echo-cancel: add capture and playback props
Add a capture.props and playback.props config section to set properties
for the capture and playback stream.

Fixes #2939
2023-01-07 13:58:30 +01:00
Dmitry Sharshakov
6fb543a514 adapter: support node.channel-names
Allow customizing channel names for nodes
2023-01-06 23:17:33 +03:00
Wim Taymans
4f458b5d9a filter-chain: dynamically allocate the params
Dynamically allocate the offsets and params arrays so that it can
support more than 512 params.

Fixes #2933
2023-01-06 12:41:06 +01:00
Wim Taymans
860b8fc27f modules: fix rate update
Setting the rate with the PROP_rate would actually result in a rate
adjustment of 1.0f / rate, so do the same here.

See #2891
2022-12-29 12:22:56 +01:00
Barnabás Pőcze
73c5f6e1bf pipewire: module-roc-{sink,source}: port to ROC v0.2.X
Incompatible changes between ROC v0.1.X and v0.2.X require
adjusting the ROC modules' code. The largest change is going
from `roc_address` to `roc_endpoint`. There is also a breaking
change, the removal of `local.ip` parameter from module-roc-sink
as `roc_sender_bind()` has been removed.

The API usage was modelled after https://github.com/roc-streaming/roc-pulse

See #1757
Fixes #2911
2022-12-29 10:13:30 +00:00
Julian Picht
8c0a94c9d8 module/roc-*: fix position of comment 2022-12-19 12:47:47 +01:00
Julian Picht
b47e799c9a module/roc-*: implement audio.rate 2022-12-19 12:25:33 +01:00
Wim Taymans
f4f316b951 filter-chain: move fft to dsp_ops 2022-12-16 11:30:18 +01:00
Wim Taymans
b6b6efff42 convolver: use normal float for complex float array 2022-12-16 10:51:19 +01:00
Wim Taymans
538b6ce35e filter-chain: use dsp sum/copy/clear functions 2022-12-16 10:22:01 +01:00
Wim Taymans
0f2f113bdc filter-chain: add optimized sum function 2022-12-16 10:19:20 +01:00
Wim Taymans
cd38d7b53b filter-chain: move functions to separate struct
So that it's easier to copy them.
2022-12-16 09:37:45 +01:00
Wim Taymans
fa10849139 filter-chain: pass dsp_ops around
Initialize dsp_ops in the filter-chain and pass it around.
2022-12-16 09:28:00 +01:00
Wim Taymans
f7c49bbdde pulse-server: add channel-map in echo-cancel module 2022-12-15 13:12:47 +01:00
Wim Taymans
72bee99f87 pulse-server: add category for connection debug
Use a new conn. topic to debug the messages. These are disabled by
default.
2022-12-14 16:40:58 +01:00
Wim Taymans
61750813ff filter-chain: move buffer resample to separate function
Fix the error paths.
Rename some variables around to make things clearer.
2022-12-13 12:18:46 +01:00
Dmitry Sharshakov
28af79be79 filter-chain: convolver: flush, add resampler quality option
Robustness fix: don't truncate IR, free the resampler state after use.
2022-12-13 10:09:55 +00:00
Dmitry Sharshakov
7950d3ff0d filter-chain: convolver: resample IR
Ensure correct filtering when node rate does not match filter rate
2022-12-13 10:09:55 +00:00
Wim Taymans
b29200ee82 pulse-server: add a pulse.cmd section
Add a new config section that can contain a set of commands to run after
starting.

There is only load-module available now but it can be used to remove the
dependency on pactl when starting the server.
2022-12-12 16:46:16 +01:00
Wim Taymans
45235172c8 pulse-server: disable idle.timeout by default
Only enable pulse.idle.timeout for selected applications
(speech-dispatcher) and let other applications be. We can also
lower the minreq and min-quantum of speech-dispatcher now.

Fixes #2880
2022-12-09 10:00:32 +01:00
Jonas Holmberg
83f1de95c0 module-loopback: connect playback before capture
Connect the playback stream before the capture stream since the capture
stream can otherwise trigger playback_process() before the playback node
has been activated.
2022-12-08 13:31:45 +01:00