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 746065 - level: outputs random values if channels==1
level: outputs random values if channels==1
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 742028 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-03-12 03:32 UTC by Meg Ford
Modified: 2015-03-20 01:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Debug example 1: One channel (9.03 KB, text/plain)
2015-03-12 03:33 UTC, Meg Ford
  Details
Debug example 2: One channel (9.08 KB, text/plain)
2015-03-12 03:34 UTC, Meg Ford
  Details
Debug Example three: Two channels (15.67 KB, text/plain)
2015-03-12 03:35 UTC, Meg Ford
  Details
Mp3 file (57.12 KB, audio/mpeg)
2015-03-12 03:36 UTC, Meg Ford
  Details
patch (2.80 KB, patch)
2015-03-12 09:58 UTC, Sebastian Dröge (slomo)
rejected Details | Review

Description Meg Ford 2015-03-12 03:32:52 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.
Comment 1 Meg Ford 2015-03-12 03:33:48 UTC
Created attachment 299145 [details]
Debug example 1: One channel
Comment 2 Meg Ford 2015-03-12 03:34:35 UTC
Created attachment 299146 [details]
Debug example 2: One channel
Comment 3 Meg Ford 2015-03-12 03:35:18 UTC
Created attachment 299147 [details]
Debug Example three: Two channels
Comment 4 Meg Ford 2015-03-12 03:36:24 UTC
Created attachment 299148 [details]
Mp3 file
Comment 5 Meg Ford 2015-03-12 04:00:13 UTC
*** Bug 742028 has been marked as a duplicate of this bug. ***
Comment 6 Sebastian Dröge (slomo) 2015-03-12 09:58:56 UTC
Created attachment 299162 [details] [review]
patch

This patch was used to generate the examples btw, and just changing the channels count of the capsfilter.
Comment 7 Sebastian Dröge (slomo) 2015-03-12 13:25:26 UTC
I can confirm that it's sometimes completely different with mono, with stereo it always seems the same.
Comment 8 Sebastian Dröge (slomo) 2015-03-12 13:26:21 UTC
Note that the source file is mono, so for stereo we would even do conversion while for mono we don't
Comment 9 Sebastian Dröge (slomo) 2015-03-12 13:32:24 UTC
Lot's of valgrind warnings with mono, none with stereo :) Looking into that now
Comment 10 Sebastian Dröge (slomo) 2015-03-12 13:50:26 UTC
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
Comment 11 Meg Ford 2015-03-20 01:23:35 UTC
I can confirm that this fixes the issue for me.