gpd-pocket-ubuntu-respin icon indicating copy to clipboard operation
gpd-pocket-ubuntu-respin copied to clipboard

Custom Kernel still necessary?

Open derjohn opened this issue 6 years ago • 52 comments

Hi, Do we still need that 4.16.0-rc3 kernel?

Did anyone try to go with Ubuntu's Mainline PPA, e.g.

http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.16.5/

?

derjohn avatar Apr 27 '18 08:04 derjohn

Hans once stated that with 4.17-rc1 last required patches for USB-C should be in mainline, we are there, so it's possible we can switch to mainline without great issues :)

I just need to make some tests

stockmind avatar Apr 27 '18 08:04 stockmind

I tried 4.17-rc2 and can confirm that my i915 graphics issue is resolved. (I had sometime strange artifacts when dragging windows mit KDE). Didn't check USB, though.

derjohn avatar Apr 27 '18 10:04 derjohn

4.17-rc2 Mainline ?

Il ven 27 apr 2018, 12:20 derjohn [email protected] ha scritto:

I tried 4.17-rc2 and can confirm that my i915 graphics issue is resolved. (I had sometime strange artifacts when dragging windows mit KDE). Didn't check USB, though.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stockmind/gpd-pocket-ubuntu-respin/issues/118#issuecomment-384930048, or mute the thread https://github.com/notifications/unsubscribe-auth/AFZFV1eCN9oLyp0_3m2SyHieMCGakSq2ks5tsvD5gaJpZM4Tp82u .

stockmind avatar Apr 27 '18 10:04 stockmind

http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.17-rc2/

derjohn avatar Apr 27 '18 10:04 derjohn

I am using the 4.17 rc2 from the https://github.com/jwrdegoede/linux-sunxi repository using the .config from https://github.com/petrmatula190/gpd-pocket-kernel on 17.10 image with no issues found so far. (I got a bit scared when I saw 4.17 when I was expecting to see 4.16 rc6 messages...)

Morantz avatar Apr 27 '18 15:04 Morantz

I can report some Wifi issues, had some packet loss and and an unknown condition the Wifi NIC disappeard (maybe it was after suspend?)

derjohn avatar Apr 28 '18 07:04 derjohn

@Morantz Did you builded kernel with my latest config? I don't belive. Because all my builds after 4.16rc6 have broken charging, baterry and charging sensors not presents in /sys and charging speed is only 5V/3A.

petrmatula190 avatar May 03 '18 18:05 petrmatula190

Yes I had. Have since reverted to 4.16RC6 which works. I think 4.17 was also messing with sleep functions. Battery levels in AM after closing lid would be VERY low. Also, boot time was in the minutes to get to login screen when using 4.17.

Morantz avatar May 03 '18 19:05 Morantz

Are you going to update it for 4.17?

Morantz avatar May 03 '18 19:05 Morantz

@Morantz Not now, I am trying new build around 2-3 week, but i belive to full working final kernel 4.17 or 4.18. Maybe, mainlike will be better in future.

petrmatula190 avatar May 03 '18 19:05 petrmatula190

@petrmatula190 You should probably change your directions to show: git reset --hard origin/v4.16-footrail when pulling from https://github.com/jwrdegoede/linux-sunxi so that a version 4.16 kernel is built, not a 4.17. Thank you for all your hard work supporting us users!!!

Morantz avatar May 03 '18 20:05 Morantz

@Morantz Thanks for tip. Until now, I am using make clean && git fetch origin && git reset --hard origin/master && git pull But i have the same result when i delete and download clean repo again.

This is my fisrt steps with github :-)

petrmatula190 avatar May 03 '18 20:05 petrmatula190

Any chances for a 4.17-based kernel? Even on Hans tree?

derjohn avatar May 09 '18 07:05 derjohn

I am using the one from Hans tree, which is at 4.17rc3. Works great on a 17.10 image. On my 18.10 Budgie image, the screen goes right to sleep before the login screen comes up. This doesn't happen with 4.16rc6 image.

Morantz avatar May 09 '18 12:05 Morantz

@Morantz Can you share your .config? If I remember, this must be set everytime:

CONFIG_MATOM=y #CONFIG_GENERIC_CPU is not set CONFIG_BACKLIGHT_PWM=m CONFIG_LEDS_PWM=m

I changed only this parameters in Hans default .config and try build.

petrmatula190 avatar May 09 '18 21:05 petrmatula190

