Commit graph

4634 commits

Author SHA1 Message Date
Wim Taymans
fe417bd123 improve latency debug 2021-12-07 15:31:32 +01:00
Quantum
8bab9a18ec Add all 32-bit packed little endian 10-bit RGB colour formats
Given that 10-bit colour is now becoming supported on Wayland, PipeWire
should be able to represent all the possible colour formats in order
for screen capture to work.

This commit adds all possible orderings of 10-bit RGB channels and 2
extra bits used for nothing or alpha in little endian to enum
spa_video_format. Note that Wayland only uses little endian for its
10-bit colour formats, and these are not the same as the big endian
formats in reverse order.
2021-12-07 11:22:04 +00:00
Wim Taymans
fbef731793 make some warnings into log
Move some warnings when a wakeup was missed to info messages. The
warning can repeat a lot and is otherwise quite useless and already
reported elsewhere.
2021-12-07 10:19:10 +01:00
Wim Taymans
a8139b7acf pulse-server: handle prebuf state better
When we have a prebuf value, we start in the prebuf state.
We go back to prebuf when we have a prebuf value and an empty
ringbuffer.
2021-12-03 17:49:59 +01:00
Wim Taymans
16665d74d2 pulse-server: don't clamp missing bytes to tlength
When we increase the quantum past the tlength, we need to be able to
ask for more bytes than the tlength or else we will never exit this
underrun state. Look at the last required bytes and use that if it's
larger then tlength.
2021-12-03 16:43:16 +01:00
Wim Taymans
1b94b66924 pulse-server: always asks for more data when underrun
Even when prebuffer is active, we need to ask for more data to
resolve the underrun.
2021-12-03 16:41:41 +01:00
Wim Taymans
97cad7284a latency: fix latency combine calculations
0 is a valid min latency so we can't use it as an unset value. Use
some large value instead and when nothing was configured, assume it
is 0.

Fixes #1839
2021-12-02 14:49:48 +01:00
Wim Taymans
ebd2af612a settings: use default rate as allowed rates as fallback 2021-12-02 11:35:13 +01:00
Wim Taymans
fe547251da filter-chain: don't use id in PropInfo for params
One should use the name of the property in params to access the
property.
2021-12-02 11:35:12 +01:00
Wim Taymans
f894a51eab protocol-native: keep reading messages after error
There is no reason to exit the message loop after receiveing an
error, we can just process the next message.
2021-11-30 12:25:33 +01:00
Wim Taymans
c9264c9ce1 core: disable bind version checks
Allow clients to bind to different versions of the server object.

When the server object is newer, it will adapt to the older version.

If the server object is older and the client tries to call a newer
method, it will receive an error. The right thing for the client is to
then ignore this and not call the method again. It should also probably
first check the server version before calling newer methods.
2021-11-30 12:16:35 +01:00
Wim Taymans
cc9fbe4375 pulse-server: add some debug 2021-11-30 09:22:58 +01:00
Wim Taymans
700a22b7f7 pulse-server: recover for underrun better
If we are underrun, don't update the read pointer and let the write
pointer catch up.
If we don't have enough data to fill a buffer, skip all the available
data and wait for the new request to arrive.

Fixes #1857
2021-11-29 20:22:05 +01:00
Wim Taymans
11b8a2aad4 buffer: handle the case where only MemPtr is selected
When we need to allocate buffers with shared memory but only MemPtr is
allowed, make sure we change this to MemFd.
2021-11-29 11:23:32 +01:00
Wim Taymans
a0bf0e0686 buffers: improve fallback memory allocation
If one of the link ports is remote, enforce shared memory for the
buffer data. We must not use MemPtr because it will not be possible
to transfer this to the remote client.

If none of the sides selected any buffer type but we need shared
memory for the data, select MemFd as the fallback. This avoids using
DmaBuf, that the client did not explicitly select.
2021-11-29 11:07:13 +01:00
Wim Taymans
cff8ac0cab client-node: improve memory checks
For MemPtr memory, we use the fd of the buffer metadata and chunk
info. Check that the memory is also in this block.
Check that all the memory of the buffer fits in the memory block.

See #1859
2021-11-29 10:42:02 +01:00
Wim Taymans
d3cd36ab54 mem: improve debug
Print unsigned values as unsigned.
2021-11-29 10:41:30 +01:00
Wim Taymans
1b06d4d7c4 settings: Add more runtime settings
Move settings defaults initialization to the settings file.
Expose clock.rate, clock.allowed-rates and clock.quantum as runtime
settings.
2021-11-26 16:47:43 +01:00
Wim Taymans
6dab305407 protocol-simple: clamp size to maxsize 2021-11-25 10:24:09 +01:00
Wim Taymans
a0d7fb01ba pulse-server: add size check when reading strings 2021-11-25 10:14:30 +01:00
Wim Taymans
5d20e3028a pulse-server: avoid reading past the message size
We can't really get into this situation but it is a good idea to check
that we don't try to read past the message length.
2021-11-25 09:48:34 +01:00
Wim Taymans
ac4ec20b01 pulse-server: free pending client message
If the client is destroyed before it could completely read the message,
free the pending message as well.

See #1840
2021-11-23 18:13:35 +01:00
Wim Taymans
9feecb36d0 pulse-server: don't add large blocks to cache
See #1840
2021-11-23 17:44:01 +01:00
Wim Taymans
418c6fbe96 pulse-server: limit the max cache to 16MB
Don't recycle messages when we have too many allocated already.

