Closed qzed closed 5 years ago
It'd be good to have some documentation in setup.sh
for the dGPU power state module.
Right, we should consider a link or hint to some sort of documentation as this patch changes the default behavior of the dGPU (to off by default unless specified otherwise). A wiki entry for this would probably be helpful.
Is there a timeline on this being merged?
@MadcowD Since @jakeday seems a bit occupied at the moment I might build a .deb
kernel package in the next couple of days and release it over at https://github.com/qzed/linux-surface. I'm not running a Debian based distro at the moment so I won't be able to test that though. I normally want to give Jake the last word on merging stuff in, so I'll be doing that over in my fork. I'll ping this issue when I've uploaded a release.
@MadcowD and anyone interested: I've uploaded a release: https://github.com/qzed/linux-surface/releases/tag/v5.2.5-pre1
@MadcowD and anyone interested: I've uploaded a release: https://github.com/qzed/linux-surface/releases/tag/v5.2.5-pre1
@qzed I installed Ubuntu 19.04 on my Surface Laptop 2 the other day, alongside your pre-release kernel version 5.2.5 (signed). It's the most stable Linux experience I've had so far on my device. In particular, touchpad tapping works great and doesn't die (not sure if this is 19.04 or the kernel). Suspend still shuts down the computer, unfortunately, and plugging in headphones causes the speakers to emit a humming noise. I also get a message on startup that says "error in communicating with TPM chip". The caps lock light hasn't fixed itself either. My machine's quite useable now though - thanks! :)
@dsi3 I think the TPM issue might be upstream thing, I've got the same message as soon as I switched to 5.2. As it doesn't seem break anything major it's pretty far down my list of things to fix at the moment though.
@qzed Thanks for your heroic efforts! I took this release for a spin on a fresh install of Ubuntu 18.04.3 by first running the setup.sh script (without jakedays kernel) and then installing the deb packages from your release. I also got the following bugs:
The following works:
Generally it feels good.
Question: I can see at https://github.com/jakeday/linux-surface/blob/master/setup.sh#L181 that SKU Surface_Book_1793 (I assume thats the 15"?) uses an old version of ipts. What's the reason for that?
Edit: This command fixes the headphone hissing problem: amixer -c 0 sset 'Auto-Mute Mode' Disabled && sudo alsactl store
@runekaagaard Thanks for the praise!
I think the pen issue was reported some time ago on Gitter as bug in gnome. I experienced the same thing a while ago but now it works again, so I guess it's fixed and you just need to wait for an update.
Sadly, I still have no update on the suspend/overheating issue as I still haven't been able to reproduce this (apart from some issues when I suspend directly after resume, but they always looked different to the logs provided in #479). Could be that something wakes up the system, it notices that the lid is closed and tries to go back to sleep right away.
Question: I can see at https://github.com/jakeday/linux-surface/blob/master/setup.sh#L181 that SKU Surface_Book_1793 (I assume thats the 15"?) uses an old version of ipts. What's the reason for that?
I honestly can't say if there's any reason for that. You should be able to use the latest firmware (or try to get it via Windows if you don't have it, I've written a bit about that in this readme https://github.com/qzed/linux-firmware-ipts-surfacebook2-kbl8#obtaining-the-firmware-files).
@qzed Thanks for your prompt response.
About the overheating, I will dig into the logs and report what I can see over at #479. Will also try your latest system-sleep script from master and see if it makes a difference.
About the pen rotation, I noticed that the output of libwacom-list-local-devices
is empty. I tried both copying /usr/local/share/libwacom/surface.tablet
to /usr/share/libwacom
and placing https://github.com/linuxwacom/libwacom/blob/a90e83e9e8822e97e40e85277597f744497b5b03/data/surface-book2-15.tablet in /usr/share/libwacom
. Both makes it show up with libwacom-list-local-devices
but it chrashes on boot with the error event21 - ipts 045E:0020: tablet 'ipts 045E:0020' unknown to libwacom
.
@runekaagaard You definitely need the libwacom files for Gnome. The error indicates that libwacom does not find the data file for the tablet. You have installed the patched libwacom, right? That one doesn't just contain the data file but also changes to add the mei
bus that is required for this to work. Without those changes, the data-file won't do anything. You can find the changes here: https://github.com/linuxwacom/libwacom/compare/master...qzed:ipts-mei
@qzed I installed the patched version of libwacom from jakedays setup.sh. But good news. I tried once more installing 19.04 using both your setup.sh and your kernel release. And...........
It works!!! <3 <3 <3
I've tested suspend repeatedly and it suspends to and from s3idle
everytime without hickups so far. It wakes up when the the lid is opened and the touchpad is clicked. I suspended it overnight (about 10 hours) and it only lost from 10% to 3% battery. So.... great job!!!
The only remaining issue found so far was the rotation of the touchscreen; pen rotation is fine. Maybe it's a path/compability issue with the inbuilt libwacom? libwacom-list-local-devices
is still empty. I made a trivial workaround using dbus-monitor and xinput here: https://github.com/runekaagaard/linux-surfacebook2-rotation-bugfix.
Ahhhhh, cool hardware on great software. Life is good :)
I also installed the qzed 5.2.5 release on a new 19.04 install on Surface Pro 2017. All seems stable as long as i turn off wifi before closing the surface cover. Sleep works ok and I can turn wifi back on when I wake the system by pressing the power key. If I leave wifi turned on, the system will wake OK, but wifi may not work without a reboot. Many thanks...
@qzed Do you have a changelog for your prerelease build? Wondering if it solves some of the other issues I've been facing with suspend and dGPU.
I also installed 5.2.5-pre1 (signed) running Ubuntu 19.04 on my Surface Book 2 15". Closing the lid suspends and opening the lid perfectly pulls up the lock screen. Performance seems to be running A LOT smoother.. just for example: with only jakeday installed I was getting around 4 hours of battery life remaining at 100% charge. With qzed 5.2.5-pre1 I am getting 8:45 hours remaining on 100% battery unplugged. Very impressed.
I have not been able to test to see if this 100% fixed my overheating issue while running jakeday when the lid was closed. Although this look promising and I will update in the morning.
One issue I did experience was the back of my screen getting pretty hot by just watching twitch.tv for about 30 mins unplugged from the charger. (hot enough to have to kill the browser and after that it cooled to normal temps) I am not sure if I did not do something correctly or need to update/install something else. (I am extremely new to Linux, this is my first time ever dual booting/running linux ever) Any help on why the back of the screen would be getting so hot while playing a video would be awesome. Seems to get the hottest directly in the middle of the screen where the Windows logo is.
Cheers
@woozysatsuma that's awesome to hear. I might finally upgrade my kernel!
From what I understand, the overheating caused by watching videos is from hardware acceleration not being properly used in some browsers (Chrome, Firefox), which can be manually toggled.
@versipellis I believe you are right. I have been watching YT for over an hour since my last post without any changes and no overheating on the back of my screen. (it is barely getting warm if at all)
I will try to adjust hardware acceleration, watch twitch again the same amount of time, and update in the morning. Thank you!
@versipellis The change-log is mostly in the commit messages, for the 5.2 build these are the things that have changed compared to this PR:
Besides that there are the changes from this PR, i.e. mostly dGPU power state integration (just an integration of the external module into the kernel), minor fixes and changes in the button driver and some fixes in LID wakeup, although the latest fixes are not in the release yet. I'll probably try to update it this weekend.
The only times I had an issue with suspend (clipboard and/or base overheating) on the SB2 it was (I believe) some sort of suspend directly after resume, where the resume had not finished completely yet. I'm pretty sure I've got the dGPU-heating-up problem figured out, but I don't know how to fix it yet. Basically what I think happens is: Resume turns dGPU on (automatically via hardware/firmware even before the kernel kicks in, I think there's nothing I can do about that) and then when the device is suspended again directly afterwards it thinks it is still suspended as it has never been officially resumed from the kernel, so the dGPU does not get turned off again. The rest is pretty standard behavior, when the dGPU is turned on, it gets warm. Not critically hot, but still cause for concern. This is behavior I've also experienced without using the dGPU power state module, however there it seems to turn off after some amount of time.
@woozysatsuma Yeah @versipellis is right, this looks definitely like missing GPU acceleration for video playback. Unfortunately that's a mixed bag on Linux. In some instances (browser, hardware, and video-codec combination) it works out of the box, in some cases it requires some settings to be changed, and in some other cases it unfortunately doesn't work at all. This all depends on a mixture of things, including support in the browser and kernel driver support, in our case that's the responsibility of the Intel iGPU via VA-API.
It's not something that's in the scope of this patch-set here, as this is not problem specific to Surface devices, pretty much any other device with an Intel CPU will have the exact same problems.
The NVMe patch may also work for the other devices for better power management on suspend. I picked needed patches from 5.3-rc.
Update: Running qzed 5.2.5-pre1 (signed) - Ubuntu 19.04 on Surface Book 2 15"
Charged to 100% and closed the lid overnight. My surface only saw a 5% loss in battery life and I opened the lid up to the lock screen again. No overheating issues and everything running extremely smooth. Also, when I was only running jakeday, and would close the lid and re-open, the wifi would be disconnected and would not turn back on. This is no longer an issue either.
@qzed @versipellis I disabled hardware acceleration in my browser and things are running perfectly while watching twitch. Thank you guys for the insight and help, I really appreciate it!
Thanks @qzed. I haven't kept up to date with the status of bumblebee and the dGPU stuff in the last year, as well as power state management and the related modules. Is there somewhere where that's written up, as well as the shell commands needed to enable/disable them?
@versipellis I don't have a guide yet. My plan was to eventually integrate this with vgaswitcheroo or bumblebee more directly so that manually enabling the dGPU and loading drivers would not be necessary any more.
At the moment, the following should do the trick (using the surface-control tool, you can also do this manually via sysfs and also control the initial power-state, see the README for that):
sudo surface dgpu set on
).sudo nvidia-modprobe
).optirun
(or alternatives) as usual.To turn off, I strongly recommend unloading the drivers first, as this will fail if any application is still using the dGPU. You can keep the drivers loaded as long as no application is actually using them, but if that isn't the case you can expect crashes, so
sudo modprobe -r nvidia && sudo modprobe -r nvidia_drm
, potentially more)sudo surface dgpu set off
)Thanks for reminding me of this, though! I've recently re-installed Linux and I've yet to install optirun
again and make sure it works properly. It's been a while since I've set this up previously and I don't think optirun
requires bumblebee (or some other kind of setup) but I might be mistaken. I'll try to remember that I should write down some instructions the next time I'm setting this up.
Edit: I have added a how-to for Bumblebee/optirun to the readme of the module. It's mainly focused on Arch Linux, but should work similarly on other distributions.
I'll close this PR for now, due to more updates and management in my fork. I'll send a new PR if it is requested.
Update surface-acpi patches to fix #502 and minor issues from kernel changes, update button patch to reflect changes from upstreaming process (edit: also fixes a spurious deferral issue that seems to occur on the latest kernel versions).
Also adds in-kernel support for controlling the power-state of the dGPU on the Surface Book 2 by integrating https://github.com/qzed/linux-surfacebook2-mshw0153 (while it's still not quite done, it should be stable enough to include here).
Should also fix #473 by manually enabling GPE interrupts for the lid device.