I just finished checking my .config, and ALL of those were set wrong. I was using just his default file, without any changes. I am recompiling again now. Thanks for the tips!

Morantz avatar May 10 '18 13:05 Morantz

So I have recompiled after making those changes. Installed to my GPD and rebooted. I am currently running Ubuntu 18.04 that was dist-upgraded from the 17.10 downloadable image from this repository. Now on boot, I have a blank screen (Like was happening on Budgie) when booting this kernel. I am using LightDM for login. I have to wait a bit, then move the mouse around to get a login screen. If I select wayland as the backend, I never see a GUI and have to CTRL-ALT over to a terminal to reboot. If I select X.org, then I get Gnome3 and things seems to be working.

Morantz avatar May 10 '18 16:05 Morantz

@Morantz I tried too and you problem not organized with kernel, but only with login screen manager. Charge working again compare with 4.17rc1, at maximal 12V/2.5A. (Small EDIT: Working without problem only with USB PD 2.0 charger - official charger at profile 12V/2.5A and AUKEY PA-Y7 at profile 9V/3A, powerbank ANKER PowerCore+ 26800 at profile 12V/2.5A ; USB PD3.0 not working and constantly reconnecting at 5V/3A - AUKEY PA-Y8)

So, I can create testing channel on my github. Do you want be second beta tester :-) If yes, please write me PM, I will be happy, because I have not too mutch time to testing.

Usually, Hans kernel is OK after every rc3 release. This is my expirience until November 2017 when i got my Pocket.

There is my .config and kernel deb files, if you want make diff. I placed it to petrmatula190-testing branch in my github. https://github.com/petrmatula190/gpd-pocket-kernel/tree/petrmatula190-testing

petrmatula190 avatar May 10 '18 20:05 petrmatula190

Hi all, I've been following this thread for the past days because I was setting up my GPD Pocket with NixOS and found this repo and conversation extremely helpful. I have 4.17-rc4 up and running on my Pocket now and can confirm that it works very well, including fan control, battery / charger status and suspend.

This file from my NixOS config contains all kernel configuration options I had set differently than the stock NixOS kernel config in order to make it work. Some of them I have copied from another repo so I am not sure about them all.

Obviously this is not directly applicable to Ubuntu, but you might be able to take that handful of options and take them as a starting point to figure out the minimal changes you need compared to the stock Ubuntu configuration. I have benefitted a lot from the insights you had in this repo and thread, so I wanted to share what I found out to contribute back to the discussion.

sboehler avatar May 11 '18 15:05 sboehler

As @petrmatula190 said, to "optimize" Hans kernel for our GPD you should change just some options from the Hans .config:

# To optimize compiled code for ATOM processors
CONFIG_MATOM=y
#CONFIG_GENERIC_CPU is not set
# To include brightness controller by default, even on live environments
CONFIG_PWM_LPSS=y
CONFIG_PWM_LPSS_PLATFORM=y
# Bluetooth module
CONFIG_BT_HCIBTUSB=y
# Those was flags i've tested but not strictly required
CONFIG_BACKLIGHT_PWM=m
CONFIG_LEDS_PWM=m

Those were the result of my first tests in kernel builds, never done before so i could have made mistakes, but i'm sure about those suggestions:

CONFIG_MATOM=y
#CONFIG_GENERIC_CPU is not set
CONFIG_PWM_LPSS=y
CONFIG_PWM_LPSS_PLATFORM=y

Also, all of those config flags just optimize the builds for a better user experience but aren't essential to make everything works as expected. If you encounter problems related to charging, freezes or anything else it could be related to the current "state" of kernel version releases, were rc1 to rc4 kernels are known to show some problems (due to the first merge and tests) A new kernel version should be almost stable around rc5-6 (as @petrmatula190 said) right before the main release of the specific kernel version

I was waiting for a 4.17rc4 or rc5 to release a new kernel build as 4.16-rc3 just seems stable and works fine (if you are using the one compiled with the PD charging patch of Hans repository, post 2018-03-06)

I have an experimental 4.17 mainline kernel ISO but still hadn't time to test it.

stockmind avatar May 11 '18 16:05 stockmind

