Quantcast
Channel: Kernel – xda-developers
Viewing all 88 articles
Browse latest View live

Xiaomi Mi A2 kernel source code for the Android Pie update is now available

$
0
0
Xiaomi Mi A2 Android Pie

Earlier this year, Xiaomi released two Android One smartphones side-by-side. The Mi A2 and the Mi A2 Lite were both officially revealed in July and they were equipped with the Snapdragon 660 and Snapdragon 625 SoCs respectively. This gave the customer a choice when determining how much money they wanted to spend on a brand new Android One smartphone from Xiaomi. A month later the company released the kernel source code for both of these devices to help spark developer community support.

Xiaomi Mi A2 XDA Forum

This kernel source code was for Android Oreo though as that was the software which launched on these two devices. This month we have reported on both the Mi A2 and the Mi A2 Lite receiving an update to Android Pie, so this left developers wondering how long it would take for new kernel sources to be released. Today, we can officially state that developers can now grab the kernel source code for Android Pie on the Xiaomi Mi A2 directly from GitHub. Hit the link below to get the kernel source code.


Source: Xiaomi


Kernel source code for the Xiaomi Mi A1’s Android Pie release is available

$
0
0

While Android Pie was officially released earlier this year it has taken some smartphone OEMs a bit of time to get the update pushed out to some of their devices. With the Mi A2 receiving priority since it is newer, that left those who owned the Xiaomi Mi A1 wondering how long it would take before they received the update. Sadly, it’s not rolling out widely just yet but a fellow community member did capture the download link for the beta build earlier this month. With a new major version upgrade of Android rolling out that means there are some kernel changes to be made.

Xiaomi Mi A1 XDA Forum

And just like Xiaomi did with the Mi A2 with its Android 9 Pie kernel source code, the company has now released the source code for the kernel that is used for the new build that’s running on the Mi A1. Not only is this good for them as they are complying with GPL but it is also great for us enthusiasts as it will mean custom ROM and kernel developers can rebase their work on the latest sources. Xiaomi notably was slow to initially release the kernel source code for the Mi A1, so we’re glad to see that they’ve reversed course by releasing the updated code even before the update is available globally.


Download Xiaomi Mi A1 Kernel Source Code for the Android Pie update

SultanXDA releases a custom kernel for the Google Pixel 3 and Pixel 3 XL

$
0
0

If you’ve ever owned a OnePlus device and considered tinkering with it, chances are you might have come across a few custom kernels on our forums. If so, then you may have heard of the work done by XDA Recognized Developer Sultanxda. He is best known for his work on custom ROMs and kernels, such as his unofficial builds of CyanogenMod (and later LineageOS) for OnePlus devices. I’ve personally enjoyed his work on my OnePlus 3T, and I know many others have as well. Sultanxda has now released a custom kernel for the Google Pixel 3 and Google Pixel 3 XL. Here are the main features of the kernel, according to the developer:

  • Compiled with the latest official GCC toolchain for the kernel
  • Removed lots of excessive bloat (improves security and performance)
  • Fast fingerprint unlock and screen power on
  • Improved app launch performance
  • Simple LMK: a custom LMK (Low Memory Killer) that improves memory management
  • CPU Input Boost: a custom CPU boost driver to keep the phone smooth while maximizing battery life
  • WireGuard, a next generation secure VPN tunnel
  • Passes SafetyNet bootloader unlock check
  • Reduced power consumption
  • Improved overall system fluidity and graphics performance
  • Improved stability
  • BBR TCP congestion algorithm
  • Many other miscellaneous improvements not listed here

Installing the kernel is as simple as downloading it and flashing it via TWRP. You can also try the newly updated FK Kernel manager app, though we haven’t tested that yet. You can find the download link and source code for the kernel in the XDA Forum thread linked below.

Sultan Kernel for the Google Pixel 3 and Pixel 3 XL

Xiaomi Mi 9 SE and Mi 8 SE kernel source code for the Android Pie release are available

$
0
0

