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 478512 - [alsamixer] volume control slider not working
[alsamixer] volume control slider not working
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: High major
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 478504 478505 545932 570378 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-09-20 08:26 UTC by Isaac L
Modified: 2009-10-20 17:18 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
git patch (7.52 KB, patch)
2009-02-03 21:44 UTC, Antoine Tremblay
none Details | Review
Patch for gstreamer 0.10.20 (5.32 KB, patch)
2009-02-03 21:44 UTC, Antoine Tremblay
none Details | Review
poll code was ok my bad... (5.02 KB, patch)
2009-02-03 22:31 UTC, Antoine Tremblay
none Details | Review
git patch (6.99 KB, patch)
2009-02-03 22:42 UTC, Antoine Tremblay
committed Details | Review

Description Isaac L 2007-09-20 08:26:25 UTC
Please describe the problem:
the gnome-volume-control program allows the slider to be modified and both left and right move at the same time but once i let go of the slider the left channel bounces to 0% and the right channel stays where it is. Also, the mute setting seems to randomly go on and off when changing the slider. Possibly due to the left channel going to 0%.

Steps to reproduce:
1. Open up the gnome-volume-control program
2. Move the PCM slider around.
3. As soon as you let go the left channel goes to 0% and the right channel stays at the same volume


Actual results:
As soon as you let go the left channel goes to 0% and the right channel stays at the same volume

Expected results:
It should just increase or decrease the volume

Does this happen every time?
Yes

Other information:
It seems to be a problem with the gnome-volume-control program, the gnome-volume applet, and the keyboard volume control
In each program the problem varies slightly...ie. the gnome-volume applet can go from 0%->100% but it only changes the right channel leaving the left at 0%.
The keyboard control only allows up to 13%ish and only adjusts the right channel

System Specs:
Gnome is running on a archlinux compiled under x86_64.
Also using the Plantronics Headset. Which uses the snd_usb_audio kernel driver.
Linux <hostname> 2.6.22-suspend2 #1 SMP PREEMPT Sat Sep 1 13:56:25 CEST 2007 x86_64 AMD Opteron(tm) Processor 242 AuthenticAMD GNU/Linux
Comment 1 Isaac L 2007-09-20 13:28:42 UTC
*** Bug 478505 has been marked as a duplicate of this bug. ***
Comment 2 Isaac L 2007-09-20 13:28:57 UTC
*** Bug 478504 has been marked as a duplicate of this bug. ***
Comment 3 Isaac L 2007-10-18 12:41:32 UTC
It seems to occur in version 2.20.x as well.
Comment 4 Ronald Bultje 2007-10-18 13:09:54 UTC
Given your description, this seems like a gstreamer plugin problem, the apps seem to do what I would expect given a common problem in the plugin from gst. Please file a bug upstream there (feel free to CC me).
Comment 5 Adalbert Dawid 2007-10-19 23:34:35 UTC
Possibly my problem is related to the reporter's one.

When changing the volume with the volume applet slider (or with the mouse wheel), the volume symbol "flickers" from the expected "accoustic waves" icon to the "muted" icon back and forth. This seems to be one of the symptoms Isaac is observing. However, the sound does not really mute, it's just the icon that behaves strange.

When I adjust the volume with the terminal alsa mixer, this bug does not occur. Also, when I switch from ALSA mixer to OSS mixer, the gnome volume applet behaves correctly again.
Comment 6 Ronald Bultje 2007-10-20 02:13:12 UTC
-> gst
Comment 7 Steven Van Impe 2007-10-26 07:32:04 UTC
"When changing the volume with the volume applet slider (or with the mouse
wheel), the volume symbol "flickers" from the expected "accoustic waves" icon
to the "muted" icon back and forth. This seems to be one of the symptoms Isaac
is observing. However, the sound does not really mute, it's just the icon that
behaves strange."

-> I have this exact same problem with my fresh Ubuntu 7.10 installation. I noticed it very quickly since I am used to just scroll over the volume control applet to change the volume. This problem did not occur on my previous Ubuntu 7.04 installation.
Comment 8 Isaac L 2007-10-26 07:46:58 UTC
As this has changed from gnome-media to a gstreamer problem, here are the relevant gstreamer version numbers

local/gstreamer0.10 0.10.14-1
    GStreamer Multimedia Framework
local/gstreamer0.10-alsa 0.10.14-1 (gstreamer0.10-plugins)
    GStreamer alsa plugin