@petrmatula190 Yes, I would like to test your kernel files! I don't see any info to PM you, so I have responded here. My email is [email protected]. If you contact me there, then we can use that channel. I have pulled your testing branch and am building a kernel with that config. @stockmind Thank you for all that information!!! I will look into those changes also. I would also be willing to test that ISO if you want. I have taken to automating the install of the extra software I use, such that it is only another 15 minutes after the ISO install and I have my extra apps and data back on the device. I am using Syncthing to transfer updates and such. Just dump a new kernel on my compilation machine into the folder, and a minute later it is ready to install on my GPD Pocket.

Morantz avatar May 11 '18 17:05 Morantz

@Morantz Thanks a lot, I wrote email to you.

petrmatula190 avatar May 12 '18 15:05 petrmatula190

@stockmind I tried mainline 4.17.0-rc5 And my first i,pressions is very good. Only charging not working propetry (some Hans patches for USB C must be merged).

My charging script report correct voltage on USB C port (fusb302 and bq24190 should be OK, but max170xx code must be repaired)

#stock charger
matlala@gpdpocket ~ $ charging
USB C port:
Voltage: 12V DC
Current: 2.00A
Current imput limit: 2.00A
---------------------------
Baterry:
Voltage: 4.29V DC
Current: -.26A
Capacity: 99%

#AUKEY AUKEY PA-Y7 - PD 2.0
matlala@gpdpocket ~ $ charging
USB C port:
Voltage: 9V DC
Current: 3.00A
Current imput limit: 3.00A
---------------------------
Baterry:
Voltage: 4.33V DC
Current: 0A
Capacity: 99%

#AUKEY AUKEY PA-8 - PD 3.0
matlala@gpdpocket ~ $ charging
USB C port:
Voltage: 12V DC
Current: 2.25A
Current imput limit: 2.00A
---------------------------
Baterry:
Voltage: 4.36V DC
Current: .32A
Capacity: 99%

