Default volume keybindings do not work when audio is switched to HDMI

Bug #1455602 reported by Denilson Sá
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lubuntu-default-settings (Ubuntu)
New
Undecided
Unassigned

Bug Description

The default keybindings for changing the volume in Lubuntu are found in /usr/share/lubuntu/openbox/rc.xml:

    <!-- Keybinding for Volume management -->
    <keybind key="XF86AudioRaiseVolume">
        <action name="Execute">
            <command>amixer -q sset Master 3%+ unmute</command>
        </action>
    </keybind>
    <keybind key="XF86AudioLowerVolume">
        <action name="Execute">
            <command>amixer -q sset Master 3%- unmute</command>
        </action>
    </keybind>
    <keybind key="XF86AudioMute">
        <action name="Execute">
            <command>amixer -q sset Master toggle</command>
        </action>
    </keybind>

If you are running Lubuntu on a laptop (which has the built-in audio card with analog audio), those commands work correctly.

However, when you switch the audio to HDMI, those commands do not work anymore.

To switch to HDMI audio:
    pacmd set-card-profile 0 output:hdmi-stereo+input:analog-stereo

To switch back to analog audio:
    pacmd set-card-profile 0 output:analog-stereo+input:analog-stereo

Alternatively, right-click on the speaker icon at lxpanel, select "Volume Control Settings", and change the active profile at the "Configuration" tab.

The solution for this bug is quite simple: just add "-D pulse" to each of those commands, like this:

    <!-- Keybinding for Volume management -->
    <keybind key="XF86AudioRaiseVolume">
      <action name="Execute">
        <command>amixer -q -D pulse sset Master 3%+ unmute</command>
      </action>
    </keybind>
    <keybind key="XF86AudioLowerVolume">
      <action name="Execute">
        <command>amixer -q -D pulse sset Master 3%- unmute</command>
      </action>
    </keybind>
    <keybind key="XF86AudioMute">
      <action name="Execute">
        <command>amixer -q -D pulse sset Master toggle</command>
      </action>
    </keybind>

This solution was found here:
http://ubuntuforums.org/showthread.php?t=1956323
https://askubuntu.com/questions/349541/finding-volume-raise-lower-commands/

This solution, however, will not update the user's own configuration file, and probably it shouldn't try anyway.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.