Commit graph

8309 commits

Author SHA1 Message Date
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
a72a877515 modules: improve node.name
Make sure the node name is something unique for the capture and playback
part of filter-chain and loopback so that volumes can be remembered
separately.

Fixes #1983
2022-01-21 17:42:29 +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
Wim Taymans
5c894c2283 modules: handle x11 sample fallback better 2022-01-21 16:47:42 +01:00
Wim Taymans
b1a989f62e meson: improve SDL2 summary 2022-01-21 16:30:02 +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
Wim Taymans
5b3bc4e80e alsa: first start monitor then enumerate devices
So that we can catch the SOUND_INITIALIZED update between enumerating
devices and starting the monitor.This fixes a races in detecting devices.

Thanks to Matthias Fend for finding this.

Fixes #2046
2022-01-21 10:50:13 +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
Pauli Virtanen
ee257b148b bluez5: deal with adapters appearing after devices
Devices may appear before or after their adapter does on BlueZ DBus
interface.

When an adapter appears, search the device list, and associated its
devices with it.
2022-01-21 00:01:28 +02:00
Pauli Virtanen
88e744a06f doc: include manpages in html docs
Include manpages as raw text in html docs.  Simple and readable
enough...
2022-01-20 20:51:03 +00: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
6a892c27b0 audioconvert: block volume updates when disabled 2022-01-20 20:07:05 +01:00
Pauli Virtanen
a4b1e4c42a bluez5: don't crash in battery_remove
If device has no adapter, then there's no battery provider.
2022-01-20 18:18:09 +00:00
Pauli Virtanen
dda65b95af bluez5: maintain transport->device_list properly
If device != NULL, the transport must be in its transport_list.
2022-01-20 18:18:09 +00:00
Pauli Virtanen
f2630ed6fc bluez5: require adapter before profile connect & after
All exposed bluez devices should have an adapter specified at all times.
Adapter-less devices appear in some race conditions in BlueZ interface.

Require device has non-null adapter, in all cases before adding any
profiles (which exposes the device), and reject BlueZ profile connection
attempts in that state.

If an adapter gets removed by BlueZ, remove also all its devices, so
that device->adapter pointers stay valid.
2022-01-20 18:18:09 +00:00
Pauli Virtanen
870cd0136a spa: allow spa_dict.items to be NULL for zero items
For dicts with zero items, don't dereference dict->items, or give it to
qsort or bsearch where passing in NULL is not allowed.
2022-01-20 20:04:18 +02: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
cb077975bc alsa: remove TI 2902 rule, it seems to break things 2022-01-19 20:31:09 +01:00
Wim Taymans
a77f5131b2 jack: add dummy jacknet implementation
So that applications can link to libjacknet

Fixes #2043
2022-01-19 19:47:28 +01:00
Wim Taymans
ca3fada8cb jack: fix jacknet meson variable 2022-01-19 19:28:08 +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
Barnabás Pőcze
d2114c3f2e spa: audioconvert: fix allocation size calculation
Currently, the code allocates

  sizeof(header) * sizeof(item) * n_items

bytes instead of the more appropriate

  sizeof(header) + sizeof(item) * n_items

Fix that by simply changing the first multiplication to addition, and
furthermore, use a flexible array member instead of a zero-sized array.

Found by clang-tidy.
2022-01-19 02:01:07 +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
6ece5d810c loop: invoke immediately when loop is not running
Or else we might never get our callback called or worse, block forever,
waiting for the response.
2022-01-18 20:03:01 +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
3e73f05af4 audioconvert: expose resampler properties
Expose the resampler PropInfo and Props and params as well. Mostly
useful for updating the resample quality at runtime.
2022-01-18 17:43:44 +01:00
Wim Taymans
b9ace709dc pw-v4l2: clamp buffers to max
See #2029
2022-01-18 13:46:32 +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
5010125452 alsa: make internal latency configurable with params 2022-01-18 11:46: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
Pauli Virtanen
67dcc0d291 bluez5: don't create device if adapter is missing
BlueZ may be missing adapter information for devices in some cases.
Ignore devices without specified adapter.
2022-01-17 18:54:10 +00: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
Wim Taymans
dec7f7a608 merger: also reconfigure when monitor changes
So that monitor ports are added/removed.
2022-01-17 16:28:06 +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
d8c867b515 alsa: improve rate selection
Make sure we don't select an invalid rate when the default is set or
when the card is already opened in some unsupported rate.

See #1975
2022-01-17 14:56:45 +01:00