Commit graph

2305 commits

Author SHA1 Message Date
Barnabás Pőcze
f5e561c2fe pulse-server: module: remove unused client argument
None of the modules use the `client` argument in their
unload callbacks. Remove it.
2022-02-02 15:40:43 +00:00
Barnabás Pőcze
bc2914b3e9 pulse-server: pending-sample: move reference counting
Move the reference counting from `pending_sample_free()`
into `on_sample_done()` so that the client's references
are managed in a single place.

The reason why `pending_sample_free()` cannot simply call
`client_unref()` is that `client_free()` may be called from
`manager_disconnect()` regardless of the reference count,
and, in turn, `pending_sample_free()` may be called,
which could then lead to a recursive call to `client_free()`.
2022-02-02 15:40:43 +00:00
Barnabás Pőcze
29a288ebae pulse-server: pending-sample: remove done flag
The `done` member of the `pending_sample` struct is only ever
set, but never read. Remove it.
2022-02-02 15:40:43 +00:00
Barnabás Pőcze
9447dbe4f8 pulse-server: remove unnecessary include 2022-02-02 15:40:43 +00:00
Barnabás Pőcze
5db2c6cc32 pulse-server: simplify a condition
`a || (!a && b)` equals `a || b` due to the
short-circuiting nature of `||` and `&&`.
2022-02-02 15:40:43 +00:00
Barnabás Pőcze
6d0075b4e9 pulse-server: client: cancel related work queue jobs 2022-02-02 15:40:43 +00:00
Barnabás Pőcze
78aaa0a3dd pulse-server: client: move to cleanup list on detach
Move a client to the `impl->cleanup_clients` list right
after it has been removed its server's `clients` list.
2022-02-02 15:40:43 +00:00
Barnabás Pőcze
d2edb1ab16 pulse-server: client: do not leave dangling pointers behind 2022-02-02 15:40:43 +00:00
Wim Taymans
432f464297 conf: implement match rules with conf_section_for_each 2022-02-01 16:35:16 +01:00
Wim Taymans
dbab29d9db pulse-server: improve remap sink/source properties
Make the NODE_DESCRIPTION based on target sink or node.name
2022-01-31 12:40:38 +01:00
Wim Taymans
7ec920b0af pulse-server: improve remap sink/source properties
Make the same MEDIA_NAME and NODE_DESCRIPTION for both streams.
Make a better NODE_NAME for the other stream with a prefix.
2022-01-31 12:07:49 +01:00
Wim Taymans
115875dc5b pulse-server: add more properties
Add device.class property
2022-01-29 11:21:31 +01:00
Wim Taymans
78ff44b91d pulse-server: fill description for remap module
See #2076
2022-01-29 11:11:44 +01:00
Wim Taymans
6543899fe6 pulse-server: implement stream_buffer_attr 2022-01-28 17:34:36 +01:00
Wim Taymans
ce03fc7c15 pulse-server: increase maxlength to match tlength
When we need to increase tlength because of a quantum change, increase
maxlength as well, but clamp it to MAXLENGTH.

See #2069
2022-01-28 16:23:42 +01:00
Wim Taymans
1ac1f914e3 pulse-server: allows allocate MAXLENGTH for the ringbuffer
See #2069
2022-01-28 16:21:03 +01:00
Wim Taymans
5ead4507cc pulse-server: ensure tlength <= maxlength
See #2069
2022-01-28 16:15:26 +01:00
Wim Taymans
ead827d6cb modules: limit the max amount of items in the protocol
For now, put a limit on the amount of items we can send and receive
over the native protocol. A more complex way of allocating and freeing
can be implemented later when we really need to raise the limits.

Fixes #2070
2022-01-28 15:55:44 +01:00
Wim Taymans
36d78c41a0 modules: refactor permissions parsing 2022-01-28 10:51:09 +01:00
Wim Taymans
98aa2a04c7 modules: refactor param_info_parsing
To add more checks later.

See #2070
2022-01-28 10:35:14 +01:00
Wim Taymans
ef8fa3dc6f modules: refactory param parsing
So that we can add some more checks later.

See #2070
2022-01-28 10:25:30 +01:00
Wim Taymans
71a86877b7 modules: refactor parse_dict
Make a macro from parse_dict and move the n_items parsing and alloca
in it. This should make it easier to check the data.

See #2070
2022-01-28 10:01:12 +01:00
Wim Taymans
fd1112c4e2 modules: add latency and rate params to protocol-simple
See #2068
2022-01-27 16:56:22 +01:00
Wim Taymans
ee007eaf6c modules: improve simple-protocol arguments
Use the format parsing code to also parse the channel_map.
Improve serialization of the properties.

See #2068
2022-01-27 16:31:01 +01:00
Wim Taymans
3399d58e85 modules: compile rtkit module instead of using a symlink
The rpath is otherwise not right.

Fixes #2065
2022-01-25 16:42:27 +01:00
Wim Taymans
db2719f1f4 pulse-server: always advance the read pointer in underrun
We should always advance the read pointer when we are underrun and
not corked. This will request more bytes from the client to make
things advance.

Fixes #2041
2022-01-25 15:21:31 +01:00
Wim Taymans
b9c8f0f6b9 pulse-server: don't complete drain when corked
A corked stream should not complete a pending drain operation.
2022-01-25 15:20:27 +01:00
Wim Taymans
1b0252c267 Revert "pulse-server: don't ask data when corked"
This reverts commit 3b14afe317.