#wifi state
matlala@gpdpocket ~ $ ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.12  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::b2f1:ecff:fe83:130  prefixlen 64  scopeid 0x20<link>
        ether b0:f1:ec:83:01:30  txqueuelen 1000  (Ethernet)
        RX packets 7879  bytes 3537437 (3.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7627  bytes 1881872 (1.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I tried:

  • BT keyboard (some longer delay than 4.16 from Hans) and BT headset (SONY SBH20, clementine have lags for every 1-2s, finaly i can se long delay after stop music, headset still playing some delayed fragments around 5s, but VLC or video in chrome not have it.)
  • audio speaker and jack
  • touch
  • sleep/resume
  • wifi (playing youtube video)
  • i915: chrome scrolling on FB or youtube when playing video (no problem, on 4.16.0rc3, i can see some vertical lines and lags
  • charging with stock, AUKEY PA-Y7 and AUKEY PA-Y8 (USB PD 3.0 working, on 4.17.0-rc4 from Hans not working)

There is mainline config from /boot/config-4.17.0-041700rc5-generic

petrmatula190 avatar May 17 '18 17:05 petrmatula190

@petrmatula190 I have tried your testing version 4.17.0-rc6 and your charging script is not working and reports with the errors: /sys/class/power_suply/fusb302-typec-source/voltage_now: There is no such device /sys/class/power_suply/fusb302-typec-source/current_max: There is no such device

Also it seams that the sleep function doesn't work properly.

I have tried respinned Kubuntu 18.04 with your kernel. Recently I used 4.16.-rc3-stockmind kernel. Linux xzavrel-gpd 4.17.0-rc6-custom-matlala-25-05-2018 #3 SMP Fri May 25 17:15:41 CEST 2018 x86_64 x86_64 x86_64 GNU/Linux

xzavrel avatar Jun 06 '18 10:06 xzavrel

@xzavrel Wow, next from Czech :-) I will contact you by mail :-) I know it. I can confirm this issue from 4.16.0-rc6 to now, So I create simple text file know-bugs on my github. So, fusb302 should not enable in kernel config. You can try check builded config in /boot/config-VERSION files

Problem should be resolved with hard enable kernel modules for charging and USB C chips, check my latest commit to my testing branch with this parameters. https://github.com/petrmatula190/gpd-pocket-kernel/commit/08dadf32597745e7fc49a5b7398144f725d7479d

petrmatula190 avatar Jun 07 '18 22:06 petrmatula190

@stockmind Did you have a look at 4.19.X mainline for the Pocket 1 ?

derjohn avatar Dec 14 '18 08:12 derjohn

Hi, Team and @derjohn

I've built mainline 4.20 kernel for my GPD Pocket. Seems everything is working fine (Quick charging, USB-C connection, sound etc.), so if you are interested in - feel free to install & test :)

https://app.box.com/s/fx2onfpxooeg16qtyyip1pmvpfo5gbkp

Regards

crazyfox-ua avatar Jan 21 '19 11:01 crazyfox-ua

Hi, Team and @derjohn

I've built mainline 4.20 kernel for my GPD Pocket. Seems everything is working fine (Quick charging, USB-C connection, sound etc.), so if you are interested in - feel free to install & test :)

https://app.box.com/s/fx2onfpxooeg16qtyyip1pmvpfo5gbkp

Regards

Thanks! I'm going to try it just now :+1:

ferlanero avatar Feb 22 '19 16:02 ferlanero

Installed and running kernel 4.20. It works like a charm! Thanks @derjohn !!

ferlanero avatar Feb 23 '19 00:02 ferlanero

@ferlanero I redirect the kudos to @crazyfox-ua .... I just asked, he did build the kernel. I personally have a strong distrust against non-community-built kernels. Anyway: THX for testing @crazyfox-ua . I will try to use https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.20.11/ .....

derjohn avatar Feb 23 '19 08:02 derjohn

@stockmind isn't it time to update the install-kernel script ?

derjohn avatar Feb 23 '19 08:02 derjohn

Yeah! It's definitely time for an update :) If you confirm that the latest mainline kernel works as expected i will update iso and kernel scripts to download and install the latest mainline! :)

stockmind avatar Feb 24 '19 04:02 stockmind

@stockmind I can confirm that at least mainline 4.20 with custom config works fine. No additional patches required, only config (I took one from @petrmatula190 and adjusted with 4.20)

crazyfox-ua avatar Feb 24 '19 13:02 crazyfox-ua

Hi, Team and @derjohn

I've built mainline 4.20 kernel for my GPD Pocket. Seems everything is working fine (Quick charging, USB-C connection, sound etc.), so if you are interested in - feel free to install & test :)

https://app.box.com/s/fx2onfpxooeg16qtyyip1pmvpfo5gbkp

Regards

Confirmed. Using the @crazyfox-ua kernel build works perfect in my daily use of the GPD Pocket

ferlanero avatar Feb 25 '19 16:02 ferlanero

Thanks all, due to latest Hans patch release i've updated kernel with a build from his repository, this should let the usb-c video output work out-of-the-box

I'm now thinking on what to do about the pre-built ISOs, maybe it's better to have one version with latest Hans kernel (for usb c video output in the meanwhile that patches reaches mainline) and one with mainline (but without usb c video output)

stockmind avatar Feb 25 '19 19:02 stockmind

I have been having some weird power/sleep issues after a few weeks of using the 4.20 kernel.  I will be checking out his latest kernel and trying that to see if they go away. The last time this happened, I reverted to the 4.16 kernel for a week and when I updates to a newer kernel (4.18rc8) again, it was fine for a couple of months.  It is 'possible' that the issue is with my Pocket 1.  I may try a new battery for it if I can't get the issue to go away. I like the idea of having two images available for download.  There are not many who will be using USB C for video, so if a stock kernel works, then that would be easier to support than a custom kernel is.

-  Dan Brown  "My doctor says that I have a malformed public-duty gland and a natural deficiency in moral fibre, and that I am therefore excused from saving Universes." ~Douglas Adams

On Monday, February 25, 2019, 2:51:50 PM EST, stockmind <[email protected]> wrote:  

Thanks all, due to latest Hans patch release i've updated kernel with a build from his repository, this should let the usb-c video output work out-of-the-box

I'm now thinking on what to do about the pre-built ISOs, maybe it's better to have one version with latest Hans kernel (for usb c video output in the meanwhile that patches reaches mainline) and one with mainline (but without usb c video output)

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub, or mute the thread.

Morantz avatar Feb 25 '19 20:02 Morantz

@stockmind I can confirm that at least mainline 4.20 with custom config works fine. No additional patches required, only config (I took one from @petrmatula190 and adjusted with 4.20)

Hi all - been following your good work for some time! I'm trying to compile the current openSUSE Tumbleweed kernel (4.20.13) for the GPD Pocket 1. Can anyone tell me what the crucial kernel .config settings are for the GPD?

I've compared the .config from petrmatula190 and also Hans' .config with the stock Tumbleweed one, but there are hundreds of differences, mainly due to the openSUSE-vs-Ubuntu divergence from the vanilla kernel. What I'd really like to know is what are the essential ones to get full functionality on the GPD. It so nearly works at the moment...

Many thanks!

lgt1 avatar Mar 13 '19 17:03 lgt1

Here you can find the pieces of information needed https://github.com/stockmind/gpd-pocket-ubuntu-respin/issues/118#issuecomment-388410425

stockmind avatar Mar 13 '19 18:03 stockmind

@stockmind 5.2 was released .... since 5.0 there have been many security fixes. What's the state of the kernel? Do we still need Hans' codebase? Will you release a new kernel ?

derjohn avatar Jul 10 '19 06:07 derjohn

charging script

I have made a charging script which also can set some values. With setting /sys/class/power_supply/bq24190-charger/constant_charge_voltage it is also possible to stop charging before 100%, to prolong battery life.

The script:

http://ix.io/1P4r

dreirund avatar Jul 21 '19 12:07 dreirund

@felixbecker2 Did you out the script in this issue, because chances are better go get rid of the customer kernel with it?

derjohn avatar Jul 21 '19 15:07 derjohn

On Sun, 21 Jul 2019 08:30:08 -0700, derjohn [email protected] wrote about "Re: [stockmind/gpd-pocket-ubuntu-respin] Custom Kernel still necessary? (#118)":

@felixbecker2 Did you out the script in this issue, because chances are better go get rid of the customer kernel with it?

Because I found a note to a similar script in this thread and I wanted to report on it.

I am using latest Hans' Kernel (5.2.0-rc7-sunxi+), but I think mainline kernel as now the same GPD Pocket support.

dreirund avatar Jul 21 '19 17:07 dreirund

Hey, Team! I've updated GPD Pocket's Linux kernel to mainline 5.2 version (https://github.com/torvalds/linux/releases/tag/v5.2) As usual, everything works fine, so feel free to use it :) https://app.box.com/s/8j0pu9ifvxbeljapmkpvtcaq2fy5hcde

crazyfox-ua avatar Aug 12 '19 20:08 crazyfox-ua

Hey, Team! I've updated GPD Pocket's Linux kernel to mainline 5.2 version (https://github.com/torvalds/linux/releases/tag/v5.2) As usual, everything works fine, so feel free to use it :) https://app.box.com/s/8j0pu9ifvxbeljapmkpvtcaq2fy5hcde

Tested, at least it boots. Wifi and bluetooth working, sound working, but entering the desktop environment takes around 10 seconds (systemd-analyze blame points at gpdscreen.service, which takes only 3 seconds on 5.0.0-rc7) and I lose HDMI over USB C (dmesg shows that the cable is recognized, it's just the monitor won't pop up).

leledumbo avatar Aug 31 '19 21:08 leledumbo

@leledumbo So, with a 5.2 only HDMI over USB-C is missing? Charging is fine?

@stockmind Are you still active with the respin repo?

derjohn avatar Oct 20 '19 07:10 derjohn

So, with a 5.2 only HDMI over USB-C is missing? Charging is fine?

Charging works, no problem with that.

leledumbo avatar Oct 20 '19 07:10 leledumbo

@crazyfox-ua first of all thank you very much for the kernel, спасибище! Indeed it works well. Secondly, compiling kernel for the GPD, is it a straight-forward process? No patches necessary?

egorFiNE avatar Jan 06 '20 19:01 egorFiNE

@crazyfox-ua first of all thank you very much for the kernel, спасибище! Indeed it works well. Secondly, compiling kernel for the GPD, is it a straight-forward process? No patches necessary?

Hi, Egor! Since 4.19 release no additional patches required, it is pure mainline sources. The only thing we still need to have - is a kernel config for GPD Pocket (it is included in all my kernel packages).

crazyfox-ua avatar Jan 07 '20 14:01 crazyfox-ua

Since 4.19 release no additional patches required, it is pure mainline sources.

Thank you very much!

egorFiNE avatar Jan 07 '20 14:01 egorFiNE

Since 4.19 release no additional patches required, it is pure mainline sources.

Pure mainline or pure Ubuntu kernel sources?

egorFiNE avatar Jan 07 '20 14:01 egorFiNE

Pure mainline or pure Ubuntu kernel sources?

Pure mainline (https://github.com/torvalds/linux)

crazyfox-ua avatar Jan 07 '20 18:01 crazyfox-ua

Pure mainline (https://github.com/torvalds/linux)

Thanks!

egorFiNE avatar Jan 08 '20 09:01 egorFiNE