GithubHelp home page GithubHelp logo

vistaus / surface3-arch-antergoslinux Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nuclearsandwich/surface3-archlinux

6.0 7.0 0.0 14 KB

**POSSIBLY DEPRECATED** Arch Linux and Antergos on the Microsoft Surface Pro 3

surface3-arch-antergoslinux's Introduction

Microsoft Surface Pro 3 Documentation: Antergos & Arch Linux

NOTE!!!

I don't use the Surface Pro 3 anymore so some of the info might be deprecated.

Arch Linux and Antergos on the Microsoft Surface Pro 3. I forked this because I wanted to reflect that there's more stuff working than initially thought and I wanted to add things like clear how-to's.

Everything with a checkmark is working, everything without a checkmark isn't or might be working but is untested. Sometimes something partially works. This is denoted by additional info in cursive font. Also, you can click on most of the component names to get more info, either for getting that component to work (and seeing what doesn't work, should that be the case) or for improving the experience (for example the Onscreen keyboard one; that one's linked to a how-to I wrote).

Hardware

  • Type Cover 3
    • keyboard
    • trackpad - partially
  • WiFi - works, but issues with resume from hibernate
  • Bluetooth - works, but only after installing the driver
  • Touchscreen with multitouch support - works, but palm recognition does not work (yet)
  • N-trig Surface Pen - works, except for the OneNote button on top
  • Built-in microphone
  • Speakers
  • Headphone jack
  • Cameras
  • MicroSD card reader
  • MiniDisplay Port - untested
  • Docking station - not yet released
  • Suspend to RAM - working, but with issues
  • Suspend to SSD - working, but with issues
  • Hardware buttons (Power, Volume and touch-sensitive Windows key)

Software

##Thanks to: -nuclearsandwich for intially starting this and giving tips which really helped me get the Surface Pro 3 working fine on Antergos: https://github.com/nuclearsandwich/

-benasse for giving pointers about the Type Cover 3 but especially the Cameras: https://github.com/benasse

Reading

@rubiojr's work on Ubuntu https://github.com/rubiojr/surface3-ubuntu-trusty @rubiojr's kernel https://github.com/rubiojr/surface3-kernel

Reddit

Ubuntu 14.04 on the Surface Pro 3 Reddit Thread

http://www.reddit.com/r/SurfaceLinux/comments/2bhfk5/ubuntu_1404_on_the_surface_pro_3_thread/

Thread on the Surface Pro 1

http://www.reddit.com/r/SurfaceLinux/comments/2b1hf6/running_ubuntu_1404_on_surface_pro_1_full_time/

Ubuntu subreddit

http://www.reddit.com/r/Ubuntu/comments/26lvqc/ubuntu_on_the_surface_pro_3/

Kernel related

Type Cover 2 bug

https://bugzilla.kernel.org/show_bug.cgi?id=64811

Hardware

https://www.ifixit.com/Teardown/Microsoft+Surface+Pro+3+Teardown/26595

http://www.anandtech.com/show/8077/microsoft-surface-pro-3-review

http://www.anandtech.com/show/8037/microsoft-surface-pro-3-hands-on-display-performance-preview

https://origin-www.marvell.com/wireless/avastar/88W8897/ (wifi+bt+nfc chip?) http://wireless.kernel.org/en/users/Drivers/mwifiex

surface3-arch-antergoslinux's People

Contributors

rubiojr avatar nuclearsandwich avatar vistaus avatar

Stargazers

 avatar Andrew Yates avatar Jevin Sweval avatar  avatar Patrick Hofmann avatar JiaChen ZENG avatar

Watchers

Jevin Sweval avatar James Cloos avatar  avatar  avatar Benoît Stahl avatar Patrick Hofmann avatar Rich Mingin avatar

surface3-arch-antergoslinux's Issues

HiDPI support: working fine

I'm mainly using GNOME Shell, but I can confirm that it's working fine on Budgie and Enlightenment 0.19 as well. Although on Enlightenment, for some reason, GNOME apps don't scale right even though they're set to the correct HiDPI correction. No problem on Budgie with that. But non-GNOME GTK, Qt and EFL apps scale nice on Enlightenment though (and Aura, which is used in at least Chromium, Chrome and Yandex Browser).

Not sure how you'll experience it, but I did need to do a few tweaks to get everything scaled nicely.

Open up Tweak Tool and set the following:
-On the Fonts tab, set the fonts to an acceptable font size. I recommend 12-15. Then, set Scaling Factor to 0.70
-On the Windows tab, if not by default, set Window scaling to 1

Additonally, I found that the stock Shell theme doesn't scale nicely. Open up /usr/share/gnome-shell/theme/gnome-shell.css as root or sudo and look for the first fonts part. Set the font to something smaller. Now restart the Shell (ALT+F2 --> r --> Enter) and it scales nicely now. If you're using a custom theme and it doesn't scale right, edit the respective gnome-shell.css file of that theme.

WiFi and Bluetooth: working for the most part

WiFi is working out-of-the-box but it's rather unstable. Bluetooth isn't working out-of-the-box (at least not on 3.16 and 3.17) but you can take care of all of these issues. Do note that there's issues with WiFi and Bluetooth when coming out of a suspend from SSD or RAM (hibernation) so you might wanna consider disabling this.

Make sure you have Git installed.
Open up a terminal and issue the following commands one by one:

git clone git://git.marvell.com/mwifiex-firmware.git
mkdir -p /lib/firmware/mrvl/

(use sudo in front of it if you're on Antergos like me or have set up sudo on Arch)

sudo cp mwifiex-firmware/mrvl/* /lib/firmware/mrvl/

(use sudo in front of it if you're on Antergos like me or have set up sudo on Arch)

Now reboot :)

Cameras: working

The cameras (rear and front) are both working perfectly fine at their maximum resolutions (5 MP in the front and I believe the back one is 5 MP as well).

To do so, follow this how-to I've written to patch, compile and install the patched kernel: #8

Afterwards, you can take photos with the cameras with a photo taking app. I recommend Cheese for doing so (already installed if you're using Antergos like me). In the Cheese preferences, you can choose if you want to use the front or rear cam and of course you can change this on the fly.
The cameras are also working fine in Skype.
Didn't test any other apps.

N-Trig Surface Pen: working, except for the OneNote button on top

Works fine, as you can also see here: nuclearsandwich#8

Although unlike the comment there, Bluetooth does work on the Surface Pro 3 and the Surface Pen also connects just fine through Bluetooth (though it's not needed per se to set it up via Bluetooth). Pressure sensitivity works out of the box.

The only thing not working is the OneNote button on top. Of course, there's no OneNote Modern UI app on Linux, but it doesn't launch anything else either and there's currently no way to configure the button to do something else under Linux.

Power Indicator suddenly appeared

Just to let you know that I updated my Arch this morning and the Power Indicator (which didn't show up at all up till now) suddenly appeared and is working properly.
Also, the touch windows button now vibrates when I press it. I didn't have time to check if I could map it or not. (also, I'm not that big of a champ at this)

Linux 4.1.2-2 kernel with no patches at all.

Type Cover 3: working

If you patch the kernel, Type Cover 3 is working. Do note that there currently is no way to disable the trackpad or tap-to-click or enable stuff like two-finger scrolling.

You can patch, compile and install the patched kernel as follows: #8

Onscreen keyboard: how to improve the experience

By default, GNOME Shell has a pretty terrible onscreen keyboard and other DE's might not have a built-in one per se. Luckily, you can easily improve the experience so that it becomes perfectly useable. And by perfectly I really mean perfectly.

Using your favorite package manager or the terminal, install onboard

After installation, open up the Onboard Settings app as well Onboard itself. Now of course, this is a bit of a personal preference for most of the settings, but what I find to work awesome and beautiful as a setup is setting the following things:

General tab:
-Check Auto-show when editing text

Window tab:
-Check Dock to screen edge and then hit the Settings button; choose Bottom as the location and check the other 3 things as well
-After that, resize the keyboard to your likings by mouse (or using the touch screen, but it's a bit tricky like that) just like you would resize an app window. When done, go to the Resize Protection tab and set Frame resize handles: to None to prevent accidentally resizing the keyboard when near an edge. You can always set it back if you do need to resize the keyboard.

Layout tab:
-Depends on how many keys you want, but I personally like the Compact layout the best. You can play around with this to see what you like.

Theme tab:
-Depends on what theme you like, but IMHO the best looking theme and also most modern looking theme is Blackboard.
-Whatever theme you choose, hit the Customize theme button and play around. I personally set it to:
Keyboard tab: Color scheme: Charcoal, Gradient ba:ckground: 0, Light direction angle: -7.
Keys tab: Style: Flat, Roundness: 0, Size: 96, Border width: 36
Label tab: Font: Prelude (though you need to install that font; on a pure GNOME Shell desktop w/o installing fonts, Cantarell would integrate the best), Super key: Super, check Independent size.

Keyboard tab:
-I personally check Show label pop-ups, but that's subject to personal preference. You can also enable key sounds if you want to.

Typing Assistance tab:
-Check Show suggestions and check all the sub checkboxes under Options as well.
-Also, if you don't like auto-capitalizing, disable that on the Auto-correction tab.

Do note that you need to launch Onboard every time you decide to switch go touch only but that's a matter of a few clicks, really.
Enjoy! :)

How-to: patch, compile and install a working kernel for the Surface Pro 3

**NOTE: if you're using kernel 3.19 or higher, then you only need to apply the camera patch if you want the cameras working. DON'T apply the Type Cover 3 patch if you're on 3.19 or higher as the Type Cover 3 is supported out-of-the-box.

_First off: what's important here is that I've based it off of my experience on Antergos. Antergos uses sudo by default. Pure Arch doesn't use sudo by default so you have to change to the root user. That means that the commands I'm giving in this how-to need to be copy and pasted w/o the sudo part if you're not on Antergos or haven't set up sudo on pure Arch. Also, this howto is as generic as possible so that you can use it for the foreseeable future._

1 Downloading the kernel
First, start by getting the kernel sources. You can do so by downloading the appropriate kernel from the kernel.org website: https://www.kernel.org/
Always choose the newest stable one (or rc one if you're a tad more adventurous). You can also choose the newest longterm one as long as it has a version number higher than 3.16
Unpack the folder in the archive to a folder of your liking where you can easily reach it.

2 Patching it up
In the kernel source folder, create a new typecover3.patch file with the following content:

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 73bd9e2..e94afcc 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -702,6 +702,11 @@ static void hid_scan_collection(struct hid_parser *parser, unsigned type)
    if (((parser->global.usage_page << 16) == HID_UP_SENSOR) &&
        type == HID_COLLECTION_PHYSICAL)
        hid->group = HID_GROUP_SENSOR_HUB;
+
+   if (hid->vendor == USB_VENDOR_ID_MICROSOFT &&
+       hid->product == USB_DEVICE_ID_MS_TYPE_COVER_3 &&
+       hid->group == HID_GROUP_MULTITOUCH)
+       hid->group = HID_GROUP_GENERIC;
 }

 static int hid_scan_main(struct hid_parser *parser, struct hid_item *item)
@@ -1861,6 +1866,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
    { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K) },
    { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0) },
    { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_OFFICE_KB) },
+   { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3) },
    { HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) },
    { HID_USB_DEVICE(USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GT683R_LED_PANEL) },
    { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index e23ab8b..15f32c2 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -648,6 +648,7 @@
 #define USB_DEVICE_ID_MS_SURFACE_PRO_2   0x0799
 #define USB_DEVICE_ID_MS_TOUCH_COVER_2   0x07a7
 #define USB_DEVICE_ID_MS_TYPE_COVER_2    0x07a9
+#define USB_DEVICE_ID_MS_TYPE_COVER_3    0x07dc

 #define USB_VENDOR_ID_MOJO     0x8282
 #define USB_DEVICE_ID_RETRO_ADAPTER    0x3201
diff --git a/drivers/hid/hid-microsoft.c b/drivers/hid/hid-microsoft.c
index 8ba17a9..cacda43 100644
--- a/drivers/hid/hid-microsoft.c
+++ b/drivers/hid/hid-microsoft.c
@@ -274,6 +274,8 @@ static const struct hid_device_id ms_devices[] = {
        .driver_data = MS_NOGET },
    { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_MOUSE_4500),
        .driver_data = MS_DUPLICATE_USAGES },
+   { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3),
+       .driver_data = MS_HIDINPUT },

    { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT),
        .driver_data = MS_PRESENTER },
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 5014bb5..cebfaf2 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -77,6 +77,7 @@ static const struct hid_blacklist {
    { USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS },
    { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET },
    { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET },
+   { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3, HID_QUIRK_NO_INIT_REPORTS },
    { USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GT683R_LED_PANEL, HID_QUIRK_NO_INIT_REPORTS },
    { USB_VENDOR_ID_NEXIO, USB_DEVICE_ID_NEXIO_MULTITOUCH_PTI0750, HID_QUIRK_NO_INIT_REPORTS },
    { USB_VENDOR_ID_NOVATEK, USB_DEVICE_ID_NOVATEK_MOUSE, HID_QUIRK_NO_INIT_REPORTS },
-- 
2.1.0

Still in the kernel source folder, open up the following file to add in support for the Surface Pro 3 cameras (rear and front):

drivers/media/usb/uvc/uvc_driver.c

Somewhere in between the listed products, for example at line 2342, add the following:

     /* Microsoft Surface Pro 3 Front */
     { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                             | USB_DEVICE_ID_MATCH_INT_INFO,
       .idVendor             = 0x045e,
       .idProduct            = 0x07be,
       .bInterfaceClass      = USB_CLASS_VIDEO,
       .bInterfaceSubClass   = 1,
       .bInterfaceProtocol   = 1 },
     /* Microsoft Surface Pro 3 Rear */
     { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                             | USB_DEVICE_ID_MATCH_INT_INFO,
       .idVendor             = 0x045e,
       .idProduct            = 0x07bf,
       .bInterfaceClass      = USB_CLASS_VIDEO,
       .bInterfaceSubClass   = 1,
       .bInterfaceProtocol   = 1 },

Save the file.

Now open up a terminal window and change to the kernel source directory using the cd command.

Now apply the Type Cover 3 patch using the following command:

patch -p1 --ignore-whitespace -i typecover3.patch

(on the 3.18 kernel, you might get a small error after doing that, you can ignore that)

3 The actual compiling

Now issue the following command to copy over the current kernel config to the one you're about to compile:

zcat /proc/config.gz > .config

Then:

make menuconfig

If you're not an advanced user like me, just leave everything as it is and save the file using the corresponding button, then use the exit button to exit out of this.

Now that we've done this, the actual compiling can begin. This can take up to an hour so be patient. Issue the command for this:

make -j3

Now that that's done, let's install the modules:

sudo make modules_install

When that's done, do:

make bzImage

followed by:

sudo make install

Now, everything should be in place. Check this by issuing:

cd /boot

followed by:

ls

Note the name of the kernel there. The name of the kernel is the name minus the vmlinuz part. So for example, if you've compiled the 3.18 rc5 kernel, you'll see vmlinuz-3.18.0-rc5-ARCH - _3.18.0-rc5-ARCH_ is the name of the kernel then.

4 Generating the RAM Disk image file

Don't question what it is, just do the following ;-)

mkinitcpio -k FullKernelName -c /etc/mkinitcpio.conf -g /boot/initramfs-YourKernelName.img```

In both places in the command, replace fullkernelname with the name you just noted from the /boot folder.

5 Finishing it up
To finish it up, issue the following command:

sudo update-initramfs

followed by the last command (to inform GRUB of the changes - if you use LILO as your bootloader (at least Antergos uses GRUB by default), you don't have to issue this command):

sudo grub-mkconfig -o /boot/grub/grub.cfg

Now reboot and you should be able to choose the kernel in your bootloader. It might take a couple of reboots after compiling before the Type Cover 3 starts working. I don't know why that is, seems like something kernel-related is a bit finicky.

In case the trackpad isn't working (correctly) after rebooting into the patched kernel, add the following to /etc/X11/xorg.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

and reboot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.