Don't just store the id in the metadata but a JSON object with
the node name. This makes it possible to easily introspect the
metadata and also extend the metadata with more fields later.
Instead of matching the metadata id to the global ids we now
have to match it against the name.
The session manager might be configured without metadata support
so check this before attempting to use the metadata. It's not
really a problem because the default sink/source can only be
changed with the pulseaudio API, which activates metadata.
The prefix was used to filter the properties when loading and
saving but since the conversion to the core provided functions, this
feature is not longer available.
It's not exactly a problem, we could implement the filtering ourselves
afterwards but there is little point because we just ignore the unknown
items and never write invalid items.
The branch should be taken if errno is neither EAGAIN,
nor EWOULDBLOCK.
Previously,
if (errno != EAGAIN || errno != EWOULDBLOCK)
would be taken for all values of errno if EAGAIN != EWOULDBLOCK.
(Except for the ones that are filtered out before.)
Fix that by changing `||` to `&&`.
Use the caps of the port to set the right flags on the new port.
We only want to put the terminal/physical flags on ports that look
like hardware ports. Port created by clients should not have this
flag.
Take the queued input samples into account when calculating the
required input size. This can be 0 when there is still enough
data queued in the input for another period.
Handle 0 read_size in alsa-source and make it push out a 0 buffer,
this will then drain the resampler and make it ask for a new buffer
size. This makes the transition from one period to another more
seamless for the resampler.
Fixes#805
Always reschedule the timeout based on the new quantum. If the
quantum descreased we want to wait some more until the buffer only
has the new quantum of samples left.
Only adjust the timeout when the quantum increases so that we end u
with exactly the number of samples of the new quantum.
Suppose we are handling a quantum of 1024, we wake up with 1024
samples in the device, we now notice a quantum of 8192 and will pull
in the 8192 samples, we then have 1024 + 8192 samples in the buffer.
Schedule a timeout for 1024 samples so that we end up in the timout
with 8192 samples in the device.
Remove some magic constants that are not needed anymore with the
headroom.
Clamp the error to some reasonable value so that we don't adjust the
rate too much but still apply all of the correction calculated by the
dll.
Remove the bandwidth adjustment.
Also update the matching and resample fields when we reassign the
node to a new driver. This could cause the new follower to not activate
the adaptive resampler and get out of sync.
node.latency also influences the pipeline latency in that it can
push the latency above the default value.
node.max-latency, instead, is only used to clamp the final latency
of the pipeline.
This may avoid infinite loops if parameters are being set based on events
sent by parameter changes. It's also what alsa-acp devices do, so bluez5
should follow.
In there we can evaluate the poll fd and make sure it blocks or not
in the following poll based on the buffer filled levels. Some API
is very sensitive about this, it seems.
Fixes#433
This will prevent to run the different backends concurrently.
The native backend will only register to BlueZ if neither oFono nor
hsphfpd are running. If one of them starts, the native backend will be
unregistered and the corresponding backend will register to its daemon.
Make a registry of modules
Assign an unique number to each module with the MODULE_FLAG bit set
so that we can also enumerate them
Implement enumerating our internally loaded modules
Implement unloading of the module using the module id
Move module-null-sink into a separate file
Use Audio/Sink if no other media.class was given, so that it works
just like the pulseaudio module
Enable linger=true in all cases.