Alongside the Mi 9 and Mi 8 flagship smartphones, Xiaomi also offers more affordable variants in each lineup. The Xiaomi Mi 9 SE and Xiaomi Mi 8 SE are great mid-range options for consumers who want a similar experience to the flagship Mi line. Sadly, both smartphones are currently only sold in China, though Xiaomi may start selling the Mi 9 SE internationally. If you’ve already imported either device and want to start building TWRP or port an AOSP-based ROM, then you’ll be happy to know that Xiaomi has released the kernel source code for the Linux kernel binaries that ship with each phone’s respective Android Pie releases.

Xiaomi Mi 9 SE ForumsXiaomi Mi 8 SE Forums

The Mi 8 SE launched in the middle of 2018 with the Qualcomm Snapdragon 710 and Android 8.1 Oreo-based MIUI 9, but received the stable Android 9 Pie-based MIUI 10 release last month. On the other hand, the Mi 9 SE launched late last month with the Qualcomm Snapdragon 712 and Android Pie. The Snapdragon 712 offers a slight bump in the clock speed and Qualcomm Quick Charge 4+ over the Snapdragon 710, but it’s the same in every other aspect. That’s why Xiaomi has released the updated kernel source code for the Mi 8 SE in the same branch as the Mi 9 SE’s release, rather than under its own branch as they did last year. You’ll find the kernel source code tree for the Mi 9 SE, code-named “grus,” along with the Mi 8 SE’s (“sirius”) updated kernel sources.

Xiaomi Mi 9 SE/Mi 8 SE Kernel Source Code

Xiaomi once fell short of its commitment to release the kernel source code for new devices within 3 months after launch when they delayed the Mi Pad 4’s kernel source code release. The company’s goal in 2019 is to release kernel source code more quickly for all of its devices, and we’ve already seen them release the kernel source code for the Mi 9 on day one. We hope Xiaomi continues to release the kernel sources for all of their devices in a timely manner.

ASUS ZenFone 6 gets 75Hz display refresh rate support via custom kernel

$
0
0

The ASUS ZenFone 6, or the ASUS 6z as it is called in India, is one of the surprise releases of this year, coming out as a very good smartphone alternative for those who dislike the more often recommended mainstream options. Asus had blessed the phone with several key updates, like bringing over August 2019 security patches, more Smart Key options, Google Duo dialer integration, and even camera rotation stability improvements. Asus has been quite supportive of the device, releasing the bootloader unlock tool and kernel sources for the same right around its release. Thanks to this timely release, developers have been able to work on custom kernels and other modifications such as GCam and LineageOS 16. Now, XDA Senior Member kdrag0n‘s Proton Kernel for the ASUS ZenFone 6 is bringing over the ability to set the display to refresh at 75Hz, higher than the stock 60Hz refresh rate.

ASUS ZenFone 6 / ASUS 6z XDA Forums

Proton Kernel is a custom kernel for the ASUS ZenFone 6, or ASUS 6z, intended to be used on the stock ASUS Android Pie ROM for the device. Since this is a custom kernel, you do need an unlocked bootloader as well as a custom recovery like TWRP to install it on your device. The kernel has a long list of features, but some of the highlights include the 75Hz screen refresh rate, sultanxda‘s Simple Low Memory Killer, magisk preservation, latest Qualcomm CAF sources with latest mainline LTS updates merged, and exFAT support.

Proton Kernel for the ASUS ZenFone 6 – XDA Thread

For 75Hz refresh rate, users need to turn the screen off and then turn it on after every boot for it to reliably work. A higher refresh rate does have risks associated, so if you just want to try out the kernel and are not interested in the higher refresh rate, you can simply append “60hz” or “60fps” to the kernel zip name and the flasher output will adapt accordingly to confirm the change.


Have you tried out Proton Kernel on the ASUS ZenFone 6? How has your experience been with 75Hz, with regards to fluidity and battery life? Let us know in the comments below!

The post ASUS ZenFone 6 gets 75Hz display refresh rate support via custom kernel appeared first on xda-developers.

WireGuard VPN protocol makes its way to Linux Kernel 5.6

$
0
0

