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 649642 - [volume] Overflows with volume>=4.0 and 8/16 bit integer formats
[volume] Overflows with volume>=4.0 and 8/16 bit integer formats
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.32
Other Linux
: Normal normal
: 0.10.36
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-05-07 09:49 UTC by webber
Modified: 2011-06-15 17:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libgstvolume.so in gst-plugins-good-0.10.32 (78.69 KB, application/octet-stream)
2011-05-12 01:28 UTC, webber
Details

Description webber 2011-05-07 09:49:36 UTC
It seems that volume:4.0 is the max volume, not volume:10.0. volume:5.0 begins volume down and equal to volume:3.0. 

That means:

volume:4.0 = MAX
volume:5.0 = volume:3.0
volume:6.0 = volume:2.0
volume:7.0 = volume:1.0
volume:8.0 = volume:0.0 = mute
volume:9.0 = volume:1.0
volume:10.0 = volume:2.0

You can refer to the attachment.

Thanks!
Comment 1 webber 2011-05-07 09:52:56 UTC
The volume plug-in works normal in 0.10.29 & 0.10.30
Comment 2 Sebastian Dröge (slomo) 2011-05-09 07:28:23 UTC
How do you test this? Seems to work fine for me
Comment 3 webber 2011-05-09 07:47:53 UTC
1. I have installed the basic plug-ins to run playbin2, all plug-ins are the latest version. 
2. Run gst-launch-0.10 playbin2 uri=... volume=8
3. But the real volume is 0.

Now, I only replace the volume.so(in 0.10.32) with the volume.so(in 0.10.30), volume work fine!
Comment 4 Sebastian Dröge (slomo) 2011-05-09 07:58:09 UTC
Could you test it with

gst-launch-0.10 -v filesrc location=/path/to/your/file ! decodebin2 ! audioconvert ! volume volume=XXX ! audioconvert ! autoaudiosink

and replace the XXX with different volumes. Also please paste the output of this for one for a volume of 1.0 and one different value.
Comment 5 webber 2011-05-09 08:05:12 UTC

# gst-launch-0.10 -v filesrc location=/home/frank/Music/aac.aac ! decodebin2 ! audioconvert ! volume volume=8 ! audioconvert ! autoaudiosink
Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstDecodeBin2:decodebin20/GstTypeFindElement:typefind.GstPad:src: caps = audio/mpeg, framed=(boolean)false, mpegversion=(int)4, stream-format=

(string)adts, level=(string)1, base-profile=(string)lc, profile=(string)lc, channels=(int)2, rate=(int)22050
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstDecodeBin2:decodebin20/GstFaad:faad0.GstPad:sink: caps = audio/mpeg, framed=(boolean)false, mpegversion=(int)4, stream-format=(string)adts, 

level=(string)1, base-profile=(string)lc, profile=(string)lc, channels=(int)2, rate=(int)22050
/GstPipeline:pipeline0/GstDecodeBin2:decodebin20.GstDecodePad:src0: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, 

rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstDecodeBin2:decodebin20/GstFaad:faad0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=

(int)16, rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, 

rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, 

rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstDecodeBin2:decodebin20.GstDecodePad:src0.GstProxyPad:proxypad3: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=

(int)16, depth=(int)16, rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstVolume:volume0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, 

channels=(int)2
/GstPipeline:pipeline0/GstVolume:volume0.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)

44100, channels=(int)2
/GstPipeline:pipeline0/GstAudioConvert:audioconvert1.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, 

rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstAudioConvert:audioconvert1.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, 

rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstAutoAudioSink:autoaudiosink0/GstAlsaSink:autoaudiosink0-actual-sink-alsa.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=

(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstAutoAudioSink:autoaudiosink0.GstGhostPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=

(int)16, rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstAutoAudioSink:autoaudiosink0.GstGhostPad:sink.GstProxyPad:proxypad1: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, 

width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstAudioSinkClock

--------------------------------------------------------------------------------------------------------------
I hear nothing
--------------------------------------------------------------------------------------------------------------


# gst-launch-0.10 -v filesrc location=/home/frank/Music/aac.aac ! decodebin2 ! audioconvert ! volume volume=1 ! audioconvert ! autoaudiosink
Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstDecodeBin2:decodebin20/GstTypeFindElement:typefind.GstPad:src: caps = audio/mpeg, framed=(boolean)false, mpegversion=(int)4, stream-format=

(string)adts, level=(string)1, base-profile=(string)lc, profile=(string)lc, channels=(int)2, rate=(int)22050
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstDecodeBin2:decodebin20/GstFaad:faad0.GstPad:sink: caps = audio/mpeg, framed=(boolean)false, mpegversion=(int)4, stream-format=(string)adts, 

level=(string)1, base-profile=(string)lc, profile=(string)lc, channels=(int)2, rate=(int)22050
/GstPipeline:pipeline0/GstDecodeBin2:decodebin20.GstDecodePad:src0: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, 

rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstDecodeBin2:decodebin20/GstFaad:faad0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=

(int)16, rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, 

rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, 

rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstDecodeBin2:decodebin20.GstDecodePad:src0.GstProxyPad:proxypad3: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=

(int)16, depth=(int)16, rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstVolume:volume0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, 

channels=(int)2
/GstPipeline:pipeline0/GstVolume:volume0.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)

