stockmind / gpd-pocket-ubuntu-respin

Collection of scripts and tweaks to adapt Ubuntu and Linux Mint ISO images to let them run smooth on GPD Pocket
350 stars 35 forks source link

Custom Kernel still necessary? #118

Open derjohn opened 6 years ago

derjohn commented 6 years ago

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/

?

stockmind commented 6 years ago

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

derjohn commented 6 years ago

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.

stockmind commented 6 years ago

4.17-rc2 Mainline ?

Il ven 27 apr 2018, 12:20 derjohn notifications@github.com 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 .

derjohn commented 6 years ago

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

Morantz commented 6 years ago

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...)

derjohn commented 6 years ago

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

petrmatula190 commented 6 years ago

@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.

Morantz commented 6 years ago

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 commented 6 years ago

Are you going to update it for 4.17?

petrmatula190 commented 6 years ago

@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.

Morantz commented 6 years ago

@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!!!

petrmatula190 commented 6 years ago

@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 :-)

derjohn commented 6 years ago

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

Morantz commented 6 years ago

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.

petrmatula190 commented 6 years ago

@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.

Morantz commented 6 years ago

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 commented 6 years ago

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.

petrmatula190 commented 6 years ago

@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

sboehler commented 6 years ago

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.

stockmind commented 6 years ago

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.

Morantz commented 6 years ago

@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 dan@lantzer.org. 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.

petrmatula190 commented 6 years ago

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

petrmatula190 commented 6 years ago

@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:

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

xzavrel commented 6 years ago

@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

petrmatula190 commented 6 years ago

@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

derjohn commented 5 years ago

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

crazyfox-ua commented 5 years ago

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

ferlanero commented 5 years ago

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 commented 5 years ago

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

derjohn commented 5 years ago

@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 commented 5 years ago

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

stockmind commented 5 years ago

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! :)

crazyfox-ua commented 5 years ago

@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)

ferlanero commented 5 years ago

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

stockmind commented 5 years ago

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)

Morantz commented 5 years ago

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 <notifications@github.com> 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.

lgt1 commented 5 years ago

@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!

stockmind commented 5 years ago

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

derjohn commented 5 years ago

@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 ?

dreirund commented 5 years ago

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

derjohn commented 5 years ago

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

dreirund commented 5 years ago

On Sun, 21 Jul 2019 08:30:08 -0700, derjohn notifications@github.com 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.

crazyfox-ua commented 5 years ago

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

leledumbo commented 5 years ago

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).

derjohn commented 5 years ago

@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?

leledumbo commented 5 years ago

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

Charging works, no problem with that.

egorFiNE commented 4 years ago

@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?

crazyfox-ua commented 4 years ago

@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).

egorFiNE commented 4 years ago

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

Thank you very much!

egorFiNE commented 4 years ago

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

Pure mainline or pure Ubuntu kernel sources?