GNOME Bugzilla – Bug 746065
level: outputs random values if channels==1
Last modified: 2015-03-20 01:23:35 UTC
When the level element receives input which contains a single channel, it produces random values. The values change each time the file is played back. When the input is converted to two channels, the values are stable and coincide with the perceived noise level. This bug was first reported in https://bugzilla.gnome.org/show_bug.cgi?id=742028 Please see the attached output files (two with one channel and one with two channels) and sample mp3 file.
Created attachment 299145 [details] Debug example 1: One channel
Created attachment 299146 [details] Debug example 2: One channel
Created attachment 299147 [details] Debug Example three: Two channels
Created attachment 299148 [details] Mp3 file
*** Bug 742028 has been marked as a duplicate of this bug. ***
Created attachment 299162 [details] [review] patch This patch was used to generate the examples btw, and just changing the channels count of the capsfilter.
I can confirm that it's sometimes completely different with mono, with stereo it always seems the same.
Note that the source file is mono, so for stereo we would even do conversion while for mono we don't
Lot's of valgrind warnings with mono, none with stereo :) Looking into that now
commit 7b90bf32150897a141a29a12ecab555d8c5b7fab Author: Sebastian Dröge <sebastian@centricular.com> Date: Thu Mar 12 13:49:56 2015 +0000 level: Don't read over the end of the input memory Previously we advanced the in_data pointer by bps for every channel, and then later again for block_size*bps. This caused us to be one sample further than expected if an input buffer covered two analysis frames. And in the end lead to completely bogus values reported by level. https://bugzilla.gnome.org/show_bug.cgi?id=746065
I can confirm that this fixes the issue for me.