44100, channels=(int)2
/GstPipeline:pipeline0/GstAudioConvert:audioconvert1.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, 

rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstAudioConvert:audioconvert1.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, 

rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstAutoAudioSink:autoaudiosink0/GstAlsaSink:autoaudiosink0-actual-sink-alsa.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=

(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstAutoAudioSink:autoaudiosink0.GstGhostPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=

(int)16, rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstAutoAudioSink:autoaudiosink0.GstGhostPad:sink.GstProxyPad:proxypad1: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, 

width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstAudioSinkClock

--------------------------------------------------------------------------------------------------------------
I hear the music with volume = 1
--------------------------------------------------------------------------------------------------------------
Comment 6 webber 2011-05-12 01:28:53 UTC
Created attachment 187670 [details]
libgstvolume.so in gst-plugins-good-0.10.32
Comment 7 webber 2011-05-12 01:29:38 UTC
I have reinstalled ubuntu10.04(LST), I only replaced the libgstvolume.so with that in 0.10.32, but the same problem. 

I attached my libgstvolume.so above, hope it is useful for you.
Comment 8 webber 2011-05-12 02:03:44 UTC
Sorry for the typo, the attahed libgstvolume.so maked in gst-plugins-base-0.10.32
Comment 9 Tim-Philipp Müller 2011-05-12 07:51:07 UTC
Could you try with -base 0.10.33 and orc 0.4.14 please? (e.g. using the GStreamer PPA)
Comment 10 webber 2011-05-12 10:09:17 UTC
I have done as you say, but the same problem.

I provide one info, hope it is useful.

Only the PCM format files that converted by GoldWave software works fine.
Comment 11 Stefan Sauer (gstreamer, gtkdoc dev) 2011-05-12 10:23:37 UTC
Could you please confirm this is x86 and that you don'ät have e.g. a self built gstreamer installed in a separate prefix.

Could you run a test with ORC_CODE=backup gst-launch too?
Comment 12 webber 2011-05-13 01:04:01 UTC
Yes,this is in x86, and I installed all gstreamer and most dependencies libs in "/usr". Only a few dependencies was installed in "/usr/local", including glib,zlib.

Out test platform is x86 + ubuntu10.04-LST run in VMware.

The following is my test you required. Is it right?

Run: # gst-launch
output:ERROR: pipeline could not be constructed: empty pipeline not allowed.


Run:# ORC_CODE=backup gst-launch
output:ERROR: pipeline could not be constructed: empty pipeline not allowed.

Run:# ORC_CODE=backup 
output:Nothing。


I have reinstaled gstreamer-0.10.33, gst-plugins-base-0.10.33 and gst-plugins-good-0.10.29. The following infos indicate plugins that I installed. Lack anything?


__________________ gst-plugins-bad-0.10.33 ________________________________

configure: *** Plug-ins without external dependencies that will be built:
	audioconvert
	audioresample
	playback
	typefind
	volume

configure: *** Plug-ins with dependencies that will be built:
	alsa
	ogg
	vorbis
____________________________________________________________________________


__________________ gst-plugins-good-0.10.29 ________________________________
configure: *** Plug-ins without external dependencies that will be built:
	apetag
	audioparsers
	autodetect
	id3demux
	wavparse

configure: *** Plug-ins with dependencies that will be built:
	flac
	pulseaudio
____________________________________________________________________________
Comment 13 Tim-Philipp Müller 2011-05-13 09:21:04 UTC
> Run: # gst-launch
> output ERROR: pipeline could not be constructed: empty pipeline not allowed.
>  
> Run:# ORC_CODE=backup gst-launch
> output ERROR: pipeline could not be constructed: empty pipeline not allowed.

I think he meant run this with ORC_CODE=backup gst-launch <YOUR PIPELINE HERE>  :)
Comment 14 webber 2011-05-13 09:36:28 UTC
Oh, OK

Run # ORC_CODE=backup gst-launch playbin2 uri=file:///home/frank/Music/flac.flac 
Output: listen the song.


# ORC_CODE=backup gst-launch playbin2 uri=file:///home/frank/Music/flac.flac volume=8
Output: muted.
Comment 15 webber 2011-05-17 06:26:18 UTC
I installed the newest gstreamer&gst-base(0.10.34), and I have tested a lot of audio formats, including mp3, mp4, aac, flac, ogg, wav, pcm, wma. Only when playing ogg or pcm format audio files, volume plug-in works fine.
Comment 16 David Schleef 2011-05-30 21:51:16 UTC
Test script.  Definitely a bug, not in Orc.

