Commit graph

944 commits

Author SHA1 Message Date
Barnabás Pőcze
d88def09bd pipewire: module-roc-{sink,source}: add rudimentary ROC_INTERFACE_AUDIO_CONTROL support 2023-11-23 17:21:39 +01:00
Barnabás Pőcze
333fd8d2ae pipewire: module-roc-{sink,source}: port to ROC v0.3.X
ROC 0.3 introduced breaking changes, so adjust the code.
Also set the minimum supported ROC version to 0.3.0.

Fixes #3667
2023-11-23 14:12:35 +01:00
Wim Taymans
0c857f5455 pulse-server: add stream/device state in dev_info
Also include and update the state of the device/stream in
collect_device_info so that we can compare it against the previous value
and emit a change event.

Fixes #3660
2023-11-20 11:39:31 +01:00
Pauli Virtanen
90bd9adb6b pulse-server: rename combine sinks option
Let's call it "sinks" in the docs, but keep the Pulseaudio name for
backward compat.
2023-11-20 08:41:13 +00:00
Pauli Virtanen
843e733479 doc: add documentation for pipewire-pulse modules
Add (minimal) reference documentation for each pipewire-pulse module.

Add some preprocessing to substitute @pulse_module_options@ in docs from
PW_KEY_MODULE_USAGE so the module options don't need to be repeated.

Produce Doxygen docs + generate manpages pipewire-pulse-modules.7,
pipewire-pulse-module-*.7
2023-11-20 08:41:13 +00:00
Wim Taymans
11320cf203 tweak number of buffers
In most cases we can use just 1 buffer.

The alsa-pcm-source needs at least 2 buffers so increment the min
limit.
2023-10-13 14:00:29 +02:00
Wim Taymans
6d0613bc9a pulse-server: place stream media.* keys as Tag 2023-10-11 15:17:13 +02:00
Barnabás Pőcze
e3a69d1932 pulse-server: use spa_autofree with open_memstream()
Coverity is saying that `response_str` is leaked on the return
if `fclose()` returns non-zero. So use `spa_autofree` to fix that.
2023-10-07 08:44:50 +00:00
Wim Taymans
5d7900c4aa pulse-server: prefix nonstandard messages with pipewire-pulse: 2023-10-06 17:55:35 +02:00
Wim Taymans
4b27807292 pulse-server: add /core message handlers for memory debugging
Add malloc-info and malloc-trim message handlers.
2023-10-06 16:49:03 +02:00
Barnabás Pőcze
e8f17814ba pulse-server: pass the client to message handlers
Instead of passing the pw_manager object, pass the client
object to the message handler. The client's manager can
still be accessed via `client->manager`. Furthermore,
message handlers now have access to `client->impl`.
2023-10-06 16:16:48 +02:00
Barnabás Pőcze
4e69507b18 pulse-server: pass FILE to message handlers
Use `open_memstream()` to create a FILE stream and pass
that to message handlers to store their response. This allows
the `open_memstream()` calls and related error handling to be
removed from the message handlers.
2023-10-06 16:16:18 +02:00
Barnabás Pőcze
649b33c73f pulse-server: remove unnecessary check
`spa_streq()` already checks if any of its arguments
are NULL, and NULL is not considered equal to any non-NULL
string, therefore the check can be removed.
2023-10-06 15:58:06 +02:00
Barnabás Pőcze
5d0e82be7e pulse-server: module-echo-cancel: set pulse.module.id
Set `pulse.module.id` on every node that libpipewire-module-echo-cancel
creates so that one can see in the output of `pactl list {sinks,sources}`
which nodes were created by a particular instance of module-echo-cancel.

Fixes #3541
2023-10-02 22:04:34 +02:00
Barnabás Pőcze
37b2633756 pulse-server: reorder initialization to make proper cleanup possible
Previously, in case of errors, the struct members were not disposed of
correctly, leading to memory leaks. Reordering the initialization slightly
makes it possible to call `impl_free()`.

