[SOLVED] Wi-Fi failure with custom kernel - Samsung Galaxy S20 / S20+ / S20 Ultra Questions &

I built a minimally modified BTI (Android 10) kernel for my Exynos S20+ (G986B) from the Samsung-released source and used Android Image Kitchen by @osm0sis to extract the boot.img from my device and repack it with the kernel image I built. I subsequently installed the new boot.img with dd, and the phone boots normally, including showing the expected uname output.
The only issue I've seen so far is that Wi-Fi doesn't work. I observed the following:
Immediately after installing the kernel, Wi-Fi simply refuses to turn on, with the button turning back to gray a few seconds later. dmesg output includes complaints about failure powering up Wi-Fi chip and downloading firmware to it.
After reformatting /data, Wi-Fi turns on and wlan0 is even visible in ifconfig output, but no networks are discovered and it is impossible to connect to any network. dmesg output contains numerous WIFI_SEC errors including references to files that do not exist in /data/misc/conn
After reinstalling a boot.img containing the stock kernel, normal Wi-Fi functionality is immediately restored on next boot, even without reformatting /data.
A search of XDA and the greater web turned up lots of complaints about this issue spanning many years and generations of Galaxy devices. The solutions I found fell into three categories:
Replacing libsecure_storage components with a patched version. The version I found was quite old.
Setting ro.securestorage.support to false in build.prop. There are also comments that indicate this doesn't work.
Placing some provided files in /data/misc/conn. This seems somewhat unlikely to be applicable for this device/build since there are no files here even when Wi-Fi is working correctly with the stock kernel.
Can someone (maybe one of the prolific kernel devs like @freeza ) explain to me what is going on here and suggest a good way to address it? I'd definitely prefer an approach that doesn't involve inserting prepared binaries.
Thanks.

The problem here is the way the Wi-Fi driver (drivers/net/wireless/broadcom/bcmdhd_101_12) is built in my custom Kernel:
Makefile uses the ANDROID_VERSION or PLATFORM_VERSION environment variables to define the ANDROID_PLATFORM_VERSION macro, but does not do so if ANDROID_VERSION or PLATFORM_VERSION are not set.
dhd.h uses the lack of ANDROID_PLATFORM_VERSION to:
Set the VENDOR_PATH macro to "" resulting in firmware being sought in /etc/wifi instead of /vendor/etc/wifi as expected for Android 10.
Set the PLATFORM_PATH macro to "/data/misc/conn/" resulting in configuration being sought in /data/misc/conn instead of /data/vendor/conn as expected in Android 10.
So, the solution was much simpler than any of possible methods I found earlier. All I had to do to resolve this problem was run this before building my Kernel:
Bash:
export PLATFORM_VERSION=10.0
It seems that this is an omission in Samsung's build instructions. Upon installing my kernel built this way, Wi-Fi works as expected. This is very similar to what is described in post 79 of this thread.

Thank you, I also meet wifi problem on my s8 kernel, I will try to fix it by you provided.

Sadly, this didn't work for the Galaxy Tab 8.0 (SM-T290) which suffers identical symptoms when I build from kernel source. There's no reference to ANDROID_VERSION, PLATFORM_VERSION, ANDROID_PLATFORM_VERSION or even VENDOR_PATH in any kernel source file.

sjevtic said:
The problem here is the way the Wi-Fi driver (drivers/net/wireless/broadcom/bcmdhd_101_12) is built in my custom Kernel:
Makefile uses the ANDROID_VERSION or PLATFORM_VERSION environment variables to define the ANDROID_PLATFORM_VERSION macro, but does not do so if ANDROID_VERSION or PLATFORM_VERSION are not set.
dhd.h uses the lack of ANDROID_PLATFORM_VERSION to:
Set the VENDOR_PATH macro to "" resulting in firmware being sought in /etc/wifi instead of /vendor/etc/wifi as expected for Android 10.
Set the PLATFORM_PATH macro to "/data/misc/conn/" resulting in configuration being sought in /data/misc/conn instead of /data/vendor/conn as expected in Android 10.
So, the solution was much simpler than any of possible methods I found earlier. All I had to do to resolve this problem was run this before building my Kernel:
Bash:
export PLATFORM_VERSION=10.0
It seems that this is an omission in Samsung's build instructions. Upon installing my kernel built this way, Wi-Fi works as expected. This is very similar to what is described in post 79 of this thread.
Click to expand...
Click to collapse
how do I know my platform version?

dirty flash of my ROM worked for me.

dirty flash of my ROM worked for me.

walker2771 said:
dirty flash of my ROM worked for me.
Click to expand...
Click to collapse
what is it

Related

[Q] Google goggles ipv6