#!/bin/sh

for i in `seq 1 8`
do
  echo $i
  gst-launch audiotestsrc num-buffers=20 volume=0.1 ! \
          audio/x-raw-int,width=16,depth=16 ! \
          volume volume=$i ! alsasink
done
Comment 17 webber 2011-05-31 00:59:29 UTC
I have tested the script you gave me, but the same problem.
Comment 18 webber 2011-05-31 01:29:28 UTC
I have tested the script you gave me, but the same problem.
Comment 19 Stefan Sauer (gstreamer, gtkdoc dev) 2011-05-31 08:33:45 UTC
Something is indee wrong with vol=8, will have a look later:

----------------------------------------
#!/bin/sh
for i in `seq 1 8`
do
  echo "== $i =="
  gst-launch-0.10 -m audiotestsrc num-buffers=20 volume=0.1 ! \
          audio/x-raw-int,width=16,depth=16 ! \
          volume volume=$i ! level interval=300000000 ! wavenc ! filesink location=volume$i.wav | egrep -o ": level,.*$" | cut -d',' -f7-8
done
----------------------------------------
produces

== 1 ==
 rms=(double){ -23.009990657631747 }, peak=(double){ -20.002120837426741 }
== 2 ==
 rms=(double){ -16.989390744352121 }, peak=(double){ -13.981520924147118 }
== 3 ==
 rms=(double){ -13.467565563238498 }, peak=(double){ -10.459695743033492 }
== 4 ==
 rms=(double){ -10.968790831072496 }, peak=(double){ -7.9609210108674935 }
== 5 ==
 rms=(double){ -13.467565563238498 }, peak=(double){ -10.459695743033492 }
== 6 ==
 rms=(double){ -16.989390744352121 }, peak=(double){ -13.981520924147118 }
== 7 ==
 rms=(double){ -23.009990657631747 }, peak=(double){ -20.002120837426741 }
== 8 ==
 rms=(double){ -699.99999984363217 }, peak=(double){ -349.99999992181608 }
Comment 20 Stefan Sauer (gstreamer, gtkdoc dev) 2011-05-31 08:46:03 UTC
Same happens for 8bit. For 32bit it works fine:
== 1 ==
 rms=(double){ -23.008067507385952 }, peak=(double){ -20.000002216486319 }
== 2 ==
 rms=(double){ -16.987467594106331 }, peak=(double){ -13.979402303206696 }
== 3 ==
 rms=(double){ -13.465642412992707 }, peak=(double){ -10.45757712209307 }
== 4 ==
 rms=(double){ -10.966867680826709 }, peak=(double){ -7.9588023899270732 }
== 5 ==
 rms=(double){ -9.028667420665581 }, peak=(double){ -6.020602129765944 }
== 6 ==
 rms=(double){ -7.4450424997130842 }, peak=(double){ -4.436977208813448 }
== 7 ==
 rms=(double){ -6.1061067071008202 }, peak=(double){ -3.098041416201184 }
== 8 ==
 rms=(double){ -4.9462677675470843 }, peak=(double){ -1.938202476647449 }


Using ORC_CODE emulate or such, does not change it.
Comment 21 webber 2011-05-31 08:53:05 UTC
thank you, but I do not understand what you said. 

What means 8 bit and 32 bit,and "Using ORC_CODE emulate or such, does not change it."
Comment 22 Sebastian Dröge (slomo) 2011-05-31 09:08:23 UTC
commit 8f967e9e7029b5b77c3a434af8a1cce878a2954d
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Tue May 31 11:05:03 2011 +0200

    volume: Fix handling of volume>=4.0 for 8 and 16 bit integer formats
    
    Also add a unit test for this. Previously volumes bigger than 4.0
    would have resulted in overflows in the fixed point processing.
    
    Fixes bug #649642.
Comment 23 webber 2011-05-31 09:21:48 UTC
I am still a little confused.

Could you tell me is this a bug or my misuse?

If my misuse, what should I do to solve the problem.
Comment 24 Stefan Sauer (gstreamer, gtkdoc dev) 2011-05-31 09:32:50 UTC
It was a bug and the fix will be in the next release. Release plan is here: http://gstreamer.freedesktop.org/wiki/ReleasePlanning2011
Comment 25 webber 2011-05-31 09:44:09 UTC
I see.

Our method is to replace the volume source directory with that in the gst-plugin-base-0.10.30, and configure&make, it seems work fine. Is it feasible?

Or could you provide a patch to me in advance?
Comment 26 webber 2011-05-31 09:44:41 UTC
thank you a lot!
Comment 28 webber 2011-05-31 11:06:02 UTC
Thank you! I will try.