See https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1840#note_2106874
2023-09-29 18:19:13 +02:00
Wim Taymans
224f1f16f1 pulse-server: emit stream changed after Latency param change
Piggy back on the Latency param change to emit a stream changed event
because we now might have a link between the stream and a device.

We should really watch for new links and emit change events for the
streams that it links to.

Fixes #3522
2023-09-21 16:42:08 +02:00
Wim Taymans
846e732458 pulse-server: remove pending_streams list
We can simply use the pending flag and merge the handling of the new
stream with the stream move logic.
2023-09-14 12:08:48 +02:00
Wim Taymans
13caae49b5 pulse-server: avoid emitting changes for unused params
Don't emit change events when latency or tag change, for example.
2023-09-14 11:03:39 +02:00
Wim Taymans
3c812f672b pulse-server: add an option to check module arguments
Add a list of valid keys to the module info. When set, check if the
module arguments only contain the allowed keys and give an error
otherwise.
2023-09-13 12:26:57 +02:00
Wim Taymans
016d15e598 ratelimit: missed -> suppressed
To avoid confusing with missed samples.
2023-09-08 12:18:23 +02:00
Wim Taymans
9f30e58ef2 pipe-tunnel: support pipe-source as a driver
Use a timer to periodically schedule the pipe-source when configured
as a driver. Adjust the timeout period based on buffer fill levels.

Fixes #3478
2023-08-31 11:41:00 +02:00
Wim Taymans
9f66c42d1f pipe-tunnel: rework the source
Let the source write into a ringbuffer when there is data available.

We then read from the ringbuffer when scheduled and use a dll to keep
the delay constant. We can later make this a driver and use the rate
correction to tweak the timeouts instead of resampling.

See #3478
2023-08-30 18:41:19 +02:00
Wim Taymans
bc15d0c766 pulse-server: support use_system_clock_for_timing
Move the pipe-sink to the dummy driver when instructed to use the system
clock.
2023-08-30 18:36:01 +02:00
Wim Taymans
20fdafb7f1 pulse-server: rename a variable to avoid confusion 2023-08-30 18:32:34 +02:00
Wim Taymans
89fab13c77 pulse-server: allow monitors when selecting source by index
Fixes #3476
2023-08-30 09:59:37 +02:00
Wim Taymans
dbf1ea0e78 pulse-server: add alsa source and sink module
See #3456
2023-08-23 11:15:59 +02:00
Wim Taymans
820ca90705 pulse-server: set all change_mask flags when removing
So that the logic to emit events will select sink and source objects.

Fixes #3414
2023-08-08 13:01:30 +02:00
Wim Taymans
c9b7367f8f pulse-server: keep track of sink/monitor changes
For sink nodes, keep a separate device_info around for the sink and
the monitor source part of the node. Only emit changes for the sink
and monitor source part when it changed.

See #3388
2023-07-31 11:23:47 +02:00
Wim Taymans
3a8894d2a4 pulse-server: improve device lookup
Make sure don't handle names ending in .monitor as a valid sink (because
it's a monitor on the sink).

Make sure we don't return a sink (monitor) as a source accidentally but
only when explicitly requested by name with the .monitor extension.

Makes

pactl set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo.monitor -5%
pactl set-source-volume alsa_output.pci-0000_00_1b.0.analog-stereo -5%

fail as expected.
2023-07-28 18:26:41 +02:00
Wim Taymans
3f77c4e25f pulse-server: move the changed counter internally
We don't actually use this counter anywhere.

Change the counter to a mask that will contain object specific changes
to the params. This should make it possible to track what kind of
changes where done to the object and make it easier to emit the right
events later.
2023-07-28 13:31:02 +02:00
Wim Taymans
39a1887a0b pulse-server: improve network and virtual node checks
Tag the sink/source as HARDWARE when it's not virtual, the presence
of a DEVICE_API property is not a good check.

