GNOME Bugzilla – Bug 649642
[volume] Overflows with volume>=4.0 and 8/16 bit integer formats
Last modified: 2011-06-15 17:42:45 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!
The volume plug-in works normal in 0.10.29 & 0.10.30
How do you test this? Seems to work fine for me
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!
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.
# 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 --------------------------------------------------------------------------------------------------------------
Created attachment 187670 [details] libgstvolume.so in gst-plugins-good-0.10.32
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.
Sorry for the typo, the attahed libgstvolume.so maked in gst-plugins-base-0.10.32
Could you try with -base 0.10.33 and orc 0.4.14 please? (e.g. using the GStreamer PPA)
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.
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?
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 ____________________________________________________________________________
> 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> :)
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.
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.
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
I have tested the script you gave me, but the same problem.
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 }
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.
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."
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.
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.
It was a bug and the fix will be in the next release. Release plan is here: http://gstreamer.freedesktop.org/wiki/ReleasePlanning2011
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?
thank you a lot!
http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=8f967e9e7029b5b77c3a434af8a1cce878a2954d
Thank you! I will try.