Commit graph

1142 commits

Author SHA1 Message Date
Wim Taymans
96a2a2b4e2 pulse-server: Use the spa json implementation 2021-01-19 16:57:33 +01:00
Wim Taymans
0e5ad1c0a4 module-rtkit: log the dbus error as a warning 2021-01-19 15:02:37 +01:00
Wim Taymans
abfc67a3ca Revert "remove mlock and use MAP_LOCKED"
This reverts commit ab91e94b59.

When no memory can be locked, the mmap fails with -EAGAIN.

Fixes #592
2021-01-19 14:47:52 +01:00
Wim Taymans
ab91e94b59 remove mlock and use MAP_LOCKED
The warnings are confusing and a properly tuned system would have
the limits set correctly.
2021-01-19 11:59:21 +01:00
Wim Taymans
89641785c3 pulse-server: keep global free message pool 2021-01-19 11:06:00 +01:00
Wim Taymans
7e5441fbb3 pulse-server: implement stats 2021-01-19 10:52:29 +01:00
Pauli Virtanen
d46c58e958 pulse-server: behave like PA when moving streams to default
Pulseaudio unsets the preferred sink/source when stream is moved to a
default target. Emulate this behavior by setting + unsetting
target.node, which informs policy-node to move it accordingly.
2021-01-18 22:40:27 +02:00
Wim Taymans
02931df835 pulse-server: start with underrun_for = -1
PulseAudio starts with underrun_for equal to -1, sets it to 0 when
something was played and increments it from then on with the number
of bytes played.
2021-01-18 17:16:37 +01:00
Wim Taymans
55915f420e pulse-server: on underrun, pretend we read from the ringbuffer
Also update the ringbuffer read pointer on underrun.
2021-01-18 16:24:46 +01:00
Wim Taymans
6b2ec6d619 pulse-server: require at least 32 samples per buffer 2021-01-18 16:24:00 +01:00
Wim Taymans
235d25316c pulse-server: make sure we never try to ask more than tlength 2021-01-18 16:23:24 +01:00
Wim Taymans
76aff7640f pulse-server: improve variable name 2021-01-18 16:22:30 +01:00
Wim Taymans
be9c2f9757 pulse-server: account for underrun
Not quite sure, it needs more investigation but It seems the time
needs to increase when underrunning.

See #510
2021-01-17 21:07:31 +01:00
Wim Taymans
bf25fc1388 pulse-server: always use rate_match value when available
The minreq is just a fallback for when we don't know the exact
amount of required samples to consume from the ringbuffer.
2021-01-16 17:16:02 +01:00
Wim Taymans
b118a84a60 module-metadata: set factory id in properties 2021-01-14 19:22:18 +01:00
Wim Taymans
be107317f5 Silence some dbus errors
Log info when a service is not running and disable it.
2021-01-14 17:11:42 +01:00
Wim Taymans
3162465f6f portal: error->warn when the portal pid is unknown 2021-01-14 15:07:42 +01:00
Wim Taymans
4cba8fc7e9 pulse-server: implement set_sample_rate 2021-01-12 13:14:05 +01:00
Wim Taymans
219248d43e connection: guard against NULL 2021-01-12 10:13:02 +01:00
Pauli Virtanen
84ebce147a module-protocol-native: add test for reentering 2021-01-12 10:13:02 +01:00
Pauli Virtanen
23f010541f module-protocol-native: make demarshaling safe vs. reentering
The message structures returned by pw_protocol_native_connection_get_next
point to data that is contained in the buffer of the connection.

The data was invalidated when pw_protocol_native_connection_get_next was
called the next time, which made the connection loop non-reentrant, in
cases where it was re-entered from demarshal callbacks.

Fix this by allocating new buffers when reentering and stashing the old
buffers onto a stack. The returned message structure is also stored on
the stack to make lifetimes to match.
2021-01-12 10:13:02 +01:00
Wim Taymans
7ae1ea1420 pulse-server: set default channel_map
Set a default channel map when not otherwise set. Makes pulseeffects
work.
2021-01-09 12:46:00 +01:00
Wim Taymans
f94d2e7da5 pulse-server: use rate match to read from ringbuffer
Use the rate match io are to read the exact amount of samples we
need for this cycle from the ringbuffer. We can then request lower
latency.

