Commit graph

2305 commits

Author SHA1 Message Date
Wim Taymans
8712cfb6a1 pulse-server: remove MIN_BLOCK
It is not really used and minreq is good enough
2021-02-23 12:29:39 +01:00
Wim Taymans
8414092763 Rework profile/route handling
Add save property to Profile and Route params to notify the session
manager that they should be saved. Let the session manager only save
the Profile and Routes with the save flag.
Make pulse-server set the save flag on Profile and Route changes.
The result is that we can make a difference between user requested
changes and automatical changes and only remember the user preferences.
When a port changes availability, first check if we need to perform
a profile switch, if not select the new best port.
2021-02-22 16:51:59 +01:00
Wim Taymans
1c3a17362e pulse-server: fix weird property handling
There is no need to copy the properties, just pass ownership.
Make sure to always have properties for the server. Ensure we
clean up properties on error.
2021-02-21 09:43:02 +01:00
Wim Taymans
fcf00b3d35 pulse-server: handle unsupported formats
We can only handle PCM encodings for now, fail conversion otherwise.
If we have no supported formats, return an error code.

VLC first try to send AC3 or EAC3 passthrough and then tries again
with decoded data. If we accept the encoded data we are just playing
noise.

Fixes #428
2021-02-19 15:25:32 +01:00
Wim Taymans
4b591df145 pulse-server: print encoding name in format_info 2021-02-19 14:57:11 +01:00
Pauli Virtanen
ed9614077c pulse-server: implement node latency offset
Also add facility for storing user data on objects.
2021-02-18 11:33:45 +00:00
Wim Taymans
7053936ffd don't attempt to connect to empty remote name
Fixes jconvolver startup.

See #744
2021-02-18 10:22:39 +01:00
Wim Taymans
60233e30a7 jack: tweak names a little
Move the Description in the main node/port name. This then matches
the device names seen in pavucontrol.
Make the port alias contain the node nick.
2021-02-17 11:36:16 +01:00
Wim Taymans
38a7333608 adapter: number unknown ports from 1 instead of 0
This makes it like what jack does.
2021-02-17 10:14:47 +01:00
Wim Taymans
3aa0a39e30 pulse-server: track volume/mute changes
When something else changes the volume of our stream, store the new
value in our volume/mute state so that we always have an up-to-date
value when we compare our volume to the desired volume.

See #721
2021-02-16 17:21:26 +01:00
Wim Taymans
9074bfc23a module-rtkit: don't use dbus when disabled 2021-02-12 18:10:40 +01:00
Wim Taymans
a243d126db Fix tests, use the right config dir 2021-02-12 10:33:02 +01:00
Wim Taymans
80825aeaea conf: more work on config changes
Add -c option to pipewire to select config file. Use this to select
the uninstalled conf file.
Rename conf properties, prefix with context.
Simplify the main daemon now that everything can go in config.
Simplify pipewire-pulse now that we can put everything in config, it's
now virtually the same as pipewire but with a differenct config file.
Parse server addresses as array of strings.
2021-02-12 10:31:29 +01:00
Wim Taymans
c605672d43 Implement per client config files
Move the daemon config file loading to a new conf.c file used by
the context to load the configuration. This replaces the module
profiles and some hacks to move properties around.

If there is nothing other specified with $PIPEWIRE_CONFIG_NAME or
a property, the client.conf file is loaded as a fallback.

Update the session manager config file to load the modules via the
config now. Rename the session modules section to another name.

Update pipewire-pulse to also load a specific pulse property file.
This then makes it pssible to assign specific RT priorities for the
pipewire-pulse process.
2021-02-12 10:07:16 +01:00
Nicolai Syvertsen
3c0821775f pipewire-pulse: Don't send sink-input volume updates unless it has actually changed 2021-02-10 19:12:10 +01:00
George Kiagiadakis
0ce6de8fdf src: change license (LGPL -> MIT) on left-over LGPL files
Discussed with and approved by Wim
2021-02-10 11:52:09 +00:00
Wim Taymans
c140a573be pulse-server: try to avoid setting the same volume/mute 2021-02-09 18:17:45 +01:00
Wim Taymans
d60f2b9b92 pulse-server: write captured data in fragsize chunks
Keep on queuing chunks of fragsize length until we read all the
captured data. Else we would fall behind and really never catch
up.
2021-02-09 17:37:41 +01:00
Wim Taymans
210950dc0a context: disable mlock warnings by default
Make this a tunable option instead.
2021-02-08 10:59:02 +01:00
Pauli Virtanen
3e9bf908ac pulse-server: clients expect stream names to be non-null
Fixes crash in pavucontrol when media name is missing.
2021-02-06 20:19:19 +02:00
Pauli Virtanen
d617d7e1a3 pulse-server: SET_DEFAULT_* commands change the configured values 2021-02-06 18:10:28 +00:00
Wim Taymans
4f28edd4f7 pulse-server: limit packets to fragsize
When sending captured data to a client, pulseaudio limits the
size of the block to the fragsize. Let's do the same just in case
a client can't deal with more data.

See #615
2021-02-05 11:36:23 +01:00
Wim Taymans
c25bdce645 rework param updates
Make it possible to add a NULL param to the pending list. The NULL
param removes all previous updates.
When applying the updates, the NULL param removes the params from
the target list.

