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.
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
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
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.
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.
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.