LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-29-2004, 09:06 PM   #1
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Where is XF86AudioRaiseVolume in KDE 3.3 define the volume up command


I am trying to figure out where XF86AudioRaiseVolume is defined in KDE 3. Previously I have made volume up, down , & mute scripts for my notebook and mapped them to Function Keys. I decided to take on a new Challenge. I found the keycodes for the actual volume buttons on the notebook using xev.

Keycode 174 for volume down.
Keycode 176 for volume up.

xmodmap -e 'keycode 176 = XF86AudioRaiseVolume'
xmodmap -e 'keycode 174 = XF86AudioLowerVolume'

Now pressing the volume keys raise or lower the volume, but the problem is it raises or lowers to much from one touch of the button. Pressing the volume key gives xev about 5 or 6 keysense pickups. Roughly 30% of increase or decrease at a time.

What I need to know is where XF86AudioRaiseVolume is defined and what app it uses to raise the volume. Need to see about changing the percentage of change.

System
Prostar 8874
Fedora Core 3 (fully updated using apt)
KDE 3.3.2
Xorg 6.8.1

Thank you for your time and help.
Brian1

Last edited by Brian1; 01-22-2005 at 09:36 AM.
 
Old 04-24-2005, 01:22 PM   #2
TomalakBORG
Member
 
Registered: Dec 2004
Posts: 245

Rep: Reputation: 30
Ok, rough idea here - but if you map them to the command aumix -v [+/- a value], just edit the alue to be lower. This won't solve your problem of it picking up too many key presses, but should patch it.
 
Old 06-20-2005, 07:31 PM   #3
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Original Poster
Rep: Reputation: 65
Well after many hours of searching the net, looking at many files on the harddrive, and going just a bit crazy. I finally figured out how to make use of my volume keys on my notebook.

A little history first
Notebook is a ProStar 888e. Now the volume keys map as keycodes 174 for volume down and 176 for volume up according to xev. So I added the following to my /etc/X11/Xmodmap. Once Xmodmap is edited it can be reloaded without restarting X by issuing the command ' xmodmap /etc/X11/Xmodmap '.
Contents of Xmodmap
Code:
keycode 176 = XF86AudioRaiseVolume
keycode 174 = XF86AudioLowerVolume
keycode 178 = XF86WWW
keycode 236 = XF86Mail
The problem is that one press of the volume button sends anywhere from 8 to 10 keycodes. The result is when I press the volume key is instead of maybe an increment of 5% it sends 8 to 10 5% signals. Finally result is volume increases about 50% at one time from one key press. It displays on screen in a graphical box which I think is kmix command, but have not confirmed this.

Spent many many hours trying to find the file that defined the values of XF86AudioRaiseVolume and XF86AudioLowerVolume. Keysyms are defined in file:///usr/X11R6/include/X11/XF86keysym.h. It list a lot of XF86**** items available. Not what I needed but helped out some. Finally found the answer at KDE.org. The fix was to turn off the Kmilo service. This is done in Control Center > KDE Components > Service Manager. Unchecked kmilo box and stop the service.

Now I created two volume scripts to make increments of 1%. Examples of scripts.
volumeup1
Code:
#!/bin/sh
aumix -v +1 -S
volumedn1
Code:
#!/bin/sh
aumix -v -1 -S
Now with Xmodmap setup and the scripts created I added them to the kmenu and then using the Current Shortcut Key option in kmenu on each new item I mapped them to the volume keys. Still the only bug is it increases or decreases volume 8 to 9 percent per press of the button since it still sends multi keycodes. Result is it better to increase maybe 10% versus 50% as before.

Would like to be able to show the graphical display of volume increase or decrease as before like kmilo was doing while running but have yet to figure out what command it uses to display it. Once again I think it is kmix. Would ike to figure out the command it uses to create the graphical display of volume up and down. Guess I will spend time on that some other day. For now happy with the way it works now.

Brian1
 
Old 06-20-2005, 11:12 PM   #4
TomalakBORG
Member
 
Registered: Dec 2004
Posts: 245

Rep: Reputation: 30
Sounds good - I used some of your other posts of volume keys to make my own scripts to mute the volume with aumix, and it saves your volume settings! I will quickly outline the procedure right here.

Map the mute/unmute button to /opt/volmute
/opt/volmute is not a script, but a link to a script named volmute1
Volmute 1 saves your settings, (aumix -S) and then mutes (aumix -v0). It then removes /opt/volmute and links /opt/volmute2 to /opt/volmute
/opt/volmute now points to volmute2, which is run when you press the key again.
volmute2 simply restores the aumix settings with aumix -L, then removes /opt/volmute and relinks volmute1 to /opt/volmute.

The key was mapped using the handy program xbindkeys, add xbindkeys to your xinit file and you're good to go! It also includes a nice event monitor and easy config file.

Sorry this isn't about the XF86 raise/lower command, but I finally got muting to work!
Thanx to Brian1 for helping out with the volume commands in some other posts, -Bill

Last edited by TomalakBORG; 06-20-2005 at 11:14 PM.
 
Old 06-21-2005, 01:09 AM   #5
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,883
Blog Entries: 28

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
I use IceWM in the ./icewm/keys file I added
key "Alt+Ctrl+KP_Divide" aumix -v -5 # lower volume
key "Alt+Ctrl+KP_Multiply" aumix -v +5 # raise volume