For the cached params in the node/device/port we need to be careful
because multiple clients might ask for updates concurrently. Clear
the pending list whenever a new param update starts so that we always
only keep the last set of updates.

This has two advantages: it actually removes params that become
unreadable or that got removed and it allows us to update the target
list more efficiently in one single loop.
2021-02-05 11:03:47 +01:00
Wim Taymans
994fc1169e Revert "rework param updates"
This reverts commit 5aa7746c95.

Routes are duplicated for some reason, needs more debugging.
2021-02-04 20:56:54 +01:00
Wim Taymans
be25a00ddb pulse-server: detect flatpak and pass on the pipewire connection 2021-02-04 17:18:33 +01:00
Wim Taymans
20008b4846 pulse-server: actually fill in the maxlenght and fragsize.. 2021-02-04 14:53:28 +01:00
Wim Taymans
5aa7746c95 rework param updates
Make it possible to add a NULL param to the pending list. The NULL
param removes all previous updates.
When applying the updates, the NULL param removes the params from
the target list.

This has two advantages: it actually removes params that become
unreadable or that got removed and it allows us to update the target
list more efficiently in one single loop.
2021-02-04 13:26:35 +01:00
Wim Taymans
d85862af71 module-access: fall back to client requested access mode
When nothing else was decided, use the client requested access
method. The idea is that pipewire-pulse will detect a flatpak client
an performs the pipewire connection on behalf of the client,
requesting flatpak access restrictions.
2021-02-04 11:48:45 +01:00
Wim Taymans
8befe9e238 pulse-server: allow objects with priority 0 to be default
Also use the object with priority 0 as a best option when there
is not yet anything else.
2021-02-03 10:02:22 +01:00
Wim Taymans
b8ef0fc5bb module-access: make access.allowed an array
Reformat the config file a little
2021-02-02 17:48:25 +01:00
Wim Taymans
7c0081eb6f pulse-server: move memblock back to debug 2021-02-02 15:24:05 +01:00
Wim Taymans
0d2b9104d1 pulse-server: fix seek modes
Adjust missing when seeking and update the filled level correctly.

Fixes #653
2021-02-02 15:13:49 +01:00
Wim Taymans
2b44f42845 pass the complete buffer size to snprintf
There is no reason to pass size-1, snprintf will always put a \0
at the end.
2021-02-02 12:09:29 +01:00
Wim Taymans
748e205453 pulse-server: hand out silence when corked
In the corked state we simply hand out silence and don't try to
consume data from our ringbuffer.
Also set the corked state before syncing this with the data thread.

Fixes #662
2021-02-02 10:42:34 +01:00
Wim Taymans
80368ab8ae pulse-server: remove unused macro 2021-02-01 15:16:39 +01:00
Wim Taymans
60aef11072 pulse-server: if prebuf == 0, keep increasing playing_for
Or else the client pauses and time stops. Makes GStreamer
pipelines complete.
2021-01-30 21:04:07 +01:00
Wim Taymans
d1c0244512 pulser-server: keep updating missing bytes if prebuf == 0 2021-01-30 20:38:47 +01:00
Wim Taymans
d37742b410 pulse-server: handle prebuf better
prebuf == 0 should keep the read pointer updating
prebuf > 0 should pause
2021-01-30 19:48:01 +01:00
Wim Taymans
98dab7903a pulse-server: add buffer attributes as properties 2021-01-30 19:32:13 +01:00
Wim Taymans
7cc5026c02 pulse-server: remove useless _pop() 2021-01-29 16:58:17 +01:00
Wim Taymans
1ea8282a24 pulse-server: don't update ringbuffer in underrun 2021-01-29 10:45:26 +01:00
Wim Taymans
f8d57d03ca pulse-server: keep separate counter for missing bytes
And only increment when consumed from ringbuffer. In underrun we
play silence and don't ask for the missing bytes.

Fixes #616
2021-01-28 20:00:48 +01:00
Wim Taymans
09f423922d pulse-server: don't crash when alloc fails 2021-01-28 19:30:32 +01:00
Wim Taymans
8636c509f5 pulser-server: revert attempt to flush more
size is later used as the buffer size and might be too large.
2021-01-28 19:17:50 +01:00
Wim Taymans
b65b291bb2 pulse-server: make sure to count played samples
On underrun we need to keep on counting playing_for so fill this
in underrun and don't add this to missing to avoid double counting.

See #639
2021-01-28 18:59:03 +01:00
Wim Taymans
ac3555d6fc pulse-server: skip underrun more aggressively
Skip all of the underrun bytes immediately.

See #638
2021-01-28 17:56:32 +01:00
Wim Taymans
e172effe71 pulse-server: log the amount of underrun bytes 2021-01-28 17:56:07 +01:00
Nicolai Syvertsen
ebcdfe8f5d pipewire-pulse: better default null sink description
This includes the sink_name and media class.
2021-01-27 19:09:21 +01:00
Nicolai Syvertsen
c092f0c1c4 pipewire-pulse: null sink must have a description
Certain pulseaudio clients crash if this is unset
2021-01-27 15:31:54 +00:00
Wim Taymans
0be851739f improve config parsing
Use get_string to get object keys in a more generic way.
2021-01-27 15:36:32 +01:00