[xanmod][zen-kernel][GoogleLTS][codename:benares] Kernel 4.19.x for Android-x86

GearLock-Package [xanmod][zen-kernel][GoogleLTS][codename:benares] Kernel 4.19.x for Android-x86 4.19.169


Blog Author

Benares art by Marin Liekuriva , thank you for your amazing background :D

I. Introduction and Features
At first, this codename is for a kernel we made based on Intel Celadon project, but after that due to some problem in testing, we decided to abandon it. :/

But a little while ago, I found out a custom kernel called Liqourix Kernel , Liqourix is actually zen-kernel that have a lot of nice tweak and modification . So I think, why don't I try to compile it for Darkmatter ? .So I started to working on this. Using Android-x86 project's Kernel 4.19.80, with the latest kernel patch from GoogleLTS source, I’ve created a working version - benares 1.0 base on Kernel 4.19.92. The feedback was positive.

Many days later, there are member who feedback to me that their wifi is not working. So I tried to find a suitable kernel module sources, wrap it up and give them to test, the result is good :D. Now not only we have rtl8723de support, we’ll have some cards like rtl8821ce, rtl8188fu (rtl8188ftv), rtl8821cu and rtl8821au (rtl8812au).

Now let’s look at some features :

- Base on Android-x86 Project’s Kernel 4.19.80, upstream to 4.19.9x. (4.19.96 in benares 1.2)

- Using firmware from linux-firmware repo.

- Some optimization taken from zen-kernel (liqourix.net for more information) (now switch to xanmod)

- BBR TCP Congestion Control + CAKE Queue Management Algorithm turned on as default. (benares 2.0.1 with xanmod patch)

- Tested with great performance so far.

- Added support for Realtek rtl8723de wireless chipset with ant_sel=2 (read Troubleshoot part for more info)

- Added support for Realtek rtl8188fu wireless with rtl_power_mgnt=0 and rtw_enusbss=0.

- Added support for Realtek rtl8821ce, rtl8821cu and rtl8821au (rtl8812au).

- Compiled with Retpoline to avoid security vulnerable like Spectre or Meltdown.

- Turn off ASPM completely to avoid problem in some PCI cards drivers like PCIE BUS ERROR.

- Set default CPU Governor to Performance. (depricated in 1.6 due to some overheat issue feedback)

- Turn on Virtual Wifi for Ethernet connection aka virt_wifi (which soon to be added in Phoenix OS Darkmatter Exo4.4).
Hmmmm.... what did I forget... ?

II. Download
For benares-1.0, it is integrated to PhoenixOS Darkmatter Exo4.4 through Multi-boot.
For benares-1.2 and later : The DOWNLOAD button up there .

III. Troubleshoot
1. As lwfinger stated that :

The ONLY option you are likely to need is "ant_sel". The penny-pinchers at some laptop vendors,

mostly HP, decided to save a few cents to install only one antenna. That would not have been a

problem as the driver contains the logic necessary to handle this case; however, the idiots

failed to correrctly encode that information in the devices ROM. Accordingly, the driver follow

the ROM setting and uses the WRONG antenna. Effectively, the device has NO usable antennas.

So try this method can help you not only change antenna in rtl8723de, but also some Realtek wifi card like rtl8723be
Open terminal and type this :
su (if you use Terminal Emulator or Termux)

rmmod <your_wifi_card>

modprobe <your_wifi_card> ant_sel=<antenna_number>

<your_wifi_card> is your wifi card name, like rtl8723de

<antenna_number> there are 3 number you can use : 0, 1 or 2

2. Turn off Intel Power State (P-state) to switch to acpi_cpufreq to use more CPU Frequencies (and turn on set Performance as default)

A new CPU driver intel_pstate was added to the Linux kernel 3.9 (April 2009). First, it only supported SandyBridge CPUs (2nd generation), Linux 3.10 extended it to Ivybridge generation CPUs (3rd gen), and so on and so forth.

This driver supports recent features and thermal control of modern Intel CPUs. Its name comes from P-states.

The processor P-state is the capability of running the processor at different voltage and/or frequency levels. Generally, P0 is the highest state resulting in maximum performance, while P1, P2, and so on, will save power but at some penalty to CPU performance.

It is possible to force the legacy CPU driver (acpi_cpufreq) using intel_pstate=disable option in the kernel command line.
Source : https://vstinner.github.io/intel-cpus.html

So to disable it as you can see up there, is to add intel_pstate=disable to your grub code, for example :
menuentry 'PhoenixOS DarkMatter'
insmod all_video

search --set=root --file /dark.matter

linux /kernel quiet root=/dev/ram0 androidboot.selinux=permissive acpi_sleep=s3_bios,s3_mode SRC=/ intel_pstate=disable

initrd /initrd-stock.img