For some reason if I add a mute command like aumix -v 0 , it will mute but not unmute. Oh well with Kmix it is only 2 clicks to mute.
 
Old 06-21-2005, 06:20 PM   #6
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Original Poster
Rep: Reputation: 65
Glad to be of help and thanks for the info there craigevil & TomalakBORG. So far I have seen about 5 different ways to control extra keys.

Hi craigevil , check this post of mine to create 3 scripts to make mute to work. What it amounts to is two scripts one that mutes and one that returns to say 75%. The thrid is the main one that just keeps flip flopping the contents back and forth to the thrid script.
http://www.linuxquestions.org/questi...130#post506130

Brian1
 
Old 06-21-2005, 10:30 PM   #7
TomalakBORG
Member
 
Registered: Dec 2004
Posts: 245

Rep: Reputation: 30
Yes, those scripts of brian's worked very well. I prefer to use the aumix load command to bring the volume back to where it was when it was muted. Either way, did you all use xbindkeys? I was unable to figure out xmodmap. No matter what I put in that darned file comes up with an error. I went with xbindkeys because that way I can just put in a custom command like xmms -t (or whatever the play/pause command is) right next to the keycode.
 
Old 06-22-2005, 06:23 PM   #8
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Original Poster
Rep: Reputation: 65
Hi TomalakBORG, modified my script so now it saves the volume setting before muting and then restores it back to the previous volume setting when unmuting. I will edit other post on the subject as well but here they are again.

Contents of /opt/volumekeys/volumemute2
Code:
#!/bin/sh
# copy of volumemute2
aumix -S
aumix -v0
cp /opt/volumekeys/volumemute1 /opt/volumekeys/volumemute
Contents of /opt/volumekeys/volumemute1
Code:
#!/bin/sh
# copy of volumemute1
aumix -L
cp /opt/volumekeys/volumemute2 /opt/volumekeys/volumemute
Contents of /opt/volumekeys/volumemute
Code:
#!/bin/sh
# copy of volumemute2
aumix -S
aumix -v0
cp /opt/volumekeys/volumemute1 /opt/volumekeys/volumemute
I would copy over volumemute2 contents to volumemute script for the first time. I also add the command ' cp /opt/volumekeys/volumemute2 /opt/volumekeys/volumemute ' to /etc/rc.local file so it is set to go from a reboot. Using the command aumix -L is problably overkill since the ~/.aumixrc should not change from point A to point B but helps to make since of it all.

Brian1

Last edited by Brian1; 06-23-2005 at 05:27 PM.
 
Old 06-26-2005, 12:16 PM   #9
davecs
Member
 
Registered: Feb 2003
Location: Barking, Essex, Britain
Distribution: PCLinuxOS and MX-Linux
Posts: 503

Rep: Reputation: 32
Great thread. Especially as KDE3.4 no longer seems to respond to the XF86Audio Mute, RaiseVolume and LowerVolume keys.

I've made a couple of changes:

First in volumemute1:

Code:
#!/bin/sh

# copy of volumemute1

mv ~/.aumixrc_store ~/.aumixrc

aumix -L

cp /opt/volumekeys/volumemute2 /opt/volumekeys/volumemute
By changing the cp command to mv, the file aumixrc_store only exists when volume is muted, so can be used as a kind of flag.

I did not have the same problems in terms of the volume increasing too fast, so I put mine in steps of 5. However, here are my other changes:

volumedn5:
Code:
#!/bin/sh



#if muted then vol dn = zero saved level

if [ -f ~/.aumixrc_store ] ; then

   aumix -S ;

   cp ~/.aumixrc ~/.aumixrc_store ;

else

   aumix -v -5 -S ;

fi

volumeup5:
Code:
#!/bin/sh



#if muted then vol up = unmute

if [ -f ~/.aumixrc_store ] ; then

   # copy of volumemute1

   mv ~/.aumixrc_store ~/.aumixrc ;

   aumix -L ;

   cp /opt/volumekeys/volumemute2 /opt/volumekeys/volumemute ;

else

   aumix -v +5 -S ;

fi
As a result of these changes, if you press VOL+ when muted, it is just the same as pressing MUTE again to unmute. The previous behaviour was that the volume would raise from zero, but if you pressed MUTE again, it would return to its saved value, which seemed odd to me.

If you press VOL- when muted, it sets the saved volume to zero, meaning that VOL+ now starts from the bottom.

That's the way my former TV used to work, so I find it logical, anyway!
 
Old 06-27-2005, 06:57 PM   #10
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Original Poster
Rep: Reputation: 65
Hi Dave, Glad to be of help there. I did make some changes myself since you last seen my post. I ended up just removing the cp line all together since no changes are written to the aumixrc file since saving. There is more than one way to do things when it comes to linux.

Thanks for your ideas there Dave.
Brian1
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Control Volume in KDE? mrurmil Linux - Newbie 3 01-26-2005 04:32 PM
Volume issues in KDE TheOneSYM Linux - Software 2 10-30-2004 06:30 PM
command line tool to control volume? infected Programming 4 09-02-2004 08:58 AM
How to change volume/audio settings using the command line? brynjarh Linux - Newbie 3 07-08-2004 10:50 PM
Where is the volume control in KDE rdaves@earthlink.net Linux - General 1 07-13-2001 11:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration