Make a new filter-chain.conf file that contains the boilerplate for
filters.
Suggest that the example filter-chain fragments be copied to the
filter-chain.conf.d/ directory and that filters be run from this
config.
Add avx mixer to test and benchmark
Rework and unroll the avx mixer some more.
The SSE one is 10 times faster than the C one, The AVX is 20 times
faster. The SSE2 function is 5 times faster than the C one.
_FORTIFY_SOURCE defines always_inline versions of open etc. functions,
which conflict with our exported override versions. Disable it for the
file that defines the override functions.
User changing volume via headset buttons should be treated on the same
level as changing from desktop UI. Also initial headset volume should
be considered saved (even though session managers currently ignore the
initial route values on route restore).
Mark route as saved on volume events.
When emitting node, get initial volumes from transport hardware volume,
if available.
The session manager usually overrides these immediately with saved
values, but it's better to show the HW volume when the node first
appears.
The A2DP and HFP profiles may have different volume curves, so trying to
convert volumes between the two can produce undesirable volume spikes.
For example, when one of them is using hardware volume and the other
software.
Fix by separating HFP and A2DP routes.
Let the mixer functions accumulate the intermediate results into a
larger size variable and then clamp to the final precission. This avoids
distortions because of intermediate clamping.
Although the access pattern of the reads are no longer sequential, the
writes are sequential and we don't need to read intermediate values.
Together with the avoided clamping this is probably faster overall.
Add a unit test for the various cases.
When the audioconverter needs more data, let it return NEED_DATA. This
can happen before the ports actually have consumed all the input data.
For example, then the next cycle would require 1024 samples but there
are currently only 16 samples queued, the next cycle will consume the
16 samples and then need another buffer to produce output.
For rt streams, this is not a problem because a new buffer will be
fetched in the next cycle synchronously.
When the stream is async, we can use this NEED_DATA to prefetch a
new buffer so that we have one in the next cycle.
This fixes hickups with async streams that provide random sized
buffers.
Move the setup of the output buffers first.
Then figure out how many samples we need to produce and consume.
Make sure we use the resampler to only convert the input samples that
are needed to produce the output samples.
Fixes some muddled sound with mpv when upmixing.
When we are running non-rt and we just dequeued a buffer, check if the
queue is empty and we need to call process to queue a new buffer. We can
only do this when there is an empty buffer to dequeue.
Don't try to request a new buffer immediately when we are rate_matching
because we want the peer to first process the newly dequeued buffer and
update the rate match.
This makes pw-midiplay work again. Previously it was only requesting a
buffer every other cycle.