[pulseaudio-discuss] Crackling audio with Pulseaudio 4.0 and the simple Pulse API.

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Wed Jul 10 11:21:43 PDT 2013


On Wed, 2013-07-10 at 16:39 +0300, Tanu Kaskinen wrote:
> This commit seems to break speech-dispatcher:
> http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=30ce3a14e5ae1cd316a18bec95b831c07ac57a1a
> 
> I don't know yet what is wrong with the patch.

The patch introduced variable work_channels, which should be used
instead of o_ss.channels in the resampling phase, but the patch doesn't
convert all the o_ss.channels instances to work_channels that it should.
The conversion is missing from the src_new() call, many places in the
peaks resampler code and many places that are related to the leftover
buffer handling. Converting o_ss.channels to work_channels isn't enough
to fix the issue with speech-dispatcher, however, because there's also
another thing issue: when resampling happens before remapping, the
leftover buffer handling is completely broken, because it assumes that
the leftover data from the resampling phase is supposed to be stored in
the remap buffer, while it actually should be stored in the
to_work_format buffer. At least the ffmpeg resampler needs the leftover
handling with the speech-dispatcher stream. I don't have a simple fix
for this, so I'll just revert the patch for now.

It's by no means impossible to add support for storing the leftover data
in the to_work_format buffer, if someone wants to work on it, but the
leftover code is hairy already as it is, and this would make it doubly
so. I will accept patches that do that, although it would be better if
the leftover buffer handling could be simplified. I'm not sure if it's
possible to simplify the code without affecting the performance, though.
I tried pretty hard when I originally wrote the leftover logic. That
said, perhaps a minor performance hit would be acceptable just for code
readability.

-- 
Tanu



More information about the pulseaudio-discuss mailing list