nuclearsandwich / surface3-archlinux

Archlinux on the Microsoft Surface Pro 3
70 stars 4 forks source link

Type Cover 3 not working even after kernel patch #4

Open nuclearsandwich opened 9 years ago

nuclearsandwich commented 9 years ago

The patch listed here after being applied to Archlinux kernel version 3.16.

The following comes from dmesg

[  298.210436] usb 1-3: new full-speed USB device number 9 using xhci_hcd
[  298.384153] usb 1-3: No LPM exit latency info found, disabling LPM.
[  308.384780] hid-multitouch 0003:045E:07DC.0008: usb_submit_urb(ctrl) failed: -1
[  308.384822] hid-multitouch 0003:045E:07DC.0008: timeout initializing reports
[  308.385080] input: Microsoft Surface Type Cover UNKNOWN as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/0003:045E:07DC.0008/input/input21
[  308.385573] hid-multitouch 0003:045E:07DC.0008: input,hiddev0,hidraw2: USB HID v1.11 Keyboard [Microsoft Surface Type Cover] on usb-0000:00:14.0-3/input0
benasse commented 9 years ago

Type Cover is working for me with patch from http://winaero.com/blog/how-to-install-linux-on-surface-pro-3

nuclearsandwich commented 9 years ago

Awesome, I'll check it out this evening. Thanks.

benasse commented 9 years ago

if you don't want to rerompile the kernel, you can install the pakage folowing this link : http://cicogna.fr/share/linux-3.16.1-1-x86_64.pkg.tar.xz

Vistaus commented 9 years ago

@benasse: Thank you so much for that package! I would love it if there was a way to have the keyboard working but the trackpad disabled though.

nuclearsandwich commented 9 years ago

@Vistaus You should be able to disable the trackpad via XInput at the very least.

Vistaus commented 9 years ago

Nope. xinput recognizes the trackpad as part of the Type Cover 3.

[vistaus@heimenssp3 ~]$ xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Microsoft Surface Type Cover id=7 [slave pointer (2)] ⎜ ↳ NTRG0001:01 1B96:1B05 Pen id=8 [slave pointer (2)] ⎜ ↳ NTRG0001:01 1B96:1B05 id=9 [slave pointer (2)] ⎜ ↳ Arc Touch Mouse SE id=10 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Video Bus id=6 [slave keyboard (3)] [vistaus@heimenssp3 ~]$

Vistaus commented 9 years ago

Btw, any chance that someone can build a 3.17 package with this patch? I tried patching it but it didn't really work. I'm not too familiar with patches/kernel compilation either so...

nuclearsandwich commented 9 years ago

Sorry I've been letting this stuff go. I had to revert to Windows to get firmware updates and have been trying to force Windows onto an SD card. If I'm successful in that endeavor I'll document it.

@Vistaus does the touchpad use the synaptic drivers or evdev? If the former, you should be able to disable it in software via synclient.

Vistaus commented 9 years ago

It doesn't use synaptic, synclient doesn't recognize it either.

benasse commented 9 years ago

Someone has worked on the subject since? Someone managed to make it work with the 3.18 kernel ?

Vistaus commented 9 years ago

Haven't tried the 3.18 kernel yet but the 3.17 kernel (with the Type Cover 3 patch applied, of course) makes the Surface Pro 3 very unstable in my experience. Have tried it a couple of times over the last few weeks. Too unstable. 3.16 from the package you provided earlier in this thread (from that French mirror) is the most stable still.

benasse commented 9 years ago

To get the touchpad working, add the following lines in /etc/X11/xorg.conf.d/50-synaptics.conf

Section "InputClass"
        Identifier "Surface Pro 3 cover"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"
        Option "vendor" "045e"
        Option "product" "07dc"
        Option "IgnoreAbsoluteAxes" "True"
EndSection

http://ubuntuforums.org/showthread.php?t=2231207&page=2&p=13070900#post13070900

Vistaus commented 9 years ago

@benasse: I know, i have that. But the 3.17 kernel is still unstable with the Type Cover 3 esp. 3.16 is stable.

gcaillaut commented 9 years ago

How can I enable two finger scrolling ? It worked perfectly in the manjaro live CD, but it isn't working after the installation.

I added the following lines in my 50-synaptics.conf

    Option "EmulateWheel" "True"
    Option "EmulateWheelButton" "3"

So I can scroll with my finger when the right button is pressed. But this isn't what I want, I want to scroll with two fingers :(. I saw that the synaptics driver seems to have such an option, but unfortunately I wasn't able to make my touchpad work with this driver, so I'm stuck with evdev. Someone has a solution ?

Vistaus commented 9 years ago

