Commit graph

8327 commits

Author SHA1 Message Date
Wim Taymans 1b0252c267 Revert "pulse-server: don't ask data when corked"
This reverts commit 3b14afe317.

Breaks mpv..
2022-01-25 13:23:58 +01:00
Wim Taymans 3b14afe317 pulse-server: don't ask data when corked
Don't ask for data when we are corked. Some clients like telegram
don't send data when corked.

See #2041
2022-01-25 13:18:56 +01:00
Daniel Cousens 5c6e26fd0b fix pipewire-pulse typo and indentation 2022-01-25 04:44:26 +00:00
Wim Taymans 8d37451fb8 alsa: ensure period_size is not 0 2022-01-24 12:44:16 +01:00
Wim Taymans 3a86ae0276 client-node: handle mix init errors better
Make sure we mark the port invalid when we can't allocate an id
for it. Also check that the id does not exceed the max amount of
areas we have allocated and release resources correctly.
2022-01-24 09:51:10 +01:00
Wim Taymans 7e387d842b impl-link: handle mixer failures better
It is possible that the mixer input can't be created because of hitting
the max limits of dsp mixer or client-node. Make sure we handle those
errors, destroy the link and clean up properly.
2022-01-24 09:39:52 +01:00
Pauli Virtanen a67f38f790 spa/v4l2: better device product names on current kernels
udev/kernel sometimes give "Video Capture N" as ID_V4L_PRODUCT, which is
bogus as a device product name.  The ID_MODEL* field seem to always have
a sensible product name.

Get device.product.name always from ID_MODEL*, and use ID_V4L_PRODUCT
only as the last fallback.
2022-01-23 12:57:11 +00:00
Pauli Virtanen e1bc1c4569 alsa-udev: postpone emitting if pcm devices are busy, retry later
There is a race condition on udev permission changes (e.g. switching
VTs), when pipewire from one user closes devices, and the other process
from second user tries to open them.  The close/open are not ordered, so
opening a device may fail in alsa-acp-device.c resulting to missing
devices/profiles.

Address this by trying to open devices already in alsa-udev.c. If some
devices are busy, do not emit the device info yet, but retry after a
timeout.  If it still fails, go ahead emitting the device, even if some
profiles may be missing.  The retry with delay should be enough to solve
the race almost always.
2022-01-23 12:33:57 +00:00
Wim Taymans 0bc3d1444a Add PIPEWIRE_QUANTUM env variable
That tries to both set the buffersize and the samplerate of the graph.
Document them in README.md
Also add the same env variables to pw-stream and pw-filter.
2022-01-23 11:21:18 +01:00
Wim Taymans f4021c7f44 port: add some more warnings when unregister fails 2022-01-23 10:16:42 +01:00
Wim Taymans 6c84b77e4d jack: add some debug to port_register()
See #1714
2022-01-23 09:35:21 +01:00
Wim Taymans 6ab56804e8 jack: uuid of ports is based on the id, not serial 2022-01-23 09:35:21 +01:00
Barnabás Pőcze 899281be60 jack: fix member name in fastpath logs
The port struct's `id` member has been renamed to `port_id`,
but the `pw_log_trace_fp()` invocation sites weren't changed.

Fixes: 029539831d ("jack: rework port allocation")
2022-01-22 23:29:45 +01:00
Pauli Virtanen 0a55085b14 bluez5: allow setting initial profile to off
This is useful if the session manager wants to set the profile itself,
and has special handling for the off profile.
2022-01-22 20:01:00 +00:00
Wim Taymans 029539831d jack: rework port allocation
Port ids should be allocated using a map.
Only keep a port_id for the ports we allocate ourselves.
Keep just one port free list, there is no reason to keep per direction
free lists.
Get the port from the object directly.

See #1714
2022-01-22 20:59:27 +01:00
Wim Taymans 4f57f3cdae pulse-server: allow per-application latency quirks
Make it possible to set latency and buffer parameters in the matching
rules.

Add a rule for speech-dispatcher and force it to some larger latency.
2022-01-22 16:17:09 +01:00
Wim Taymans 7f08cadca4 pulse-server: move quirks to config section
Make a pulse.rules section in the config file with match rules. Add
support for setting custom client properties and quirks.
2022-01-22 11:51:11 +01:00
Joakim Olsson 2e1a08edc2 module-echo-cancel: Configure buffersize and play delay
* Possible to set max buffer size from config
* New play buffer with possibility to set a delay sent to backend,
  orignal play buffer is still sent without delay to output

Change-Id: If787977305586a40cba4585ab6dad4b7163bee5a
2022-01-21 16:57:04 +00:00
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