Where is XF86AudioRaiseVolume in KDE 3 define the volume up command
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
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.
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
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.
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:
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
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.
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.
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:
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
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.
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:
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.
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.
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!
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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.