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.
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.
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.
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.
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.
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")
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
* 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
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
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.
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.
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
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.
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.
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.
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.
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.