Virtual Private Networks, or VPNs, can be an essential tool in the digital age. Due to growing privacy concerns or simple geolocation barriers, more and more users are taking advantage of the increased privacy and versatility afforded by VPNs that they trust. With COVID-19 forcing millions of workers to stay at home, many are forced to use company-owned VPNs to work remotely. In the last few years, a new VPN implementation has taken root among tech enthusiasts, and it’s finally going to become accessible to millions of users in the near future. The name of that new implementation is WireGuard, developed by Jason Donenfeld, who goes by the username zx2c4 on our forums. Yesterday, he announced that WireGuard version 1.0 is a part of Linux Kernel 5.6 (via ArsTechnica).

In comparison to OpenVPN, IPSec, and other popular VPN implementations, WireGuard has a considerably smaller codebase, which reduces the attack surface. It is easy to configure and has faster connection negotiations than OpenVPN. There are also performance and power efficiency improvements. There are some limitations to the protocol, however. Still, because of the benefits that it brings, the Linux Kernel community has come around to supporting it. After getting the crypto implementation into the kernel, WireGuard is now available in-tree with Linux Kernel 5.6. Any user running a distribution with Linux Kernel 5.6 can get started with a WireGuard client. While bleeding-edge distributions like Arch and Gentoo will quickly upgrade to Linux Kernel 5.6, other distributions that focus on stability like Ubuntu or Debian will take some time to make the upgrade. Mr. Donenfeld, however, states that WireGuard has been backported to Ubuntu 20.04 “Focal Fossa” and Debian Buster and that he is also maintaining backports to Linux Kernel version 5.4.y and 5.5.y.

As for Android, most users will have to wait a bit before they can use WireGuard VPN tunnels. Even though Android is built on top of the Linux kernel, the kernel running on most Android devices is fairly out of date. For example, my Pixel 3 running Android 11 is built on top of Linux Kernel 4.9, released back in 2016. Vendors can backport the kernel patches needed for WireGuard into the device’s older kernel tree, but there’s no telling if that’ll actually happen. Most likely we’ll have to wait for Google to start a new Android Common Kernel branch for the latest Linux kernel release followed by silicon manufacturers productizing new SoCs based on the newer release, but this may take some time to happen. Meanwhile, expect to see WireGuard grow in popularity among custom kernels on our forums.

WireGuard (Free, Google Play) →

Though the integration of WireGuard into the mainline Linux Kernel is definitely a welcome move that will excite many sysadmins and some users, we hope to see the new VPN protocol make its way to more platforms. As of now, the Windows version of WireGuard sits at 0.1.0 beta. Since its initial preview release, WireGuard 0.1.0 for Windows has made major improvements to performance and stability, so we should hopefully see a stable release in the near future.

The post WireGuard VPN protocol makes its way to Linux Kernel 5.6 appeared first on xda-developers.

KTweak is a new kernel adjustment mod that optimizes the performance of Android devices

$
0
0

Here at XDA, we love to keep tabs on kernel source code release events by various Android OEMs. The modus operandi of this practice lies in the fact that our brilliant aftermarket development community often tinkers with those stock kernel sources to fix existing bugs or even add some kind of novel feature. The concept of the Generic Kernel Image (GKI) is still as mature as the Generic System Image (GSI), which is why such device-specific custom kernels are the preferred method to manipulate low-level hardware parameters in the Android ecosystem.

As a matter of fact, the Linux kernel itself exposes a number of tunable parameters through pseudo file systems like sysfs and procfs. If you ever use a “kernel manager” app for tweaking the kernel of your Android device, you are basically playing with a nice frontend of sysfs (or procfs, depending on the parameter). Based on this aspect of Android kernels, XDA Recognized Developer tytydraco has come up with a unique Magisk Module named KTweak that can serve as a universal kernel tweaker.

According to the developer, Android kernels are usually compiled with CONFIG_SCHED_DEBUG as well as other debugging options set to true, which are enough to tune the kernel parameters on the fly given that you have root access. Google will eventually bring Generic Kernel Image to the masses, thus it indeed seems feasible to switch to a device-agnostic solution in the long run instead of recompiling device-specific kernel sources from scratch to achieve the same result.

