Skip to main content

Linux on a Compaq Presario V2000

GNU/Linux (Ubuntu 5.10) on a Compaq Presario V2000

How to make the volume keys work

Objective: Map the volume keys (Volume up/down/mute) to amixer (command-line mixer for ALSA soundcard driver).

Find the keycode of the three keys using xev. After executing xev as an ordinary user in the terminal, it creates a window and then asks the X server to send it events whenever anything happens to the window (such as it being moved, resized, typed in, clicked in, etc.).

Example: after pressing the keyboard key m, you will be see the following report:

KeyPress event, serial 27, synthetic NO, window 0x2800001,
root 0x48, subw 0x0, time 10163530, (97,69), root:(929,430),
state 0x0, ''keycode 58 (keysym 0x6d, m)'', same_screen YES,
XLookupString gives 1 bytes: (6d) "m"

KeyRelease event, serial 27, synthetic NO, window 0x2800001,
root 0x48, subw 0x0, time 10163645, (97,69), root:(929,430),
state 0x0, ''keycode 58 (keysym 0x6d, m)'', same_screen YES,
XLookupString gives 1 bytes: (6d) "m"


These two events are the pressing and de-pressing of key m. The keycode is 58 and it is symbolically mapped to character/string m.

Try pressing the three keys (volume up/down/mute), you will most likely get the following keycodes:

* 174 - volume down
* 176 - volume up
* 160 - mute

with no symbolic mapping. To map these keycodes, create the file in your home folder ~/.Xmodmap with the following mapping:

keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
keycode 160 = XF86AudioMute


Use your window manager's (e.g. Gnome metacity, mine is Xfce) key shortcut manager. This allows you to map a keyboard shortcut to a command.

Example: (applicable only in Xfce)

Settings > Xfce 4 Settings Manager > Window Manager > Keyboard (tab)

Under command shortcuts, click none to add a command, then simulate the key (i.e. pressing the volume up/down/mute key)

The commands to adjust the mixer (using amixer) are the following:

* /usr/bin/amixer sset Master toggle - toggle mute
* /usr/bin/amixer sset Master 1- unmute - decrease vol
* /usr/bin/amixer sset Master 1+ unmute - increase vol

Master is the (grand) master mixer control.

Hope that helps.

Contact

If you have questions, post them at Ubuntu Forums, then leave a comment.

Resources
* Linux (Ubuntu 5.10) on a Compaq V2000
* Ubuntu GNU/Linux on the HP Compaq nw8240

Comments

Popular posts from this blog

ld: unrecognized option '--hash-style=both'

gcc -Wl,-Map=contiki.map,-export-dynamic testv6.co obj_linux-native/socketdev_listener.o \ contiki-linux-native.a -o testv6.linux-native /usr/local/bin/ld: unrecognized option '--hash-style=both' /usr/local/bin/ld: use the --help option for usage information collect2: ld returned 1 exit status If you look closely, the error is something related to the local gcc not using the host's linker (ld). $ which gcc /usr/bin/gcc $ which ld /usr/local/bin/ld For some reason, I messed my compiler path. To synchronized gcc to use the host's dynamic linker (i.e. /usr/bin/ld ), set the environment variable COMPILER_PATH to /usr/bin . $ export COMPILER_PATH=/usr/bin $ echo $COMPILER_PATH /usr/bin $ gcc -print-prog-name=ld /usr/bin/ld

Ubuntu on Intel D945GCLF (with Intel Atom)

The rig: D945GCLF board Intel Atom @ 1.6GHZ w/HT It looks like it's a linux kernel bug: http://www.gossamer-threads.com/lists/linux/kernel/982159 The ethernet controller is: Realtek Semiconductor Co., Ltd. RTL8101E PCI Express Fast Ethernet controller (rev ff) does not seem to work in any of the Ubuntu versions. Fix: recompile the kernel with patch You can download my patched packages here (currently uploading, let me know if something is missing): http://mirakulo.com/pub/linux-image-2.6.24-21-patched/ NOTE: I got the .udeb packages because of this warning: dpkg-gencontrol: warning: deb package with udeb specific field Kernel-Version or you can do the following steps if you don't trust me: apt-get source linux-source-2.6.24 apt-get build-dep linux-source-2.6.24 aptitude install install devscripts build-essential fakeroot cd linux-2.6.24/ Get this patch: http://bugzilla.kernel.org/attachment.cgi?id=17604&action=view patch -p 1 debuild -us -uc -b Install the kernel that...

Ebay scammer

+639056538210 09056538210 Gene Paminiano Claiming to be his wife: Ramona Carmen Paminiano City States savings account# 011-22-001124-3 TIP: Do not push with the transaction without hearing the seller/buyer's voice on the phone. Record the conversation for publicity purposes.