Skip to content

Instantly share code, notes, and snippets.

View krasCGQ's full-sized avatar
🍵

Albert I krasCGQ

🍵
View GitHub Profile
@krasCGQ
krasCGQ / build-cpio
Last active February 26, 2024 16:57
Scripts to build static-PIE binary of the following; only works on Alpine Linux and other Musl libc based Distros, as some may segfault when done with Glibc.
#!/usr/bin/env dash
#
# SPDX-License-Identifier: Unlicense
#
CC=clang
LD=ld.lld
STRIP=llvm-strip
# -fuse-ld= tells compiler to use specific linker above

AIMROM vendor repository

If you're going to build AIMROM for your device, please head to Getting Started section of our manifest. This README is intended for anyone interested to become a maintainer of AIMROM.

Table of Contents

General Requirements

  1. You MUST own the device. Blind and untested builds are not allowed. Exemptions are given for devices with little hardware derivations, as long as you still own the base device.
From 985447f09d3f439194f69be12f4cf72952e1f317 Mon Sep 17 00:00:00 2001
From: Albert I <krascgq@outlook.co.id>
Date: Wed, 29 Nov 2017 19:47:19 +0800
Subject: [PATCH] kernel: Fix out-tree kernel compile
I blame Samsung.
Signed-off-by: Albert I <krascgq@outlook.co.id>
---
drivers/gud/Makefile | 14 ++++++++------
@krasCGQ
krasCGQ / tissotpls.txt
Created January 30, 2018 14:17
This is why you should #NeverGoXiaomi as a development device.
From 24ea5efc315593a2c4fadd39df307b78def02faa Mon Sep 17 00:00:00 2001
From: hehao <hehao@xiaomi.com>
Date: Mon, 29 Jan 2018 19:07:17 +0800
Subject: [PATCH] Kernel: Xiaomi kernel changes for Mi A1.
The Patch based on QualComm release version: LA.UM.5.3-06310-89xx.0
The kernel config file used is tissot-perf_defconfig
Change-Id: I43370f3c149069879808f6865ca405f545420ca1
Signed-off-by: hehao <hehao@xiaomi.com>
# GCC 7+ - no longer updated due to lack of present hardware
ccflags-$(CONFIG_CC_OPTIMIZE_FOR_2630V4) += -march=broadwell -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -mmovbe -maes -mpclmul -mpopcnt -mabm -mfma -mbmi -mbmi2 -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=4096 -mtune=broadwell
ccflags-$(CONFIG_CC_OPTIMIZE_FOR_L5520) += -march=nehalem -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -mpopcnt -msse4.2 -msse4.1 -mfxsr --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=nehalem
# GCC 8+
ccflags-$(CONFIG_CC_OPTIMIZE_FOR_4114) += -march=skylake-avx512 -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -mmovbe -maes -mpclmul -mpopcnt -mabm -mfma -mbmi -mbmi2 -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mavx512f -mavx512cd -mcl
@krasCGQ
krasCGQ / PreferredSettings.md
Last active March 4, 2024 17:09
My personal prefered settings for encoding media files, especially audio.

Disclaimer

If you decide to follow my settings, I'm not responsible for anything that happens if you decide to go careless and become a priceless dumb. All commands are done in Linux PC using corresponding CLI programs. In Windows, just add .exe after CLI program name.

Free Lossless Audio Codec (FLAC)

I prefer maximum compression as possible with replay gain applied. This command below will silence all warnings, especially when dealing with Hi-Res audios: a.wav: WARNING: Legacy WAVE file has format type 1 but bits-per-sample=24

$ flac --totally-silent --delete-input-file --replay-gain -V8 .wav

Opus Conversion Test

Testing is done with different allocation of maximum frame in milliseconds, with 192kbps VBR, maximum encoding complexity, with no expected packet loss during encode.

According to opusenc help menu:

 --framesize n      Set maximum frame size in milliseconds
                      (2.5, 5, 10, 20, 40, 60, default: 20)
@krasCGQ
krasCGQ / SuperSU-by-ameel.diff
Created July 25, 2017 13:17
SuperSU update-binary patch for ZenFone 2 MM by ameel @ XDA-Developers.
--- update-binary~
+++ update-binary
@@ -896,6 +896,15 @@
fi
fi
+ASUS_ZENFONE2_X86_60=false
+if [ "$API" -eq "$API" ]; then
+ if [ "$API" -ge "23" ]; then
+ ASUS_ZENFONE2_X86_CHECK=$(cat /system/build.prop | grep "ro.build.product=" | grep -i "mofd_v1" )