You are not logged in.

#1 2009-10-19 14:20:06

flaq
Member
Registered: 2009-05-13
Posts: 3

amixer sound toggle doesn't work

Hi,

I've been having this problem ever since I started using openbox.
I can't get the "amixer set 'Master' toggle" command working, it just doesn't do anything.  Same as "amixer set 'Master' mute" or even "amixer sset 'Master' toggle"

I know in kde it works no problem, but i noticed some environment variables for the mixer load with kde, but don't load in openbox.

All I need to work is a toggle, so when I hit my mute button the volume goes to 0, and when I hit it again it puts the volume back to what it was.

So far the best I could do is setup my media keys for Master, using control-media key for headphones, and alt-media key for Speakers.  Any suggestions into getting the toggle working in amixer?

<!--Volume control Master-->
    <keybind key="XF86AudioRaiseVolume">
      <action name="Execute">
        <execute>amixer -q set Master 5+</execute>
      </action>
    </keybind>
    <keybind key="XF86AudioLowerVolume">
      <action name="Execute">
        <execute>amixer -q set Master 5-</execute>
      </action>
    </keybind>
    <keybind key="XF86AudioMute">
      <action name="Execute">
        <execute>amixer -q set Master 0</execute>
    </action>
    </keybind>

 <!--Volume control for Headphones (Front)-->
    <keybind key="C-XF86AudioLowerVolume">
      <action name="Execute">
        <execute>amixer -q set Front 5-</execute>
      </action>
    </keybind>
    <keybind key="C-XF86AudioRaiseVolume">
      <action name="Execute">
        <execute>amixer -q set Front 5+</execute>
      </action>   
    </keybind>
    <keybind key="C-XF86AudioMute">
      <action name="Execute">
        <execute>amixer -q set Front 0</execute>
      </action>
    </keybind>

<!--Volume control for Speakers (Surround)-->
    <keybind key="A-XF86AudioMute">
      <action name="Execute">
        <execute>amixer -q set Surround 0</execute>
      </action>
    </keybind>

ArchLinux kdm + openbox,  Athlon XP2500, 1GB  DDR, 160gb IDE, ATI X800, Audigy, linksys wmp54gv2

Offline

#2 2009-10-20 10:21:48

idx
Member
Registered: 2009-07-22
Posts: 34

Re: amixer sound toggle doesn't work

Hi,

it looks like you're lacking an "s" :

amixer sset Master toggle

is what you want.

EDIT

I take that back, I just tried without the double s and it sill works. So IDK what's wrong, sorry.

Last edited by idx (2009-10-20 10:24:27)

Offline

#3 2009-10-21 13:52:09

finne
Member
From: Sweden
Registered: 2009-10-21
Posts: 9

Re: amixer sound toggle doesn't work

I use amixer sset Master,0 toggle to mute my volume. Don't know what the ,0 does though. It works for me.

Offline

#4 2017-04-09 12:09:13

Cer
Member
Registered: 2016-04-24
Posts: 3

Re: amixer sound toggle doesn't work

I have the same problem, this is the log

$ amixer -c 0 set PCM 50%   
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 128 [50%] [-25.40dB]
  Front Right: Playback 128 [50%] [-25.40dB]
$ amixer -c 0 set PCM 0% 
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 0 [0%] [-51.00dB]
  Front Right: Playback 0 [0%] [-51.00dB]
$ amixer -c 0 set PCM 100%
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB]
  Front Right: Playback 255 [100%] [0.00dB]
$ amixer -c 0 set PCM toggle
$ amixer -c 0 set PCM mute  
amixer: Invalid command!
$ amixer -c 0 set PCM unmute
amixer: Invalid command!

The manual:
       set or sset <SCONTROL> <PARAMETER> ...
              Sets the simple mixer control contents. The parameter can be the volume either as a percentage from 0% to 100% with % suffix,  a
              dB  gain  with  dB  suffix (like -12.5dB), or an exact hardware value.  The dB gain can be used only for the mixer elements with
              available dB information.  When plus(+) or minus(-) letter is appended after volume value, the volume is incremented  or  decre‐
              mented from the current value, respectively.

              The parameters cap, nocap, mute, unmute, toggle are used to change capture (recording) and muting for the group specified.

              The optional modifiers can be put as extra parameters to specify the stream direction or channels to apply.  The modifiers play‐
              back and capture specify the stream, and the modifiers front, rear, center, woofer are used to specify channels to be changed.

              A simple mixer control must be specified. Only one device can be controlled at a time.

So, it's a bug?

Last edited by Cer (2017-04-09 12:16:52)

Offline

#5 2017-04-09 12:23:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,529
Website

Re: amixer sound toggle doesn't work

Cer that's not the same problem at all.  I don't even see a problem in your output.  The OP is using Master, you are trying to use PCM.  See `amixer scontents` to see the difference in their capabilities.  `amixer set Master toggle` works fine here, but `amixer set PCM toggle` gives an invalid command error.  Checking the scontents output shows that PCM only has volume capabilities, not switching (Master has both).

OP, can you use `amixer set Master toggle` from a terminal in openbox?

EDIT: I just realized this is a nearly 8 year old thread!  Cer, do not necrobump:

https://wiki.archlinux.org/index.php/Co … bumping.22

Closed.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

Board footer

Powered by FluxBB