You are not logged in.
Pages: 1
At least I hope this classifies as an laptop issue.
Anyway. The problem is that if, I start the acpid daemon from a different vt as the one X in running on, X crashes if swivel the display into tablet mode. This is the output from the X server. The weird thing is, that if I start a terminal emulator inside X and start acpid from there, everything works just fine.
I'm not sure whether acpid clashes with thinkpad-acpi or something else, because "ps aux | grep acpid" tells that there is also a "[ktpacpid]" running. But I don't to what this one belongs.
I actually only want to use acpid to detect whether the PC is in tablet mode or not so if anybody has a pointer on how I could detect this otherwise, that would be nice too.
Offline
I think that it is probably indicated somewhere is /sys, so if you can figure that out, you can simply apply a udev rule to it.
Offline
This problem occurs to me and to some others as well and we started to discuss it here. Unfortunately, I can't provide a solution yet. There also seems to be a related bug report: here. There is said that downgrading acpid might help for now. However, I didn't try yet. The reason seems to be related to a recent introduction of a new tablet mode event in acpid.
Offline
Here is instruction on how to use a udev rule to run a script when one's laptop is plugged/unplugged. Using it for your purposes would be quite similar. Of course you would have to figure out what value is changing in /sys when you flip the screen.
https://wiki.archlinux.org/index.php/La … _udev_rule
That said, here is some info on how to get started writing udev rules.
http://www.reactivated.net/writing_udev_rules.html
It is a bit outdated, in that the command is now udevadm. So to find the necessary parameters to put into your rule, you would do something like
$ udevadm info --attribute-walk --path=/bus/usb/devices/usb1
for the usb1 device located at /sys/bus/devices/usb1 (notice in the udevadm command, you leave out the initial /sys).
Good luck!
Offline
Hi!
I got the same problem with my X230t.
I think that this problem is not related to udev, because if acpid is disabled the rotation switch is ignored and the x server doesn't break.
I only can think of 2 possibilities here:
1. bug in the new acpi "video/tabletmode" event
2. bug in x-server or gnome by handling the acpi event. (I didn't tried kde or others)
I tried to write a acpid configuration file for this event and it works fine (automatic tablet-rotation) till the x server breaks but only after acpid handled this event.
Here a log from this:
Oct 15 19:10:04 Orrorin acpid[19119]: client connected from 19453[0:0]
Oct 15 19:10:04 Orrorin acpid[19119]: 1 client rule loaded
Oct 15 19:10:07 Orrorin logger[20107]: ACPI action: Tabletmode on
Oct 15 19:10:07 Orrorin logger[20113]: ACPI group/action undefined: video/tabletmode / TBLT
Oct 15 19:10:07 Orrorin gnome-session[19547]: Gdk-WARNING: gnome-session: Fatal IO error 11 (The resource is not currently available) on X server :3.
Oct 15 19:10:07 Orrorin systemd-logind[9580]: Removed session 137.
So maybe waiting for a fix would be the solution...
Last edited by PyroDevil (2012-10-15 17:31:08)
Probably the last man who knew how it worked had been tortured to death years before.
Or as soon as it was installed. Killing the creator was a traditional method of patent protection.
(Small Gods)
Offline
This problem occurs to me and to some others as well and we started to discuss it here. Unfortunately, I can't provide a solution yet. There also seems to be a related bug report: here. There is said that downgrading acpid might help for now. However, I didn't try yet. The reason seems to be related to a recent introduction of a new tablet mode event in acpid.
Thanks for that, I thought I had bricked something.
Good luck!
Thanks for the pointers, going to investigate that, let the quest begin!
Last edited by Ponder (2012-10-15 18:09:05)
Offline
There's also related bug - some distros don't compile xorg-server with ACPI support.
Offline
@WonderWuffy
Found it, the file /sys/devices/platform/thinkpad_acpi/hotkey_tablet_mode holds 0 or 1, whether it is in "normal mode" or in tablet mode.
Thanks for the help again.
EDIT: I don't think I'm using a udev rule, though. I'll just have my script look the sys file up.
Last edited by Ponder (2012-10-20 23:59:18)
Offline
@Ponder, good find. Thanks for that! It's the same on the x230t btw.
Offline
As of version 2.0.18, acpid now sends "correct" string, and X does not crash anymore!!
If it interests anybody, on a lenovo X230T, you can turn on auto rotation by:
-------- start of /etc/acpi/events/rotate ---------
event=video*
action=/your/homedirectory/bin/thinkpad_handler.sh "%e"
-------- end of /etc/acpi/events/rotate ---------
-------- start of /your/homedirectory/bin/thinkpad_handler.sh ---------
#!/bin/bash
USER=`who | grep ':0' | grep -o '^\w*' | head -n1`
sudo -u $USER -i /home/$USER/bin/smart_rotate $@
-------- end of /your/homedirectory/bin/thinkpad_handler.sh ---------
-------- start of /your/homedirectory/bin/smart_rotate ---------
#!/usr/bin/perl -w
if($ARGV[0] !~ /video\/tabletmode/){
die;
}
$tabletmodefile="/sys/devices/platform/thinkpad_acpi/hotkey_tablet_mode";
if(-e "$tabletmodefile"){
$tabletmode=`cat $tabletmodefile`;
chomp($tabletmode);
if(!$tabletmode){
system("export DISPLAY=:0; xrandr --output LVDS1 --rotate normal");
system("export DISPLAY=:0; xsetwacom --set \"Wacom ISDv4 90 Pen stylus\" rotate none");
}else{
system("export DISPLAY=:0; xrandr --output LVDS1 --rotate inverted");
system("export DISPLAY=:0; xsetwacom --set \"Wacom ISDv4 90 Pen stylus\" rotate half");
}
}
-------- end of /your/homedirectory/bin/smart_rotate ---------
Offline
Pages: 1