Make a method to check if a node is a NETWORK sink/source to make it
use the same logic everywhere.
2023-07-26 11:51:48 +02:00
Wim Taymans
ad71dd89a2 protocol-pulse: remove private.h include
See #3243
2023-07-11 19:37:49 +02:00
Wim Taymans
dc07c2321b spa: add spa_ratelimit 2023-07-11 19:25:35 +02:00
Barnabás Pőcze
7d6fc0f544 pulse-server: fix remove proplist command
`command` is never equal to `COMMAND_UPDATE_CLIENT_PROPLIST`,
instead, the check should be against `COMMAND_REMOVE_CLIENT_PROPLIST`.
2023-07-11 16:04:53 +02:00
Barnabás Pőcze
fe45786a5d treewide: add some examples for the spa_auto* macros 2023-07-11 14:23:53 +02:00
Wim Taymans
895e516a75 pulse-server: support latency_msec in module-raop-discover
See #3247
2023-07-04 14:09:15 +02:00
Barnabás Pőcze
0f70256230 pulse-server: include "reply.h" in "reply.h"
So that definitions are checked against declarations.
2023-07-03 19:40:31 +02:00
Barnabás Pőcze
3b4a255dec pulse-server: format_info_from_spec(): remove redundant decl 2023-07-03 19:40:31 +02:00
Wim Taymans
c34a987076 pulse-server: add option to disable fix_ flags
Document the pulse.fix properties.
Add an option to disable handling of the FIX flags when the pulse.fix.
property is set to an invalid value/0.

See #3317
2023-07-03 16:39:32 +02:00
Wim Taymans
f612ffe8e4 pulse-server: use the fixed rate for graph rate
We need to use the format rate for calculating the buffer size and
latency but the fixated rate for the graph rate.

See #3317
2023-06-30 12:34:25 +02:00
Wim Taymans
91ac3acf3d pulse-server: debug the fixed format/rate/channel 2023-06-30 12:34:25 +02:00
Barnabás Pőcze
2abd3432b8 pulse-server: module-combine-sink: remove redundant member
`module_combine_sink_data::info` member has not been used
since 782e0dfb1f, so remove it.
2023-06-29 23:57:48 +02:00
Wim Taymans
f9efc63a04 pulse-server: make sure we have a card_name
Clients crash if the card name is NULL so make sure we generate
a backup name.
2023-06-28 16:18:44 +02:00
Wim Taymans
0156d63109 audioconvert: don't negottiate rate when resample is disabled
This will leave the negotiated rate 0 when parsed and instructs the
stream to follow the graph rate.
2023-06-26 11:23:29 +02:00
Wim Taymans
b464d2145d pulse-server: don't override initial volume/mute
When we are asked to apply the initial volume/mute, don't overwrite it
with the default volume.

Fixes #3306
2023-06-23 09:51:09 +02:00
Wim Taymans
989c61e8a1 pulse-server: add virtual-sink and virtual-source
Although those are example elements, they actually work and we can
implement them as well.
2023-06-16 12:18:36 +02:00
Wim Taymans
a0a32af386 pulse-server: add 2 quirks to block sink/source updates
See #1517
2023-06-15 11:45:43 +02:00
Wim Taymans
8eb6c0ec33 pulse-server: handle special device names in play/record
@DEFAULT_MONITOR@ finds the default sink but returns is_monitor true.

Always lookup the device based on the name and index. This transform
the special device names like @DEFAULT_XXX@ to the default device.

Always use the found device name as the target. Make sure to set the
CAPTURE_SINK property when dealing with a monitor.

Fixes #3284
2023-06-11 18:37:24 +02:00
Wim Taymans
004d3d900a pulse-server: improve debug 2023-05-24 18:01:19 +02:00
Pauli Virtanen
38860630a5 pulse-server: module-gsettings: check schemas exist before starting
Check the required GSettings schemas exist before trying to use them, as
g_settings_new aborts if they are missing.  Instead, make it just log
errors.
2023-05-21 10:18:56 +00:00