Unlike some popular flash-once-and-forget “kernel optimizers”, KTweak is driven by the KISS principle. There is not a single compiled component, while the actual codebase (which is nothing but a shell script) is less than 250 lines long. Expand the list below to see all the tweaks that KTweak applies:

List of modifications done by KTweak

  • kernel.perf_cpu_time_max_percent: 25 –> 5
  • kernel.sched_autogroup_enabled: 0 –> 1
  • kernel.sched_enable_thread_grouping: 0 –> 1
  • kernel.sched_child_runs_first: 0 –> 1
  • kernel.sched_downmigrate: 20 20
  • kernel.sched_upmigrate: 80 80
  • kernel.sched_group_downmigrate: 20
  • kernel.sched_group_upmigrate: 80
  • kernel.sched_tunable_scaling: 0
  • kernel.sched_latency_ns: 10000000 (10ms)
  • kernel.sched_min_granularity_ns: 1000000 (1ms)
  • kernel.sched_migration_cost_ns: 500000 (0.5ms) –> 1000000 (1ms)
  • kernel.sched_min_task_util_for_boost: 25
  • kernel.sched_min_task_util_for_colocation: 50
  • kernel.sched_nr_migrate: 32 –> 64
  • kernel.sched_schedstats: 1 –> 0
  • kernel.sched_wakeup_granularity_ns: 1000000 (1ms) –> 5000000 (5ms)
  • kernel.timer_migration: 1 –> 0
  • net.ipv4.tcp_ecn: 2 –> 1
  • net.ipv4.tcp_fastopen: 3
  • net.ipv4.tcp_syncookies: 1 –> 0
  • vm.compact_unevictable_allowed: 1 –> 0
  • vm.dirty_background_ratio: 5 –> 10
  • vm.dirty_ratio: 20 –> 30
  • vm.dirty_expire_centisecs: 300 (3s) –> 1000 (10s)
  • vm.dirty_writeback_centisecs: 500 (5s) –> 0 (0s)
  • vm.extfrag_threshold: 500 –> 750
  • vm.oom_dump_tasks: 1 –> 0
  • vm.page-cluster: 3 –> 0
  • vm.reap_mem_on_sigkill: 0 –> 1
  • vm.stat_interval: 1 –> 10
  • vm.swappiness: 100 –> 80
  • vm.vfs_cache_pressure: 100 –> 200
  • Next Buddy
  • No Strict Skip Buddy
  • No Nontask Capacity
  • TTWU Queue
  • Governor Tweaks
    • hispeed_load: 90 –> 80
    • hispeed_freq
  • CAF CPU Boost Tweaks
    • input_boost_freq: 1.4 GHz
    • input_boost_ms: 250 ms
  • I/O
    • iostats: 1 –> 0
    • readahead: 0
    • nr_requests: 128 –> 512
    • noop / none
  • ZRAM

If you need a thorough insight into all the aforementioned tweaks and how they can boost the performance level of your Android smartphone or tablet, head on over to the module discussion thread linked below. All the tunables and the corresponding enforced values were carefully chosen by the developer based on their effects on real-life usage scenarios, so you know it’s not snake oil. You are also welcome to contribute to the project by submitting pull requests to the module’s GitHub repo.

KTweak Kernel Adjustment Magisk Module — XDA Download and Discussion Thread

The post KTweak is a new kernel adjustment mod that optimizes the performance of Android devices appeared first on xda-developers.

Android is shifting to an “upstream first” development model for new Linux kernel features

$
0
0

When you see the words “Android” and “fragmentation” in the same sentence, your mind probably immediately jumps to the Android version distribution chart. There are a few entities that most people point their fingers at when complaining that Android OS updates are slow to roll out across the board, but there’s only so much Google can do to force OEMs to develop and roll out updates more quickly. What Google can do, however, is reduce the development time and thus the cost of rolling out updates.

