Re: ALPS touchpad not recognized (hp mini 311)
Hi all
two days ago i bought a HP Pavilion dm1 which looks exactly like the mini 311 but it has a faster dual core cpu, 2gig's of ram and 320 gigs of harddisk space. however, it seems to have the same crappy touchpad.
allthough i am not really a c programmer nor a kernel hacker i saw a wiki (german) which described some way to modify the alps driver to enable the use of newer models.. (here's the link for those speaking german amongst you: http://wiki.ubuntuusers.de/Touchpad#...-nicht-erkannt )
however, the proposed line didn't work but once i was in that file i started to fiddle around..
in the german wiki they add one line that looks like this:
Code:
{ { 0x73, 0x02, 0x50 }, 0x4f, 0x4f, ALPS_FW_BK_1 },
to the array definig the different known alps touchpad models (this line probably contains the model description for one type i think)
i then found in the sources, that the first three numbers must match some kind of a hardware fingerprint which they call "E7 report". in order to find out the numbers for my notebook i changed to debug mode by defining DEBUG at the beginning. i then recompiled and loaded the new module. and voilą, my E7 report contained: 73 02 64. so i put them in a new line like this one:
Code:
{ { 0x73, 0x02, 0x64 }, 0xf8, 0xf8, ALPS_FW_BK_2 },
and recompiled and loaded the whole thing.. and tataaaaa.. my ubuntu recognized an ALPS touchpad and when i checked the mouse settings in gnome i even saw the touchpad tab where i could choose all these options and disable the pad while typing etc.. but don't jump around yet.. because sadly it had no effect on the behaviour of the touchpad.. no matter what i set, it didn't change anything..
since i had no clue what the rest of the line was for (except for the last parameter which seems to be something defining special types of touchpads which obviousley need special attention) i tried to go deeper into the sources to find out what the rest stands for...
while i did't find out what the rest is used for (and changin it had no effect on it not changin anything in gnome) i found the place where the actual events from the touchpad are being received by the driver and then processed to pass them on to the system.. its inside the function called
alps_process_packet()
i started to put some printk statements in there which basically print some output to the dmesg pipe or whatever that thing is called and i then found out that as it seems the touchpad itself is sending pure ps2 commands to the OS..
and i also found out that from the data packet, that the driver seems to receive from the bios or whatever sends them, there was no way to distinguish between a tap-click and a real mouse button click!
while googling around the web i also found out that other notebooks with similar touchpads have a "hardware tap feature" which can be enabled or disabled.. if it is enabled the touchpad's firmware does the interpretation of the tap and converts it into a click and i suspect that exactly this is what's happening here... sadly HP's bios sucks so badly that they don't allow us customers to change anything at all and they also don't allow to change how the pad works..
i am now about to restore my notebook to windows 7 again, hoping to find a driver option which disables this crappy hardware touch stuff and finally makes the touchpad work as a real touchpad..
if anyone of you knows what the rest of the lines stand for or how the whole mouse stuff really works i'd be happy to know more about it..
another thing that worried me a bit was: allthough x seemed to recognize my mous as a touchpad it didn't seem to receive the mouse movement from the touchpad driver.. when i checked with
Code:
xinput test "AlpsPS/2
..." i never saw any movements.. i only saw them on the PS/2 Mouse device.. whereas on my old vaio it is exactly the opposite way, i see the movements from the alps but not form the regular ps2 mouse driver..
any help on this is appreciated.. this stupid tap feature really renders my notebook more or less useless because it is soooo annoying when typing something..
my last solution to "solve" the problem would be to find a way how to script X to not accept any mouse input while typing.. so also with a normal mouse it would not be able to move it or click while typing ... maybe that's available somewhere.. the problem of accidentially clicking on something while moving the cursor around would still exist though..
regards
Pascal
Re: ALPS touchpad not recognized (hp mini 311)
unfortunately changing any of the settings under windows doesn't change anything for linux. so if these settings like the tapping are to be changed in the firmware at least they don't stay permanently.
one thing i've noticed.. i was playing around with those i8042 parameters and it seemed that i disabled the vertical scrolling somehow using these kernel parameters (like i8042.reset and such) ... so maybe fiddling with the i8042 driver could help to get real touchpad stuff from the touchpad and not just mouse commands.
1 Attachment(s)
Re: ALPS touchpad not recognized (hp mini 311)
and another self-reply :) (maybe someone will find this interesting one day :) )
i experimented alot with the alps.c driver source but i couldn't find the right solution yet. however, i succeeded in getting rid of the biggest annoyance: my ubuntu 9.10 now turns off the mousepad when i'm typing.. i therefore had to giveup the scrolling for now..
so here is the current status:
as described before i found out that the touchpad is a new type with a new E7 signature. I added the signature to the driver which with most other new types of alps touchpads usually leads to the touchpad being recognized as a touchpad and then the cursor jumps around your screen like crazy until you set the last three arguments in that line i discussed before to the right values. unfortunately in our case this doesn't happen. the mousepad is recognized as an alps pad now and gnome shows the desired third pannel in the mouse settings but they have no effect. that is, because the touchpad is still working in some kind of pass through mode, meaning, it still transmits relative movements and not absolute coordinates of the finger posiion on the tablet and therefore it still is the firmware of the touchpad who decides weather it should click on tab and these things and because the ps2 output is then sent through a virtual ps2 mouse device rather than through the alps device even disabling the mousepad won't work.
i then commented out some lines in the driver part where it obviously creates this second virtual mouse and made it not do this anymore. however i don't understand what i've really done in detail, i just imagine i did about this :) .. the consequence is, that now the ps2 commands are sent through the driver and then through the alps device and therefore gnome is now able to turn off the touchpad while i am writing..
at least it can do so as long as you don't stop and think .. :)
below you can find my modified alps.c file and a compiled version of psmouse.ko
if you use the exact same version of ubuntu 9.10 with the same kernel as i am (i am using the regular desktop install, up to date as of now and with the folowing kernel:
Code:
$ uname -a
Linux pshp 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux
so if this is the same for you you can give it a try and copy these two compiled files to /liob/modules/2.6.31-14-generic/kernel/drivers/input/mouse/ AFTER MAKING A BACKUP COPY OF THE ORIGINAL!
and then do
Code:
sudo rmmod psmouse
sudo modprobe psmouse
now you should see the "touchpad" tab under System->Preferences->Mouse
you have to disable and then enable the "disable touchpad while typing" option to activate it the first time. from then on it should work..
i hope i'll get some help from someone who knows how the driver really works and how i can find out how to do this the right way and get the touchpad to work as a real touchpad.
regards
pascal
Re: ALPS touchpad not recognized (hp mini 311)
thank you psuter!!! now my mini311 touchpad turns off while typing, but without scroll.
Re: ALPS touchpad not recognized (hp mini 311)
I don't know much about kernel compiling, so how do you compile just the psmouse kernel module? like i know enough to compile the entire kernel, but is there an easy way to just rebuild psmouse.ko?
Re: ALPS touchpad not recognized (hp mini 311)
i will self reply too... here is the answer to my question.
once you have the kernel source and the build requirements, (see here for more info) the source will likely reside in /usr/src/linux-source-`uname -r`. so copy the mouse module source files to somewhere like /tmp/mouse (i.e. cp /usr/src/linux-source-`uname -r`/drivers/input/mouse /tmp/mouse), or if you don't care about modifying your /usr/src then just edit the files in place.
once your source files are modified to your liking, from within your mouse directory (either /tmp/mouse or /usr/src/...) run the following command:
Code:
make -C /lib/modules/`uname -r`/build M=`pwd` psmouse.ko
finally, you'll need to copy your psmouse.ko module back to the modules directory like psuter said. remember to rmmod psmouse first, copy (backup first) the module over, then modprobe psmouse.
Re: ALPS touchpad not recognized (hp mini 311)
Used your binary successfully on 2.6.31-16-generic #52-Ubuntu SMP, thanks for the hack. Can't disable the tap to click "feature" still using either the Trackpad tab in mouse settings or gpointing-device-settings, and stuck with no scrolling, but it's still better than constantly clicking the damn thing accidentally while typing ;) This is definitely an annoying bug, hopefully it will get squashed soon. Not having a properly functioning trackpad on a netbook/laptop is a major pain.
The 311 is awesome in 9.10 though, aside from this one thing.. compiz runs perfect thanks to the ION, wifi and sound work great out of the box. If I had the cash lying around I'd buy some kernel hacker a 311 just to get it done yesterday. :P
Re: ALPS touchpad not recognized (hp mini 311)
i have been using synaptiks so far which seems to work well for avoiding the accidental touchpad bumps while typing. i also wrote a quick script for rebuilding the psmouse module.
Code:
#!/bin/bash
BUILD_DIR=/tmp/mouse
SRC_DIR=/usr/src/linux-source-2.6.31/drivers/input/mouse
MOD_DIR=/lib/modules/`uname -r`/kernel/drivers/input/mouse
MOD_BUILD_DIR=/lib/modules/`uname -r`/build
if [ "`whoami`" != "root" ]; then
echo "Please Run as root"
exit
fi
echo "Unloading old psmouse module"
rmmod psmouse
echo "Removing old module build directory"
rm -rf $BUILD_DIR
echo "Copy source files to new build directory"
cp -R $SRC_DIR $BUILD_DIR
cd $BUILD_DIR
echo "Building psmouse module"
make -C $MOD_BUILD_DIR M=$BUILD_DIR psmouse.ko
if [ -z $BUILD_DIR/psmouse.ko ]; then
echo "Module failed to build, aborting"
exit
fi
if [ -z $MOD_DIR/psmouse.ko.orig ]; then
echo "Backing up original psmouse module"
cp $MOD_DIR/psmouse.ko $MOD_DIR/psmouse.ko.orig
fi
echo "Installing new psmouse module"
cp $BUILD_DIR/psmouse.ko $MOD_DIR/psmouse.ko
echo "Loading new psmouse module"
modprobe psmouse
i just left it in the kernel source path where the mouse driver files are located.
Re: ALPS touchpad not recognized (hp mini 311)
Re: ALPS touchpad not recognized (hp mini 311)
Hello patsissons,
I try to use your script but face some issues.
It seems that the makefile is missing or something (the make step does not work).
do you have some suggestions ?
I think we should prepare a kind of howto at the end. many users would be interested.
ps: I use jolicloud prebeta. It is based on ubuntu netbook remix 9.04 but with some modification.