There will also be less buffering in the audioconverter, which makes
our timestamps more accurate.
2021-01-08 17:22:15 +01:00
Wim Taymans
bad9a36a84 rtkit: set nice-level to -11 by defaukt
To mimic pulseaudio.
2021-01-05 12:33:41 +01:00
Pauli Virtanen
b76bcdc70d pulse-server: NULL means default only if id==INVALID
The default values also only apply for sources/sinks which have
defaults.
2021-01-04 23:54:48 +02:00
Wim Taymans
518365e350 pulse-server: fix module arg parsing
Parse the module arguments according to the pulseaudio syntax,
not our own syntax (which requires "" around a , delimter). Fixes
audio.position=FL,FR argument.

See #527
2021-01-04 17:25:28 +01:00
Wim Taymans
0bf7b07d91 pulse-server: improve warning 2021-01-02 20:37:44 +01:00
Wim Taymans
461e3db741 tests: fix some leaks
See #497
2020-12-21 20:07:02 +01:00
Wim Taymans
62954e14c3 node: improve profiler
Make a new complete event and use it instead of the start event
Use the start event at the start of the cycle
Make the profiler also log incomplete graph cycles
2020-12-20 20:37:21 +01:00
Wim Taymans
2d89ad8533 profiler: add xrun_count and latency to profiler 2020-12-20 12:32:54 +01:00
Wim Taymans
f7a7feea4e pipewire-pulse: use defines for our keys 2020-12-18 17:19:24 +01:00
Wim Taymans
bcceff4ab0 module-access: update with checks for fuse like upstream xdp 2020-12-18 15:48:13 +01:00
Wim Taymans
d2a5f5c1ae pulse-server: also cleanup sample when error
Remove the separate error event and merge with the done event with
error code. This then also marks the sample as done when in error
so that it gets cleaned up properly.

Fixes #486
2020-12-18 09:50:12 +01:00
Wim Taymans
1a690a0cbb pulse-server: limit writes to ringbuffer
We can't write more to the ringbuffer than its maxsize. Some clients
send more than the negotiated maxsize and cause a crash if we don't
clamp.

See #440
2020-12-17 19:39:12 +01:00
Wim Taymans
e0580fedc1 pulse-server: handle seek flags and offset
Fixes #485
2020-12-17 16:49:17 +01:00
Wim Taymans
00295b64b5 pulse-server: don't write too small buffers
Fixes #399
2020-12-11 18:09:21 +01:00
Wim Taymans
bcf6c0986e pulse-server: read in chunks of minreq from the ringbuffer
Don't read too large chunks from the ringbuffer but in minreq
increments. This is more what pulseaudio does.

Fixes #463
2020-12-11 12:45:01 +01:00
Wim Taymans
d3db703f77 pulse-server: improve some debug 2020-12-11 12:39:46 +01:00
Wim Taymans
4ef0ef464e pulse-server: warn for unsupported seek flags 2020-12-11 10:39:15 +01:00
Wim Taymans
606d48a3e8 adapter: remove unused defines 2020-12-09 20:32:05 +01:00
Wim Taymans
5469ac19ab pulse-server: map node.description to device.description
Makes Teamspeak work

Fixes #462
2020-12-08 12:20:47 +01:00
Wim Taymans
5a94bfc6cd pulse-server: add some more supported channel_map values 2020-12-07 21:52:09 +01:00
Wim Taymans
157d6de607 pulse-server: convert channel_map channels
channel_map contains pulseaudio channel names, convert them to
pipewire channel ids and then into pipewire channel names for the
null sink.
2020-12-07 20:29:22 +01:00
Wim Taymans
316a96d501 improve debug 2020-12-06 09:32:12 +01:00
Wim Taymans
203679f27e pulse-server: support lookup of monitor names
Support setting a monitor as default source.
2020-12-05 19:16:04 +01:00
Wim Taymans
cfe43cbea7 pulse-server: handle NULL as default sink/source
Fixes #444
2020-12-05 13:30:02 +01:00
Wim Taymans
8c4145291e pulse-server: name and id can't be both set in volume/mute 2020-12-05 13:27:42 +01:00
Wim Taymans
0fba936b06 pulse-server: use defines for default sink/source 2020-12-05 13:26:59 +01:00
Wim Taymans
c6663b6a18 pulse-server: fix set-port
Parse the name as a string
Pass the device id and port_id in the right properties
Return an error when unknown port was specified.

Fixes #443
2020-12-04 15:41:11 +01:00
Wim Taymans
745b7ee900 pulse-server: tweak some parameters to get lower latency 2020-12-04 15:11:35 +01:00