The first major initiative in Google’s long-term project to reduce development burdens is Project Treble. Announced alongside Android 8.0 Oreo in 2017, Project Treble modularized Android by separating the OS framework from the vendor implementation (HALs and the device-specific Linux kernel fork). This made it easier for Android OEMs to rebase their OSes on top of the latest AOSP framework as they could boot the latest version without needing updated code from vendors. As a result, OEMs could ready their custom Android forks quicker than before, and by extension, roll out major OS updates more quickly.

The next step in Google’s plans was to streamline the delivery of updates to key Android components. Google called this initiative Project Mainline when it introduced it alongside Android 10 in 2019. Google essentially took control of key OS components and forbid OEMs from modifying them. They then set up a delivery mechanism via Google Play so they could remotely roll out updates to these key components without having to wait for OEMs to apply the patches themselves. Mainline greatly improved how quickly devices receive updated versions of important OS components, in turn improving the security of the Android ecosystem as a whole.

But what’s coming next is even more important, and is arguably the most important part of Google’s long-term strategy. When we pointed out earlier how Treble modularized Android by separating the OS framework from the vendor implementation, we included the “device-specific Linux kernel fork” as part of that vendor code. Anyone who’s familiar with Linux on desktops will recognize a problem there: Why is it lumped in with closed-source vendor code? The problem is that while Android devices do ship with the Linux kernel, that kernel features a lot of out-of-tree code.

How did we get there? The problem, as outlined by Google software engineer Todd Kjos at this year’s Linux Plumbers Conference (via ArsTechnica), is because the mainline Linux kernel is forked several times before it ships on an Android device. Google forks each mainline Linux kernel into an “Android Common Kernel” branch, which closely tracks the mainline release but adds a few Android-specific patches. SoC vendors like Qualcomm, MediaTek, and Samsung then fork that kernel for each SoC they make. OEMs then take that SoC-specific kernel and add additional patches to implement support for the specific hardware they want to ship.

Illustration showing how the Linux kernel gets to Android phones

Due to these changes, “as much as 50% of the code running on a device is out-of-tree code (not from upstream Linux or AOSP common kernels)“, according to Google. The large amount of out-of-tree code on these devices makes merging upstream changes a long and challenging process. This is harmful to device security, as OEMs need to work harder to implement patches to vulnerabilities that are discovered in the Linux kernel. Furthermore, this leaves most Android devices on years-old kernel releases, meaning they miss out on new Linux kernel features.

In an effort to address this problem, Google is working on the Android Generic Kernel Image (GKI), which is essentially a kernel compiled straight from an ACK branch. The GKI isolates SoC vendor and OEM customizations to plugin modules, eliminating out-of-tree code and allowing Google to push kernel updates directly to the end-user. For over a year, Google has been working on a way to deliver GKI updates via the Play Store, through the use of a Mainline module.

According to our sources, devices that launch with Android 12 and ship with Linux kernel 5.10 must deploy a Google-signed boot image. Google’s very own Pixel 6 series will launch with Android 12 out of the box and ship with Linux kernel 5.10, so the two phones may be the first mass market devices to ship with a GKI.

New GKI apprach to isolate vendor modules reduce fragmentation

In addition, Google’s Todd Kjos revealed that the company plans to shift to an “upstream first” development model for new Linux kernel features. This will help Google ensure that new code lands first in the mainline Linux kernel, which will reduce future technical debt accrued from more out-of-tree code landing on Android devices.

Google's timeline to address Android kernel fragmentation

At the Linux Plumbers Conference this week, Kjos said, “Since out-of-tree modules are really important for our use case, we expect we’ll always have a set of exports and some things that are different or in addition to what’s upstream, but this whole project is a multi-year project working towards getting rid of as many out-of-tree patches as we possibly can, and aligning as much as possible with upstream.” Google aims to complete its work towards upstreaming existing features and isolating vendor changes by the end of 2022 and, starting in 2023, the company plans to adopt this “upstream first” development model to avoid such issues in the future.

The post Android is shifting to an “upstream first” development model for new Linux kernel features appeared first on xda-developers.


Viewing all 88 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>