Stuck with the same problem here. I want to disable the touchpad or enable scrolling but it's not possible. I've tried a lot of things, even direct evdev things, but not working :(

Vistaus commented 9 years ago

I'll try the 3.18 rcX kernel ASAP and see if that makes things better. 3.17 with the known patch was very unstable so I'm still stuck on the patched 3.16 so far. Hopefully 3.18 will be more stable.

nuclearsandwich commented 9 years ago

I've been meaning to test with the current stock kernel but I've misplaced my Type cover. I bought the Surface specifically to bring my own keyboard so it hasn't been a high priority concern for me.

Vistaus commented 9 years ago

Tried with 3.18 rc5 unpatched today. Results in a kernel panic during boot. Will investigate further.

Vistaus commented 9 years ago

Status update: 3.18 rc works now. But the Type Cover 3 doesn't :( Still needs patching. Will do that now and report back.

Edit: it does error out when patching:

vistaus@heimenssp3:~/Downloads/linux-3.18-rc5$ patch -p1 --ignore-whitespace -i typecover3.patch patching file drivers/hid/hid-ids.h Hunk #1 succeeded at 642 (offset 11 lines). patching file drivers/hid/hid-core.c patching file drivers/hid/usbhid/hid-quirks.c Hunk #1 FAILED at 73. 1 out of 1 hunk FAILED -- saving rejects to file drivers/hid/usbhid/hid-quirks.c.rej vistaus@heimenssp3:~/Downloads/linux-3.18-rc5$

@benasse In case it doesn't work out, I now see that you also have packages for 3.17.2 on your website. Did you also apply the camera patch on those packages?

Vistaus commented 9 years ago

So after patching 3.18 rc5 works good, so far. Need to test more as it wasn't directly unstable with 3.17 at first either. The only downside is that the touchpad stopped working, both in 3.18 and the patched 3.16 for some reason :/ Not that I care though, I wanted it disabled anyway. But the downside is is that my external mouse acts a little flaky with emulating a middle mouse click on my left mouse button. A couple of X restarts seems to have solved that for now, but let's not jinx it lol.

Anyway: at least typing works as good as on 3.16 so you can compile 3.18 rc5 if you want to, you just need to patch it like 3.16 (and 3.17); that patch error can be ignored.

Vistaus commented 9 years ago

Status update: booted this morning (same 3.18 rc5) and now the touchpad is enabled again. And just for the record 'cause I know some of you do care about the touchpad (;-)): it's the same as on 3.16/3.17, no two-finger scrolling and stuff.

gcaillaut commented 9 years ago

I had the same problem yesterday. I tried to build the 3.16.7 kernel with the touch cover and the camera patch. It took one reboot to re enable the touch pad (the keyboard was working). After that, it seems to work like a charm, touch cover and both camera.

It's the first time I build a kernel, so I guess I did some mistakes. Could you explain how do you build and make a package ? I'd like to share m'y little work but I fear I did a bad work :( (e.g. kernel option I should enable or disable)

Vistaus commented 9 years ago

I've created a how-to for patching, compiling and installing the kernel (including Type Cover 3 and Camera patches!): https://github.com/Vistaus/surface3-arch-antergoslinux/issues/8

nuclearsandwich commented 9 years ago

@GaaH https://wiki.archlinux.org/index.php/Arch_packaging_standards should get you started on the right path to creating packages. A very simple package would be https://github.com/nuclearsandwich/mwifiex-firmware-git

benasse commented 9 years ago

@Vistaus I have upload the pakages with the camera patch now. For information, I build the kernel using ABS : https://wiki.archlinux.org/index.php/Kernels/Compilation/Arch_Build_System

lizalc commented 9 years ago

There is support for the Type Cover 3 in the linux-next branch. I haven't tested it yet, but presumably the code there is more complete than the patches floating around (there is code in there that I haven't seen in any of the patches I've seen before).

I'll be testing this out later today and will also try backporting it to 3.17 (and potentially 3.16, but I'm no expert with this).

Vistaus commented 9 years ago

That's great! Is linux-next what will become 3.19? Currently running 3.18 rc5 patched.

lizalc commented 9 years ago

Linux-next is a staging area for the next kernel merge window. So there is a chance that support will be merged into 3.18.

lizalc commented 9 years ago

Here is the patch that went into linux-next: http://www.spinics.net/lists/linux-usb/msg116763.html

I tested it on 3.17.4 and the keyboard works, but the trackpad doesn't. Though I haven't had any success with that at all yet.

Vistaus commented 9 years ago

Looks like the same patch as in this thread. Or is that just me?

lizalc commented 9 years ago

It is similar. It's based on the the patches on the Ubuntu forum and the Winaero page.

karlis-dreizis commented 9 years ago

I tried the http://winaero.com/blog/how-to-install-linux-on-surface-pro-3, https://github.com/Vistaus/surface3-arch-antergoslinux/issues/8, http://www.spinics.net/lists/linux-usb/msg116763.html and the next branch itself all without success.

Is it possible that the patches don't work because I have the Japanese typecover?

Vistaus commented 9 years ago

There shouldn't be any difference, but I have no experience with the Japanese version of the Type Cover 3 so I can't rule it out...

@svhr The patch from Linux-Next also works fine with the 3.18.0 stable kernel. Just as well as the original patch.

benasse commented 9 years ago

