Releases: BYZYB/android_device_xiaomi_libra
lineage-18.1-20210602
Main changes
- Adjust AAPT and dalvik-heap configs (the values in
phone-xhdpi-xxxx-dalvik-heap.mk
will be used now). - Enable write barriers for all partitions.
Fix a issue that makes audio recording unavailable.Please power off then power on (instead of reboot) your device if audio recording doesn't work (this issue happens occasionally, further checks needed).- Fix a issue that makes media provider too slow due to the failure of file locks.
- Kernel improvements:
- Backport open file description locks from linux-3.18 (needed by Android 11).
- Create no loop devices at init time (to save memory when updatable APEX is disabled).
- Port "CPU overclock", "Edge gesture" and some other framework changes from lineage-17.1 (except "Screen refresh rate" settings, which may switch to another method in the future).
Download mirror
lineage-18.1-20210529
First release of LineageOS 18.1
Here is the first public release of lineage-18.1, most features and changes are similar to the latest version of lineage-17.1, except:
- Edge gesture config (in Settings)
- CPU overclock control (in Settings)
- Signature spoofing support (for MicroG)
- Screen refresh rate config (in Settings)
- Some more changes that users cannot see in UI
You could simply upgrade to this ROM from lineage-17.1 without a factory reset. It's also recommended to wait for a few minutes after a ROM update, to make sure the dex2oat
process has finished properly.
Main changes
- Android Security Patch level:
5/5/2021
. - Android System Webview version:
90.0.4430.82
. - Kernel improvements:
- Backport BFQ I/O scheduler from linux-4.4 and set as default.
- Build with CONFIG_CC_WERROR enabled (no build warning now).
- Disable F2FS consistency check.
- Disable fsync by default (cannot be used on Android 11, control via
/sys/module/sync/parameters/fsync_enabled
). - Disable more unused features and schedulers (refer to the changes in chiron kernel).
- Disable unused congestion control modules.
- Enable LLVM Polly optimizations.
- Enable write barriers for early mount partitions (for data safety).
- Remove dynamic fsync module (not compatible with Android 11).
Download mirror
lineage-17.1-20210512
Main changes
- Android Security Patch level:
5/5/2021
. - Android System Webview version:
90.0.4430.82
. - Add Traditional Chinese translation for custom setttings (thanks to @yipinghuang1991).
- Kernel improvements:
- Add clang-12 build support for Debian WSL on Windows 10 Dev.
- Enable schedtune support (which will be used by Android to adjust processes priority).
- Remove most Xiaomi custom changes that should not be used in AOSP based ROMs.
- Remove unnecessary commands from init scripts.
- Restrict background process to use CPU0 only (should improve battery consumption).
Download mirror
lineage-17.1-20210414
Main changes
- Android Security Patch level:
4/5/2021
. - Android System Webview version:
89.0.4389.105
. - Add a merged repo diff to replace the outdated patches (also remove some unused scripts).
- Define shipping FCM version (legacy level) in the manifest.
- Kernel improvements:
- Build kernel image with clang-12 on Debian (the Ubuntu VM used before has been replaced).
- Enable function inline for some modules.
- Enable HID input device support (wireless mouse or gamepad should work properly)
- Enable linker (gnu-ld) optimization by default.
- Disable unnecessary kernel logs.
- Fix all build warnings that should be fixed (or disable warning if the codes should not be changed).
- Improve kernel security by merging upstream patches.
- Remove trailing spaces from all files in kernel repo.
- Remove forced fast charge implementation (not allowed in official builds).
- Remove creation of
/data/misc/wifi
and/data/misc/dhcp
. - Remove LineageOS Updater (new versions will always be released here and on Android File Host).
- Remove more packages and overlays to reduce resource consumption (please delete
/data/resource-cache
manually if a bootloop happened). - Simplify CPU scheduler configure script (no need to set CPU retention mode manually).
- Update NotoSansCJK (v2.003) and NotoSerifCJK (v1.001) fonts to the latest version.
- Update SEPolicy (still not recommend to use
enforcing
mode).
Download mirror
lineage-17.1-20210307
Main changes
- Android Security Patch level:
3/5/2021
. - Change
PRODUCT_SHIPPING_API_LEVEL
from Android 5.0 (L) to 5.1 (L-MR1). - Kernel improvements:
- Apply upstream patches to reduce memory leak and improve overall stability.
- Enable per-uid task statistics (needed by some userspace services).
- Overclock GPU frequency (650 MHz → 700 MHz) and increase bus voltage (for 700 MHz only).
- Switch to new
sysfs
based LiveDisplay driver (LiveDisplay HAL will not use software based implementationlegacymm
). - Use per-cpu partial cache instead of allocating 4K pages only.
- Remove unofficial addon-su support (it provides better performance, but also has many security vulnerabilities, please use Magisk instead to get root access).
- Remove unused energy-awareness service.
- Switch to
sysfs
based LiveDisplay implementation (instead oflegacymm
in previous builds). - Use a better way to set initial value for persist properties.
- Use
everything
as default dex2oat compiler filter to improve performance (which wasspeed
in previous builds).
Download mirror
lineage-17.1-20210209
Main changes
- Android Security Patch level:
2/5/2021
. - Android System Webview version:
88.0.4324.152
. - Kernel improvements:
- Disable Battery Current Limit (BCL) driver (CPU 4/5 won't be accidentally offlined which causes failure to set cpufreq governor after boot, disable BCL should be safe enough on most Mi-4c).
- Use CPU 2/3/4/5 rather than CPU 1/2/3/5 for KTM hotplug (the heating in heavy loads should be reduced, it's also the original behavior before version 20201112).
- Optimize the logic of
libinit_libra
module. - Remove global property triggers from init scripts.
- Remove obsolete dex2oat settings.
- Replacing copy headers with header libraries.
- Set initial value for persist properties (system properties
persist.sys.cpu_overclock
+persist.sys.root_access
+persist.vendor.edge_touch_mode
should have a default valuefalse
after a clean install). - Temporary disable KTM hotplug before setting cpufreq governor.
Download mirror
lineage-17.1-20210116
About BCL hotplug
According to some user feedbacks previously, all A57 cores (CPU4/5) won't online if the battery voltage (or battery level) is too low (exactly, lower than 3.5V). It may also happens if the device boots in a low temperature, which may affect the power output of battery. After reading some documentations, I confirmed that the Battery Current Limit (BCL) driver inside kernel is the real cause of this problem. In msm8992.dtsi, the qcom,bcl-hotplug-list
and qcom,bcl-soc-hotplug-list
indicates the cores that may be offlined in such situations (CPU4/5 is chosen by default).
As the BCL driver will start with the kernel before Android boots, init is unable to set CPU governor for all A57 cores which have been already offlined. That's why CPU4/5 sometimes gets performance
instead of sched
as its cpufreq governor after boot, which will result in a frequent online/offline switching and affect both battery (as A57 cores are always working in highest frequency) and performance (as A57 cores are offlined too frequently).
However, disable the BCL driver completely should not be a good solution. Low battery voltage (or battery level) may cause random reboot or harm the battery itself if the CPU is working in full power (for example, Apple iPhone limits the CPU performance if the battery is in bad condition). As a solution, I'll move CPU4 out of the BCL hotplug list and use CPU3 instead, which will make CPU4 always online and be available for cpufreq governor configuring. This way should still be safe enough on most devices and most batteries.
NOTE: This solution may make have negative effects on thermal control (as one A57 core is always online), a better way will be used in the next ROM update (disable BCL by default before setting cpufreq scheduler).
Change screen refresh rate in Settings
To make full use of the dynamic-fps feature on Mi-4c, a new setting named "Screen refresh rate" has been added in this release. Users are now able to change screen refresh rate easily without shell command or root access. For safety reasons, this setting will be reset to default after reboot.
The basic principal is to change the value of /sys/class/graphics/fb0/dynamic_fps
. All screens on Mi-4c/Mi-4s support dynamic-fps in immediate_porch_mode_vfp
mode, which means these screens are able to change refresh rate dynamically without a suspend/resume or a reboot. As a result, users could change screen refresh rate to any available values (30 Hz ~ 60/75 Hz) immediately without any breaks.
Refresh rate | Characteristic |
---|---|
30/48/50 Hz | Suitable for watching movies (24 FPS), plays (25 FPS), online videos (30 FPS) with fixed fps, also saves more power. |
60 Hz | The default value of most screens, which provides the best compatibility. |
75 Hz | Make motions more smooth but only supports Mi-4c with Sharp-RSP61322 screens, also uses more power. |
However, this setting cannot achieve the same effect as the "Dynamic refresh rate" feature on new devices like Mi-10, which needs a userspace daemon or something similar to take proper actions in different use cases. What it mainly does is to read/write the value of a node in sysfs, but not something more complex.
Main changes
- Android Security Patch level:
1/5/2021
. - Android System Webview version:
87.0.4280.101
(the persistent histograms issue has been fixed,*.pma
in/data/data
will be deleted automatically). - Add refresh rate option to Settings (in
Settings > Display > Screen refresh rate
). - Enable KSM (controlled by
/sys/kernel/mm/ksm/run
) and low_ram mode (controlled by system propertyro.config.low_ram
) to reduce RAM consumption on 2GB devices. The default profile of KSM is conservative, in order to reduce performance impact during heavy loads. If you want to merge same pages more quickly to get more free RAM, please reduce the value of/sys/kernel/mm/ksm/sleep_millisecs
. Both of them will not apply to devices with 3GB+ RAM by default, the performance of these devices should also be slightly improved as SWAP/ZRAM support (and related things) has been removed from kernel. - Enable variable button brightness support (in
Settings > Buttons > Backlight
). - Enable delalloc for all partitions (to improve I/O performance).
- Kernel improvements:
- Enable
delalloc
for system partition. - Inline KSM with
msm-3.18
upstream (partly backport). Use CPU3/5 instead of CPU4/5 for BCL hotplug[REVERTED] restored after v2021.02.12
.- Use KSM rather than ZRAM to improve memory usage on 2GB devices.
- Enable
- Optimize the logic of "Root access" option (in
Settings > System > Developer options
).
Download mirror
lineage-17.1-20201216
User-friendly controller for hardware features
In this rom update, you are able to control the state of CPU overclock and Edge gesture inside Settings app. The former one is located in Settings > Battery > Battery saver and performance > High performance mode
, and the latter one is at Settings > System > Buttons > Edge gesture
. It's now available to control both of them without shell commands or external apps.
Due to some breaking changes, you have to enable then disable the following two settings manually. Everything should work properly after that, and both of their status would be saved permanently. Otherwise, CPU overclock will be enabled by default (which may cause random reboot on some Mi-4c), and Edge gesture will be kept disabled (this one is safe).
Each of these features are controlled by init triggers (exactly, by properties). You could set these properties to false/true
in order to disable/enable each feature. CPU overclock is at persist.sys.cpu_overclock
, Edge gesture is at persist.vendor.edge_touch_mode
, and root access is at persist.sys.root_access
just like before. By using init triggers, the Settings app is no longer needed to handle file operations which may cause exceptions in some conditions.
If you're using addon-su for root access instead of Magisk, please also do the same thing to Settings > Developer options > Root access
. Otherwise, root access will be kept disabled. No matter how you got root access, adb_root is always available at Settings > Developer options > Rooted debugging
, which allows to run adb shell as root user.
Todo: Add a new screen refresh rate controller to Settings > Display
, which allows users to control FPS dynamically (in 30/48/50/60/75Hz).
Main changes
- Android Security Patch level: 12/5/2020.
- Android System Webview: 87.0.4280.101 .
- Add new property for overclock control and edge gesture.
- Adjust file paths for pinner service.
- Convert all init shell scripts to init rcs.
- Convert libshim makefile to blueprint.
- Copy init scripts to ramdisk instead of building as packages.
- Declare fingerprint HAL in device manifest.
- Kernel improvements:
- Clean-up unnecessary build options.
- Completely disable debugfs on Android system.
- Disable seccomp filter (has no effect if selinux is set to permissive).
- Keep at least one A57 core online when reaching thermal threshold (CPU1/2/3/5 might be offlined instead of CPU2/3/4/5).
- Overclock CPU and adjust voltage mapping (A53: 1440MHz → 1632MHz, A57: 1824MHz → 1920MHz).
- Move config_deviceDisabledComponents to lineage_config.xml .
- Optimize GPS configuration (should improve positioning experience outside Mainland China).
- Remove core control configs from init script.
- Remove debugfs related things.
- Remove duplicate lines from init.qcom.rc .
- Remove lineage recovery from rom (as most users are using TWRP).
- Remove unused custom thermal HAL.
- Remove unused kernel offset values.
- Remove unused proprietary files from list.
- Set fpc parameters with libinit (only set those values on Mi-4s).
- Update storage cleaning rules and dex2oat properties.
- Use a better way to handle root access (both addon-su and adb_root).
- Use arch specific optimization (cortex-a53) globally.
Download mirror
lineage-17.1-20201112
Patches for building your own ROM
It's now available to use patches for applying custom modifications outside device/kernel/vendor
repos, no more manual editing is required. These new patches are generated from my own lineage-17.1 repo, including most necessary changes for building a functional (or better) lineage rom than mine. The repo diffs will still be kept as a detailed reference to what I did in my lineage-17.1 sources locally.
Each patch is placed into its relative path from the root directory of your lineage repo, and named by its feature. Therefore, it's easier to apply them (or choose the ones you need) than reading repo_17.diff line by line and modify everything manually. Just copy the pacthes from /device/xiaomi/libra/patch
and execute git am xxx.patch
in correct place, then the changes will be applied automatically.
Don't forget to run git reset HEAD^
after each patch, or the changes will be discarded by repo sync
.
Main changes
- Android Security Patch level: 11/5/2020.
- Android System Webview: 86.0.4240.185 .
- Fix adb_root support in user build variant (need to enable "Root access" in "Settings - System - Developer options").
- Fix audio recording as well as media volume (see issue #2 for more details).
- Kernel improvements:
- Fix almost all fixable build warnings (tested with clang-11).
- Never set minimum/maximum value limit for wlan configs.
- Show timestamp in printk() by default.
- Refactor libinit module.
- Remove lineage recovery from rom (as most users are using TWRP, also saves 10MB free space), the current installed recovery image would never be replaced.
- Remove unused nano/vim config files.
- Tiny clean-up for for init scripts.
- Update NotoSansCJK to v2.002 and remove Latin+CJK merged NotoSerif fonts (restore serif fonts to original state).
Download mirror
lineage-17.1-20201014
Clang/LLVM support for 3.10.y kernel
Switch from gcc to clang
In many conditions, clang will generate better codes than gcc in less time. It's also reported that the executable binaries built by clang runs faster than the one from gcc. What's more, the prebuilt gcc-4.9 is removed from Android 11 sources, which may cause build errors if the kernel doesn't add support to clang/llvm, or the users didn't specify custom gcc toolchains (just like how I used gcc-10 to build the kernel before).
Therefore, switching from gcc to clang has become a high priority plan. Currently, only linux-4.4 and later has clang/llvm build support, there is also some patches for linux-3.18 . Backport such things to linux-3.10 is theoretically possible (as the C/C++ codes in linux kernel is always C/C++), but takes much time to check all patches and do build tests.
At early time, the kernel built with clang-10 would panic if WLAN is enabled (there must be something wrong in qcacld-2.0 driver), without a chance to get kernel logs (because ADB also crashed and I have no way to access UART on Mi-4c currently). After taking some patches to fix OOM and improve stability, the kernel finally worked with WLAN enabled (but there is no actual changes to qcacld-2.0 driver, maybe memory overlaps? or some problems from clang-10 itself?). At last, the clang-11 on Ubuntu 20.10 built a stable kernel image that works properly, made a well beginning.
In my daily use (for test), the kernel built with clang provides better performance than the one with gcc-10, even with less aggressive scaling up time for "sched" CPU scheduler. No issue was found currently, but my use cases may not include all available situations. If you got into trouble with this release, please give me a feedback.
Known issue
- LTO must be disabled (in libra_defconfig) to keep gcc-9/10 compatibility, or vmlinux won't link properly. This issue doesn't affect most users, unless someone wants to build the kernel using gcc toolchains.
For more details (or contribution), please go to android_kernel_xiaomi_libra and see pull requests.
Reduce resource consumption
Disable system logs
It's highly recommended to disable system logs to reduce resource consumption (for better performance and privacy), unless you're going to collect system logs. Like the following picture: go to "Settings - System - Developer options - Logger buffer sizes", and set the value to "off".
Main changes
- Android Security Patch level: 10/5/2020.
- Drop Wifi Display support (no native implementation in Android 9+).
- Improve I/O performance (disable atime and write barrier).
- Organize the name of libshims.
- Remove dirac blobs (not used).
- Remove libhidltransport and libhwbinder from vendor libs.
- Remove sepolicy hacks of addon-su (to avoid build errors without patch).
- Kernel improvements:
- Build with clang-11 on Ubuntu 20.10 (better performance).
- Fix some memory leaks to improve stability.
- Merge more upstream changes of F2FS.
- Remove custom KTM changes by flar2.
- Update fsnotify module (inline with linux-3.18, may need in Android 11).
- Use full link-time optimization (LTO) in build process.
- Use less aggressive up scaling time for "sched" CPU scheduler.
- Stability improvements for KTM (inline with caf-LA.BR.1.3.6.c25).
- Use the consumerir HAL from android_hardware_xiaomi.