3. Upgrade from benares 1.0 (Exo4.4).
In the new PhoenixOS Darkmatter Exo4.4, there is a Multi-boot kernel option which pre-installed benares-1.0 (Kernel 4.19.92) in it. So to upgrade , delete or rename kernel41992 name and change kernel file name to .kernel41992. Or, you can change to anyname you want, like me, I changed to kernel.benares
If you customize the name, change the Grub2 code of Kernel 4.19.92 like this (require) :

insmod all_video
search --set=root --file /dark.matter
linux /kernel.benares quiet root=/dev/ram0 androidboot.selinux=permissive acpi_sleep=s3_bios,s3_mode SRC=/ intel_pstate=disable
initrd /initrd-stock.img

4. Realtek Ethernet (r8169) temporary fix :
Due to some bug in the 4.19 and 5.x kernel that making Realtek PHY driver (realtek.ko) didn't load as default, making the r8169 driver (Realtek Ethernet) unusable so that's the reason why the new 4.19 kernel can't using Ethernet
kernel.org team made a commit to warn that situation, but we don't use initframfs image so we have to load it in the different way.
You can simply add
insmod realtek
to load the Realtek PHY driver when it boot. For example :

insmod all_video
insmod realtek
search --set=root --file /dark.matter
linux /kernel.benares quiet root=/dev/ram0 androidboot.selinux=permissive acpi_sleep=s3_bios,s3_mode SRC=/ intel_pstate=disable
initrd /initrd-stock.img

If it doesn't work then you 'll have to manually fix it :
Go to Terminal, type these command
rmmod realtek
rmmod r8169
modprobe realtek
modprobe r8169

And then go re-plug your Ethernet cable, check Settings if it's working

IV. Changelog :
- v1.6 (08/03/2020) :
+ Upstream kernel to 4.19.108
+ Added support for Nintendo Switch Controller. (Joy-con, Switch Pro)
+ Remove Performance CPU governor as default due to some overheat issue.

- v1.4 (21/01/2020) :
+ Upstream to kernel 4.19.97.
+ Try to revert commit 6c25da5ad55d48c41b8909bc1f4e3cd5d85bb499
+ Added Broadcom wireless (wl) module.

- v1.2 (14/01/2020) :
+ Upstream to kernel 4.19.96.
+ Adding support for rtl8188fu (rlt8188ftv), rtl8821ce, rtl8821au (rtl8812au) and rtl8821cu

- v1.0 (Pre-release) (05/01/2020) : Initial Release.

V. Bugs :
- Using this kernel may give you freeze in PUBG Mobile. (Exo4.3 below)
Solution : We've successfully fixed the issue on Exo4.4.
- Freezes when using Nvidia GPU.
I still can't support Nvidia properly yet, since I'm using a AMD one. And also, Android-x86 is not recommend using Nvidia GPUs too since the open-source nouveau driver is too poor.

(btw you can use @mido.fayad Kernel 4.13.5 if you have one of it, or just use iGPU)

VI. Credit.
- Marin Liekuriva for the background. (Check out her Facebook or Twitter for more great arts :D)
- Android-x86 Project for providing Kernel 4.19.80 as base kernel.
- Steven Barrett for zen-kernel project.
- Larry Finger (aka lwfinger) for rtlwifi_extended modules
- kelebek333 for rtl8188fu module
-Tomás Pinho (tomaspinho) and endlessm (I guess this is Endless OS ?) for rtl8821ce module.
- Yuan-W for rtl8821cu module
- jeremyb31 for rtl8812au module
- @mido.fayad and @Night for testing and also solving freezing issue (thanks a lot guys)
- @AXON for Phoenix OS Darkmatter and Gearlock :D
And everyone who tested the kernel, modules for me :D

Thanks again for your contribution. ???
Last edited:


Blog Author
* About the codename idea

Benares - the codename I took from is actually a dragon (and a boss) in the game Honkai Impact 3rd.

Benares is a massive Honkai Beast taking the guise of a flying dragon. It first appeared with the 2nd Herrcher during the 2nd Honkai War. Its Honkai Core was distributed across 4 separate crystals capable of generating violent weather conditions and reviving the drake if it were to be defeated.
More information, you can read about the Second Corruption comic : https://manga.honkaiimpact3.com/book/1005


So above I told that this kernel used to base on Intel Celadon project. When I compile the kernel, I actually thinking about the blue color of Intel logo and thought : "Maybe try to find a character that have a suitable color tone ? " , so I just remember about Second Corruption comic that I read a month ago and found Benares (in human form, her name is Bella). So...... I choose her as the codename ¯\_(ツ)_/¯
Last edited:


Blog Author
wait, im figuring this out.
Post automatically merged:

test 2
Last edited:

Get Connected

Discord Server

New Threads

Latest From Blog