# No Dock/Undock ACPI event

## lyallp

I have installed amd64 on a HP EliteBook 8540w.

I receive ACPI events for AC/Battery but nothing regarding Dock/Undock.

I am particularly interested in knowing when I dock so I can re-configure X for external monitors.

The Dock USB and Video work, I just don't get told when they arrive/leave.

I also note that on that laptop there are some little  buttons, one of which, I think, is the 'presentation' or 'external monitor' button.

This button does nothing under linux but a /var/log/messages diagnostic is generated indicating that the key is unrecognised.

As an alternative to not receiving ACPI dock/undock events, I would like to be able to have that key fire something up, independant of X and the Desktop environment. Can I do this? If so, how?

Any suggestions?

----------

## Jaglover

I recall there is dock option in the kernel, did you turn it on?

----------

## lyallp

I will have a look tomorrow morning, my time  :Smile: 

Pretty sure I did, but will check.

----------

## depontius

Another thing to keep track of is the difference between a "dock" and a "port replicator".  My W510 is plugged into a "port replicator", but that is technically not a "dock", so it doesn't show up as such in sysfs, and as far as I know won't generate acpi events.  However the W510 only has the built-in LVDS and VGA connectors, while the port replicator adds DP-1, DP-2, and DP-3 (DP3 appears to be DVI) devices.  I do have /sys/device/platform/dock.{0,1}, but dock.0/type is battery_bay and dock.1/type is ata_bay.  So at least I can detect the presence of the port replicator using xrandr, but I won't get an event on dock/undock.

----------

## lyallp

I have docking enabled in the kernel.

The only difference in the /sys filesystem between docked and undocked is a USB hub and it's attached devices.

Even xrandr shows no change.

I do receive a battery/AC event, but I am trying to isolate something which tells me I have a new external monitor or that the external monitor has gone away.

Investigation continues.

----------

## depontius

On second thought (My first thought got erased before sending.) I guess the reason I can detect being docked with xrandr is because my port replicator offers additional display options that aren't there on the naked laptop.  The laptop has LDVS and VGA through a 15-pin D-Sub on the side.  The port replicator adds DVI and DisplayPort(s?) as well as replicating the VGA D-Sub.  I guess your port replicator only replicates the display options present on the naked laptop, presumable a VGA D-Sub.

I need to check my lsusb, because I believe my port replicator adds a USB hub, as well.  That would be another way to detect.  I'm currently docked:

```
$ lsusb

Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 004: ID 0d3d:0001 Tangtop Technology Co., Ltd HID Keyboard

Bus 001 Device 003: ID 17ef:100a Lenovo 

Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
```

The question now becomes how much of this remains for the naked laptop.  I know the "Tangtop Technology" gizmo is how I get my PS2 keyboard and USB mouse+PS2 converter plugged in, so that's presumably a reliable indicator.  But as you've said, none of these are acpi events.  I'll presume that they are udev events, but I know even less about those.

----------