See #1840
2021-11-23 17:24:24 +01:00
Wim Taymans
e7f9046bb8 global: place object.serial in object info
Make a method to return or allocate the serial for a global.
When the global is unregistered, a new serial is calculated.
Place the serial in the object info and the global info.
2021-11-22 17:13:10 +01:00
Wim Taymans
53548aee75 global: add the object.serial property for globals
Make sure the lower 32 bits of the serial are never SPA_ID_INVALID. This
makes it possible for applications that need a unique 32 bits number to
use the lower bits while still having an invalid 32 bit serial number.
2021-11-22 16:30:00 +01:00
Wim Taymans
59c4975750 global: add serial number
Add a global serial number for each global object. We can use this
to uniquely define each global.
2021-11-22 16:00:25 +01:00
Wim Taymans
92a5570bbd raop: small cleanup 2021-11-22 10:53:49 +01:00
Wim Taymans
5ae75e1d2a pulse-server: use STREAM_CAPTURE_SINK for monitor capture
Make the pulseaudio layer set the PW_KEY_STREAM_CAPTURE_SINK property
when a monitor device is selected as a source to make it easier for the
session manager to find the right source.
2021-11-19 20:24:58 +01:00
Peter Hutterer
d4d6458b5b modules: check for a NULL resource in client-device and client-node
See https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/113
2021-11-19 09:58:49 +10:00
Wim Taymans
5bc95234e8 filter-chain: fix memory leaks 2021-11-17 12:53:32 +01:00
Wim Taymans
cf66400035 filter-chain: clean up on errors 2021-11-17 12:49:00 +01:00
Wim Taymans
1b88e0023b filter-chain: free plugin when load fails 2021-11-17 12:45:26 +01:00
Wim Taymans
6d492db948 impl-module: don't leak filename
When dlopen fails, don't leak the filename.
Fix indentation.
2021-11-17 12:43:46 +01:00
Wim Taymans
23ac9e5f3c module-access: improve pipewire.client.access handling
If a client (pipewire-pulse) has performed the access check and creates
a client with a specific access path, it will set this in the
pipewire.client.access property. For example, when a flatpak client
connects to pipewire-pulse, it will create a client with the flatpak
pipewire.client.access property.

Check the property after reading it so that we don't blindly grant
complete access to the flatpak client. Instead let the session
manager to assign the permissions.

This fixes a problem where flatpak clients entering pipewire-pulse would
initially get full access and then be downgraded by the session manager.
This would result in the pulse client thinking that it has access to
objects while failing later.
2021-11-16 17:27:05 +01:00
Wim Taymans
a0e0a4d9d2 protocol-native: improve permission debug 2021-11-16 17:26:46 +01:00
Wim Taymans
af2e7b630a pulse-server: turn error into info
Receiving a message from an already removed stream should not result in
an error message.

See #1812
2021-11-16 12:33:23 +01:00
Peter Hutterer
34847f117f systemd: extend the description for the socket files
Let's add PipeWire and Socket into the description, the current messages
are not overly obvious:
   Listening on Multimedia System.
   Closing Multimedia System.
2021-11-15 10:17:39 +10:00
Wim Taymans
c03d10296b raop: connect TCP socket
Connect to the server TCP socket in TCP mode.
Use getaddrinfo to resolve hostname.
2021-11-13 21:00:24 +01:00
Niklāvs Koļesņikovs
ceeaf6c2f9 meson: add -Draop switch for OpenSSL dep control
Even though OpenSSL is very common, automagic dependencies
are still not great, so let's have a raop switch to control
that.
2021-11-13 12:07:33 +00:00
Wim Taymans
a9fbc8a88d impl-core: use PW_ID_CLIENT to make things clearer 2021-11-13 13:05:31 +01:00
Wim Taymans
e52f9f513e raop: add user agent 2021-11-13 10:13:55 +01:00
Wim Taymans
0573944e59 raop: add authentication 2021-11-13 10:00:50 +01:00
Wim Taymans
5d6690ebe7 raop: only encrypt when enabled 2021-11-12 18:10:39 +01:00
Wim Taymans
4695bd32c4 raop: move some info to debug 2021-11-12 17:56:04 +01:00
Wim Taymans
6ce9260980 pulse-server: implement module-raop-discover 2021-11-12 17:53:24 +01:00
Wim Taymans
fa1f556d93 module-raop-sink: handle 0 block_size 2021-11-12 16:58:27 +01:00
Wim Taymans
ac92f584ab raop: remove duplicate define 2021-11-12 16:58:27 +01:00
Wim Taymans
7ed9c790e2 raop: More improvements
Handle control source io. We don't yet implement retransmission,
though.
Handle latency by exposing the server latency on the stream ports.
Use the Format param event to connect/announce and teardown.
Use the stream state to record/flush.
Fix some leaks.
Remove the state from rtsp-client, we don't need it.
Strip whitespace from header values.
2021-11-12 16:58:27 +01:00
Wim Taymans
27bc5e9ae5 raop: more improvements
Create sync and timing packets, reply to timing requests.
Send the right amount of data.
Parse protocol/encryption/codec parameters and use them.
2021-11-12 16:58:27 +01:00