local/gstreamer0.10-bad 0.10.5-2 (gstreamer0.10-plugins)
    GStreamer Multimedia Framework Bad Plugins (gst-plugins-bad)
local/gstreamer0.10-base 0.10.14-1 (gstreamer0.10-plugins)
    GStreamer Multimedia Framework Base Plugins (gst-plugins-base)
local/gstreamer0.10-cdparanoia 0.10.14-1 (gstreamer0.10-plugins)
    GStreamer CDParanoia plugin
local/gstreamer0.10-flac 0.10.6-1 (gstreamer0.10-plugins)
    GStreamer flac plugin
local/gstreamer0.10-gconf 0.10.6-1 (gstreamer0.10-plugins)
    GStreamer GConf plugin
local/gstreamer0.10-good 0.10.6-1 (gstreamer0.10-plugins)
    GStreamer Multimedia Framework Good Plugins (gst-plugins-good)
local/gstreamer0.10-musicbrainz 0.10.5-1 (gstreamer0.10-plugins)
    GStreamer musicbrainz plugin
local/gstreamer0.10-ogg 0.10.14-1 (gstreamer0.10-plugins)
    GStreamer OGG plugin
local/gstreamer0.10-vorbis 0.10.14-1 (gstreamer0.10-plugins)
    GStreamer Vorbis plugin

Also, I have upgraded to gnome 2.20 and the problem still occurs.

The gnome-volume-control program seems to behave better than before, however the keyboard volume control still mucks the sliders up and moving the sliders around back and forth fast seem to make the problem occur.

As for Adalbert's problem, I appear to have the same problem.

I would also like to add that when using gnome-alsamixer its volume control works fine. I suspect it uses a different way of changing the volume so I hope this helps in narrowing where the problem could be.
Comment 9 Patrick Walton 2007-12-28 03:20:09 UTC
Additional information can be found here.

https://bugs.launchpad.net/ubuntu/+source/gstreamer/+bug/158590

I'm getting this too, so I can provide a bit more information.

This is a problem that seems to be exclusively with USB audio output.  The issue is with the gstreamer ALSA mixer plugin - it seems that gstreamer somehow does not set the ALSA mixer variables in the proper way (i.e. how alsamixer and gnome-alsamixer do it). If any gstreamer-based mixer app is open and has access to the mixer component, then the command-line alsamixer will exhibit the same erratic behavior. Only after closing all gstreamer-based mixer apps will alsamixer work.
Comment 10 Isaac L 2008-01-03 14:46:38 UTC
Ubuntu Bug# 158590 seems to describe the problem accurately.

I also found https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/155109
Which describes the problems as well, this one seems more accurate to what I'm seeing.

As it appears to be a problem with USB audio, I'm using a Plantronics 750 DSP headset.


Since there seems to be quite a number of people with this bug, is it possible to confirm this bug?
Comment 11 Tim-Philipp Müller 2008-01-07 14:44:03 UTC
Is this the same issue as bug #486840? Could anyone try with core+gst-plugins-base from CVS to see if the issue persists?
Comment 12 Joachim Sauer 2008-01-22 20:16:54 UTC
I've just checked out gstreamer and gst-plugins-base from CVS and the problem still remains the same (*)

I had the exact same problem I'm having now (i.e. left channel jumping to zero, right channel beeing raised/lowered as requested).

By the way, I'd like to add that at the Launchpad.net Bug, every one reporting to have the same problem seems to be using a USB sound device.

(*) I'm not entirely sure if my way of testing was ok, so I'll report it here:

I basically did a ./configure --prefix=$HOME/tmp/gst && make && make install for both gstreamer & gst-plugins-base (with PACKAGE_CONFIG_PATH set for the later) and then ran "LD_LIBRARY_PATH=$HOME/tmp/gst/lib/ gnome-volume-control". I've checked /proc/$(pidof gnome-volume-control)/maps and it seems to correctly load the just-compiled gst libraries from $HOME/tmp/gst/lib
Comment 13 Øyvind Stegard 2008-01-22 22:54:18 UTC
Got the same problem, volume control through GStreamer framework is just behaving crazy (using the Gnome volume control app, for instance). Alsamixer (console) works fine. I've got an external Creative Xmod hooked up via USB.
Comment 14 Øyvind Stegard 2008-01-22 22:57:29 UTC
Sorry, I forgot to mention: I'm using Ubuntu Gutsy with standard packages.
Comment 15 Teppo Turtiainen 2008-04-05 12:54:49 UTC
I'm seeing this too with Logitech V20 USB speakers.
Comment 16 Teppo Turtiainen 2008-04-09 18:24:51 UTC
Bug 478485 and bug 478498 are very similar to this one.
Comment 17 The Saint Of Good Ale 2008-04-25 14:35:08 UTC
I get erratic volume slider behaviour here myself, but only when Firefox is running and its worse when Firefox is the active window. The stereo sliders split apart on their own, and the  sliders  move in opposite directions....epiphany and seamonkey: same thing happens. Gecko 1.8x. Seems strange that a web browser might interfere with the multimedia keys in gnome, but that's how I see it here:

