# A7V333 & ACPI/acpid configuration

## Lucretia

Hi,

I'm wanting to set up acpid so that when I press the power button it'll either suspend or shutdown properly.

I'd also like the machine to powersave properly, as I tend to leave it on for weeks at a time.

The thing is, when I try to cat the contents of /proc/acpi/event it doesn't print anything and just sits there doing nothing (doesn't hang though).

I have the following modules installed ok:

Module                  Size  Used by    Tainted: P

rtc                     7712   0  (autoclean)

ospm_system             5780   0  (unused)

ospm_processor          6112   0  (unused)

ospm_button             3456   0  (unused)

ospm_busmgr            12116   0  [ospm_system ospm_processor ospm_button]

NVdriver             1067840  10

sr_mod                 12184   0  (unused)

sg                     26124   0  (unused)

ide-scsi                7568   0

keybdev                 1792   0  (unused)

mousedev                3928   1

hid                    16836   0  (unused)

input                   3296   0  [keybdev mousedev hid]

uhci                   24912   0  (unused)

ehci-hcd               14152   0  (unused)

usbcore                57056   1  [hid uhci ehci-hcd]

parport_pc             15304   1  (autoclean)

ppa                     9176   0  (unused)

parport                14560   1  [parport_pc ppa]

3c59x                  25648   1

Does anyone know how to do this?

I'm using KDE and I'm wondering if there are any modules for confiuring this sort of thing (apart from the laptop battery module).

Thanks,

Luke.

----------

## stratocastor666

Its all in the kernel configuration. Under General Setup in the kernel config, you will see an option for ACPI, and under that there are options for compiling in support for the ac button. You wont neet the lid, or the other things, those are for standby on a laptop. I would recomend building the options you need into the kernel, rather then as modules.

----------

## Lucretia

 *stratocastor666 wrote:*   

> Its all in the kernel configuration. Under General Setup in the kernel config, you will see an option for ACPI, and under that there are options for compiling in support for the ac button. You wont neet the lid, or the other things, those are for standby on a laptop. I would recomend building the options you need into the kernel, rather then as modules.

 

Yup, I have that. I just created them all as modules and I try to load them all.

The thing is, how you get it to work properly? I can shutdown, the machine via "shutdown -r now" but not via a button, it just turns the machine off without shutting down the OS first!!

I have emerged acpid, but I need to know how to configure that properly; like I said, there's nothing in /proc/acpi/event.

Thanks,

Luke.

----------

## stratocastor666

Try building them directy into the kernel instead of as modules. The button then should come up during boot as an acpi event. Is this comming up, look in dmesg. You should see something come up like ACPI ( subsystem 20021205 ) or something like that. That stuff has to come up in boot though, and having built in support instead of just moduels might help with the loading at boot time so everything gets recognized properly.

----------

## Lucretia

Linux version 2.4.19-gentoo-r10 (root@cdimage) (gcc version 3.2.1 20021207 (Gentoo Linux 3.2.1-20021207)) #3 SMP Sun Feb 16 15:15:00 GMT 2003

BIOS-provided physical RAM map:

 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)

 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)

 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)

 BIOS-e820: 0000000000100000 - 0000000000f00000 (usable)

 BIOS-e820: 0000000000f00000 - 0000000001000000 (reserved)

 BIOS-e820: 0000000001000000 - 000000001fffc000 (usable)

 BIOS-e820: 000000001fffc000 - 000000001ffff000 (ACPI data)

 BIOS-e820: 000000001ffff000 - 0000000020000000 (ACPI NVS)

 BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)

 BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)

 BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)

511MB LOWMEM available.

Advanced speculative caching feature present

On node 0 totalpages: 131068

zone(0): 4096 pages.

zone(1): 126972 pages.

zone(2): 0 pages.

Kernel command line: root=/dev/ide/host0/bus0/target0/lun0/part2 hdd=ide-scsi vga=791 video=vesa:1024x768@70

ide_setup: hdd=ide-scsi

Found and enabled local APIC!

Initializing CPU#0

Detected 1666.768 MHz processor.

Console: colour dummy device 80x25

Calibrating delay loop... 3322.67 BogoMIPS

Memory: 510576k/524272k available (1490k kernel code, 10108k reserved, 594k data, 116k init, 0k highmem)

Checking if this processor honours the WP bit even in supervisor mode... Ok.

Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)

Inode cache hash table entries: 32768 (order: 6, 262144 bytes)

Mount-cache hash table entries: 8192 (order: 4, 65536 bytes)

