Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 77523 - alsa-utils amixer sset relative value not working as expected
Summary: alsa-utils amixer sset relative value not working as expected
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Jeremy Huddleston (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-11 07:57 UTC by Alex Porras
Modified: 2005-05-04 20:53 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Porras 2005-01-11 07:57:29 UTC
I am using amixer to raise/lower the master volume on my soundcard, using the "+/-" syntax:

amixer sset Master 5-,5-

When using "+", both channels seem to raise by 5, but when using "-", the left channel seems to get lowered at higher increments than the right, thus causing the balance to be skewed.

I tested using alsamixer to change the master volume, and the behavior is not reproduced--pushing the up/down key changes the master volume evenly.

I am currently working around this problem by using a command line mixer that controls the oss-emulated mixer device for my card.

Note: the same behavior occurs when using relative percentage values, i.e.:

# amixer sset Master 5%-,5%-

Reproducible: Always
Steps to Reproduce:
1. set the master volume to 0,0 (i.e. evenly balanced at zero), just to make sure the balance is even before testing amixer.
2. raise the master volume by 15 by running the command below three times:

# amixer sset Master 5+,5+

3. Lower the volume by 10 by running the command below twice:

# amixer sset Master 5-,5-

Left channel consistently ends up lower than the right.

Actual Results:  
1. Check volume first:

bash-2.05b$ amixer get Master
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 63
  Front Left: Playback 0 [0%] [on]
  Front Right: Playback 0 [0%] [on]

# okay, it's at zero on both channels

2. Raise the volume by 15:

Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 63
  Front Left: Playback 5 [8%] [on]
  Front Right: Playback 5 [8%] [on]
bash-2.05b$ amixer sset Master 5+,5+
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 63
  Front Left: Playback 10 [16%] [on]
  Front Right: Playback 10 [16%] [on]
bash-2.05b$ amixer sset Master 5+,5+
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 63
  Front Left: Playback 15 [24%] [on]
  Front Right: Playback 15 [24%] [on]

# volume is now at 15, as expected

3. Lower the volume by 10:

bash-2.05b$ amixer sset Master 5-,5-
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 63
  Front Left: Playback 10 [16%] [on]
  Front Right: Playback 10 [16%] [on]
bash-2.05b$ amixer sset Master 5-,5-
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 63
  Front Left: Playback 2 [3%] [on]
  Front Right: Playback 5 [8%] [on]

# left is now at 2, right is at 5

Expected Results:  
Both Left and Right channels should have ended up at 5, but the left ended up at 2.

My sound card is listed in /proc/pci as: "Creative Labs SB Live! EMU10k1 (rev 4)"



---
Portage 2.0.51-r3 (default-linux/x86/2004.0, gcc-3.3.4, glibc-2.3.4.20040808-r1,
2.6.9-gentoo-r13 i686)
=================================================================
System uname: 2.6.9-gentoo-r13 i686 Intel(R) Pentium(R) 4 CPU 2.00GHz
Gentoo Base System version 1.4.16
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.90.0.1.1-r3
Headers:  sys-kernel/linux-headers-2.4.21-r1
Libtools: sys-devel/libtool-1.5.2-r7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium4 -fprefetch-loop-arrays -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium4 -fprefetch-loop-arrays -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distcc distlocks sandbox sfperms"
GENTOO_MIRRORS="http://gentoo.osuosl.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://our.local.mirror.which.I.changed/portage"
USE="x86 X aalib acl aim alsa apm arts avi berkdb bitmap-fonts cdr crypt cups
dga directfb dvd dvdr encode esd fam fbcon flac foomaticdb fortran gdbm ggi gif
gnome gpm gstreamer gtk gtk2 imap imlib ipv6 java jpeg ldap libwww mad mikmod
motif mozilla mpeg msn mysql ncurses nls ofx oggvorbis opengl oss pam pdflib
perl png python qt quicktime readline samba sdl slang spell ssl svga tcpd tiff
truetype usb xinerama xml xml2 xmms xv yahoo zlib"
Comment 1 Alex Porras 2005-01-11 08:21:01 UTC
Oops, the paste I did for the "Actual Resuts" is missing the first line for #2 (i.e. line following "2. Raise the volume by 15:"):

bash-2.05b$ amixer sset Master 5+,5+
Comment 2 Jeremy Huddleston (RETIRED) gentoo-dev 2005-05-04 15:15:50 UTC
what versions of alsa-utils and alsa-lib are you using?  Have you reported this problem upstream at http://bugtrack.alsa-project.org?
Comment 3 Alex Porras 2005-05-04 19:09:42 UTC
I believe I was using 1.0.6.  I apologize for not having documented it initially.  Unfortunately, I no longer have the hardware that this issue originated from.  I am now running 1.0.8 lib/utils and am using an ac_97 compatible card, and the issue does not occurr under this setup.
Comment 4 Alex Porras 2005-05-04 19:11:00 UTC
Oh, and I have not reported this to upstream.
Comment 5 Jeremy Huddleston (RETIRED) gentoo-dev 2005-05-04 20:53:16 UTC
ok, then closing... hopefully the bug is either gone or someone else will be able to help us in the future.  thanks.