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
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
Wim Taymans
2f397035b8
modules: don't call pw_stream_set_control in process
...
pw_stream_set_control can only be used from the pipewire main_loop, not
the process callback. Instead, use the rate_match field directly.
Fixes #2633
2022-12-08 11:01:24 +01:00
Wim Taymans
72912c9589
pulse-tunnel: improve latency property docs
...
To make it clear it needs to a number only (without ms at the end)
2022-11-17 19:04:46 +01:00
Wim Taymans
945529f029
modules: actually copy the network property to the stream
...
Fixes #2384
2022-11-17 15:56:39 +01:00
Wim Taymans
e5881e9afb
module-pulse-tunnel: rate limit some messages
2022-10-20 09:24:54 +02:00
Wim Taymans
88785c42e5
modules: avoid partial writes to pulseaudio
...
Pulseaudio requires that we call pa_stream_write with a multiple
of frame_size bytes. Because our ringbuffer is a power of two, this
might cause problems at the edge of ringbuffer where a sample is
split between the end and beginning of the ringbuffer.
Avoid this by letting pulse allocate a buffer instead and memcpy
the requires samples into it.
Fixes multichannel output on module-pulse-tunnel.
2022-10-18 13:14:32 +02:00
Wim Taymans
e6356f7415
module: pass a channel map in pa_stream_new
...
Convert the PipeWire channelmap to pulseaudio and pass it in
pw_stream_new().
2022-10-17 18:58:15 +02:00
Wim Taymans
6f235f344f
modules: set tunnel minreq and prebuf more like pulseaudio
...
See #2755
2022-10-12 12:18:14 +02:00
Wim Taymans
c20790c64b
pulse-tunnel: destroy the module on errors
...
When the pulse context or stream is in error, destroy the module.
2022-08-30 16:09:04 +02:00
Wim Taymans
9248ce3c19
pulse-tunnel: fix rate adjustement argument
...
The sign of the error was wrong, making the rate controller adjust in
the wrong direction and make things worse.
See #2548
2022-08-30 16:01:14 +02:00
Wim Taymans
de65fd442f
modules: use TARGET_OBJECT instead of NODE_TARGET
2022-07-11 13:52:35 +02:00
Wim Taymans
60cbc44526
modules: improve docs
2022-06-23 12:48:45 +02:00
Wim Taymans
c8b8b24a9c
modules: fix format parsing
...
Use the same logic for parsing the format.
2022-06-23 12:39:51 +02:00
Wim Taymans
0f839c7b61
modules: clamp input offset and size
...
So that we don't cause memory errors with invalid input.
2022-06-04 11:47:48 +02:00
Wim Taymans
87172fde06
modules: align tunnel.mode
...
Source for a source, sink for a sink. We use capture and playback for
streams that link to a source/sink respectively.
2022-06-03 10:52:45 +02:00
Wim Taymans
de4b021b34
modules: add docs
2022-04-22 16:44:15 +02:00
Wim Taymans
d1207422e0
make NODE_WANT_DRIVER=true the default
...
So that all nodes attach to some driver to be scheduled.
For the virtual sink/sources this is a normal thing and we can remove
the custom settings.
For normal stream, this now makes it possible to link pw-play directly
to pw-record and have it transport data.
Fixes #1761
2022-04-21 10:14:53 +02:00
Wim Taymans
26db2f1ec9
module-pulse-tunnel: clear ringbuffer on cork
2022-04-19 10:51:45 +02:00
Wim Taymans
4cc0082634
module-pulse-tunnel: move some info log to debug
2022-04-19 09:58:18 +02:00
Wim Taymans
cdbdcd6771
module-pulse-tunnel: improve error recovery
...
Track the end-to-end latency of the stream and use that to drive
the resampler.
Hard reset the ringbuffer when under/overflow happens so that we
can recover quickly.
See #2230
2022-04-19 09:41:28 +02:00
Wim Taymans
c73c852413
pulse-tunnel: improve debug
2022-04-18 16:48:10 +02:00
Wim Taymans
3c38794886
pulse-tunnel: recover from xruns better
2022-03-30 17:59:25 +02:00
Wim Taymans
da6687e6ec
module-pulse-tunnel: use dll to keep latency under control
...
Assign half the latency to the internal ringbuffer and half on the
network and remote end.
Use a dll to calculate the drift from our target ringbuffer fill
level and use the stream rate property to driver the resampler.
This should reduce uncontrolled latency over the tunnel.
PulseAudio wants us to be a driver will pull requests from the remote
side. We would need to provide a clock based on the remote end and
also try to follow it when we are not a driver. It would be slightly
better because in the normal playback case we would be able to
avoid resampling. We might do this eventually.
2022-03-30 17:23:09 +02:00
Wim Taymans
4ae94a6ca6
modules: use NODE_WANT_DRIVER=true instead of NODE_GROUP
...
For the modules that require a driver, don't add ourselves to
the pipewire.dummy group but instead just use the NODE_WANT_DRIVER
property to be assigned to a driver.
This makes it possible for the nodes to move to another driver than the
dummy driver (which has very high priority) and it avoids resampling in
cases where the nodes are linked to an audio source or sink.
2022-03-30 14:56:28 +02:00
Barnabás Pőcze
45bd8532eb
pipewire: use newly added function for deferred module destroy
...
Use the newly introduced `pw_impl_module_schedule_destroy()`
for deferred module destroy in all modules except
module-example-{sink,source}.
2022-02-18 12:30:53 +01:00
Barnabás Pőcze
4d4c6f20df
pipewire: remove work queue checks
...
Since now `pw_context_get_work_queue()` cannot
fail, the checks can be removed.
2022-02-18 12:30:53 +01:00
Wim Taymans
8c346ab3a7
pulse-server: list NETWORK flag on devices
...
Mark network sinks and sources with node.network.
2021-10-14 13:45:58 +02:00
Peter Hutterer
1d8d7e90ce
modules: switch a few modules to the new property helpers
2021-10-13 07:12:00 +00:00
Nicolai Syvertsen
dea1755b68
pulse-tunnel: follow pulseaudio for default format
2021-10-07 15:39:11 +02:00
Nicolai Syvertsen
28c2e8ca56
pulse-tunnel: use format, channels and rate props
2021-10-07 13:00:24 +02:00
Wim Taymans
696dbf7cd6
pulse-tunnel: pass latency as msec
2021-09-30 09:49:00 +02:00
Peter Hutterer
14112fd168
modules: use the new topic-based logging from various pipewire modules
2021-09-28 09:35:39 +02:00
Wim Taymans
cb474043fa
pulse-tunnel: add pulse.latency option
...
Add a pulse.latency option to override the default 100ms latency.
2021-09-23 13:11:52 +02:00
Wim Taymans
88ba3014d6
pulse-tunnel: increase default latency to 100ms
...
20ms is too small and might be a typo from the pulseaudio 200ms default
latency.
2021-09-23 13:00:15 +02:00
Wim Taymans
9f57341699
module-pulse-tunnel: set the bufferattr right
...
tlength for playack and fragsize for capture.
See #1434
2021-08-30 21:26:33 +02:00
Wim Taymans
6e44c081b0
modules: silence some useless warnings
...
Fixes #1423
2021-07-19 18:30:22 +02:00
Wim Taymans
aa4de60032
modules: pulse-tunnel can use RT_PROCESS
...
It writes samples to a ringbuffer and will not do any rt-unsafe
methods.
2021-06-25 15:51:30 +02:00
Peter Hutterer
f181232a61
doc: add the documentation infrastructure for pipewire modules
...
All empty pages for now but at least this makes them show up in the
documentation.
2021-06-25 08:42:24 +00:00
Wim Taymans
1f04e911c5
module: handle work queue create errors
...
Handle NULL when creating a work queue instead of crashing. The
create can fail when we run out of fds.
2021-06-18 16:29:23 +02:00
Peter Hutterer
e0471c6757
pipewire: allow NULL pointers in pw_properties_free()
...
Just like the real free() we should just ignore a NULL pointer, makes the
caller code easier for those instances where properties are optional.
Patch generated with concinelle with a few manual fixes.
2021-06-02 10:56:46 +00:00
Wim Taymans
b9efb25605
pulse-tunnel: handle latency a little better
...
Set a limit on the buffer size.
Announce our latency on the streams.
2021-05-28 11:19:05 +02:00
Peter Hutterer
7697ed0757
treewide: replace strcmp() == 0 with spa_streq()
...
This change is only done in source files for now, header files will be done
separately.
2021-05-18 22:10:27 +10:00
Wim Taymans
5c152bab23
zeroconf: improve stream properties
2021-05-14 11:19:02 +02:00
Wim Taymans
a428228ebf
pulse-tunnel: handle holes in record stream
...
Holes in the stream return a NULL ptr. Write silence to the
ringbuffer in that case.
2021-05-14 09:51:51 +02:00
Wim Taymans
09cba1e4de
module-pulse-tunnel: use SPA_UNLIKELY instead of PA_UNLIKELY
2021-05-13 14:53:39 +02:00
Wim Taymans
938e193987
pulse-tunnel: support node.target
...
Pass the node.target as the target on the remote.
Make a nicer stream name on the remote.
2021-05-12 16:49:19 +02:00
Wim Taymans
44f326013b
module-pulse-tunner: add module to tunnel to PulseAudio
...
Add a module that can make a source or sink that tunnels audio
to or from a (remote) PulseAudio server.
2021-05-12 15:56:59 +02:00