So heres how I  see it:
firefox (and thunderbird) running) 
 
I use the vol down key and its fine for a moment or two...use it a few minutes later and the level is erratic. Mute works. 

No running gecko engine, no audio keys problems here.

Try it yourself!

Comment 18 Maxim Levitsky 2008-06-21 10:46:10 UTC
I see exactly the same bug here on acer aspire 5720.

It has a ordinary ALC268 HDA codec.

The volume jumps/mutes on a single channel, when do following:

1) rotate the volume knob

To test that volume knob isn't guilty I assigned the volume up/down to ctrl+ up/down, and I see exactly the same behavior.

3) When I change the volume using the "mouse wheel" , I mean I move finger on the touchpad, over the volume icon, same happens.

4) If I change the volume using drop-down menu of the volume applet same happens.

Comment 19 Isaac L 2008-06-21 11:56:49 UTC
I'm now running gnome 2.22 with kernel version 2.6.25
 and it still has the same problem


As mentioned before, I've tested it with USB speakers and with and an internal sound card and the problem is only with USB speakers. So it would seem that the api to change the alsa volumes is faulty when communicating to a USB device.
Comment 20 Laurento Frittella 2008-06-21 12:37:58 UTC
Here the problem happens only with 2.6.25 kernel (both vanilla and tuxonice patched), I switched back to 2.6.24 and all works well.
It should be related with the alsa driver version in the new kernel, shouldn't it?
Comment 21 Isaac L 2008-06-21 12:47:24 UTC
I was running 2.6.24 before and the problem was still there.
Comment 22 Teppo Turtiainen 2008-06-22 06:53:19 UTC
This is pretty bad for affected users. Increasing priority and severity.
Comment 23 Stefan Sauer (gstreamer, gtkdoc dev) 2008-06-22 10:20:09 UTC
I have this with my usb headset too. Teppo, that severity and priority does not help, we try to fix all problems.
Comment 24 Teppo Turtiainen 2008-06-25 18:39:43 UTC
I found a way to work around this (that is, to actually change the volume on my USB speakers):