Buffer-cache hash table entries: 32768 (order: 5, 131072 bytes)

Page-cache hash table entries: 131072 (order: 7, 524288 bytes)

CPU: Before vendor init, caps: 0383fbff c1c3fbff 00000000, vendor = 2

Advanced speculative caching feature present

Disabling advanced speculative caching

CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)

CPU: L2 Cache: 256K (64 bytes/line)

CPU: After vendor init, caps: 0383fbf7 c1c3fbff 00000000 00000000

Intel machine check architecture supported.

Intel machine check reporting enabled on CPU#0.

CPU:     After generic, caps: 0383fbf7 c1c3fbff 00000000 00000000

CPU:             Common caps: 0383fbf7 c1c3fbff 00000000 00000000

Enabling fast FPU save and restore... done.

Enabling unmasked SIMD FPU exception support... done.

Checking 'hlt' instruction... OK.

POSIX conformance testing by UNIFIX

mtrr: v1.40 (20010327) Richard Gooch (rgooch@atnf.csiro.au)

mtrr: detected mtrr type: Intel

CPU: Before vendor init, caps: 0383fbff c1c3fbff 00000000, vendor = 2

Advanced speculative caching feature present

Disabling advanced speculative caching

CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)

CPU: L2 Cache: 256K (64 bytes/line)

CPU: After vendor init, caps: 0383fbf7 c1c3fbff 00000000 00000000

Intel machine check reporting enabled on CPU#0.

CPU:     After generic, caps: 0383fbf7 c1c3fbff 00000000 00000000

CPU:             Common caps: 0383fbf7 c1c3fbff 00000000 00000000

CPU0: AMD Athlon(TM) XP 2000+ stepping 02

per-CPU timeslice cutoff: 731.44 usecs.

task migration cache decay timeout: 10 msecs.

SMP motherboard not detected.

enabled ExtINT on CPU#0

ESR value before enabling vector: 00000000

ESR value after enabling vector: 00000000

Using local APIC timer interrupts.

calibrating APIC timer ...

..... CPU clock speed is 1666.7999 MHz.

..... host bus clock speed is 266.6880 MHz.

cpu: 0, clocks: 2666880, slice: 1333440

CPU0<T0:2666880,T1:1333440,D:0,S:1333440,C:2666880>

migration_task 0 on cpu=0

PCI: PCI BIOS revision 2.10 entry at 0xf17e0, last bus=1

PCI: Using configuration type 1

PCI: Probing PCI hardware

Unknown bridge resource 0: assuming transparent

PCI: Using IRQ router VIA [1106/3147] at 00:11.0

isapnp: Scanning for PnP cards...

isapnp: No Plug & Play device found

Linux NET4.0 for Linux 2.4

Based upon Swansea University Computer Society NET3.039

Initializing RT netlink socket

Starting kswapd

Journalled Block Device driver loaded

devfs: v1.12a (20020514) Richard Gooch (rgooch@atnf.csiro.au)

devfs: boot_options: 0x1

Installing knfsd (copyright (C) 1996 okir@monad.swb.de).

ACPI: Core Subsystem version [20011018]

ACPI: Subsystem enabled

vesafb: framebuffer at 0xf0000000, mapped to 0xe0816000, size 32768k

vesafb: mode is 1024x768x16, linelength=2048, pages=0

vesafb: protected mode interface info at c000:9b39

vesafb: scrolling: redraw

vesafb: directcolor: size=0:5:6:5, shift=0:11:5:0

Looking for splash picture.... found (1024x768, 32386 bytes).

Console: switching to colour frame buffer device 79x42

fb0: VESA VGA frame buffer device

Detected PS/2 Mouse Port.

pty: 256 Unix98 ptys configured

