After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 674025 - audiofirfilter drops buffers when using more than one channel
audiofirfilter drops buffers when using more than one channel
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.x
Other All
: Normal normal
: 0.10.32
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-04-12 23:18 UTC by Chris Pankow
Modified: 2012-04-23 08:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Python script to demo the bug (1.75 KB, text/x-python-script)
2012-04-12 23:18 UTC, Chris Pankow
  Details
patch to remove an extraneous division by nchannels (504 bytes, patch)
2012-04-22 20:51 UTC, Chris Pankow
committed Details | Review

Description Chris Pankow 2012-04-12 23:18:38 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.
Comment 1 Chris Pankow 2012-04-22 20:51:32 UTC
Created attachment 212570 [details] [review]
patch to remove an extraneous division by nchannels
Comment 2 Sebastian Dröge (slomo) 2012-04-23 08:08:22 UTC
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.