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
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
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
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
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
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
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
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
1d03923a97
pulse-server: use object serial as index
...
Use the lower 32 bits of the object serial as the index. When there is
an overflow, use an invalid index, which will probably result in a
protocol error.
2022-01-17 12:48:31 +01:00
Wim Taymans
0904a35ba8
pulse-server: make separate index
...
Separate the id (the pipewire object id) from the index (what we send to
the client to identify the objects).
2022-01-17 12:01:13 +01:00
Wim Taymans
955e4287ab
pulse-server: index flags are only used for modules
...
one flag for the internal extension modules, another flag for the
modules we load in pulse server that don't really have a matching
pipewire module.
2022-01-17 10:28:09 +01:00
Wim Taymans
6a2aea8e0a
pulse-server: remove the MONITOR flag
...
PulseAudio has separate namespaces for sources and sinks so we can reuse
the same id for the sink and its monitor.
2022-01-17 10:25:26 +01:00
Wim Taymans
48e83fc780
pulse-server: find_object -> find_object_by_id
2022-01-17 10:04:28 +01:00
Wim Taymans
3b85369ff6
pulse-server: use key instead of id for the data key
2022-01-17 10:03:02 +01:00
Wim Taymans
b2d221a66c
pulse-server: rename obj_id -> id
...
Simply use id for the object id.
2022-01-17 09:50:41 +01:00
Wim Taymans
5a315d5351
pulse-server: rename some id -> index
...
It's port_index and profile_index.
2022-01-17 09:49:39 +01:00
Wim Taymans
7c6649b5e5
pulse-server: use quantum_limit
...
Don't use max_quantum as the upper quantum limit, this is now scaled
with the rate. Use quantum_limit instead. We don't really care about the
max_quantum anymore so get rid of the field.
2022-01-14 16:45:41 +01:00
Wim Taymans
6394537dbd
pulse-server: remove unused field
...
And it's not quite useful to debug the value either.
2022-01-14 10:41:11 +01:00
Wim Taymans
661ff95748
pulser-server: use max_client settings instead of constant
2022-01-13 19:53:06 +01:00
Barnabás Pőcze
3d081215f2
pulse-server: improve message queue pruning
...
Firstly, separate the message dropping logic into
its own `drop_from_out_queue()` function.
Secondly, do not check earlier messages if the NEW
event for a particular object has been reached while
processing a REMOVE event for that object.
Thirdly, if - while processing a REMOVE event -
the corresponding NEW event is found and dropped,
drop the REMOVE event as well.
See #1840
2022-01-13 18:14:42 +00:00
Pauli Virtanen
11e57de7b0
pulse-server: index mask is now 24 bits
...
Update INDEX_MASK to match the new id allocation scheme.
2022-01-13 19:08:45 +02:00
Wim Taymans
3a49168f26
pulse-server: use the upper 8 bits of the id to mark things
...
The upper 8 bits of the object id is always 0 so we can use it to mark
our internal objects.
2022-01-13 14:54:16 +01:00
Wim Taymans
776b52749f
Use configured quantum_limit instead of hardcoded value
...
Parse the quantum_limit parameters and use this to scale the buffers so
that they can contain the maximum allowed samples instead of the
hardcoded 8192 value.
See #1931
2022-01-12 17:50:12 +01:00
Wim Taymans
676bed734c
context: scale max_quantum and add quantum_limit
...
Also scale the max_quantum with the selected rate. Add a new
quantum_limit property that is the upper limit of the quantum regardless
of the sample rate, this is usually the allocated buffer size.
See #1931
2022-01-12 17:44:45 +01:00
Wim Taymans
982758ffed
pulse-server: calculate missing bytes differently
...
Based on patch from Barnabás Pőcze <pobrn@protonmail.com>
Instead of trying to keep track of the missing bytes ourselves, use the
simple tlength - avail - requested formula to request more bytes from
the client.
Fixes #1981
2022-01-10 15:08:52 +01:00
Wim Taymans
163c365340
pulse-server: implement control arg for module-ladspa
...
See #1987
2022-01-07 16:40:36 +01:00
Wim Taymans
222ef88704
pulse-server: request more data when seeking backwards
...
Immediately ask for more data when we seek backwards so that we don't
underrun in the next process cycle.
See #1981
2022-01-07 10:59:41 +01:00
Wim Taymans
ab425d44b8
pulse-server: after uncork, ask for missing data
...
When we uncork, ask for any missing data immediately so that we don't
underrun in the next process cycle.
See #1981
2022-01-07 10:41:10 +01:00
Pauli Virtanen
9eddd0474f
pulse-server: show monitor sources with device.class=monitor
...
Pulseaudio shows monitors with device.class=monitor, so we follow.
2022-01-06 20:32:53 +00:00
Wim Taymans
22625fb658
pulse-server: support server config
...
Extend the server.address property so that you can also specify
an object per server. Add support for configuring some aspects of the
server such as max-clients and backlog.
Most importantly, the pipewire client.access can be configured per
server.
See #1960
2022-01-04 14:30:33 +01:00
Wim Taymans
611591d0fc
json: add spa_json_parse_stringn()
...
It also checks the destination size.
2022-01-04 12:37:00 +01:00
Wim Taymans
c46113faa3
json: spa_json_get_string() writes up to len chars or fail
2022-01-04 10:42:32 +01:00
Wim Taymans
13c0cbb899
pulse-server: remove unused defines
2022-01-04 10:08:54 +01:00
Wim Taymans
35cbe4e939
buffers: make alignment optional
...
Make the alignment parameter optional when negotiating buffers.
Default to a 16 bytes alignment and adjust for the max cpu
alignment.
Remove the useless align buffer parameter in plugins, we always
set it to 16 anyway.
2022-01-03 12:32:26 +01:00
Barnabás Pőcze
e35b9828d3
pulse-server: make GET_SERVER_INFO accessible without manager
...
For example, pulseaudio.js[1] immediately sends a
GET_SERVER_INFO request after AUTH, and only later
issues a SET_CLIENT_NAME.
See #1966 .
[1]: https://github.com/janakj/pulseaudio.js
2021-12-31 02:12:03 +01:00
Barnabás Pőcze
1c3e45a584
pulse-server: add command access control
...
By default require that a client is authenticated and
has a manager to be allowed to run a command.
Specially:
* AUTH requires nothing
* SET_CLIENT_NAME and STAT only require authentication
2021-12-31 02:11:59 +01:00
Barnabás Pőcze
92abc7b7ad
pulse-server: store whether the client has been authenticated
...
Add a new flag to the client struct which saves whether or not
the client has successfully authenticated itself.
2021-12-30 21:24:06 +01:00
Barnabás Pőcze
705ac662e3
pulse-server: use macro to generate command entries
2021-12-30 21:22:19 +01:00
Wim Taymans
2f742bb56c
Revert "pulse-server: use partial data as missing/played for"
...
This reverts commit 08b18b9da4 .
This was likely caused by a bug in mpv
Fixes #1956
2021-12-29 19:49:15 +01:00
Barnabás Pőcze
c04580a256
pulse-server: module-roc-{sink,source}: fix potential memory leaks
...
Two `pw_properties` objects are not freed in the error path.
Resolves Coverity issues: 1468665, 1468666, 1468667, 1468668.
Furthermore, the module argument string is also not freed.
2021-12-29 15:16:58 +01:00
Barnabás Pőcze
6d64454300
pulse-server: module-zeroconf-publish: harmonize log messages
...
Use lowercase letters consistently and report errors.
2021-12-28 23:56:03 +01:00
Barnabás Pőcze
7fb27098b9
pulse-server: module-zeroconf-publish: handle allocation failure
2021-12-28 23:37:53 +01:00
Barnabás Pőcze
417b2e2bf7
pulse-server: module-zeroconf-publish: remove empty line
2021-12-28 23:37:53 +01:00