Serial driver version 5.05c (2001-07-0 :Cool:  with MANY_PORTS SHARE_IRQ SERIAL_PCI ISAPNP enabled

ttyS00 at 0x03f8 (irq = 4) is a 16550A

ttyS01 at 0x02f8 (irq = 3) is a 16550A

Uniform Multi-Platform E-IDE driver Revision: 6.31

ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx

VP_IDE: IDE controller on PCI bus 00 dev 89

PCI: No IRQ known for interrupt pin A of device 00:11.1. Please try using pci=biosirq.

VP_IDE: chipset revision 6

VP_IDE: not 100% native mode: will probe irqs later

VP_IDE: VIA vt8233a (rev 00) IDE UDMA133 controller on pci00:11.1

    ide0: BM-DMA at 0xb400-0xb407, BIOS settings: hda:DMA, hdb:DMA

    ide1: BM-DMA at 0xb408-0xb40f, BIOS settings: hdc:DMA, hdd:DMA

hda: IC35L080AVVA07-0, ATA DISK drive

hdb: ST38410A, ATA DISK drive

hdc: SONY CDU4811, ATAPI CD/DVD-ROM drive

hdd: RICOH CD-R/RW MP7083A, ATAPI CD/DVD-ROM drive

ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

ide1 at 0x170-0x177,0x376 on irq 15

hda: 160836480 sectors (82348 MB) w/1863KiB Cache, CHS=10011/255/63, UDMA(100)

hdb: 16841664 sectors (8623 MB) w/512KiB Cache, CHS=1048/255/63, UDMA(66)

hdc: ATAPI 48X CD-ROM drive, 120kB Cache, UDMA(33)

Uniform CD-ROM driver Revision: 3.12

Partition check:

 /dev/ide/host0/bus0/target0/lun0: p1 p2 p3 p4 < p5 p6 p7 p8 p9 >

 /dev/ide/host0/bus0/target1/lun0: p1

Floppy drive(s): fd0 is 1.44M

FDC 0 is a post-1991 82077

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize

loop: loaded (max 8 devices)

Linux agpgart interface v0.99 (c) Jeff Hartmann

agpgart: Maximum main memory to use for agp memory: 439M

agpgart: Detected Via Apollo Pro KT266 chipset

agpgart: AGP aperture is 32M @ 0xfc000000

SCSI subsystem driver Revision: 1.00

kmod: failed to exec /sbin/modprobe -s -k scsi_hostadapter, errno = 2

NET4: Linux TCP/IP 1.0 for NET4.0

IP Protocols: ICMP, UDP, TCP, IGMP

IP: routing cache hash table of 4096 buckets, 32Kbytes

TCP: Hash tables configured (established 32768 bind 32768)

IPv4 over IPv4 tunneling driver

GRE over IPv4 tunneling driver

NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.

RAMDISK: Couldn't find valid RAM disk image starting at 0.

Freeing initrd memory: 31k freed

EXT3-fs: INFO: recovery required on readonly filesystem.

EXT3-fs: write access will be enabled during recovery.

kjournald starting.  Commit interval 5 seconds

EXT3-fs: recovery complete.

EXT3-fs: mounted filesystem with ordered data mode.

VFS: Mounted root (ext3 filesystem) readonly.

Mounted devfs on /dev

Freeing unused kernel memory: 116k freed

Adding Swap: 1574328k swap-space (priority -1)

EXT3 FS 2.4-0.9.17, 10 Jan 2002 on ide0(3,2), internal journal

PCI: Found IRQ 11 for device 00:0d.0

PCI: Sharing IRQ 11 with 00:09.1

PCI: Sharing IRQ 11 with 01:00.0

3c59x: Donald Becker and others. www.scyld.com/network/vortex.html

00:0d.0: 3Com PCI 3c905 Boomerang 100baseTx at 0xb800. Vers LK1.1.16

parport0: PC-style at 0x378 (0x778) [PCSPP(,...)]

parport0: irq 7 detected

ppa: Version 2.07 (for Linux 2.4.x)

ppa: Found device at ID 6, Attempting to use EPP 32 bit

ppa: Communication established with ID 6 using EPP 32 bit

scsi0 : Iomega VPI0 (ppa) interface

  Vendor: IOMEGA    Model: ZIP 100           Rev: K.05

  Type:   Direct-Access                      ANSI SCSI revision: 02

Attached scsi removable disk sda at scsi0, channel 0, id 6, lun 0

SCSI device sda: 196608 512-byte hdwr sectors (101 MB)

sda: Write Protect is off

 /dev/scsi/host0/bus0/target6/lun0: p4

usb.c: registered new driver usbdevfs

usb.c: registered new driver hub

PCI: Found IRQ 10 for device 00:09.2

PCI: Sharing IRQ 10 with 00:05.0

PCI: Sharing IRQ 10 with 00:07.0

PCI: Sharing IRQ 10 with 00:0e.0

PCI: Sharing IRQ 10 with 00:0e.1

hcd.c: ehci-hcd @ 00:09.2, VIA Technologies, Inc. USB 2.0

hcd.c: irq 10, pci mem e291e000

usb.c: new USB bus registered, assigned bus number 1

ehci-hcd.c: USB 2.0 support enabled, EHCI rev 0.95

hub.c: USB hub found

hub.c: 4 ports detected

uhci.c: USB Universal Host Controller Interface driver v1.1

PCI: Found IRQ 12 for device 00:09.0

uhci.c: USB UHCI at I/O 0xd400, IRQ 12

usb.c: new USB bus registered, assigned bus number 2

hub.c: USB hub found

hub.c: 2 ports detected

PCI: Found IRQ 11 for device 00:09.1

PCI: Sharing IRQ 11 with 00:0d.0

PCI: Sharing IRQ 11 with 01:00.0

uhci.c: USB UHCI at I/O 0xd000, IRQ 11

usb.c: new USB bus registered, assigned bus number 3

hub.c: USB hub found

hub.c: 2 ports detected

PCI: Found IRQ 3 for device 00:11.2

IRQ routing conflict for 00:11.2, have irq 5, want irq 3

IRQ routing conflict for 00:11.3, have irq 5, want irq 3

uhci.c: USB UHCI at I/O 0xb000, IRQ 5

usb.c: new USB bus registered, assigned bus number 4

hub.c: USB hub found

hub.c: 2 ports detected

PCI: Found IRQ 3 for device 00:11.3

IRQ routing conflict for 00:11.2, have irq 5, want irq 3

IRQ routing conflict for 00:11.3, have irq 5, want irq 3

uhci.c: USB UHCI at I/O 0xa800, IRQ 5

usb.c: new USB bus registered, assigned bus number 5

hub.c: USB hub found

hub.c: 2 ports detected

usb.c: registered new driver hiddev

usb.c: registered new driver hid

hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik <vojtech@suse.cz>

hid-core.c: USB HID support drivers

mice: PS/2 mouse device common for all mice

scsi1 : SCSI host adapter emulation for IDE ATAPI devices

  Vendor: RICOH     Model: CD-R/RW MP7083A   Rev: 1.20

  Type:   CD-ROM                             ANSI SCSI revision: 02

Attached scsi CD-ROM sr0 at scsi1, channel 0, id 0, lun 0

sr0: scsi3-mmc drive: 32x/32x writer cd/rw xa/form2 cdda tray

nvidia: loading NVIDIA Linux x86 NVdriver Kernel Module  1.0-3123  Tue Aug 27 15:56:48 PDT 2002

ACPI: Power Button (FF) found

ACPI: Multiple power buttons detected, ignoring fixed-feature

ACPI: Power Button (CM) found

Processor[0]: C0 C1

ACPI: System firmware supports S0 S1 S4 S5

spurious 8259A interrupt: IRQ7.

hub.c: USB new device connect on bus2/2, assigned device number 2

hub.c: USB hub found

hub.c: 4 ports detected

kjournald starting.  Commit interval 5 seconds

EXT3 FS 2.4-0.9.17, 10 Jan 2002 on ide0(3,3), internal journal

EXT3-fs: recovery complete.

EXT3-fs: mounted filesystem with ordered data mode.

kjournald starting.  Commit interval 5 seconds

EXT3-fs warning: maximal mount count reached, running e2fsck is recommended

EXT3 FS 2.4-0.9.17, 10 Jan 2002 on ide0(3,6), internal journal

EXT3-fs: recovery complete.

EXT3-fs: mounted filesystem with ordered data mode.

kjournald starting.  Commit interval 5 seconds

EXT3 FS 2.4-0.9.17, 10 Jan 2002 on ide0(3,7), internal journal

EXT3-fs: recovery complete.

EXT3-fs: mounted filesystem with ordered data mode.

hub.c: USB new device connect on bus2/2/2, assigned device number 3

input0: USB HID v1.00 Mouse [KYE Genius USB Wheel Mouse] on usb2:3.0

kjournald starting.  Commit interval 5 seconds

EXT3 FS 2.4-0.9.17, 10 Jan 2002 on ide0(3,9), internal journal

EXT3-fs: recovery complete.

EXT3-fs: mounted filesystem with ordered data mode.

Real Time Clock Driver v1.10e

PCI: Found IRQ 10 for device 00:05.0

PCI: Sharing IRQ 10 with 00:07.0

PCI: Sharing IRQ 10 with 00:09.2

PCI: Sharing IRQ 10 with 00:0e.0

PCI: Sharing IRQ 10 with 00:0e.1

NVRM: AGPGART: VIA Apollo KT133 chipset

NVRM: AGPGART: aperture: 32M @ 0xfc000000

NVRM: AGPGART: aperture mapped from 0xfc000000 to 0xe29cc000

NVRM: AGPGART: mode 4x

NVRM: AGPGART: allocated 16 pages

CSLIP: code copyright 1989 Regents of the University of California

PPP generic driver version 2.4.2

PPP MPPE compression module registered

----------

## stratocastor666

In there it says something about multiple power buttons found, ignoring fixed feature. Im not quite sure what that is, ive never seen it before. Will try talking to a few people, and looking around though... kind of weird though, but it looks to be the source of your proplem...

----------

## aardvark

I have exactly the same issues on my A7V (no further numbers, kt 133 chipset)

I have the button module loadad and it (the deamon) *does* respond to the button. I have a custom "action" in /etc/acpi/events/default that echo's a text to a file and also takes the value of "%e" (the placeholder for the kernel event) as $1 and should also write that, but that is where nothing happens. Also passing %e to the default.sh script in /etc/acpi/ will not have it recieve anything as %e i.e. %e has no value whatsoever. 

Now comes the strange part : in /var/log/acpid I find an entry for every time I press the powerbutton and it is defined as a "button/power ..." event!

So somthing is being passed somewhere but acpid does not recieve it and put it in the placeholder %e

AlLso running 'acpid -d'  (debugging) from the commandline gives all sorts of outpt when I press the powerbutton, but the %e contains nothing! whereas the event is in fact defined as button/power in the output

Wonder what's going on... Asus A7V ? perhaps not compatible?

Output in DEBUG mode:

```

[Wed Feb 19 22:20:53 2003] starting up

[Wed Feb 19 22:20:53 2003] DBG: parsing conf file /etc/acpi/events/default

[Wed Feb 19 22:20:53 2003] 1 rule loaded

[Wed Feb 19 22:20:55 2003] received event "button/power PWRF 00000080 0000001b"

[Wed Feb 19 22:20:55 2003] DBG: rule from /etc/acpi/events/default matched

[Wed Feb 19 22:20:55 2003] executing action "/etc/acpi/writeevent "

[Wed Feb 19 22:20:55 2003] BEGIN HANDLER MESSAGES

[Wed Feb 19 22:20:55 2003] END HANDLER MESSAGES

[Wed Feb 19 22:20:55 2003] action exited with status 0

[Wed Feb 19 22:20:55 2003] DBG: 1 total rule matched

[Wed Feb 19 22:20:55 2003] completed event "button/power PWRF 00000080 0000001b"

[Wed Feb 19 22:21:03 2003] exiting

```

----------

## Lucretia

 *aardvark wrote:*   

> I have exactly the same issues on my A7V (no further numbers, kt 133 chipset)
> 
> I have the button module loadad and it (the deamon) *does* respond to the button. I have a custom "action" in /etc/acpi/events/default that echo's a text to a file and also takes the value of "%e" (the placeholder for the kernel event) as $1 and should also write that, but that is where nothing happens. Also passing %e to the default.sh script in /etc/acpi/ will not have it recieve anything as %e i.e. %e has no value whatsoever. 
> 
> Now comes the strange part : in /var/log/acpid I find an entry for every time I press the powerbutton and it is defined as a "button/power ..." event!
> ...

 

Well, I've started it up (using the default setup, nothing added) and watched the output of /var/log/acpid but when I press the poer button, I get no events logged.

Hmmm, could it be that my power button is set in the BIOS to suspsend after 4 seconds?

Thanks,

Luke.

----------

## aardvark

 *Lucretia wrote:*   

> 
> 
> Well, I've started it up (using the default setup, nothing added) and watched the output of /var/log/acpid but when I press the poer button, I get no events logged.
> 
> Hmmm, could it be that my power button is set in the BIOS to suspsend after 4 seconds?
> ...

 

Well my modules name is just button. I use the 2.4.20-r1 gentoo kernel. My powerbutton is set up in bios to shutdown after 5 sec.

BTW I got the event handling working by responding to event "button/power*" and then direct action and not through the placeholder.

----------

## Lucretia

Can you post your /etc/acpi/events/default and /etc/acpi/default.sh files so I can try them out?

Thanks,

Luke.

----------

## aardvark

Well try running 'acpi -d' in console as root.

If you don't see anything there, these files will prolly not work either

/etc/acpi/powerbutton:

```

#!/bin/bash

##

echo "event occured:" >> /var/log/events

echo $1 >> /var/log/events

halt

#reboot

```

/etc/acpi/events/default

```

event=button/power*

action=/etc/acpi/powerbutton Powerbutton

```

----------

