[pulseaudio-discuss] Resampler rewinding
Georg Chini
georg at chini.tk
Thu Jun 20 19:09:03 UTC 2019
On 16.06.19 12:28, Georg Chini wrote:
> I sent the patch that introduces the history queue to the list.
> Please take a look. I think it is rather simple.
Hi Tanu,
I tried your proposal to synchronize read and write index of the
history queue immediately after the push and then to add the
render memblockq length when the history queue is rewound.
It does not work for the soxr resampler, possibly because the
soxr resampler has a non-constant delay. That means, that if
the resampler had for example 1000 frames delay before the
reset, it will already produce output data if you feed it 1000
frames after the reset. (The soxr resampler still produces
some glitches after my changes anyway, probably because
the state cannot be restored perfectly, but you have to
listen hard to hear them.)
I did not try the second option, that is synchronizing the read
and write index in pa_sink_input_drop(), because that would
mean that I do not only have to take the render memblockq
length into account, but also the length of the history queue.
Some data may have been pushed into both queues after
read and write index were synchronized.
So I would ask you to reconsider the picture you have in mind.
In my opinion it is inappropriate anyway, because the history
queue is not part of the audio flow and therefore trying to make
it fit in somehow is the wrong approach. Instead it should be
considered as a mirror of the render memblockq. Using it as
a mirror definitely produces simpler code.
More information about the pulseaudio-discuss
mailing list