Breaks mpv..
2022-01-25 13:23:58 +01:00
Wim Taymans
3b14afe317 pulse-server: don't ask data when corked
Don't ask for data when we are corked. Some clients like telegram
don't send data when corked.

See #2041
2022-01-25 13:18:56 +01:00
Wim Taymans
3a86ae0276 client-node: handle mix init errors better
Make sure we mark the port invalid when we can't allocate an id
for it. Also check that the id does not exceed the max amount of
areas we have allocated and release resources correctly.
2022-01-24 09:51:10 +01:00
Wim Taymans
7e387d842b impl-link: handle mixer failures better
It is possible that the mixer input can't be created because of hitting
the max limits of dsp mixer or client-node. Make sure we handle those
errors, destroy the link and clean up properly.
2022-01-24 09:39:52 +01:00
Wim Taymans
4f57f3cdae pulse-server: allow per-application latency quirks
Make it possible to set latency and buffer parameters in the matching
rules.

Add a rule for speech-dispatcher and force it to some larger latency.
2022-01-22 16:17:09 +01:00
Wim Taymans
7f08cadca4 pulse-server: move quirks to config section
Make a pulse.rules section in the config file with match rules. Add
support for setting custom client properties and quirks.
2022-01-22 11:51:11 +01:00
Joakim Olsson
2e1a08edc2 module-echo-cancel: Configure buffersize and play delay
* Possible to set max buffer size from config
* New play buffer with possibility to set a delay sent to backend,
  orignal play buffer is still sent without delay to output

Change-Id: If787977305586a40cba4585ab6dad4b7163bee5a
2022-01-21 16:57:04 +00:00
Wim Taymans
000b448ba3 pulse-server: set the node.name on the input/output
Not on the global property because module-loopback does not read it
from there anymore in order to have unique names.
2022-01-21 17:55:32 +01:00
Wim Taymans
a72a877515 modules: improve node.name
Make sure the node name is something unique for the capture and playback
part of filter-chain and loopback so that volumes can be remembered
separately.

Fixes #1983
2022-01-21 17:42:29 +01:00
Wim Taymans
373432a4e7 pulse-server: implement module-x11-bell
Just load the x11-bell module into the pulse server.

See #1668
2022-01-21 17:01:18 +01:00
Wim Taymans
5c894c2283 modules: handle x11 sample fallback better 2022-01-21 16:47:42 +01:00
Wim Taymans
0cd0ef5912 modules: add x11-bell module
It listens for X11 bell events and plays a sample with libcanberra.

Fixes #1668
2022-01-21 16:30:02 +01:00
Robbert van der Helm
5d890435b4 module-rt: Handle realtime sched check edge cases
The policy can of course be higher than zero if the current thread uses
anything other than `SCHED_OTHER`, and `SCHED_RESET_ON_FORK` needs to be
set according to the old policy or we'll either run into errors or cause
unwanted side effects.
2022-01-21 14:17:29 +01:00
Robbert van der Helm
e60f62e69b module-rt: Don't explicitly check RLIMIT_RTPRIO
There are a couple other ways to allow a user/process to use realtime
priviliges like `CAP_SYS_NICE`. Instead of trying to check every
possible factor, just trying if setting realtime priviliges works is
going to be a much cleaner solution.
2022-01-21 14:17:29 +01:00
Barnabás Pőcze
cec9347864 pulse-server: iterate addresses correctly
When creating servers, actually iterate the addresses correctly instead
of only using the first address.

Fixes #2047
2022-01-21 10:25:46 +01:00
Wim Taymans
695f8dfdd9 roc: NODE_PASSIVE can only be on the streams
Don't put NODE_PASSIVE on sinks/sources because it will request passive
links to the linked node and thus not be activated.

Fixes #2045
2022-01-20 21:47:37 +01:00
Wim Taymans
5a72e2769a adapter: add adapter.auto-port-config property
This automatically configures the node in a supported format with the
highest amount of channels. Options are available to enable monitor
and to override the port channels as AUX or UNKNOWN.
2022-01-20 18:08:30 +01:00
Wim Taymans
aa128ed489 spa: make common function to find type from short name 2022-01-20 18:08:30 +01:00
Wim Taymans
9935f921c5 pulse-server: use TARGET_OBJECT with the target serial
Use a new TARGET_OBJECT property to ask to be linked to a target by name
or serial. This should deprecate NODE_TARGET later.
2022-01-19 17:09:55 +01:00
Wim Taymans
dec2b1b9a2 pulse-server: set serial to invalid on parse error 2022-01-19 16:57:17 +01:00
Wim Taymans
f3dfa9b9af module-rt: only change nice level on our servers
Make the default nice.level an invalid value, that is not configured
as the priority on a process.
Explicitly enable a nice level on our daemon processes.

Fixes #2034
2022-01-18 13:32:25 +01:00
Wim Taymans
d19ab798be module-metadata: allow create without client
Which will create a new impl-metadata object.
2022-01-18 12:42:23 +01:00
Wim Taymans
72e748a197 adapter: add node.param.* property support
You can pass some node.param.* properties to the adapter and it will
configure them, so you can do:

    node.param.Props = {
        params = [
            audio.channels 6
        ]
    }

Remove adapter.port-config because it can be done with node.param
2022-01-18 11:55:08 +01:00