SOLVED - Volume controls (buttons of my laptop) doesn't work

Problems and successes with specific brands/models of computer audio hardware
Post Reply
Message
Author
User avatar
luiscuadrado123
Posts: 58
Joined: Wed 29 Jan 2014, 18:57

SOLVED - Volume controls (buttons of my laptop) doesn't work

#1 Post by luiscuadrado123 »

Hello everyone

I have this problem only with "LxPup 14.02", because "Precise Puppy" or other "puppy" systems everything works perfectly.

Currently I have sound on my computer, and the speaker icon in the taskbar functions and can properly raise and lower the volume from the taskbar.

The problem is that the hotkeys of my notebook for volume do not work, ie: FN + (arrow) keys +/- and MUTE key.

How I can tell the OS that those keys do what they should do?

I'm sending you a report of my current laptop hardware (generated by the Hardinfo app)

Sorry for my English, I used google translator
Attachments
hardinfo_report.html.tar
Hardware Report
(110 KiB) Downloaded 439 times
Last edited by luiscuadrado123 on Mon 10 Nov 2014, 00:08, edited 1 time in total.

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

Openbox key bindings

#2 Post by peebee »

LxPup uses Openbox. see http://wiki.lxde.org/en/LXDE:Questions# ... d_bindings

Key bindings for Openbox are stored in /etc/xdg/openbox/rc.xml

You therefore need to edit that file to add bindings that link the keys on your laptop to the correct sound commands.

The file has an example for the Print Screen key.

The sound commands are:

Code: Select all

amixer set Master 10%-
amixer set Master 10%+
amixer set Master toggle
You can use xev in a terminal to obtain the keycodes - run xev then press a key - read the keycode in decimal and convert it to hex.

Example: for my HP laptop the sound keys are Fn+f11 to decrease, Fn+f12 to increase, so the entries to put into rc.xml are:

Code: Select all

  <!-- Keybindings for Sound Adjust -->
    <keybind key="0xAE">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Decrease sound</name>
        </startupnotify>
        <command>amixer set Master 10%-</command>
      </action>
    </keybind>
    <keybind key="0xB0">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Increase sound</name>
        </startupnotify>
        <command>amixer set Master 10%+</command>
      </action>
    </keybind>
Fn+f11 = decrease=174 = 0xAE
Fn+f12 = increase=176 = 0xB0

Restart the window manager after making the changes.

Not tested so will be interested to know if it works for you.

Cheers
peebee
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

User avatar
luiscuadrado123
Posts: 58
Joined: Wed 29 Jan 2014, 18:57

Re: Openbox key bindings

#3 Post by luiscuadrado123 »

peebee wrote:LxPup uses Openbox. see http://wiki.lxde.org/en/LXDE:Questions# ... d_bindings

Key bindings for Openbox are stored in /etc/xdg/openbox/rc.xml

You therefore need to edit that file to add bindings that link the keys on your laptop to the correct sound commands.

The file has an example for the Print Screen key.

The sound commands are:

Code: Select all

amixer set Master 10%-
amixer set Master 10%+
amixer set Master toggle
You can use xev in a terminal to obtain the keycodes - run xev then press a key - read the keycode in decimal and convert it to hex.

Example: for my HP laptop the sound keys are Fn+f11 to decrease, Fn+f12 to increase, so the entries to put into rc.xml are:

Code: Select all

  <!-- Keybindings for Sound Adjust -->
    <keybind key="0xAE">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Decrease sound</name>
        </startupnotify>
        <command>amixer set Master 10%-</command>
      </action>
    </keybind>
    <keybind key="0xB0">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Increase sound</name>
        </startupnotify>
        <command>amixer set Master 10%+</command>
      </action>
    </keybind>
Fn+f11 = decrease=174 = 0xAE
Fn+f12 = increase=176 = 0xB0

Restart the window manager after making the changes.

Not tested so will be interested to know if it works for you.

Cheers
peebee
yeeesss!!!

it works!!!

thanks!! i can now up and down volume!! thanks!

totolanio
Posts: 202
Joined: Sun 04 Jan 2015, 02:19

#4 Post by totolanio »

In which part of the xml should I put the code you provided ?
And hopefully you wrote it otherwise I would never know what to write o_0
for example adding the "mute" keybind, i have no idea (but i know how it's keynumber 160 and it needs hexadecimal number)

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#5 Post by peebee »

totolanio wrote:In which part of the xml should I put the code you provided ?
And hopefully you wrote it otherwise I would never know what to write o_0
for example adding the "mute" keybind, i have no idea (but i know how it's keynumber 160 and it needs hexadecimal number)
Add after line #308 - after the </keybind> for print screen

I would imagine the mute command is
amixer set Master 0%
but try it in a terminal to check

http://linux.die.net/man/1/amixer

http://www.binaryhexconverter.com/decim ... -converter
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

totolanio
Posts: 202
Joined: Sun 04 Jan 2015, 02:19

#6 Post by totolanio »

Hey, your code works very well !
I also tried to put

Code: Select all

amixer set Master mute
it works
But how do I add the second effect, when you push again ?

Code: Select all

amixer set Master unmute 
doesn't work if I put them both (i tried different set up and nothing worked)

Also the key "W" (it means Super, between Ctrl and Alt) is not working, even if I set it to 0x73 it doesn't do anything !! I can't use it at all

PS : do you know the command to read a specific file within deadbeef (music player) ?

Code: Select all

deadbeef pathtofile
doesnt work

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#7 Post by peebee »

totolanio wrote:Hey, your code works very well !
I also tried to put

Code: Select all

amixer set Master mute
it works
But how do I add the second effect, when you push again ?

Code: Select all

amixer set Master unmute 
doesn't work if I put them both (i tried different set up and nothing worked)

Also the key "W" (it means Super, between Ctrl and Alt) is not working, even if I set it to 0x73 it doesn't do anything !! I can't use it at all

PS : do you know the command to read a specific file within deadbeef (music player) ?

Code: Select all

deadbeef pathtofile
doesnt work
Google!!

http://linux.die.net/man/1/amixer

unmute should work - or try toggle

Super is a modifier - has to be pressed with some other key (I think??!!)
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

totolanio
Posts: 202
Joined: Sun 04 Jan 2015, 02:19

#8 Post by totolanio »

Maybe it's easy for you but it's not for me.
I tried this :

Code: Select all

    <keybind key="0xA0">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Mute sound</name>
        </startupnotify>
        <command>amixer set Master mute</command>
      </action>
            <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Unmute sound</name>
        </startupnotify>
        <command>amixer set Master unmute</command>
      </action>


If you wonder what I tried : how to put 2 actions which switch after the second key push ? I couldn't find anything on google... Don't even have the words for it.

Anyway, for this particular case I tried toggle and it works but I didn't have a clue what was toggle doing (i wanted only mute and unmute so...)
So replace "mute/unmute" by "toggle" all !

Everything should work regarding sound keys for everybody now :P

The Super key works in a combination IN THEORY, because it doesnt work for me. If I put W-d it doesn't work (it opens a little input to write stuff wtf xD) if I put C-d it works very well.

PS : couldn't find anything on google about deadbeef commands, and i searched during 20 min but I'll ask in another thread.

Post Reply