1. Set PCM volume to zero (don't mute, drag the slider to the bottom).
2. Separate/Unlock the PCM channels.
3. Adjust left channel to desired volume.
4. Adjust right channel to the same volume.

It doesn't work the other way around (right channel first) and you always have to go through zero to change the it.
Comment 25 Isaac L 2008-06-26 01:50:05 UTC
Theres a better way than that.

If you download/compile and install gnome-alsamixer. It can change volumes without the left/right channel going nuts.

Comment 26 Pacho Ramos 2008-07-08 11:34:46 UTC
I am also affected by this, even with gst-plugins-base-0.10.20 and gstreamer 0.10.20 , this could be maybe related with http://bugzilla.gnome.org/show_bug.cgi?id=478498
Comment 27 Aleksandar 2008-08-20 23:51:33 UTC
My instalation is showing simmilar symptoms. I am not using any usb sound device. I have laptop with integrated Intel HDA. I am using x86_64 with following software versions:
    GNOME 2.22.3
    gstreamer0.10-base 0.10.20
    alsa-lib 1.0.16
    kernel 2.6.26.2
Comment 28 Laurento Frittella 2008-11-12 17:22:12 UTC
I've just upgraded to kernel 2.6.27 and the problem disappeared, I'm using in-kernel alsa driver.
Comment 29 Richard Laager 2008-11-13 01:31:36 UTC
Can those of you affected by this bug try the patch in bug #545932, which may very well be the same issue?
Comment 30 Martin Ling 2008-12-24 02:46:33 UTC
I had been suffering from this bug for over a year, with Debian unstable on a Dell Precision M20 laptop (same hardware as Latitude D610, Intel ICH6 with STAC9750,51). It showed up when a video was playing or a Flash applet was present in a browser. Upgrading from 2.6.25 to 2.6.27 made no difference.

The suggestion from xt.knight at https://bugs.launchpad.net/ubuntu/+bug/252237, posted here in bug #545932, was to revert this commit:

http://webcvs.freedesktop.org/gstreamer/gst-plugins-base/ext/alsa/gstalsamixer.c?r1=1.37&r2=1.38

Doing this fixed the problem for me.

Please, either revert this change upstream or fix whatever problem it has introduced in some other way. It makes volume control utterly unusable for the whole system.
Comment 31 Stefan Sauer (gstreamer, gtkdoc dev) 2009-01-25 16:23:40 UTC
FYI. the commit mentioned in comment #30, was done in order to implement the feature requested in bug #152864.
Comment 32 Antoine Tremblay 2009-02-03 21:43:00 UTC
This is due to race conditions between functions that modified the mixer like set_volume and snd_mixer_handle_events since the handle_events can now be called at any time.

Fixed by adding locking around any snd_mixer call since even read functions can modify the mixer stucture. (Since alsa likes to clear it's values before reading new ones)

The favorite race condition seemed to be that set_volume called read_elem (in alsalib) that reset the volumes to 0 and then read them with read_x_volume. This read looped on each channel and as the race condition occured the channels value could be anything , most of the time it was 0.. Thus no value was read or only the value of one channel was and the volume
was reset to 0.

Note that I also cleaned up the poll code...
Comment 33 Antoine Tremblay 2009-02-03 21:44:16 UTC
Created attachment 127874 [details] [review]
git patch
Comment 34 Antoine Tremblay 2009-02-03 21:44:51 UTC
Created attachment 127875 [details] [review]
Patch for gstreamer 0.10.20
Comment 35 Antoine Tremblay 2009-02-03 22:21:25 UTC
There is an error in those 2 patches.. 

There is nothing to stop the poll.. set_state_null when the thread_join is execed... so it deadlocks

fixing please wait before review/apply


Comment 36 Antoine Tremblay 2009-02-03 22:31:34 UTC
Created attachment 127879 [details] [review]
poll code was ok my bad...
Comment 37 Jannis Pohlmann 2009-02-03 22:40:32 UTC
Just to give a little feedback: The latest patch (id 127879) works fine for me. No deadlocks, no volume drops to zero and no randomly enabled recording when changing the volume of capture tracks anymore.
Comment 38 Antoine Tremblay 2009-02-03 22:42:26 UTC
Created attachment 127882 [details] [review]
git patch

left pool code as it was... sorry
Comment 39 Alberto Garcia 2009-02-10 01:30:42 UTC
(In reply to comment #38)
> Created an attachment (id=127882) [edit]
> git patch

I tested this against gstreamer-plugins-base 0.10.19-2 from Debian lenny and it fixes the problem for me.

Thanks for the patch!
Comment 40 Sebastian Dröge (slomo) 2009-02-10 10:02:55 UTC
commit fc23037a9aaf0beca99f9494948b2fb1169a03db
Author: Antoine Tremblay <hexa00@gmail.com>
Date:   Tue Feb 10 11:00:12 2009 +0100

    alsamixer: Fix race condition that made alsamixer not working properly
    
    This is due to race conditions between functions that
    modified the mixer like set_volume and
    snd_mixer_handle_events since the handle_events
    can now be called at any time.
    
    Fixed by adding locking around any snd_mixer call
    since even read functions can modify the mixer stucture, since
    alsa likes to clear it's values before reading new ones.
    
    The favorite race condition seemed to be that set_volume
    called read_elem (in alsalib) that reset the volumes to
    0 and then read them with read_x_volume. This read looped
    on each channel and as the race condition occured the
    channels value could be anything , most of the time
    it was 0. Thus no value was read or only the value of
    one channel was and the volume was reset to 0.
    
    Fixes bug #478512.
Comment 41 Marc-Andre Lureau 2009-02-10 11:09:44 UTC
Awesome! thanks for your effort!
Comment 42 Jannis Pohlmann 2009-10-20 02:53:59 UTC
*** Bug 570378 has been marked as a duplicate of this bug. ***
Comment 43 Tim-Philipp Müller 2009-10-20 17:18:58 UTC
*** Bug 545932 has been marked as a duplicate of this bug. ***