@InfernalLV : If you do a lsusb, have you this device : Bus 001 Device 005: ID 045e:07dc Microsoft Corp.

karlis-dreizis commented 9 years ago

No I don't. The output of lsusb

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 045e:07bf Microsoft Corp. 
Bus 001 Device 003: ID 045e:07be Microsoft Corp. 
Bus 001 Device 002: ID 045e:07dd Microsoft Corp. 
Bus 001 Device 009: ID 090c:1000 Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) Flash Drive
Bus 001 Device 008: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n
Bus 001 Device 007: ID 18a5:0240 Verbatim, Ltd 
Bus 001 Device 006: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

If I unplug the cover Bus 001 Device 002: ID 045e:07dd Microsoft Corp. is no longer in the list.

benasse commented 9 years ago

You could try to replace +#define USB_DEVICE_ID_MS_TYPE_COVER_3 0x07dc by +#define USB_DEVICE_ID_MS_TYPE_COVER_3 0x07dd in the patch

karlis-dreizis commented 9 years ago

3.18, edited the /usr/share/X11/xorg.conf.d/10-evdev.conf, workes great, but the touchscreen stops functioning after a while. How does one go about getting this into the kernel alongside the original id?

Vistaus commented 9 years ago

Just installed 3.19 RC1. I can confirm that the Type Cover 3 patch is now incorporated so no need to patch the kernel for that anymore. You only need to patch the kernel for the Cameras to work now.

AykoPoel commented 9 years ago

@InfernalLV I had the same problems with the touchscreen and tried out some stuff and I have the feeling that it got much better after setting the mapping of all Buttons of the Touchscreen to leftclick. It can be done by creating a new conf file in /etc/X11/xorg.conf.d/

52-ntrig.conf

Section "InputClass"
    Identifier      "Touchscreen"
    MatchProduct    "NTRG0001:01 1B96:1B05"
    Option "ButtonMapping" "1 1 1 1 1"
EndSection

Section "InputClass"
    Identifier      "Pen"
    MatchProduct    "NTRG0001:01 1B96:1B05 Pen"
    Option "ButtonMapping" "1 3 3 3 3"
EndSection

The second option is for setting the second side button of the Pen to right click, I didn´t managed to get the first side button to work.

In my case the touchscreen deactivated considerably less then before. And when it happens then I could get it back to work easily just by running:

$ xinput disable "NTRG0001:01 1B96:1B05" 
$ xinput enable "NTRG0001:01 1B96:1B05"

That was often not possible before.

I use a script for managing autorotation of the screen and let this commands run when I rotate the device so when the touchscreen is stuck again I just rotate the surface once and it works again. If sombody is intrestet in the script I could post it.

BTW I'm using 3.18.1-Arch Linux and have applied the latest Firmwarepatch. I tried 3.19-rc1 but ACPI was not working for me :0(

Hopes this helps you too :0)

Vistaus commented 9 years ago

ACPI works fine for me on 3.19-RC1 as much as on 3.18. It just doesn't show the battery percentage, but that's it and I don't really find that a problem 'cause I know it's gonna be back in RC2 or 3.

paulhandy commented 9 years ago

@AykoPoel What is your autorotate script? I cannot find anything that recognizes the gyroscope.

Also, has anyone solved two finger scrolling on the touchpad yet?

AykoPoel commented 9 years ago

@paulhandy posted it on the new issue :0)

colorprint commented 9 years ago

Somebody solved the scroll issue (two-finger or right edge)? Thanks

benasse commented 9 years ago

I have found this redit : http://www.reddit.com/r/SurfaceLinux/comments/2w7rvm/touchpad_sp3_on_ubuntu_gnomeunity/ .

felipeota commented 9 years ago

Here's a patch to have multitouch working and two finger scroll. It's for the 4.0 tree. https://gist.github.com/felipeota/afb5f510f5b315f8bed8 I can backport it to another kernel if you need.

colorprint commented 9 years ago

Many thanks, it works fine on 4.0-rc5!

colorprint commented 9 years ago

It seems right click not works with this patch :(

felipeota commented 9 years ago

Yes, that's one of the main problems, I am looking into that. Meanwhile you can get right click by tapping with two fingers.

felipeota commented 9 years ago

The issue is that the type cover only has one big button. In the previous patch the type cover was in mouse mode, that is one finger and it emulated two buttons by detecting which side was being touched. But in multitouch mode it only sends one button as information, so it is the job of the X11 driver to figure out which is the click. I don't know if there is a synaptics setting for that.

felipeota commented 9 years ago

Well after some digging it turns out that synaptics does support this usage through the clickpad and softbuttons option. Both the click and drag and right click work if you add a file to your Xorg.conf.d option with this:

Section "InputClass"
        Identifier "Default clickpad buttons"
        MatchDriver "synaptics"
        Option "ClickPad" "true"
        Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
        Option "SecondarySoftButtonAreas" "58% 0 0 15% 42% 58% 0 15%"
EndSection

Note that this will match any touchpad you plug into your surface, you can make it more specific by matching the manufacturer and device.