Commit graph

4868 commits

Author SHA1 Message Date
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
ba7e5d619d audioconvert: add option to disable channelmix 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
b3e7d2b72a settings: add an option to check quantum/rate in settings
Add an option to check if the rate and quantum configured with the
settings metadata is in the allowed range.

This is false by default, you can use metadata to set any rate/quantum
but in a minimal controlled setup you might want to restrict this.
2022-01-19 15:55:43 +01:00
Wim Taymans
6515553b7d node: add NODE_SUSPEND_ON_IDLE option
Makes the node suspend as soon as it goes to IDLE.
2022-01-18 20:35:00 +01:00
Wim Taymans
709d25f0c4 make key for node.transport.sync 2022-01-18 20:34:03 +01:00
Wim Taymans
18607ee5e3 resample: implement resample disable
Implement the option to completely disable the resampler.
2022-01-18 18:05:36 +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
9976a7f8b2 daemon: add an example minimal conf file
Add an example for how to start a daemon with source, sink and
metadata. It does not need a session manager and is able to run
jack clients.
2022-01-18 12:47:52 +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
afa0f9305d impl-metadata: add some more properties to global 2022-01-18 12:41:48 +01:00
Wim Taymans
a8bafa0631 pw-metadata: handle NULL props from metadata object 2022-01-18 12:41:17 +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
Wim Taymans
4dcb4f7526 adapter: add adapter.port-config option
It takes a JSON POD description of the PortConfig parameter and sets it
on the node. This can be used to configure the ports of the adapter node
directly.
2022-01-18 10:38:34 +01:00
Wim Taymans
5ebbe09371 pw-cli: move json to pod code to SPA 2022-01-18 10:38:11 +01:00
Barnabás Pőcze
1d4551a98d pipewire: module-protocol-native: avoid file descriptor leaks
At the moment, file descriptors may be leaked
due to a malicious/buggy client:

1. If the control messages have been truncated, some file descriptors
   may still have been successfully transferred. Currently, seeing
   the MSG_CTRUNC bit causes `refill_buffer()` to immediately return
   -EPROTO without doing anything with the control messages, which
   may contain file descriptors.

2. When there is no truncation, it is still possible that the current
   batch of file descriptors causes the total file descriptor count
   to go over the maximum number of fds for the given buffer (currently 1024).
   In this case, too, `refill_buffer()` immediately returns -EPROTO
   without closing the file descriptors that can not be saved.

Fix both of these cases by closing all file descriptors in all
remaining cmsgs when one of the mentioned conditions occur.
2022-01-17 18:00:48 +01:00
Robbert van der Helm
75212a4054 module-rt: Default RLIMIT_RTTIME to -1/unlimited
As discussed in !1118.
2022-01-17 14:10:44 +00:00
Robbert van der Helm
baabcbe606 module-pw: Log when RTKit limits RLIMIT_RTTIME 2022-01-17 14:10:44 +00:00
Robbert van der Helm
5d169523b3 module-rt: Fix extra whitespace in module usage 2022-01-17 14:10:44 +00:00
Wim Taymans
8415fa525f pw-cat: print "monitor" when recording from a sink 2022-01-17 14:47:27 +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
7336f380a5 add some more properties to globals
Add the global serial and name
2022-01-17 12:18:07 +01:00
Wim Taymans
b1fb4a2660 Revert "global: don't reuse ids"
This reverts commit bae0d16e09.
2022-01-17 12:12:54 +01:00
Wim Taymans
5135f9767a Revert "pw-cli: use a list for globals instead of a map"
This reverts commit 3c68476984.
2022-01-17 12:12:48 +01:00
Wim Taymans
b48864e77d Revert "global: limit the id to 24 bits"
This reverts commit b8f8409980.
2022-01-17 12:12:39 +01:00
Wim Taymans
e68dc49666 Revert "global: avoid using existing global id"
This reverts commit 5baab24848.
2022-01-17 12:11:59 +01:00
Wim Taymans
dd9fd95c75 Revert "context: improve retry logic"
This reverts commit bc164814cc.
2022-01-17 12:11:51 +01:00
Wim Taymans
adee9931b6 Revert "global: handle id allocation errors"
This reverts commit e241febe62.
2022-01-17 12:11:31 +01:00
Wim Taymans
92ef2cd56b Revert "context: implement faster id collision check"
This reverts commit 8ca037683e.
2022-01-17 12:11:15 +01:00
Wim Taymans
1f58b147d6 Revert "impl-client: improve permission storage"
This reverts commit 888716a871.
2022-01-17 12:11:07 +01:00
Wim Taymans
77ee3aecd2 Revert "context: hash the globals by id"
This reverts commit 80b2e345d7.
2022-01-17 12:10:57 +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
Barnabás Pőcze
ec465966bc treewide: meson.build: simplify get_variable() calls
Since 01c6fd0a88 the
minimum required meson version is 0.59.0, and since
meson 0.58.0, `get_variable()` on a dependency object
accepts a positional argument. The "type" of variable
(internal, pkgconfig, etc.) in that case does not need
to be specified explicitly.
2022-01-17 08:28:53 +00:00
Robbert van der Helm
a36f902e1d module-rt: Log when RTKit lowers priorities
Because otherwise just looking at the rest of the output and seeing the
thread being set to priority 20 instead of the value that's set in the
config file may look a bit confusing.
2022-01-16 22:18:41 +01:00
Robbert van der Helm
4419baec45 module-rt: Use magic value for user config prio
Instead of having the context priority hardcoded at 88.
2022-01-16 21:54:32 +01:00