Hi all,
I have Fat Free Froyo installed with the latest 14th Jan 2011 kernel voguimg-240x320-2.6.32-froyo-14-01-11_14.nbh edited to froyo & panel type 2 from t029000.massey.ac.nz but Google Goggles needs ipv6 support.
Is this a kernel problem or a problem with the build itself? I am experienced in linux, so can modprobe or insmod the ipv6.ko but I don't know where to get it from
Any help would be appreciated!
(message for kernel's developers) take this man! he can dev ipv6!
Jumping the gun there a bit
I triage bugs and work on stuff for Ubuntu. Have also ported a few linux bits to ppc64 (PlayStation 3).
I'm pinching the ipv6.ko from slayhers latest kernel build, hopefully that will work insmod-ding or modprobing it into the kernel thru the terminal on the Kaiser itself.
So, fingers crossed, this may be solved in 5 minutes!!
Didn't work, it must be compiled for a different platform...
Anyone have or know where to get a kernel for the Kaiser with ipv6 support, or failing that the correctly built ipv6.ko for the Kaiser so that it can be insmodded?
Getting it compiled in the kernel is the easy bit, although it does use up a lot of space which is limited in the kaiser's kernel so a little tweaking is needed. Getting it to work with the Kaiser's modem and the builds we currently use is a different matter unfortunately. It will take a bit of modding for it to work but it's more then achievable with a bit of free time. Wish i could buy that stuff!!If i get a chance i will get you the ipv6 module for the kaiser's kernel or a kernel with support for it so you can have a play.
I definitely look forward to it! If I knew how and what to modify I'd do it myself, but I thought arch-specific kernels had to be compiled on the arch itself? If that's the case, I can see how free time would be needed, it'd take hours or days to compile the linux kernel at 400MHz
I have compiled kernels before so if/when I learn how to do it myself, I could start to use my own git repo for more recent daily builds or something.
I'm also thinking about starting working on some *buntu stuff (I know Ubuntu is there for the Kaiser, but soem tweaks would help if I get a chance.)
Hmm, a little Googling goes a long way http://www.androidonhtc.com/wiki/Get_Involved << was hard to find that,so hopefully I can add ipv6 somewhere in the 'make menuconfig' options for the kernel.
Are the standard kernel options used by "make vogue_defconfig" ok to use, i.e. will it build a normal useable kernel so that everything works?
xteejx said:
Hmm, a little Googling goes a long way http://www.androidonhtc.com/wiki/Get_Involved << was hard to find that,so hopefully I can add ipv6 somewhere in the 'make menuconfig' options for the kernel.
Are the standard kernel options used by "make vogue_defconfig" ok to use, i.e. will it build a normal useable kernel so that everything works?
Click to expand...
Click to collapse
Yes, that is th correct make file to use. I have built the kernel with IPV6 support, haven't tested it but have attached the module to the post for you to try
Brilliant! I'll try it sometime within the next couple of days, although I might myself be working on a blazing fast kernel specifically for the HTC Kaiser, and it is SERIOUSLY!!!! fast, even at 400MHz I can notice a massive increase in speed with the exact same build, but I haven't economised too much.
I can see the the options for ipv6 in the ncurses menuconfig, so I guess it's just a case of enabling it and building the zImage right?
I seem to be having the old problem with the wifi though, and I know it's kernel related, but there are only patches for it, i.e. the wlan.ko, but can't see how to implement it myself so it's an all-in-one solution
When I get the hang of the Kaiser hardware properly, I might just push through a newer kernel from the armlinux site so watch this space
xteejx said:
I might myself be working on a blazing fast kernel specifically for the HTC Kaiser, and it is SERIOUSLY!!!! fast, even at 400MHz I can notice a massive increase in speed with the exact same build
Click to expand...
Click to collapse
How have you managed that??? What have you done?
I have no idea how it happened, perhaps the other devs add a load of useless options, but all I did was follow the instructions at that link above and compiled a zImage from the 2.6.32 arm branch, using the 2010 arm tools. Used NBHeditor to edit it for Kaiser, panel 2, froyo, flashed it and bang (not literally thank god).
I can't answer any better than that. I used the default options (for now at least) that the vogue build script uses for the kernel, but bluetooth, camera and gps work. No internet connection as yet either through the network or wifi, dumno what I've missed there, and no ipv6 (but can add that easily enough). Wifi doesn't work either, but I'm working on it, although that MAY be the reason why it's so fast...maybe it's missing a few options...still unsure at this point.
I notice that although this is an open community, and people attach NBHs, there are no changelogs or anything showing what the people have done with the kernel to implement some options, so it's kinda holding me back at the minute.
xteejx said:
I notice that although this is an open community, and people attach NBHs, there are no changelogs or anything showing what the people have done with the kernel to implement some options, so it's kinda holding me back at the minute.
Click to expand...
Click to collapse
That isn't true, all tested changes are pushed to git, you can see what has been changed and how from here: http://androidhtc.git.sourceforge.n....git;a=shortlog;h=refs/heads/htc-vogue-2.6.32
*facepalm!*
Didn't see that, will bookmark it and keep an eye on it, perhaps work with it. Thanks for the link
the androidhtc.com site is not related directly to the develop project because no developer is connected to it. Also the git repository it not hosted in linux to go but on sourceforge (so download the correct git). That site is very outdated.
wifi works if you use the correct branch (on sourceforge) and modules.
Am I right in thinking that http://androidhtc.git.sourceforge.n...7c0bf5edc4f5c6d64ce4df29254e8332ce26b;hb=HEAD is the prebuilt kernels and nbhs from the source at http://androidhtc.git.sourceforge.n...og;h=62f075ddd13f378fd252be94c77e4f93d12584fb ??
I think I'm looking at the right tree now.
Flashing the latest NBH: VOGUIMG-320-FROYO-01-16-11.NBH still gives me the wifi error. Do I need to manually add the wlan.ko to it or ??
I could've sworn that an NBH I flashed before had all that in the NBH and it worked fine.
Ok, got it back to how I had it:
Flashed latest.NBH from http://androidhtc.git.sourceforge.n...7c0bf5edc4f5c6d64ce4df29254e8332ce26b;hb=HEAD and dropped androidupdate.tgz to the /andboot folder of the SD card, installed update thru the boot menu and done.
So in reality there's nothing stopping me grabbing the same kernel source, building it and adding ipv6 support in the ncurses kernel config menu and making an NBH from it and flashing that over, and then doing the androidupdate.tgz, although I think with HTCFlasherGUI you can flash a zImage directly right??
Is there something wrong with the git at http://androidhtc.git.sourceforge.net/git/gitweb.cgi?p=androidhtc/kernel.git;a=summary I can't get access, it's showing old stuff. It looks closed since git clone rejects me
xteejx said:
Is there something wrong with the git at http://androidhtc.git.sourceforge.net/git/gitweb.cgi?p=androidhtc/kernel.git;a=summary I can't get access, it's showing old stuff. It looks closed since git clone rejects me
Click to expand...
Click to collapse
No, nothing wrong with it. Just do:
git clone git://androidhtc.git.sourceforge.net/androidhtc/kernel.git
You then need to set it to the correct branch using 'git checkout -b <branch you want> '
It's the 2.6.32 branch you are interested in, you can find out exactly what it's called using 'git branch -a' which will list the available branches.
Cool. Knew something went wrong somewhere, had to be me lol!
I added that ipv6.ko to the NAND via a androidupdate.tgz (only way I could do it), and it didn't work, something about incorrect module format (or something like that).
Are there any prebuilt kernels or NBHs for the Kaiser that include ipv6? Either as a module that I can insmod it in the terminal or built-in?
I hate being upstaged by people that can use Goggles without any problems.
I know slayher's kernels have ipv6, but I flashed the new stock one from http://forum.cyanogenmod.com/topic/4434-froyo-kernels-by-slayher/ and it didn't work. I mean the kernel did, but Goggles didn't - couldn't insmod it either - same invalid module format as the ipv6.ko scooter did for me
Also the git clone didn't work:
Initialized empty Git repository in /home/name/android-git/kernel/.git/
fatal: The remote end hung up unexpectedly

[HOWTO] Build CM10 For The I957

First things first: THANK YOU to all those involved in the coding of this, especially the msm8660-common kernel that so many folks have put so much effort into, and Mr. Cyanogen for the device tree, etc etc. NONE of this would be possible without your efforts. I stand on the shoulders of giants in providing these instructions, the code is NOT mine, I'm just documenting this so you all can help contribute. Kindest regards to everyone who has contributed to make this possible. Your work has enabled the community to beat the vendor to the punch, yet again!
DISCLAIMER: This contains information on working with very early code as well as hacking together a completely unsupported Frankenstein build with some proprietary samsung binaries from another device (ATT Note) and I will warn you: If you aren't willing to risk bricking your device, don't even think about this. Also, I'm not so much a coder as I am a QA engineer, so I know enough to be dangerous, but I couldn't code C++ get myself out of a virtual crashing airplane if I had to. I also might not be able to help you out of a sticky situation, so... have fun at your own risk! But do have fun
Looking for binaries? See post #2
That said, it's honestly not likely any of this will brick your tab, if you know what you're doing, but... early software always carries danger, and using binaries from a similar yet different device can do who knows what.
Also of note: you should probably back up your EFS partition if you're going to hose with the radios to get cellular data working... hasn't been an issue for me, but... corrupt EFS partition = no more cellular data for you. ever.
Cyanogen has added initial support for the i957 to the CM10 repository, and it's looking good so far! But, there are no nightly builds yet, probably because Cyanogen would like to do some more work on it before handing out binary packages... Or maybe he hasn't figured out how to get things quite functional yet. I considered releasing a binary package for you to toy with, but then realized that would defeat the purpose of helping along the development of an official Cyanogen i957 (p5att) release, and lock you into something I already built from "pre-alpha" code. It's best to check out the latest source tree and do your own build, then you can easily test and contribute your modifications, should you find any.
So with that, here's some instructions on how to build CM10 for your SGH-I957 ("p5att") device from source code. This will also ensure time is spent doing development work, not hand-holding the faint of heart (sorry, sue me!)
These instructions assume you've successfully built Cyanogenmod for a supported device and understand the basics of getting things going. If not, start with that first, then come back to this. I'm also assuming you've got the android tools that you get from any build of cyanogen (like mkbootimg) in your path for some of the "optional" steps, which is of course elementary...
I'm also going to assume you know what to do with the resulting zip... You know... backup, factory reset, wipe system, flashy the zippy...
I really recommend doing the boot image modifications after the build, without ADB on boot, if something goes wrong, you'll have no way of knowing whats going on. If you get the boot image modified properly as detailed below, you will be able to ADB to the device as soon as the second boot logo disappears. Also, there's probably a cleaner way (like changing something somewhere to invoke one of the other case statements in init.qcom.usb.rc), but I didn't have any luck with that. Feel free to school me! :laugh:
EDIT: If you don't feel like hacking the boot image, just flash the one attached (ps: none of the zips below are TWRP/CWM flashable, just zipped up files.. dd if=bootimagefilename of=/dev/block/mmcblk0p8 from a root shell to flash the boot partition on the i957)
I've attached the initlogo.rle file to this post so you don't have to fish it out of the ramdisk embedded in the stock boot image. Adding initlogo.rle to the ramdisk gives you confirmation the kernel is bootstrapping, and it's disappearance indicates ADB is now available. Also, use a linux box for ADB! silly wabbit, windoze is for kids.
According to comments in system.prop, the cyanogenmod boot animation is disabled because the framebuffer is "weird". Strangely, it sometimes displays for me, one in 10 boots maybe. Weird!
Here goes.
----
Initialize Repo:
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
Sync Repo:
repo sync -j6
... Coffee Break!
Breakfast for p5att:
. build/envsetup.sh && breakfast cm_p5att-userdebug
Modify device/samsung/p5att/BoardConfig.mk to clean up a few things:
Comment out:
#BOARD_SDCARD_DEVICE_PRIMARY := /dev/block/mmcblk1p1
#BOARD_SDCARD_DEVICE_SECONDARY := /dev/block/mmcblk0p28
#BOARD_SDEXT_DEVICE := /dev/block/mmcblk1p2
Add above these lines:
BOARD_HAS_SDCARD_INTERNAL := true
Modify device/samsung/p5att/device-proprietary-files.txt:
Comment out all the entries, because they aren't really needed and probably dont work with jellybean. Worry about this later, blah blah.
Modify device/samsung/msm8660-common/common-proprietary-files.txt:
Comment out all the WiFi stuff, that is, like:
# Wi-Fi
# etc/wifi/bcm4330_apsta.bin
#etc/wifi/wl
#etc/wifi/nvram_net.txt
#etc/wifi/wpa_supplicant.conf
#etc/wifi/bcm4330_p2p.bin
#etc/wifi/bcm4330_sta.bin
#etc/wifi/bcm4330_mfg.bin
#etc/wifi/nvram_mfg.txt
To get WiFi working later, you need /system/etc/wifi/* from your honeycomb image. Go save them to /sdcard/wifi or something like that now, so you can just copy them over after CM10 boots
Edit: attached the files
Extract proprietary files from i717 Note CM10 image, since I have no idea where else to get these files, and they work:
from device/samsung/p5att, run ./extract-files.sh <path to an extracted CM10 i717 nightly .zip>
... The path you provide should contain the "system" folder.. IE the root of the extracted nightly zipfile.
I had used the 0831 nightly with luck here.
Get prebuilts:
run vendor/cm/get-prebuilts
Do the build:
from the system directory of your CM10 source tree run:
. build/envsetup.sh && brunch p5att
Go find something or someone to do, this is going to take a while...
You'll end up with a .zip file to flash.
After you flash, you'll need to, manually:
1) Copy back the /system/etc/wifi/* files (wifi firmware/tools, the note ones dont seem to work).
2) Install a Skyrocket ICS AT&T radio if you want cellular data, the honeycomb radio doesn't seem to work with CM10. UCLF6 works for me, although it's slower to acquire LTE than the official samsung HC image... but it works great once it finds a cell, and HSPA comes up pretty fast.
3) Consider doing the stuff below to enable early ADB and add back the second samsung logo, for debugging purposes, if you care...
----
Things you might want to do after the build, start by unzipping the resulting .zip pacakge...
Edit: I attached a the resulting boot.img to this post so you don't have to do all this if you so desire. Bonus: working i957 JB kernel binary for whatever else you might want to do with it..
Remove the assert for platform type if your TWRP recovery, like mine, thinks it's a i717 Note:
Edit META-INF/com/google/android/updater-script, remove the assert lines (first two lines of that file)
Do some handy ramdisk hacks:
First, unpack the boot image. From the root of what you unzipped:
mkdir boot
unpackbootimg -i boot.img -o boot
cd boot
Then Unpack the initial ramdisk:
mkdir rd
cd rd
zcat ../boot.img-ramdisk.gz | cpio -id
Edit init.qcom.usb.rc to enable early adb:
Search for "on property:sys.usb.config=mtp", you'll find: (line 340, for me)
on property:sys.usb.config=mtp
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 04E8
write /sys/class/android_usb/android0/idProduct 6860
write /sys/class/android_usb/android0/f_acm/acm_transports tty
write /sys/class/android_usb/android0/functions mtp,acm
write /sys/class/android_usb/android0/enable 1
setprop sys.usb.state $sys.usb.config
Make this section like:
on property:sys.usb.config=mtp
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 04E8
write /sys/class/android_usb/android0/idProduct 6860
write /sys/class/android_usb/android0/f_acm/acm_transports tty
write /sys/class/android_usb/android0/functions mtp,acm,adb
write /sys/class/android_usb/android0/enable 1
start adbd
setprop sys.usb.state $sys.usb.config
Add the glowing samsung initlogo:
Copy initlogo.rle from the root of a stock ramdisk to the root of this ramdisk
... So you'll get the second samsung logo, so you know the kernel is bootstrapping... if you care.
Turn off ro.secure:
Edit default.prop in the root of the ramdisk and change:
ro.secure=1
to
ro.secure=0
Repack the ramdisk:
find . | cpio -o -H newc | gzip > ../boot.img-ramdisk.gz
(you may want to save the original, if you care)
Make the new boot.img:
cd .. (ie get back to the directory with the files listed in the next line)
rm ../boot.img
mkbootimg --kernel boot.img-zImage --ramdisk boot.img-ramdisk.gz --cmdline "console=ttyHSL0,115200,n8 androidboot.hardware=qcom" --base 48000000 --ramdiskaddr 49400000 --pagesize 2048 -o ../boot.img
Repack the flashable zip:
cd .. (ie get back to where you unzipped the original flashable .zip)
rm -rf boot (remove the extracted boot.img and ramdisk under it, save it somewhere if you care)
(also remove the original .zip from here if you extracted it in the cwd)
zip -r ../somezipname.zip .
Then flash somezipname.zip or whatever you called it..
(Remember you'll need to put the Honeycomb files from /system/etc/wifi into /system/etc/wifi of the running image after you boot if you want wifi
(And flash a Skyrocket ATT radio if you want cellular data!)
WARNING: FOR SAMSUNG SGH-I957 NORTH AMERICAN DEVICES ONLY
GT-SERIES (IE: GT-7320, etc) ARE NOT SUITABLE FOR THIS RELEASE
UPDATE ZIP DOES _NOT_ CHECK YOUR PRODUCT CODE, WILL HAPPILY EAT OTHER DEVICES
THIS IS A TEST RELEASE FOR EXPERIENCED ANDROID HACKERS
SOME FEATURES MAY NOT BE USABLE OR WORK AS INTENDED
BOOTLOOP ISSUE? USE TWRP 2.1.4: https://www.dropbox.com/s/u07zrx808a5ae2z/i957_twrp_recovery.img.tar
Latest Flashable .ZIP, update 7: http://droid.arm.ee/957/cm10_p5att_nrvate_testrelease7.zip
Use TWRP, factory reset and wipe /system if you are coming from another ROM. Don't forget to install google apps http://wiki.cyanogenmod.com/index.php?title=Latest_Version/Google_Apps
Update 2
* h264 hardware decode fixes for youtube HQ and other hardware-decode enabled apps (vidc/yamato firmware update)
* camera fixes from kunals.shah -- thanks!! (camera library in system/lib/hw)
* wifi address fix - get MAC from EFS, no more random address (insert proper path to .nvmac.info in dhd.ko kernel module)
* move /mnt/secure to internal sdcard to fix asec apps (asec folder linked to /sdcard/.asec)
* disable adb on early boot -- fix mtp maybe? (change to init scripts in ramdisk)
* remove a couple of (probably) harmless references to sdcard1 in init scripts
* update vold.fstab with the correct partition for the sdcard (26), not sure if anything even uses that, but...
Update 3
* Kernel Lovins ->
--- Picked up slew of bugfixes from msm8660-common cyanogenmod jellybean kernel tree -- up to and including 09/13/2012 commits.
--- Enabled CONFIG_USB_ANDROID_SAMSUNG_MTP and CONFIG_SPI_QUP kernel options to match SHV-140 ICS samsung kernel config
--- Disabled CONFIG_XVMALLOC and CONFIG_ZRAM kernel options, also to match up to SHV-140 ICS samsung kernel config
--- Now compiled with newest Sourcery cross-compiler
--- Modified dhd.ko (Broadcom WiFi kernel module) -- you can now create file /data/.ranmac if you want your MAC address randomized on each reboot (ignores MAC on EFS partition, random generation expanded to 5 bytes)
* symlink for light sensor (/dev/i2c11 -> /dev/i2c-11) -- Doesn't fix auto brightness, but at least things that access the light sensor via the standard API will get values back now, FWTW.
* RIL stuff from SHV-140S (korean Tab 8.9 LTE) -- An attempt to resolve SIM_NOT_READY error -> Files replaced:
/system/lib/libril-qcril-hook-oem.so
/system/lib/libsecril-client.so
/system/lib/libreference-ril.so
/system/lib/libril.so
/system/lib/libril-qc-qmi-1.so
/system/bin/qmuxd
/system/bin/qmiproxy
/system/bin/netmgrd
* Update /system/etc/wifi stuff -- newer broadcom firmware images, wpa_supplicant.conf with p2p parameters
* Reenable early ADB since it appears MTP issues likely related to lack of CONFIG_USB_ANDROID_SAMSUNG_MTP kernel option -- Maybe someone who uses MTP can tell me whats up now?
Update 4
* Fix A2DP bitrate (48000 -> 44100 in /system/etc/audio_policy.conf)
* More invasive ASEC fix that might actually fix this jellybean nonsense (modified vold to use /data/secure locations, create /data/secure directory tree in init.emmc.rc)
* Revert SHV-140 RIL change, back to Note CM10 RIL libraries
Update 5
* Android 4.1.2 - Complete rebuild from CM10 tree retrieved on October 12th. Includes ASEC hack as in update4.
* SGH-i957 Radio Information Libraries (RIL) from official Telus ICS image - Thanks Dan!
Update 6
* Rebuilt from CM10 source code retrieved Nov 10 2012. ASEC hack applied.
* Update to latest msm8660-common kernel. Kernel unmodified (ie: no overclocking).
Update 7
* Rebuilt from CM10 source code retrieved Dec 20 2012. ASEC hack applied.
* Update to latest msm8660-common kernel. Kernel unmodified (ie: no overclocking).
Fantastic!
Are you saying everything seems to work pretty well except the 4G radio? (No guarantees, at my own risk, etc. etc. I know, I won't blame you)
If so, I'm going to try this right away. I don't have a data plan for my SIM, and haven't used the 4G yet. (Got a free upgrade from the wifi version after some shipping trouble with the vendor.)
The Galaxy Tab has been kind of a letdown when I have JB on my Galaxy Nexus and Kindle Fire both, and the "upgrade" is a bit disappointing since I checked on custom ROMs *before* I ordered, but the AT&T version is further behind.
Thanks for your hard work! I'll let you know what happens.
YellowRex said:
Fantastic!
Are you saying everything seems to work pretty well except the 4G radio? (No guarantees, at my own risk, etc. etc. I know, I won't blame you)
Thanks for your hard work! I'll let you know what happens.
Click to expand...
Click to collapse
I haven't had time to try "everything", but the stuff that I use on a regular basis is mostly functional. There's quirks, but... It's usable!
For example, one thing I just found out.. the Adreno (qualcomm MSM graphics) drivers aren't production-build.. There's no such thing available -- The current drivers available from qualcomm are "early sample" binaries for jellybean bringup testing, which is what this is... So, I've seen the random screen flicker, etc. Remember there are only a few devices with tested jellybean images, and most of them are google devices... And the i957 will probably never see an official JB release.
https://developer.qualcomm.com/mobi...phics-optimization-adreno/tools-and-resources
This release contains an early sample of the user-mode driver binaries for Qualcomm's Adreno 2xx GPU on Google Android 4.1 Jelly Bean. It has been tested with the CAF release M8960AAAAANLGD105210.1 and supports any Adreno 2xx GPU on Android 4.1 Jelly Bean. This release is intended only for developers that work on Jelly Bean bring-up work. It is an early release sample which will be replaced by a new driver binary in the future.
Click to expand...
Click to collapse
I'm sure there's plenty of little quirks you can find if you "twiddle all the knobs and flip all the switches" -- But it's certainly testable, and way closer to the "usable" end of the spectrum than the "barely functions" end.
Cheers!
PRE-ALFA CM10 Build
You did a great job nrvate !!. you inspired me to get ICS/JB on my SGH-i957. I did try your method and seems everything (3G, SMS, GPS, Bluetooth, Camera etc..) works except wifi. I am surprised that Voice calling is also working in this build !!! I will update you once I fix wifi issue. and also provide CWM/TWRP/ODIN flashable build if time permits.
Cheers !!
-KS
Its so exciting to see some real pregress.
Sent from my SAMSUNG-SGH-I957 using xda app-developers app
Ditto. This is really good news. Thanks.
Cheers, y'all!
Only thing I had to do to get wifi working was stuff the original stuff (from honeycomb) in /system/etc/wifi.
first thing I'd do is make sure the dhd module is getting loaded.. dmesg will print your kernel log that'll show problems with loading that module.. also, try rmmod dhd and insmod dhd, see what happens.
If the DHD module doesn't report symbol errors or some nasty like that, make sure it's loading the firmware -- That'll probably leave an error in dmesg also if it's broke.
also check logcat for wifi-related nastiness
If you can find a specific problem post it and I'll try to help reproduce/solve.
Also working on hacking together a build of ICS based on what's been done with JB, but no idea how that's going to turn out yet. It'd be nice to have as a daily until qualcomm releases production-grade adreno graphics drivers (and, the CM9 ICS tree is now "final", might as well build it!)
update: due to needing the "late model" msm8660-common kernel for proper i957 device support, the later qualcomm (JB) graphics drivers are required too.. drat! however, looks like I'll still be able to hack together a build of CM9 based on the current "final" ics branch using the JB kernel and beta qualcomm graphics. got 'er booted, working out the kinks now. I'll start another thread for that when it's done
i wish i knew half as much as you do, keep up the good work!
orlandoxpolice said:
i wish i knew half as much as you do, keep up the good work!
Click to expand...
Click to collapse
Thanks! Learning as I go with half this.. It's just bits, try one way, get dirt.. try another way, get bacon!
Some of this is so touchy.. ie kernel versions vs adreno drivers, blah blah.. seeing what the SHV-140 kernel does.. it boots CM9, now to see if it'll play nice with video decoders. might forget CM9, i <3 jelly beans anyways!
nrvate said:
Thanks! Learning as I go with half this.. It's just bits, try one way, get dirt.. try another way, get bacon!
Some of this is so touchy.. ie kernel versions vs adreno drivers, blah blah.. seeing what the SHV-140 kernel does.. it boots CM9, now to see if it'll play nice with video decoders. might forget CM9, i <3 jelly beans anyways!
Click to expand...
Click to collapse
Solid work/mashery my friend. This indeed great news. I am currently waiting for my zip file to spit out, do a few mods and then give it a flash when I complete those things.
As far as the adreno drivers have you checked the site for them? I recall reading about them on another msm8660 device and perhaps may pertain to this project as well. The screen flicker has a few work arounds based on other devices that may relate to this device as well. Either to get rid of the flicker entirely or at least minimize them. Worth trying (here are a few I have seen work on some devices.. dev options, disable HW overlay, another is adjusting the debug.mdpcomp.maxlayer value in build.prop from 3 to 2, another is to set the min CPU freq to 486mhz).. last but not least, this was posted on cyanogenmod review, and can be cherry picked if not merged already: http://review.cyanogenmod.com/#/c/22782/ and may work. As far as getting LTE to light up in a more prompt manner, it may be worth exploring different modems (I see you are using UCLF6 from the i717 note), there are many others from the i717 leaks (ie. UCLF5, UCLE2/3, etc etc) and also of course any other Skyrocket ICS+ modems, as well as i717m (canadian, rogers modems such as XLA2 (gingerbread but worked on the i717 note in the US) and various others. If you cannot located them I will post links when I have more time. This is a great start, and I will help out when I have time to contribute to this project (I have a few on my plate plus a full time job so sometimes having the time is a difficult venture). In any case, great start and I can see this will progress very well in due time. Congrats and thanks for your contribution to the base of this, as this progresses and we work to manage these small issues, we will have something even solid
Regards,
th3g1z
th3g1z said:
Solid work/mashery my friend. This indeed great news. I am currently waiting for my zip file to spit out, do a few mods and then give it a flash when I complete those things.
As far as the adreno drivers have you checked the site for them? I recall reading about them on another msm8660 device and perhaps may pertain to this project as well. The screen flicker has a few work arounds based on other devices that may relate to this device as well. Either to get rid of the flicker entirely or at least minimize them. Worth trying (here are a few I have seen work on some devices.. dev options, disable HW overlay, another is adjusting the debug.mdpcomp.maxlayer value in build.prop from 3 to 2, another is to set the min CPU freq to 486mhz).. last but not least, this was posted on cyanogenmod review, and can be cherry picked if not merged already: http://review.cyanogenmod.com/#/c/22782/ and may work. As far as getting LTE to light up in a more prompt manner, it may be worth exploring different modems (I see you are using UCLF6 from the i717 note), there are many others from the i717 leaks (ie. UCLF5, UCLE2/3, etc etc) and also of course any other Skyrocket ICS+ modems, as well as i717m (canadian, rogers modems such as XLA2 (gingerbread but worked on the i717 note in the US) and various others. If you cannot located them I will post links when I have more time. This is a great start, and I will help out when I have time to contribute to this project (I have a few on my plate plus a full time job so sometimes having the time is a difficult venture). In any case, great start and I can see this will progress very well in due time. Congrats and thanks for your contribution to the base of this, as this progresses and we work to manage these small issues, we will have something even solid
Regards,
th3g1z
Click to expand...
Click to collapse
Thanks for the input! The flicker, as is, is really minor. It only really seems to happen, for me atleast, in the main launcher window and sometimes when scrolling in maps. It's intermittent, actually. I will have a look at that change you linked, nice catch!
Qualcomm's dev site is linked in post #4, hopefully they will post the final drivers soon. Do they have another site that would receive them faster, or with incremental builds? I really wish OEMs would share engineering builds more openly with the community, but I guess I'm just used to being on an engineering team, lol. I've been spoiled with working for a few of the larger OEMs and getting all the cool toys first...hehe.
I tried a few of the note ICS radios, got nothing at all from them besides errors in logcat -b radio, wouldn't bring up the SIM.
All the skyrocket radios seem to work to varying degrees.
Also, it may be more of the RIL -- The UCLF6 skyrocket modem works very nicely on the stock honeycomb image, insta-LTE and everything.
I have not tried any of the non-ATT radios... wasn't sure how that'd work out. I'll give some of the non-ATT radios a go, why not! Besides Skyrocket or Note, any other similar devices? Only thing I can think of is the SGS II LTE HD (SGH-i757) but not much is available for that device as AT&T punted it for the S III (747) and it never got popular.. If you want the HD screen, you get a S-III, which came out about a month later, which is just why ATT punted it all together.
I hear you on the job. I've got an interview lined up for a better one, too! Man, I'm hoping that works out!
nrvate said:
Thanks for the input! The flicker, as is, is really minor. It only really seems to happen, for me atleast, in the main launcher window and sometimes when scrolling in maps. It's intermittent, actually. I will have a look at that change you linked, nice catch!
Qualcomm's dev site is linked in post #4, hopefully they will post the final drivers soon. Do they have another site that would receive them faster, or with incremental builds? I really wish OEMs would share engineering builds more openly with the community, but I guess I'm just used to being on an engineering team, lol. I've been spoiled with working for a few of the larger OEMs and getting all the cool toys first...hehe.
I tried a few of the note ICS radios, got nothing at all from them besides errors in logcat -b radio, wouldn't bring up the SIM.
All the skyrocket radios seem to work to varying degrees.
Also, it may be more of the RIL -- The UCLF6 skyrocket modem works very nicely on the stock honeycomb image, insta-LTE and everything.
I have not tried any of the non-ATT radios... wasn't sure how that'd work out. I'll give some of the non-ATT radios a go, why not! Besides Skyrocket or Note, any other similar devices? Only thing I can think of is the SGS II LTE HD (SGH-i757) but not much is available for that device as AT&T punted it for the S III (747) and it never got popular.. If you want the HD screen, you get a S-III, which came out about a month later, which is just why ATT punted it all together.
I hear you on the job. I've got an interview lined up for a better one, too! Man, I'm hoping that works out!
Click to expand...
Click to collapse
I hear you on OEM not releasing the drivers in a timely fashion, and it is frustrating when you have sources for it as "leaks" .. pertaining to your question I did see a link to update drivers but in my 5 min search (short on time atm, work early in the morning), I didn't find it yet, but I will look a bit deeper and hopefully can find it. I recall it related to CM10 and addressing said drivers for a particular device or devices. I will see what I can find tomorrow, and hope that it pertains.
No harm in trying a few other modems, I would look at the i717/i717m (m is the canadian model, same device though and the modems from rogers work with the i717 as well as the skyrocket).. and obviously the skyrocket various modems which it seems you have tried at least a few of. They vary so much and your location has a lot to do with it. Some work better in certain areas, and others in other areas as I'm sure you know already. Worst case, even after trying a few you can always go back to UCLF6. I found it a bit odd that the rogers modems worked with ATT but hey I'm not complaining about that one I believe you are correct, however, pertaining to the RIL as being the issue, not so much the modem's themselves. (no telling though without trial/error)
I'm not sure the i747 modems would work or not, but, it will not hurt to try, as you can return to UCLF6 if it is a dead end. the i757 I have yet to even see, so I can't comment on that in particular.
I'd like to chat a bit more when we both have some time, not sure if you get on IRC (freenode network) at all but if you do look me up, same handle as here on XDA. It would be easier to chat that way.
I have more to say but having to be away in about 4 hours, I will have to get back to you. Good luck w/ the interview bud.
Take care, we'll catch up soon.
~th3g1z
th3g1z said:
I hear you on OEM not releasing the drivers in a timely fashion, and it is frustrating when you have sources for it as "leaks" .. pertaining to your question I did see a link to update drivers but in my 5 min search (short on time atm, work early in the morning), I didn't find it yet, but I will look a bit deeper and hopefully can find it. I recall it related to CM10 and addressing said drivers for a particular device or devices. I will see what I can find tomorrow, and hope that it pertains.
No harm in trying a few other modems, I would look at the i717/i717m (m is the canadian model, same device though and the modems from rogers work with the i717 as well as the skyrocket).. and obviously the skyrocket various modems which it seems you have tried at least a few of. They vary so much and your location has a lot to do with it. Some work better in certain areas, and others in other areas as I'm sure you know already. Worst case, even after trying a few you can always go back to UCLF6. I found it a bit odd that the rogers modems worked with ATT but hey I'm not complaining about that one I believe you are correct, however, pertaining to the RIL as being the issue, not so much the modem's themselves. (no telling though without trial/error)
I'm not sure the i747 modems would work or not, but, it will not hurt to try, as you can return to UCLF6 if it is a dead end. the i757 I have yet to even see, so I can't comment on that in particular.
I'd like to chat a bit more when we both have some time, not sure if you get on IRC (freenode network) at all but if you do look me up, same handle as here on XDA. It would be easier to chat that way.
I have more to say but having to be away in about 4 hours, I will have to get back to you. Good luck w/ the interview bud.
Take care, we'll catch up soon.
~th3g1z
Click to expand...
Click to collapse
I'll hit you up on IRC at some point for sure
So I sort of figured it out... Found how to get the radio to play nice, still don't know why... The kernel! Went back to the 3.0.8 kernel as provided by samsung for the SHV-140 (replaced zImage in boot.img, reflashed mmcblk0p8) and BAM. Nice quick 4G. Nothing in /system changed (so a bunch of other stuff broke) but the radio sure got happy.
Not sure what the difference is, quite yet... Should be an interesting needle in the hackstack for sure.
Is the package manager a problem with this the same as cm9?
Sent from my SGH-I727 using xda premium
orlandoxpolice said:
Is the package manager a problem with this the same as cm9?
Click to expand...
Click to collapse
yes, the issue actually originated with jellybean -- since there's no device tree in the cm9 repo for the p5att, i jammed the cm10 p5att device tree into cm9 source to make it happen. the device tree includes the init scripts, so the problem actually originated from cm10, lol.
same fix works.. mount tmpfs on /mnt/secure (in addition to /tmp/asec) and use wide-open (777) permissions.
nrvate said:
same fix works.. mount tmpfs on /mnt/secure (in addition to /tmp/asec) and use wide-open (777) permissions.
Click to expand...
Click to collapse
Heh! Is it just me or does that feel a little less than 'secure'? :silly:
i feel like a english lit major walking into an advanced calculus class with this jargon
This is how the sausage gets made.
Speaking of making sausage, I'm starting to think this is stable enough to share a binary build...
1) Camera is borked. I'm at a bit of a loss to figure it out, maybe I'll try again next week -- Suggestions very welcome, I'd like to get this working for video chat ala skype / gtalk.
2) MTP is borked. Again, at a bit of a loss, I suppose I'd care if I used it... Silly MTP.
3) New kernel fixes radio issues (mostly) - I've had it completely refuse to come up, showing no signal, fixed by rebooting the tablet. Goes right to LTE, but defaults to HSPA only. Change to LTE / GSM / WCDMA in mobile network settings -> network mode.
4) /mnt/asec / /mnt/secure issue (play store install problems) resolved.
5) FC in Settings -> Storage resolved by removing sdcard1 (which will never exist) from the build config
6) Boot animation is disabled due to framebuffer problems (supposedly) -- i know the spinny thing is cool, but you'll have to live with a black screen. Strangely, it comes up on some boots. lol.
7) Qualcomm graphics drivers are still the pre-release version. They seem to work pretty nice though. Haven't seen any of the flickering since some mdp changes in the kernel.
8) Video codecs aren't as screwed up as they are in the ICS build I did -- IE youtube works for all the videos I tried and bsplayer for android nicely plays my favorite x264 720P tv shows (win! gotta keep myself entertained at work some how...)
9) overclocked kernel HACK WARNING for you purists -- Modifed the kernel slightly, it now recognizes all MSM8660's as having the higher binned speed (1.66 vs 1.50 ghz) -- I didn't touch the frequency tables or anything, since it made more sense to just recognize the parts as 1.66ghz parts. Also, removed the logic that limited single-core mode to 1.2ghz (why?!). Gabe put out a OC kernel and most people reported stability at 1.7+ ghz, so... 1.66 seemed good. Hasn't borked for me. If you want stock speeds bad enough or run into problems.. http://d-h.st/8mB
Usual procedure, TWRP.. factory reset, wipe system, flash zip, receive bacon.
Bacon: http://d-h.st/Klu
I've been using this as my daily the past few days, and unless it starts behaving badly for some reason, it's probably going to be my daily for the foreseeable future. Really want to get the cams working, though!
Please share other issues. There has to be something else horribly broken I haven't noticed.
Usual "may make zombies run out of your tablet" warning applies to this test software.
Enjoy!

[KERNEL] TonoKrnl for Nexus 7 (2013)

EDIT: I want to remind everyone DO NOT FILE AN UBUNTU BUG REPORT WITH THIS KERNEL INSTALLED, ALWAYS REVERT BACK TO THE STOCK KERNEL IF YOU HAVE AN ISSUE BEFORE FILING
This is my first actual Kernel project, so please be gentle.
This kernel is ONLY for the Nexus 7 (2013) flo. I do not know if it boots on the deb, theoretically it should as I don't have any flo specific options and there are config options for Deb in the Kernel configuration. It should work for those on stable, rc or rc-proposed and may possibly work on devel (not sure) as long as devel has not released a new kernel package (3.4.0-5-flo+)
I have cherry-picked some battery optimizations from bricked-flo, elementalx-flo (4.4 branch) and some additional commits elsewhere in an attempt to not only improve battery-life but also to bring some Android features (DoubleTap2Wake) to Ubuntu Touch.
Currently it has the following:
- ROW I/O scheduler
- Beginnings of OCing (pulled from ElementalX, I think I'm missing some commits to make this relevant though)
- ElementalX's kernel thermal control
- binfmt_misc support
- CD/DVD Filesystem Support for external optical drives (ISO9660/UDF)
- Some Slimbus enhancements
- Battery life optimizations (changing default MHz, etc.)
- Default CPU governor changed from Performance to Interactive (yes, they had it set to Performance, not sure why.)
- Direct Rendering Interface/Direct Rendering Manager (XFree86 + msm_kgsl_drm)
- and more!
You can check my github for the items cherrypicked into it and there is even a current release which has seen my battery drop 4% in the last 30 minutes with the screen fully on (no autolock), WiFi on and Bluetooth.
The name of the kernel is still up for change, TonoKrnl is not going to be it's final name unless everyone likes it.
Repository is at: http://github.com/ShadowEO/TonoKrnl
Releases can be found: https://github.com/ShadowEO/TonoKrnl/releases
Status of Github Repo: It builds. It boots and it runs. I am trying my hardest not to push changes that break building.
Reserved for future use. Currently the status of the kernel's updates can be found on the issue tracker: https://github.com/ShadowEO/TonoKrnl/issues/5
Be patient, if you don't see new releases right away, it's because I'm still in the process of generating them, check back later.
-- Release 1.0.3-UBports (11/19/2017): A lot was done to bring this kernel back into usable state, see below:
Added OTG Charging
Added initscripts for turning on features (Requires the rootfs to be mounted read/write for manual installation, see my latest post #16 I think...)
Created patches to be applied against a clean UBports kernel tree for certain features (right now, only DT2W and USB Charging)
(USB Host Charging was pulled from flar2's ElementalX source code, it is not turned on by default and can be turned on with
Code:
echo 1 > /sys/module/msm_otg/parameters/usbhost_charge_mode
Feature is tested and does work.
Developers:
1.0.3 brought the kernel tree back into a buildable state and also cleaned up some problems with the previous releases. I am in the process of generating a kernel patchset which will be able to be applied to a clean kernel to bring those features to the stock UBports kernel source. After I complete generating the kernel patchset, I will be rebasing the entire kernel project onto a clean tree (As I am absolutely certain that I have problems like unfinished cherry-picks [missing commits] etc.). Be patient regarding these patches, as I am re-adding the features I pulled in originally by hand rather than cherry-picking them as I appear to have fuxxed up somewhere cherry-picking previously.
If you have any random reboots, try:
Code:
echo 1 >/sys/module/msm_watchdog/parameters/runtime_disable
If you still receive random reboots afterwards or if you received them previously but the above command fixes them, please open an issue on my project tracker with a copy of /proc/last_kmsg attached.
Kernel TODO:
Generate kernel patchset and then rebase onto clean kernel tree
Finish Kernel Feature Documentation and publish (these docs will give information on tweaking the changes to the kernel, such as readahead buffer, turning on/off DT2W, turning on/off usbhost charging, etc.)
Move TonoKrnl initscripts into ramdisk, should make them more robust and reliable.
Create ZIP installer for TWRP recoveries (this is needed for automatic installation of kernel modules, since /lib/modules is a read-only, bound mountpoint for the Android LXC container. To fix this, we just have to move /lib/modules out of the Android container.
Allow me two questions:
Which kernel repository is this branched off? Apologies if that is dumb question, my git and kernel knowledge is cursory at best, but I can't seem to figure this out looking through your github repo.
ShadowEO said:
- Direct Rendering Interface/Direct Rendering Manager (XFree86 + msm_kgsl_drm)
Click to expand...
Click to collapse
What's the intention behind this? Does this have anything to do with enabling the freedreno driver for the GPU and would that pave a way to a setup without Mir, but with wayland or X?
doniks said:
Allow me two questions:
Which kernel repository is this branched off? Apologies if that is dumb question, my git and kernel knowledge is cursory at best, but I can't seem to figure this out looking through your github repo.
What's the intention behind this? Does this have anything to do with enabling the freedreno driver for the GPU and would that pave a way to a setup without Mir, but with wayland or X?
Click to expand...
Click to collapse
This started off with the debian source package for linux-image-flo in the Ubuntu archives which is the kernel for our device. The reason you are having trouble with figuring it out is because I started with the base (Ubuntu's 3.4.0-5-flo+), pulled it into an empty git repo and then started cherry-picking features. It was originally going to be for my own personal consumption as I didn't know how well a custom kernel would be received by the touch community (so far, in all the communities I've posted it, you were the only one to ask any questions ), but since I already had a git repo up, figured that I may as well share it. So here I am, an amateur working on the Linux kernel, and learning a lot.
My full intent was to improve the experience (even marginally) on Ubuntu Touch for the Nexus 7 2013, I wanted to bring the mobile kernel features previously found on the desktop that myself or others may find useful (hence binfmt support for qemu-user), there really is no reason for me to turn on DRI/DRM except to allow playing with Wayland and X, yes, that part is correct, and I have tested the freedreno driver with it (Freedreno does get the KGSL DRI device and does start X)
In addition I found some interesting choices in the kernel in terms of battery life, it would seem that the CPU governor used by the default Ubuntu Kernel is Performance, which would explain why the battery dies so fast, I tried to pull in some battery optimizations from a couple other kernels around the Android scene for the device. So far I'm pleased with the results, and recently found that both the original cherry-picking done for DT2W worked along with the code to add fast charging.
I've had to put the project on hold due to work issues, but once I'm able to work on it again, I'm reverting the last 100 changes pulled in that broke my tree and going from there since my original targets in terms of features actually worked. (I'm pretty sure it was some recent changes to the CPU hotplug driver that killed it, I can no longer compile the kernel without mpdecision on, so that's my likely suspect.)
Thanks for your explanations!
ShadowEO said:
This started off with the debian source package for linux-image-flo in the Ubuntu archives which is the kernel for our device.
Click to expand...
Click to collapse
So something like apt source linux-image-flo? And then to build you use the instructions in the package also?
there really is no reason for me to turn on DRI/DRM except to allow playing with Wayland and X, yes, that part is correct, and I have tested the freedreno driver with it (Freedreno does get the KGSL DRI device and does start X)
Click to expand...
Click to collapse
Exciting!
In addition I found some interesting choices in the kernel in terms of battery life, it would seem that the CPU governor used by the default Ubuntu Kernel is Performance, which would explain why the battery dies so fast
Click to expand...
Click to collapse
I'm really only speculating, but my conjecture to previous mentions of odd govenor choices in android kernels was that the actual android power management magic is happening behind the backs of the governors. But, I'm really just babbling. I don't know much of anything about this. You seem to be getting impressive improvements!
I'm reverting the last 100 changes pulled in that broke my tree and going from there since my original targets in terms of features actually worked.
Click to expand...
Click to collapse
So, that means: "If you want to try it now, don't use v1.0.2, but use v1.0.2-alpha for now." Is that about correct?
doniks said:
Thanks for your explanations!
So something like apt source linux-image-flo? And then to build you use the instructions in the package also?
there really is no reason for me to turn on DRI/DRM except to allow playing with Wayland and X, yes, that part is correct, and I have tested the freedreno driver with it (Freedreno does get the KGSL DRI device and does start X) Exciting!
In addition I found some interesting choices in the kernel in terms of battery life, it would seem that the CPU governor used by the default Ubuntu Kernel is Performance, which would explain why the battery dies so fast
I'm really only speculating, but my conjecture to previous mentions of odd govenor choices in android kernels was that the actual android power management magic is happening behind the backs of the governors. But, I'm really just babbling. I don't know much of anything about this. You seem to be getting impressive improvements!
I'm reverting the last 100 changes pulled in that broke my tree and going from there since my original targets in terms of features actually worked. So, that means: "If you want to try it now, don't use v1.0.2, but use v1.0.2-alpha for now." Is that about correct?
Click to expand...
Click to collapse
I removed the problem download, the only ones available are the source tree downloads and the last known good build I had, I have also tested to ensure that the last build up there works as well as it's the one I'm running on my device until I have time to go through the tree again.
As for building, essentially yes, but you have to build the image separately. Due to how Ubuntu currently has the filesystem set up and with Android's boot images, its not feasible to really package it in a traditional sense. Essentially what I did was create a chroot, apt-get source linux-image-flo and then to get a working defconfig I used the config.* files found in Debian.flo and Debian.master, from there was the tree that I used as my base.
Then run make with the following to customize:
Code:
ARCH=arm make menuconfig
ARCH=arm make -j <number of processors>
To build the image, you'll need to grab the boot image from your device and tear it apart using a abootimg them rebuild it with the Ubuntu ramdisk. If you are using MultiROM, you can just drop it in the folder for your ROM.
Edit: As for the weird choice of governors, I noticed during my investigations (via the cpufreq-info package) that while Android is managing the CPUs that are online (I found it's running it's own version of mpdecision behind the scenes inside the LXC container), it's not doing anything to the CPU governor. That's all managed in the kernel right now through CPUFreq it appears and in the stock kernel it's set to performance, as for the reason for it, I'm not sure myself.. The other governors ARE there though, just unused right now.
ShadowEO said:
This kernel is ONLY for the Nexus 7 (2013) flo. I do not know if it boots on the deb, theoretically it should as I don't have any flo specific options and there are config options for Deb in the Kernel configuration.
Click to expand...
Click to collapse
Jup, it does boot on my deb! I've downloaded the .img, put the tablet in bootloader mode and did
fastboot boot TonoKrnl-1.0.2-flo.img
It booted without problems, and so far it's running for about half an hour or so without any problems. Wifi, sound, video, usb mouse, all work fine.
doniks said:
Jup, it does boot on my deb! I've downloaded the .img, put the tablet in bootloader mode and did
fastboot boot TonoKrnl-1.0.2-flo.img
It booted without problems, and so far it's running for about half an hour or so without any problems. Wifi, sound, video, usb mouse, all work fine.
Click to expand...
Click to collapse
Wow, that's great to hear, I wasn't sure but I was definitely curious since I had seen options for both Deb and Flo in the makeconfig page.
If you can script it in (or edit sysfs.conf) to have it write a 1 to /sys/android_touch/doubletap2wake while it's booting, you can have working DT2W and there's quite some others to mess around with under /sys :3 CPU governors are somewhere there too, just don't have it offhand.
Since you are testing it out, have you noticed any changes in the device's normal battery life? The stock kernel seems to drain 1% every 1 1/2 minutes on my Flo, not doubting that the power optimizations ARE working (I know I'm getting much better life), I'm just wanting to ensure that it's not a placebo effect that I'm experiencing.
ShadowEO said:
If you can script it in (or edit sysfs.conf) to have it write a 1 to /sys/android_touch/doubletap2wake while it's booting, you can have working DT2W
Click to expand...
Click to collapse
After
Code:
echo 1 | sudo tee /sys/android_touch/doubletap2wake
I can indeed (sometimes) wake it with double tapping. I have since quite a while (with the standard kernel) the situation that its really hard to wake up. I have to press the powerbutton many many times. Feels like it is sleeping really deeply.
Since you are testing it out, have you noticed any changes in the device's normal battery life? The stock kernel seems to drain 1% every 1 1/2 minutes on my Flo, not doubting that the power optimizations ARE working (I know I'm getting much better life), I'm just wanting to ensure that it's not a placebo effect that I'm experiencing.
Click to expand...
Click to collapse
Well, I haven't noticed anything. I might just not be in the best position to judge. I rarely have it unplugged for more than a couple of hours at a time and I don't generally monitor the battery status closely. That being said though, I have very definitely never experienced anything remotely close to 1% per 1.5 min!
If you have a particular test/measurement you'd like to see - let me know.
doniks said:
After
Code:
echo 1 | sudo tee /sys/android_touch/doubletap2wake
I can indeed (sometimes) wake it with double tapping. I have since quite a while (with the standard kernel) the situation that its really hard to wake up. I have to press the powerbutton many many times. Feels like it is sleeping really deeply.
Well, I haven't noticed anything. I might just not be in the best position to judge. I rarely have it unplugged for more than a couple of hours at a time and I don't generally monitor the battery status closely. That being said though, I have very definitely never experienced anything remotely close to 1% per 1.5 min!
If you have a particular test/measurement you'd like to see - let me know.
Click to expand...
Click to collapse
I may be exaggerating slightly, but normally my tablet goes from 100% to 95% in about 5 minutes while I'm using it after taking it off the charger (in Ubuntu only, may be an rc-proposed thing too). I haven't seen that behavior since changing kernels. I'm gonna see if I can go ahead and start reverting commits today or possibly reset back to the last known good commit.
As for the screen problems, I think there is a bug in the current doubletap2wake driver, if you look at dmesg after using DT2W for a while, you'll see it being spammed with error messages from the touchscreen driver.
That could possibly be related. Additionally, I think the minimum processor speed defaulted to 384MHz (I didn't touch any processor clock speeds in here) which the Performance governor would never had let the processor hit. So it's likely that the minimum processor speed will need bumped up at least one step there, I get some stuttery behavior on the command line when the screen is off which I hadn't received on the stock kernel.
Edit (07/01/16): I'm not sure what else I can really bring to the table here, mpdecision running in the android LXC container defeats any meaningful changes to the clock speed. I also noticed mention that you shouldn't have two hotplugging daemons running at the same time, effectively that is what the new developments would've brought in. I think my best option to continue this would be to wait until the Xenial transition and see if they make any changes for me to update on.
I'm also quite a novice, so besides cherry picking commits, I'm not sure what else I can do.
ShadowEO, is bluetooth working on your device? With your kernel or with the one from Canonical?
I can't seem to get anything at all to show up on my deb.
I am so embarrassed that I didn't check this thread in so long. Ya, Bluetooth still works on my device with either kernel. Sometimes it doesn't seem to like to power on, so if you are having trouble, try this.
Open Terminal,
do sudo bluetoothctl and see if Nexus 7 (2013) shows up in there. If it does, type power on and hit enter. You should see the bluetooth indicator show up in the status bar. If it doesn't, exit bluetoothctl and do these from a root prompt:
start bluetooth-touch
start bluetooth-touch-flo
Sometimes the commands may take a little bit of time (no idea why honestly), but after those, you should see bluetooth start. At that point, if you still don't, fully power the device down and try again.
For whatever reason, the bluetooth scripts fail every so often, haven't been able to look into it much due to personal things IRL taking up all my time the last few months.
It's been a long while since I touched this project, but I have finally cleaned up the kernel source tree and ensured that it builds properly!
Two features that must remain disabled however are GOVERNOR_ELEMENTALX and MSM_SLEEPER as they are currently broken and do not function as of right now. The defconfig for flo also has sane defaults for the UBports Ubuntu Touch distribution (installable via the UBports installer application) and has DT2W enabled (but not turned on, that requires some extra work) by default.
You should also no longer need to disable the MSM watchdog using the instructions in the OP, running the kernel now and haven't experienced near as many random reboots I used to with the previous version! (I wonder if that was a UTouch problem, because I DO get random reboots sometimes using certain apps, but they're very rare... Then again, I'm not sure if UBports made any initramfs changes for the Flo when they added it to their system-image server, which they may have, since it's in the ubports-touch/15.04 distribution instead of their ubuntu-touch mirror for older, no-longer supported devices)
To turn on DT2W, you must follow the instructions on the github page for the 1.0.2 release.
NOTE: I highly recommend building the kernel from source rather than downloading a release! I have yet to add the current stable release to the github releases page! I also have a zip file with some helper scripts and configuration that can be installed into the UBports rootfs to turn DT2W and Kernel Samepage Merging on at startup. In case that's useful, I'm adding the zip to this post. To install, simply remount your root as read/write, extract the ZIP to / and then "chmod +x /sbin/tonokrnl-init" and reboot. Upon reaching the lightdm greeter, you should be able to shut the screen off, then double tap it to wake.
The files contained in the zip are:
/sbin/tonokrnl-init - Helper Script to start DT2W and KSM
/etc/sudoers/tonokrnl - Allows the user-session upstart config to run the helper script, which requires root.
/home/phablet/.config/upstart/tonokrnl.conf - Upstart configuration to run /sbin/tonokrnl-init using sudo (requires the sudoers file)
Off-topic slightly: The reason this project got set aside, was due to my IRL work, and because I had stopped using Ubuntu Touch and was testing out other ways of getting Linux onto the N7 'flo'. I messed with the Sailfish distribution found in the Nexus 7 2013 forum, then went to postmarketOS and messed with that (it's cool, but rather bare, not enough desktop packages to make it useful [no osk, etc]), then attempted to boot a debian distribution with the Linaro mainline kernel from John Stultz (couldn't even get X11 to start, the system did boot though! Perhaps mesa/libdrm needed recompiling with freedreno support...) and then finally came back to Ubuntu Touch via UBports!
Back on Topic, if you decide to use this kernel (either by building it yourself, or using the new UBports-1.0.3 release that will go up soon!) and install the attached helper scripts (or even find your own solution to on-boot DT2W, KSM, and the Interactive governor) please let me know your experiences! I noticed after turning KSM on that the web browser didn't crash as much, but I'm not sure if it's a placebo effect or not.
(I wonder if @flar2 has a 3.4.0 patchset I can apply rather than attempting to cherry-pick ElementalX into the kernel... That would be amazing to have ElementalX's additions to the kernel under Ubuntu Touch. [Please don't be angry I used a mention flar, I just wanted to ask if you had a patchset for the flo's kernel [version 3.4.0])

[KERNEL][OREO] [SM-T830/T835] [2019-11-21] Modesty 1.0.0 [Linux 4.4.202] [ARK4]

Modesty - a modest custom kernel for the Samsung Tab S4
Modesty aims to provide a mildly appealing and reasonable alternative to the stock 4.4.78 kernel that comes with The Tab S4. In its pursuit of being both mildly appealing and reasonable, it will eschew features that could compromise device stability, whilst gleefully embracing low-risk, self-contained enhancements. In other words, your lowest expectation should be that this kernel will be at least as stable as the stock kernel.
Since there are currently no other custom kernel projects supporting the Tab S4, there isn't really any previous device-specific work to build on. Development of this kernel is therefore likely to be slow and steady.
"Why is this kernel called Modesty? That's crap! Why not Wolverine, Intrepid or Jupiter?"
Because it's just a operating-system kernel, not a turbo-charged supercar or a mission into outer space. Even as operating-system kernels go, this one is pretty dull. Besides, I'm a weary curmudgeon in his fifties, not a teenager.
This project has the modest aim of modestly enhancing the pleasure you derive from your Tab S4 and is therefore modestly named Modesty.
Key characteristics
Supports both the wi-fi only (T830) and wi-fi/LTE (T835) models.
Forked from Samsung's pristine kernel source code (Linux 4.4.78 for ARGH firmware at time of launch).
Regular merging of the upstream Linux kernel's linux-4.4.y branch (4.4.161 at time of public launch).
Regular merging of Samsung's updates to its modified kernel source as they are made available.
Includes @savoca's KCAL advanced colour/gamma control driver.
Includes @flar2's sound control driver to manage headphone and microphone gain.
Disables a huge amount of tracing and logging features inexplicably left enabled by Samsung in the stock release kernel. These debugging features have no place outside engineering builds.
Packed into a boot.img (boot image) taken directly from Samsung's latest stock firmware and kept as close to the original as possible. No obscure boot-time kernel configuration is stashed away here, and no changes are made to any other part of the file system at either install time or run time.
Provides a fully automated installer, with the option of interactive installation to allow manual selection of features and the ability to automatically root the device with Magisk in the post-installation phase.
Includes WireGuard VPN support (version 0.0.20180818 at the time of public launch), which will be updated as available.
Includes @Lord Boeffla's generic kernel wakelock blocker. The conservative default block-list is: qcom_rx_wakelock and NETLINK.
Utilises Westwood+ TCP congestion algorithm by default.
Includes Veno TCP congestion algorithm.
SELinux operates in enforcing mode and cannot be dynamically switched to permissive mode.
FAQ
Q. Is this kernel still actively developed?
A. No. The final ianmacd release was v1.0.0 on 21st November 2019 and no-one else has picked up maintenance of the project.​
Q. Will this kernel also run on Android 9.0 (Pie) devices?
A. No. Modesty targets Android 8.1 (Oreo) and there was never an intention to update it for 9.0 (Pie).​
Q. Can I overclock or underclock the CPU using this kernel?
A. No.​
Q. How does interactive installation mode work?
A. If the ZIP file name contains the string _interactive or a dot-file called .modesty_interactive is present in the root of the external SD card, interactive installation mode is triggered. Please note that this mode overrides any selections implied by the archive name or the presence of dot-files on the file-system.
In interactive mode, you will be asked whether to root the device afterwards with Magisk. Selections are made using the Volume buttons. Just follow the on-screen prompts.​
Q. Can I safely block wakelock X?
A. Perhaps. However, unless you know what a particular wakelock does and are certain that it is causing an actual problem on your device, I suggest you leave it alone.​
Q. Why is this kernel labelled beta? Is it safe to use? And who are you, anyway? Can you be trusted?
A. My T830 has been running this kernel every day since I first rooted it, and I can therefore personally vouch for its stability on this model.
A couple of users have reported Modesty running well on the T835. Initially, it was reported that the kernel did not boot on this model, but after trying several test kernels, the user in question discovered that his machine had a non-standard firmware installation. Once this situation was remedied, Modesty booted and worked as designed.
As the person who built the kernel, I know exactly what's in it, and therefore the only risk I'm exposing myself to when I run it is that of my own incompetence. That's not true for you, however, and you should exercise due caution and at least pause for a moment to consider what you are installing, and the far-reaching powers you are about to grant this unaudited code over your device. Although I link to the source code below, you have only my word for it that this bears any resemblance to the kernel actually provided in the installer.
There are likely to be many iterations of this kernel before it sees a 1.0 release. Features may be added or removed along the way, although there is no clear roadmap at this point in time. Development will go where the needs of the users take it.
Please see the Installation section below for an important note regarding the use of this kernel in combination with stock (i.e. unmodified) Samsung firmware.​
Q. Can I safely root this kernel?
A. Of course. What use would it be if you couldn't? I recommend Magisk for the task. It has a few minor issues, but as a project is very much alive, something that cannot be said about its peers. Magisk has arguably now established itself as the de facto root solution for Android devices.
It just so happens that I also produce my own builds of Magisk, which you are welcome to use. These are release builds (as opposed to debugging builds), produced from my own fork of @topjohnwu's original source, often augmented with patches. You can use anyone's builds, though.
Again, these builds work for me on various Samsung devices, but they are unofficial and you should approach them with fitting caution.​
Q. Can I install Magisk at the same time as Modesty?
A. Yes. The Modesty installer allows you to automatically root your device with Magisk following installation of Modesty..
To make use of this facility, either rename the Modesty zip file to contain the string _magisk or create a file called .modesty_magisk in either the root of your external SD card or in the standard Download directory of the internal SD card. Alternatively, you can utilise interactive installation mode. See above for details.
If any of these trigger conditions is met, the installer will look in the standard internal Download directory as well as in ./Magisk (if present) on the external SD card (if present) for a suitable Magisk zip file to install. Preference is given to versioned files matching the glob Magisk-v*, in which case the latest according to lexical sort order will be used. If none is found, the installer then looks for unversioned release builds (e.g. official Canary channel release builds) called magisk-release.zip in the same locations, selecting the one with the most recent timestamp. If none is found, the installer will then try to find unversioned debug builds (e.g. official Canary channel debug builds) called magisk-debug.zip, again picking the one with the most recent timestamp. Finally, the installer falls back to looking for the most recent file called Magisk.zip or magisk.zip. If still no files have been found by this stage, chaining of Magisk is abandoned.
For example:
Code:
star2lte:/ $ ls -l /storage/0000-0000/.modesty_magisk
-rwxrwx--x 1 root sdcard_rw 0 2018-09-15 14:31 /storage/0000-0000/.modesty_magisk
star2lte:/ $ ls /storage/0000-0000/Magisk/Magisk-* | tail -n 3
/storage/0000-0000/Magisk/Magisk-v17.2-2018091001-ianmacd.zip
/storage/0000-0000/Magisk/Magisk-v17.2-2018091201-ianmacd.zip
/storage/0000-0000/Magisk/Magisk-v17.2-2018091501-ianmacd.zip
When you flash the Modesty archive in TWRP, the most recent version of Magisk that could be found will now be used to automatically root your kernel, i.e. Magisk-v17.2-2018091501-ianmacd.zip in this example.​
Q. Why doesn't Modesty have its own Telegram group?
A. Because my experience of Android-themed Telegram groups is that they invariably degenerate into seething cesspits of rudeness, ignorance, superstition and — on a good day — pseudo-science. I don't wish to police such a den of iniquity. Of course, it's a free world (or so I still like to kid myself), so you are at liberty to create your own Telegram group for Modesty if you wish. Just please don't invite me to it.​
Building
Building the kernel from source is beyond the scope of this document. If you want to build this kernel from scratch, for example to change its configuration, start with this handy reference tailored to building kernels for Android.
Download
See posting #2 in this thread for links to the latest and all previous versions.
Known Issues
Bluetooth HID (input) devices do not work.
Versions 0.99.11 to 0.99.22 contained a bug that caused Bluetooth HID (input) devices, such as mice, keyboards and gamepads, not to function. They could be paired with the tablet, but their input was not recognised. This bug was finally traced and fixed in 0.99.23.​
Installation
Make a back-up of your existing boot partition using the custom recovery environment provided by TWRP. If your device doesn't yet have TWRP, you will need to install it first. Then, use it to flash the Modesty ZIP file. The boot image will automatically be installed in the boot partition of your device.
If your device has unmodified Samsung firmware, you will encounter problems with Bluetooth (namely delayed initialisation and forgotten pairings) after installing this or any other custom kernel. To remedy this, you will need to patch your system with modified libsecure_storage.so libraries. Some custom kernel installers actually install these without telling you, overwriting your system libraries and transparently circumventing the problem before you can run into it. This approach necessarily modifies your device's file-system, however, and that may not be what you want. At the very least, the user should be made aware what is happening to his device.
For this reason, I have instead prepared a companion Magisk module that achieves the same goal without modifying the file-system. This will allow you to run a custom kernel (not just this one, but any custom kernel) on pristine stock firmware without any Bluetooth issues. The module can be found in the official Magisk module repository, accessible from Magisk Manager on your tablet. If you install this Magisk module, you may wish to also disable the secure_storage_daemon by editing /system/etc/init/secure_storage_daemon.rc (change start to stop), as it no longer serves a purpose.
In a similar vein, you may encounter authentication errors when connecting to wireless networks after installing this or any other custom kernel. This problem is not serious and easily remedied by re-entering your passphrase for the networks you use.
Finally, if SecurityLogAgent notifies you that unauthorised actions have been detected, do not be alarmed. This is a normal consequence of having installed a custom kernel. You may wish to disable SecurityLogAgent to avoid being repeatedly notified..
Whilst the above issues are the only ones you can expect to encounter when running this kernel vs. the stock Samsung kernel, they may sound like more trouble than they're worth. In that case, you might be happier just sticking to Samsung's stock kernel. The company supplies a perfectly good kernel straight from the factory.
Configuration
You are encouraged to use either @morogoku's excellent MTweaks (a modified version of Kernel Aduitor) or @flar2's EX Kernel Manager to manage the features provided by this kernel.
Source code
Modesty's GitHub repository.
References
A useful guide to CPU governors, I/O schedulers (and more).
For more information on the some of the individual schedulers included in this kernel, you can also look under Documentation/block in the kernel source.
The WireGuard user guide, control app, home page and source code.
Credits
Thank you to everyone in the Linux kernel universe for getting us this far. Within the Android development community, I am grateful to the following people for their time-saving contributions:
@osm0sis for Android Image Kitchen, which has saved me a huge amount of work in packing and unpacking boot images.
An honorary mention must go to @Chainfire, the extent of whose benefaction to the Android community is still not fully understood or appreciated in some quarters.
Change log
v1.0.0 (final ianmacd release) (2019-11-21)
Kernel proclaimed stable. Version number incremented. No code changes since v0.99.49.
v0.99.49 (2019-11-16)
Updated to Linux 4.4.202.
v0.99.48 (2019-11-13)
Updated to Linux 4.4.201.
v0.99.47 (2019-11-11)
Updated to Linux 4.4.200.
v0.99.46 (2019-11-06)
Updated to Linux 4.4.199.
v0.99.45 (2019-10-31)
Updated to Linux 4.4.198.
v0.99.44 (2019-10-19)
Updated to Linux 4.4.197.
v0.99.43 (2019-10-08)
Updated to Linux 4.4.196.
v0.99.42 (2019-10-07)
Updated to Linux 4.4.195.
v0.99.41 (2019-09-22)
Updated to Linux 4.4.194.
v0.99.40 (2019-09-16)
Updated to Linux 4.4.193.
v0.99.39 (2019-09-11)
Updated to Linux 4.4.192.
Fixes unavailability of external SD card in Modesty 0.99.38.
v0.99.38 (2019-09-08) Release withdrawn (External SD card unavailable)
Updated to Linux 4.4.191.
v0.99.37 (2019-08-26)
Updated to Linux 4.4.190.
v0.99.36 (2019-08-12)
Updated to Linux 4.4.189.
v0.99.35 (2019-08-07)
Updated to Linux 4.4.188.
v0.99.34 (2019-08-05)
Updated to Linux 4.4.187.
v0.99.33 (2019-07-23)
Updated to Linux 4.4.186.
v0.99.32 (2019-07-12)
Updated to Linux 4.4.185.
v0.99.31 (2019-06-28)
Updated to Linux 4.4.184.
v0.99.30 (2019-06-22)
Updated to Linux 4.4.183.
v0.99.29 (2019-06-18)
Updated to Linux 4.4.182.
v0.99.28 (2019-06-12)
Updated to Linux 4.4.181.
v0.99.27 (2019-05-17)
Updated to Linux 4.4.180.
v0.99.26 (2019-04-28)
Updated to Linux 4.4.179.
v0.99.25 (2019-04-07)
Updated to Linux 4.4.178.
v0.99.24 (2019-03-26)
Updated to Linux 4.4.177.
Build only the latest revision of the DTB.
v0.99.23 (2019-03-02)
Fixed bug, introduced in v0.99.11, that caused input from Bluetooth HID devices, such as keyboards, mice and gamepads to be ignored.
v0.99.22 (2019-02-23)
Updated to Linux 4.4.176.
v0.99.21 (2019-02-20)
Updated to Linux 4.4.175.
v0.99.20 (2019-02-11)
Updated to Linux 4.4.174.
v0.99.19 (2019-02-08)
Updated to Linux 4.4.173.
v0.99.18 (2019-01-26)
Updated to Linux 4.4.172.
v0.99.17 (2019-01-17)
Updated to Linux 4.4.171.
v0.99.16 (2019-01-13)
Updated to Linux 4.4.170.
v0.99.15 (2018-12-30)
Rebased on ARK4 kernel source code and boot images.
v0.99.14 (2018-12-23)
Updated to Linux 4.4.169.
Merged four more UPSTREAM commits from android-4.4 kernel branch.
v0.99.13 (2018-12-13)
Updated to Linux 4.4.167.
Merged selected BACKPORT and UPSTREAM commits from android-4.4 kernel branch.
v0.99.12 (2018-12-05)
Updated to Linux 4.4.166.
Realtek USB Ethernet driver upgraded from v2.08.0 to v2.10.00.
v0.99.11 (2018-11-29)
Updated to Linux 4.4.165.
KCAL advanced colour/gamma control driver optimisation.
Added @flar2's sound control driver for controlling headphone and microphone gain. (Configure with MTweaks or EX Kernel Manager).
v0.99.10 (2018-11-21)
Updated to Linux 4.4.164.
Added KCAL advanced colour/gamma control driver. (Configure with MTweaks or EX Kernel Manager).
Lots of tracing and debug logging disabled, further reducing kernel size.
CONFIG_DISPLAY_USE_INFO
CONFIG_SEC_DISPLAYPORT_LOGGER
CONFIG_FB_MSM_MDSS_XLOG_DEBUG
CONFIG_SEC_FILE_LEAK_DEBUG
CONFIG_SEC_DEBUG_USER
CONFIG_SEC_DEBUG_SUMMARY
CONFIG_SCSI_UFSHCD_CMD_LOGGING
CONFIG_MSM_SMEM_LOGGING
CONFIG_PROFILING
CONFIG_DEBUG_INFO
CONFIG_SCHED_DEBUG
CONFIG_SEC_PM_DEBUG
CONFIG_CORESIGHT
Built as monolithic kernel (i.e. without CONFIG_MODULES).
Built as relocatable code (CONFIG_RELOCATABLE_KERNEL).
Assembler symbols stripped (CONFIG_STRIP_ASM_SYMS set).
Embedded kernel config (reported via /proc/config.gz) now falsely reports stock settings to allow disabling of superfluous kernel features that otherwise cause grave Android System warning on boot.
v0.99.9 (2018-11-13)
Rebased on ARJ3 kernel source code and boot images.
v0.99.8 (2018-11-10)
Updated to Linux 4.4.163.
More than 100 fixes applied from upstream AOSP android-4.4 and android 4.4-o branches.
Lots of tracing and debug logging disabled:
CONFIG_IPC_LOGGING (debug logging for IPC drivers)
CONFIG_QCOM_RTB (register tracing)
CONFIG_TRACER_PKT (for tracing IPC protocols)
CONFIG_FTRACE (kernel tracing infrastructure)
CONFIG_CPU_FREQ_SWITCH_PROFILER (CPU frequency switch profiler)
CONFIG_TRACING_EVENTS_GPIO (traces GPIO subsystem)
Fixes to allow kernel to build when above logging and tracing options are disabled.
v0.99.7 (2018-10-30)
Rebased on ARH5 kernel source code.
Reworked the v4l2 fix that restores liboemcrypto-dependent apps to working state.
v0.99.6 (2018-10-28)
v4l2 fixes to restore liboemcrypto-dependent apps to working state.
v0.99.5 (2018-10-21)
Updated to Linux 4.4.162.
v0.99.4 (2018-10-19)
Initial public release, based on Linux 4.4.161.
v0.99.3
Internal build, based on Linux 4.4.160.
v0.99.2
Internal build, based on Linux 4.4.159.
v0.99.1
Initial internal build, based on Linux 4.4.78.
It begins! Awesome to finally see a custom kernel for the Tab S4.
I want to test for you once I can get root back
ianmacd said:
Change log
v0.99.4 (2018-10-19)
Initial public release, based on Linux 4.4.161. Caution: This kernel remains completely untested on the T835.
v0.99.3
Internal build, based on Linux 4.4.160.
v0.99.2
Internal build, based on Linux 4.4.159.
v0.99.1
Initial internal build, based on Linux 4.4.78.
Click to expand...
Click to collapse
Flashed on T835 device doesnt even get past the Boot (custom device) screen is there a way to get logs without using a computer?
Sent from my Samsung SM-G950F using XDA Labs
dr460nf1r3 said:
Flashed on T835 device doesnt even get past the Boot (custom device) screen is there a way to get logs without using a computer?
Click to expand...
Click to collapse
I'll look into it this evening. I'm just about to get off a plane.
Were there any errors when installing? Was your device properly detected as a T835?
Sent from my SM-G965F using XDA Labs
ianmacd said:
I'll look into it this evening. I'm just about to get off a plane.
Were there any errors when installing? Was your device properly detected as a T835?
Click to expand...
Click to collapse
Installing just fine, correctly detected as well.
Sent from my Samsung SM-G950F using XDA Labs
dr460nf1r3 said:
Installing just fine, correctly detected as well.
Click to expand...
Click to collapse
I've gone through the ramdisk of the T835's boot image with a fine-tooth comb and can find nothing untoward. I also verified that I properly removed the dm-verity flag from the T835's device tree.
There are actually very few source code differences between the T830 and T835. Both can be built from a single tree. The only differences lie in the kernel config file and the device tree, but I am building with the default T835 configuration, and with the proper device tree for that device.
Let's try at least ruling out my installer code. Please image-flash this new boot image[/i] to your device and tell me if it boot-loops. If it does, my installer isn't the problem, because it's only used for a ZIP flash. I've already checked the installer code and can't see any bugs, so I don't think the issue lies there.
Can you also please tell me which version of the firmware your device is running? Possibly there's an issue there, too. Samsung has so far released the source to the ARGH kernel only. This seems to work fine on my ARH5 firmware, but it's uncertain whether it would still work on something based on ARI*, and I've seen that a couple of countries do now have ARI firmware available. Mind you, even if it wasn't compatible, it should still get as far as booting.
Anyway, please test that boot image and let me know your firmware version.
While I soldier on with the issues afflicting the T835 build, can anyone else verify the T830 build as working for them?
Don't be shy; I'm running it on my own device, so I'm certain that build boots.
ianmacd said:
While I soldier on with the issues afflicting the T835 build, can anyone else verify the T830 build as working for them?
Don't be shy; I'm running it on my own device, so I'm certain that build boots.
Click to expand...
Click to collapse
Sorry for the noob question if i flash this kernal on my SM-T835 will i lose DEX ? Sorry i'm not quite understanding what KERNEL does ? Thanks in advance!
N1NJATH3ORY said:
Sorry for the noob question if i flash this kernal on my SM-T835 will i lose DEX ? Sorry i'm not quite understanding what KERNEL does?
Click to expand...
Click to collapse
When the kernel is working as intended, you won't lose DeX, but it currently isn't even booting on the T835.
Only those who are able to assist in debugging the current boot failure should install the T835 build at this time.
The T830 build, on the other hand, is rock solid for me, and I encourage anyone who is capable of recovering from an unexpected bootloop to try it out.
Version 0.99.5 released.
This release updates the kernel to the latest upstream Linux.
T830 owners, install at will. T835 owners, beware: The previous release has been reported unbootable on this model, and this release is likely to be similarly afflicted. Investigations are ongoing. Until this issue is resolved, the whole project has been downgraded to alpha status.
Change log
Updated to Linux 4.4.162. Caution: This release is likely to cause a bootloop on the T835.
ianmacd said:
I've gone through the ramdisk of the T835's boot image with a fine-tooth comb and can find nothing untoward. I also verified that I properly removed the dm-verity flag from the T835's device tree.
There are actually very few source code differences between the T830 and T835. Both can be built from a single tree. The only differences lie in the kernel config file and the device tree, but I am building with the default T835 configuration, and with the proper device tree for that device.
Let's try at least ruling out my installer code. Please image-flash this new boot image[/i] to your device and tell me if it boot-loops. If it does, my installer isn't the problem, because it's only used for a ZIP flash. I've already checked the installer code and can't see any bugs, so I don't think the issue lies there.
Can you also please tell me which version of the firmware your device is running? Possibly there's an issue there, too. Samsung has so far released the source to the ARGH kernel only. This seems to work fine on my ARH5 firmware, but it's uncertain whether it would still work on something based on ARI*, and I've seen that a couple of countries do now have ARI firmware available. Mind you, even if it wasn't compatible, it should still get as far as booting.
Anyway, please test that boot image and let me know your firmware version.
Click to expand...
Click to collapse
Firmware Version ist arh5 and after flashing your img the device still constantly reboots on the start screen and doesnt even get to the boot Screen
Sent from my Samsung SM-G950F using XDA Labs
dr460nf1r3 said:
Firmware Version ist arh5 and after flashing your img the device still constantly reboots on the start screen and doesnt even get to the boot Screen
Click to expand...
Click to collapse
Thanks. That absolves the installer of any wrongdoing, at least.
Something is fundamentally wrong with the kernel for the T835.
The boot image is taken from stock firmware, and modified just enough to allow a custom kernel to boot. I very much doubt the problem lies there. A virtually identical image works for the T830.
The kernel config used is the one supplied by Samsung. The only modifications made to it are the same ones I made to the T830's.
I think my next step will be to produce a kernel built without downstreaming the 4.4.y Linux branch, so back to 4.4.78. If that works, it will indicate that an error affecting only the T835 was introduced during all of my merging of the upstream kernel.
I'll post again when I've built the kernel, which won't be for a few hours, as I'm on holiday at the moment.
Sent from my SM-G965F using XDA Labs
ianmacd said:
I think my next step will be to produce a kernel built without downstreaming the 4.4.y Linux branch, so back to 4.4.78. If that works, it will indicate that an error affecting only the T835 was introduced during all of my merging of the upstream kernel.
Click to expand...
Click to collapse
OK, @dr460nf1r3, please try this new T835 build.
This is rewound to 4.4.78, with just a few extra cherry-picked commits to enable it to build cleanly and boot without triggering dm-verity.
In other words, this kernel should be 99% identical to the one that shipped with the machine. This assumes that the source as supplied by Samsung was actually used to build the stock kernel.. They have been known to publish sources that don't match what's on the machine.
ianmacd said:
OK, @dr460nf1r3, please try this new T835 build.
This is rewound to 4.4.78, with just a few extra cherry-picked commits to enable it to build cleanly and boot without triggering dm-verity.
In other words, this kernel should be 99% identical to the one that shipped with the machine. This assumes that the source as supplied by Samsung was actually used to build the stock kernel.. They have been known to publish sources that don't match what's on the machine.
Click to expand...
Click to collapse
Thanks, flashing now will report back in a few minutes
Sent from my Samsung SM-G950F using XDA Labs
---------- Post added at 05:44 PM ---------- Previous post was at 05:17 PM ----------
ianmacd said:
OK, @dr460nf1r3, please try this new T835 build.
This is rewound to 4.4.78, with just a few extra cherry-picked commits to enable it to build cleanly and boot without triggering dm-verity.
In other words, this kernel should be 99% identical to the one that shipped with the machine. This assumes that the source as supplied by Samsung was actually used to build the stock kernel.. They have been known to publish sources that don't match what's on the machine.
Click to expand...
Click to collapse
Did not work still the same issue.. flashed via twrp to boot partition. Noob question, the boot backup i got is 64mb while your kernel hardly has 25.. whats going on here?
Sent from my Samsung SM-G950F using XDA Labs
dr460nf1r3 said:
Did not work still the same issue.. flashed via twrp to boot partition.
Click to expand...
Click to collapse
Well, that's disappointing. I was hoping that it was my screw-up, rather than Samsung's, but at this point almost everything I've done has been backed out and it still won't boot.
Noob question, the boot backup i got is 64mb while your kernel hardly has 25.. whats going on here?
Click to expand...
Click to collapse
Good question.
Your back-up is of the entire partition, including the area with no data on it, so you're getting a file the same size as the partition itself. My boot image contains just the data segment, so it's smaller.
If you pull the stock boot image from the AP file of Samsung's firmware, you'll see that it's a very similar size to mine (slightly smaller, actually):
Code:
$ unzip -p T835XXU1ARH5_T835OXM1ARH5_PHN.zip AP_T835XXU1ARH5_CL14008523_QB19263559_REV00_user_low_ship_MULTI_CERT_meta.tar.md5| tar xf - -O boot.img.\*lz4 | lz4 -dc > boot.img
$ ls -l boot.img
-rw-rw-r--. 1 ianmacd ianmacd 23593232 Oct 21 22:01 boot.img
$ file boot.img
boot.img: Android bootimg, kernel (0x8000), ramdisk (0x2000000), page size: 4096, cmdline (console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_le)
So, what now?
I'll see which other minor changes I can back out, in an effort to arrive at a kernel built from source that is as close to stock as possible. If you're wondering Why doesn't he just build from pristine sources?, the answer is: Because Samsung's source code won't even build out of the box. Many of the kernel header files are simply not in the expected locations. Alas, this is a fairly common problem with Samsung's kernel source code releases.
I suspect the solution to this problem may actually lie in changes that have yet to be made, rather than changes made that need to be reverted. In other words, the T835 may require some kernel modifications or configuration that the T830 doesn't. Theoretically, a kernel compiled from Samsung's pristine sources should just work, but that's starting to look unlikely now.
I'm hoping that I can enable/disable a few further options in the kernel config, rebuild and produce a kernel that works for you. If, however, the problem is that the source itself is faulty, we may have to wait for a future release by Samsung to give us something that compiles into a working kernel.
But I don't intend to throw in the towel on the T835 just yet. There are still a few more things we can try.
ianmacd said:
Well, that's disappointing. I was hoping that it was my screw-up, rather than Samsung's, but at this point almost everything I've done has been backed out and it still won't boot.
Good question.
Your back-up is of the entire partition, including the area with no data on it, so you're getting a file the same size as the partition itself. My boot image contains just the data segment, so it's smaller.
If you pull the stock boot image from the AP file of Samsung's firmware, you'll see that it's a very similar size to mine (slightly smaller, actually):
So, what now?
I'll see which other minor changes I can back out, in an effort to arrive at a kernel built from source that is as close to stock as possible. If you're wondering Why doesn't he just build from pristine sources?, the answer is: Because Samsung's source code won't even build out of the box. Many of the kernel header files are simply not in the expected locations. Alas, this is a fairly common problem with Samsung's kernel source code releases.
I suspect the solution to this problem may actually lie in changes that have yet to be made, rather than changes made that need to be reverted. In other words, the T835 may require some kernel modifications or configuration that the T830 doesn't. Theoretically, a kernel compiled from Samsung's pristine sources should just work, but that's starting to look unlikely now.
I'm hoping that I can enable/disable a few further options in the kernel config, rebuild and produce a kernel that works for you. If, however, the problem is that the source itself is faulty, we may have to wait for a future release by Samsung to give us something that compiles into a working kernel.
But I don't intend to throw in the towel on the T835 just yet. There are still a few more things we can try.
Click to expand...
Click to collapse
Thanks for explaining everything for me. Id like to help you were i can but i dont have a computer by my hands right now for the next time
Sent from my gts4llte using XDA Labs
dr460nf1r3 said:
Thanks for explaining everything for me. Id like to help you were i can but i dont have a computer by my hands right now for the next time
Click to expand...
Click to collapse
Here's a new build to try. This one reverts the last few changes I originally made to the T835's kernel configuration before building. This is as close to stock as possible, whilst still being able to build.
If this doesn't boot, it pretty much means that Samsung has supplied code for the T835 that simply will not compile into a working kernel. At that point, we'll probably have to wait for updated sources. I already have a request pending with Samsung for the release of the BRI sources.
Just to be clear, the current status quo as I understand it is that the Samsung logo never starts to be written from left to right. You never get past the static screen with the device name and the word Custom. Is that correct?
ianmacd said:
Here's a new build to try. This one reverts the last few changes I originally made to the T835's kernel configuration before building. This is as close to stock as possible, whilst still being able to build.
If this doesn't boot, it pretty much means that Samsung has supplied code for the T835 that simply will not compile into a working kernel. At that point, we'll probably have to wait for updated sources. I already have a request pending with Samsung for the release of the BRI sources.
Just to be clear, the current status quo as I understand it is that the Samsung logo never starts to be written from left to right. You never get past the static screen with the device name and the word Custom. Is that correct?
Click to expand...
Click to collapse
Im sorry to tell you but this doesnt boot either in fact it doesnt even reboot the static screen. Your right about the current status quo sadly.
Sent from my Samsung SM-G950F using XDA Labs

[MOD][MAGISK][LineageOS] Iptables TTL/Unthrottled Hotspot

Obviously we all know this, but I'll say it anyway: I bear no responsibility for your device!
Background:
Initially I recompiled the kernel, but thanks to @fddm I was able to get this into a Magisk module. This is a take-off from https://forum.xda-developers.com/t/...-tether-lineageos-18-1.4295601/#post-86183959 Feel free to read that (minimal reading) for additional details.
What is this?
This Magisk mod adds the required iptables kernel module for TTL/Tether/unmetering for using your phone as a hotspot. I have Tmobile & with my plan, when I connect any device to the phone it is extremely throttled to around 0.5Mbps. With this mod and the settings below, you can get around that limitation. I go from 0.5Mbps=>80+Mbps with this mod. Root is required (look at above thread for details on that if needed).
Compatibility:
Confirmed OS's that work: LineageOS18.1, LineageOS19.1
ROMs: At this point I can't indicate what ROMs this will be compatible with, but it appears LineageOS18.1 works. I'm attaching that as well as a Android/AOSP12 version if anyone wants to test that. I'm also not sure if this is exclusive to the bramble/Pixel 4a5g device (If anyone knows what they're doing or wants to get ballsy, test & report your results!)
Carrier: I tested this against Tmobile. It depends on how your carrier throttles your hotspot connected devices; Tmobile uses the TTL to determine if its the phone vs a connected device. If your carrier uses that method this should work.
xt_HL.ko: This is the kernel module we're inserting to allow the "iptables ttl set" command. I tested the Android12 xt_HL.ko file on my LineageOS18.1 OS and it does NOT work. This tells me there is some type of versioning. OR: there's an issue with the A12 file...
InCompatibility: (as reported by users in the thread)
ProtonAOSP 12, pixel 4a5g
Steps:
Install Magisk module & read the output; Verify it installed successfully.
Download Termux app from playstore
Termux App: (Shouldn't be necessary if running latest script since that does this step for you on every boot)
su (Grant permissions)
iptables -t mangle -A POSTROUTING -j TTL --ttl-set 64 (should be no errors - if you have errors my kernel is not installed)
Test: Turn on phone Hotspot, connect any device, do a speed test comparing speed on phone should be similar to the connected device.
If any limitations/blocks: (Not sure but maybe http vs https is blocked sometimes)
Install VPN Hotspot app (Green key icon): "Wi-Fi hotspot" ON, wlan1 ON, DISABLE "Tethering HW Acceleration" in settings
Issues:
After running the iptables command you get this error: iptables v1.8.4 (legacy): unknown option "--ttl-set" Try 'iptables -h' or 'iptables --help' for more information. This means the module was not loaded (or isn't compatible. Assuming the correct version was selected, there's no fix. Likely your OS isn't compatible with this module. If anyone has additional troubleshooting to add feel free to chime in.
Technical Additional Info:
ttl_magisk_L18.1: This contains the xt_HL.ko file compiled from the lineage-18.1-20220102-nightly-bramble-signed repo
ttl_magisk_A12: This contains the xt_HL.ko file compiled from AOSP kernel: android-msm-redbull-4.19-android12
Updates:
* I updated the thread title since no one reporting the Android 12 kernel mod is working (only 11 works this far)
* I added "ttl_magisk_L19.zip" script which runs the iptables command for you on every boot. I just tested this on LineageOS19.1 and it works good. I'm working on testing it on LineageOS20.0...
Based on what @fddm said though, it sounds like a Magisk module like this will not work on stock AOSP because it "enforces signatures on modules". If anyone can confirm that, or a workaround that would be helpful. Also https://forum.xda-developers.com/t/...l-tether-lineageos-18-1.4295601/post-86173703 indicates we'll want to disable IP6 via these commands:
ndc interface ipv6 rndis0 disable
ndc interface ipv6 wlan0 disable
If anyone wants to test & get back that'll be great. With Tmobile I didn't need to do that (yet), but again feedback would be great.
I had checked the stock and Lineage configs and neither had signature enforcement enabled. I only had access to this phone for a couple days, so I unfortunately can't test for you.
fddm said:
I had checked the stock and Lineage configs and neither had signature enforcement enabled. I only had access to this phone for a couple days, so I unfortunately can't test for you.
Click to expand...
Click to collapse
So you think this should work on stock? Thanks man! I need my phone for work so can't put it offline for hours atm, but maybe over the weekend I can. I'd like to reflash android 12 stock & see if this works. I'd have to assume there's some interest in this... Someone else to test...who knows
hi, I am on ProtonAOSP 12, pixel 4a5g, tested the ttl A12 zip file. But it gave me error when trying to run the iptables command as per your instruction. So I guess it is not loading the module maybe
creezalird said:
hi, I am on ProtonAOSP 12, pixel 4a5g, tested the ttl A12 zip file. But it gave me error when trying to run the iptables command as per your instruction. So I guess it is not loading the module maybe
Click to expand...
Click to collapse
Apologies for your results. I just updated the OP with an "Issues" section I'll update with issues reported, and any fixes if we discover any. I've only successfully tested this against LineageOS18.1, and was only hopeful it would work against other OS's. Just for kicks, since it's a pretty simple/quick process, you may want to try the ttl_magisk_L18.1 version. BTW that entire command is case-sensitive in case someone didn't know (Eg. Iptables... will not work; iptables... will).
Regarding the fix for your issue...I think Proton is based just on AOSP, and nothing to do with LineageOS. I wouldn't think that would matter but pointing. I would've made an Android12/LineageOS19.0 module but it isnt official yet for this device. I'm not sure how willing the Proton folks would be, but the next logical step would be to have them add the following options to their ProtonAOSP12 "redbull_defconfig" file (or equivalent), build it, and send me over the xt_HL.ko file. Then I'll add a magisk module for that for you to test.
Side note: there are 4 recent AOSP kernel versions for this device. So if there are compatibility restraints with versions, I'd guess we'd have a maximum of 4 to deal with, depending on what OS you have. I don't know for sure, but wouldn't think your ROM being AOSP, LIneageOS, or Proton would make a difference, since typically custom ROMs only customize overlays, features, preferences, 3rd party SW, etc - they don't typically rewrite the kernel for example. But we'll find out. The modules I posted reflect LineageOS18.1 (should be android-msm-redbull-4.19-android11-qpr3 but I didn't verify; though this does work with a June 2021 build which is likely android-msm-redbull-4.19-android11-qpr2 or before) & Android12 (android-msm-redbull-4.19-android12). I don't have one for android-msm-redbull-4.19-android12-qpr1 yet, but there's a chance that's what you need. Recent bramble kernels:
android-msm-redbull-4.19-android11-qpr2
android-msm-redbull-4.19-android11-qpr3
android-msm-redbull-4.19-android12
android-msm-redbull-4.19-android12-qpr1
kevin71246 said:
Apologies for your results. I just updated the OP with an "Issues" section I'll update with issues reported, and any fixes if we discover any. I've only successfully tested this against LineageOS18.1, and was only hopeful it would work against other OS's. Just for kicks, since it's a pretty simple/quick process, you may want to try the ttl_magisk_L18.1 version. BTW that entire command is case-sensitive in case someone didn't know (Eg. Iptables... will not work; iptables... will).
Regarding the fix for your issue...I think Proton is based just on AOSP, and nothing to do with LineageOS. I wouldn't think that would matter but pointing. I would've made an Android12/LineageOS19.0 module but it isnt official yet for this device. I'm not sure how willing the Proton folks would be, but the next logical step would be to have them add the following options to their ProtonAOSP12 "redbull_defconfig" file (or equivalent), build it, and send me over the xt_HL.ko file. Then I'll add a magisk module for that for you to test.
Side note: there are 4 recent AOSP kernel versions for this device. So if there are compatibility restraints with versions, I'd guess we'd have a maximum of 4 to deal with, depending on what OS you have. I don't know for sure, but wouldn't think your ROM being AOSP, LIneageOS, or Proton would make a difference, since typically custom ROMs only customize overlays, features, preferences, 3rd party SW, etc - they don't typically rewrite the kernel for example. But we'll find out. The modules I posted reflect LineageOS18.1 (should be android-msm-redbull-4.19-android11-qpr3 but I didn't verify; though this does work with a June 2021 build which is likely android-msm-redbull-4.19-android11-qpr2 or before) & Android12 (android-msm-redbull-4.19-android12). I don't have one for android-msm-redbull-4.19-android12-qpr1 yet, but there's a chance that's what you need. Recent bramble kernels:
android-msm-redbull-4.19-android11-qpr2
android-msm-redbull-4.19-android11-qpr3
android-msm-redbull-4.19-android12
android-msm-redbull-4.19-android12-qpr1
Click to expand...
Click to collapse
Another note: it appears Proton does quite a bit of work with the kernel, mods/etc (eg. Features list here: https://forum.xda-developers.com/t/kernel-pixel-4a-5g-proton-kernel.4194685/ ). I'm not sure if you flashed their kernel (1 ROM says its not required), but if you did that may explain the incompatibility - but I'm just guessing.
kevin71246 said:
Another note: it appears Proton does quite a bit of work with the kernel, mods/etc (eg. Features list here: https://forum.xda-developers.com/t/kernel-pixel-4a-5g-proton-kernel.4194685/ ). I'm not sure if you flashed their kernel (1 ROM says its not required), but if you did that may explain the incompatibility - but I'm just guessing.
Click to expand...
Click to collapse
Not at all, I am just using the Proton without the Proton Kernal (this is optional). If not mistaken, the Dev mentioned somewhere that by default, the kernel is same as stock
creezalird said:
Not at all, I am just using the Proton without the Proton Kernal (this is optional). If not mistaken, the Dev mentioned somewhere that by default, the kernel is same as stock
Click to expand...
Click to collapse
Mind going into your phone settings & post your kernel version? Thx
kevin71246 said:
Mind going into your phone settings & post your kernel version? Thx
Click to expand...
Click to collapse
sure, here you go
kevin71246 said:
Obviously we all know this, but I'll say it anyway: I bear no responsibility for your device!
Background:
Initially I recompiled the kernel, but thanks to @fddm I was able to get this into a Magisk module. This is a take-off from https://forum.xda-developers.com/t/...-tether-lineageos-18-1.4295601/#post-86183959 Feel free to read that (minimal reading) for additional details.
What is this?
This Magisk mod adds the required iptables kernel module for TTL/Tether/unmetering for using your phone as a hotspot. I have Tmobile & with my plan, when I connect any device to the phone it is extremely throttled to around 0.5Mbps. With this mod and the settings below, you can get around that limitation. I go from 0.5Mbps=>80+Mbps with this mod. Root is required (look at above thread for details on that if needed).
Compatibility:
ROMs: At this point I can't indicate what ROMs this will be compatible with, but it appears LineageOS18.1 works. I'm attaching that as well as a Android/AOSP12 version if anyone wants to test that. I'm also not sure if this is exclusive to the bramble/Pixel 4a5g device (If anyone knows what they're doing or wants to get ballsy, test & report your results!)
Carrier: I tested this against Tmobile. It depends on how your carrier throttles your hotspot connected devices; Tmobile uses the TTL to determine if its the phone vs a connected device. If your carrier uses that method this should work.
xt_HL.ko: This is the kernel module we're inserting to allow the "iptables ttl set" command. I tested the Android12 xt_HL.ko file on my LineageOS18.1 OS and it does NOT work. This tells me there is some type of versioning. OR: there's an issue with the A12 file...
InCompatibility: (as reported by users in the thread)
ProtonAOSP 12, pixel 4a5g
Steps:
Install Magisk module & read the output; Verify it installed successfully.
Download Termux app from playstore
Termux App:
su (Grant permissions)
iptables -t mangle -A POSTROUTING -j TTL --ttl-set 64 (should be no errors - if you have errors my kernel is not installed)
Test: Turn on phone Hotspot, connect any device, do a speed test comparing speed on phone should be similar to the connected device.
If any limitations/blocks: (Not sure but maybe http vs https is blocked sometimes)
Install VPN Hotspot app (Green key icon): "Wi-Fi hotspot" ON, wlan1 ON, DISABLE "Tethering HW Acceleration" in settings
Issues:
After running the iptables command you get this error: iptables v1.8.4 (legacy): unknown option "--ttl-set" Try 'iptables -h' or 'iptables --help' for more information. This means the module was not loaded (or isn't compatible. Assuming the correct version was selected, there's no fix. Likely your OS isn't compatible with this module. If anyone has additional troubleshooting to add feel free to chime in.
Technical Additional Info:
ttl_magisk_L18.1: This contains the xt_HL.ko file compiled from the lineage-18.1-20220102-nightly-bramble-signed repo
ttl_magisk_A12: This contains the xt_HL.ko file compiled from AOSP kernel: android-msm-redbull-4.19-android12
Click to expand...
Click to collapse
Hi, I followed the steps and I am able to get this to work after making the changes to iptables. I did notice that if I reboot the phone the changes are not persisting. Is there any way to fix this?
Thanks!
ankur414 said:
Hi, I followed the steps and I am able to get this to work after making the changes to iptables. I did notice that if I reboot the phone the changes are not persisting. Is there any way to fix this?
Thanks!
Click to expand...
Click to collapse
That is odd. That iptables command should be persistent across a reboot. The steps in the OP are all I did. In fact once I get it working it's hard to undo it! Like I'll delete the iptables rule, reboot, and usually I still get I throttled data. Eventually it'll break again after messing with it. No clue why. Hopefully sometime else can chime in. For reference, please post your OS, build, kernel, assume Pixel 4a5g?...
kevin71246 said:
That is odd. That iptables command should be persistent across a reboot. The steps in the OP are all I did. In fact once I get it working it's hard to undo it! Like I'll delete the iptables rule, reboot, and usually I still get I throttled data. Eventually it'll break again after messing with it. No clue why. Hopefully sometime else can chime in. For reference, please post your OS, build, kernel, assume Pixel 4a5g?...
Click to expand...
Click to collapse
Hi, thanks for the response. I am using a Pixel 4a 5G:
LineageOS 18.1-20220116
Build: lineage_bramble-userdebug 11 RQ3A.211001.00110038514
Kernel: 4.19.160-ge469934bead0
it seems to be working fine connecting with my pc.
Shared out from pc both hotspot and ICS to router connecting devices register no internet
connection from META (oculus) Quest 2 shows connected, Internet works but ( BEATSABER WILL NOT CONNECT TO MULTIPLAYER ) .
Sorry.
tested the ttl A12 zip
Termux commands in op gave no error.
also ran #ndc interface ipv6 wlan0 disable (accepted)
#ndc interface ipv6 rndis0 disable would not take
noT Mobile buy metropolitition
if anyone could give me some advice for my quest2 multiplayer problem would have much love ... its the main reason I run hotspot.
OnePlus 6T
Model: A6013
Android 12
Sec. patch 1/5/2022
ProtronExtended version
12.2.1
[ROM][12L][fajita] ProtonXtended (PXOSP) [AOSP]
ProtonXtended (PXOSP) Android 12 based ROM About Project PXOSP (Proton Xtended Open Source Project) is a fork based on ProtonAOSP to enhance the user experience with useful addition features. Screenshots Screenshots of the PXOSP Installation...
forum.xda-developers.com
Kernel ver.
4.9.227Syberia+-g44a024f66f1a
#1 Tue Jan 25 19:55:25 UTC 2022
Linux version 4.9.227Syberia+-g44a024f66f1a ([email protected]) (Android (7485623, based on r416183b1) clang version 12.0.7 (https://android.googlesource.com/toolchain/llvm-project c935d99d7cf2016289302412d708641d52d2f7ee)) #1 SMP PREEMPT Tue Jan 25 19:55:25 UTC 2022
Magisk custom update channel
24.1 (24100)
@topjohnwu
kevin71246 said:
That iptables command should be persistent across a reboot.
Click to expand...
Click to collapse
iptables rules shouldn't be persistent unless you add them via script at startup. If anything, the opposite should be true. I know some devices will refresh their firewall rules after some time, at which point you have to add it back.
everburn said:
it seems to be working fine connecting with my pc.
Shared out from pc both hotspot and ICS to router connecting devices register no internet
connection from META (oculus) Quest 2 shows connected, Internet works but ( BEATSABER WILL NOT CONNECT TO MULTIPLAYER ) .
Click to expand...
Click to collapse
I have a very hard time believing that module worked for your device, are you sure your kernel doesn't already have xt_HL builtin? That aside, were you having issues before trying this? It's probably a compatibility issue between your unnamed provider and the platforms you want to use. If that's the case, just try out a bunch of VPNs until you find one that works and use it with VPN Hotspot.
fddm said:
iptables rules shouldn't be persistent unless you add them via script at startup. If anything, the opposite should be true. I know some devices will refresh their firewall rules after some time, at which point you have to add it back.
I have a very hard time believing that module worked for your device, are you sure your kernel doesn't already have xt_HL builtin? That aside, were you having issues before trying this? It's probably a compatibility issue between your unnamed provider and the platforms you want to use. If that's the case, just try out a bunch of VPNs until you find one that works and use it with VPN Hotspot.
Click to expand...
Click to collapse
yes its running according to magisk log. I was previously on pixel exp. rom android 12 and termux cmd ended in error
that is why I switched for the kernel. and from what i can tell all data is used as talk text data.... as my wifi hotspot 15GB still shows i have only used 2GB (which i have). as far as my B.S. problem I think it has something to do with multiplayer servers. it works fine on wifey's hotspot same carrier LG stylo 6 stock..
everburn said:
yes its running according to magisk log. I was previously on pixel exp. rom android 12 and termux cmd ended in error
that is why I switched for the kernel. and from what i can tell all data is used as talk text data.... as my wifi hotspot 15GB still shows i have only used 2GB (which i have). as far as my B.S. problem I think it has something to do with multiplayer servers. it works fine on wifey's hotspot same carrier LG stylo 6 stock..
Click to expand...
Click to collapse
If I'm understanding - it works, but some devices connected have random results? TMobile, or any cell phone provider, are known for issues with VPN, etc, so that doesn't surprise me. And a total guess, but TMobile uses cgnat & ip6, so maybe that's causing issues as well - but not sure what provider u have.
kevin71246 said:
If I'm understanding - it works, but some devices connected have random results? TMobile, or any cell phone provider, are known for issues with VPN, etc, so that doesn't surprise me. And a total guess, but TMobile uses cgnat & ip6, so maybe that's causing issues as well - but not sure what provider u have.
Click to expand...
Click to collapse
thats probably it right there thanks
Have tried both on Pixel 4a 5G, Android 11 stock, rooted, RQ1C.210205.006
"unknown option --ttl-set" on both

Categories

Resources