GNOME Bugzilla – Bug 674025
audiofirfilter drops buffers when using more than one channel
Last modified: 2012-04-23 08:08:26 UTC
Created attachment 211963 [details] Python script to demo the bug The audiofirfilter (and any element which derives from AudioFXBaseFIRFilter) will drop buffers when mutlichannel input is piped in. I believe the cause of this bug is a faulty count of the output samples in the TIME_DOMAIN_CONVOLUTION_BODY macro of audiofxbasefirfilter.c. Specifically, the number of input samples is returned with: return input_samples / channels; \ ...but this is double counting since input_samples has already been divided by the number of channels previously. The overall effect is that if the kernel is short enough to invoke the time domain convolution algorithm, then the first buffer received will processed correctly and the next (nchannels-1) buffers will be dropped because of the bookkeeping error. Removing the division by the channels should fix the problem. The attached python script can be used to hear the bug by processing a dual channel audio file (the script takes the audio file as an argument) with the audiofirfilter which should otherwise be an identity operation. The choppiness is the bug in action.
Created attachment 212570 [details] [review] patch to remove an extraneous division by nchannels
Thanks, but please attach this in "git format-patch" format in the future :) commit 2eebb9ebec2e9fda5cd0dd9765530e0f0a254984 Author: Chris Pankow <kain2396@gmail.com> Date: Mon Apr 23 10:07:12 2012 +0200 audiofxbasefirfilter: Fix time-domain convolution for multichannel input Fixes bug #674025.