Start with an extra period of silence.
Reconfigure a new timeout if we are too far off from the desired
buffer fill level. Reduce this level to the maximum error we
tollerate.
With this we use the extra period of silence to reconfigure the
timeout until we are close enough and we can start the dll with a
small error.
See #892
Pass the right value for the rate, we need to pass the graph rate.
Don't reduce bandwidth, it is not needed.
Fixes timings for reading the alsa-sequencer.
Don't try to move closer to the read/write pointers in the ringbuffer
to compensate for the resampler delay. We might not have enough time
anymore to complete a cycle without xruns. The delay is properly
reported in the clock times and should also be reported on the port
latency eventually.
Avoid calling memset on a large piece of memory when draining
the resampler because it might use up all the allocated time in
our realtime thread. Instead use a prealloced empty buffer.
Keep all the children param flags around and use those to decide
if something changed. Also don't change the param flag serial when
we are simply adding a listener.
This should reduce the number of param updates, most notably the
PropInfo that was updated along with the Props on volume changes.
For batch devices we want to keep the IRQ so that the pointers are
updated with the period-size. Brings my UMC404HD to 4.8ms roundtrip
times with IRQ at 6 sample and batch enabled.
SCO transports have timer-delayed release, but they need to be released
immediately when changing profiles to close connections before switching
to A2DP.
When the quantum is changed, the error between the current and
expected buffer levels needs to be corrected with the quantum
difference.
For example, say we are running with a 1024 quantum and the quantum
is changed to 8192, when we wake up the filled level might be
1016 vs expected 8192, 1024 - 8192 = -7168. The real error for the
timeout was 1016 - 8192 - (-7168) = -8.
When we start or after an xrun, we need fill the buffer with one
period + headroom of samples, not period*2. This is because after
start we set our timeout immediately and expect there to be
period + headroom samples in the buffer.
With period*2 we take one period longer to start and we also feed
one period of error in the dll, which causes it to wobble for no
good reason.
Mark bluez5 routes always available in EnumRoute, because there's always
a device connected.
Fixes default-route resetting profiles back, when they are manually
changed.
This does not work as intended, because we no longer do a codec switch
on device connect. It should be done in a different way, but since it's
not used for anything right now, can as well remove it.
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