Issue with NFC when building custom Pie ROMs (i.e. AOSP Extended)... - Sony Xperia XZ Premium Questions & Answers

I'm currently trying to build latest AEX with most recent device/vendor/kernel trees (based on CarbonROM's), and I'm encountering issues with NFC.
With Sjll's device/vendor tree and Sjll's kernel tree NFC worked fine. However, using the same trees with cryptomilk's kernel tree NFC never worked.
When using CarbonROM's device/vendor trees as a base, NFC works with CarbonROM itself (using CarbonROM/cryptomilk's kernel tree), but not usable on other ROMs (the trees need to be modified when building other ROMs such as AEX, but regardless of using Sjll's or CarbonROM/cryptomilk's kernel tree, NFC won't work there).
I see things like these in the logcat indicating something critical happened (see attachments, note that the original file contained some special characters which might not be able to be copy-pasted when I made the excerpts).
Not sure how to get NFC working on AEX using CarbonROM's trees (other features appear to be working correctly), as I'm considering using it as a base for future builds, since it doesn't appear to have the issue of the phone overheating, freezing and rebooting during startup stage (or when the device's not getting proper signal), and can boot without issues most of the times.
EDIT: I saw CarbonROM's tree specified a pn553 for the ro.vendor.nfc.ko parameter (this parameter is not present on Sjll's device tree). However, the logcat indicated the presence of a PN54X NFC chips, as some NFC-related logs begin with PN54X. Not sure if these drivers are universal, but from what I googled so far PN54x and PN55x are indeed different NFC chips.
EDIT: Not sure if this might be related, but apparently the common-treble tree (which other device trees depended on) referenced things from /device/generic/common, which included /device/generic/common/nfc/libnfc-nci.conf. The /device/generic trees (common and architecture-specific ones) were removed by AEX in their manifest, and I need to revert the removal in a local manifest in order to build successfully.

Related

[ROM][7.1.2_r36][27Jan2018 LineageOS-14.1] Custom Roms

Nougat ROM and beyond?
It's been almost three months that I started the development of K3-Note, challenging and funny. The last few minor issues are also fixed now. Since all the major issues are fixed, it's time to move on to other devices. I might take another look when I find something or when new Android arrive.
As a promise at the beginning, I built another custom ROM -- SlimRom. With the Lineage's setup, it only took me a hour to prepare and patch the platform. After the ROM was out, I polished a few things. I built the CarbonROM too. I also have DU in my hard drive but DU-team had forbidden releasing in xda earlier. My 1T hard drive is almost full and there is no room for another ROM. If anyone interest in taking over any of these, please let me know and I might guide you through. The requirement is simple -- you need to share your work too.
The objective of this project is not releasing a particular ROM. With the solutions to the issues, I hope it would enlighten more people to join our development.
After releasing the kernel, I'm glad there are new kernels come. I was hoping many custom ROM would follow. Sadly, seems Lenovo and Mediatek are not friendly to custom ROM developers. I don't think it's intentional. The changes in the AOSP source by MTK and each manufacturer would likely be the reason. Even if we have the full source, it would probably for LP or MM. Making the proprietary blobs to work for Nougat is not a simple task. I think that's the reason why devices with MTK chips haven't received Nougat updates yet. Most of the manufacturer might be waiting for the update from MTK too.
When I finished the job in hand earlier last month, I decided to try it myself. I already had the Carbon CR-5.1 (Android 7.1.1) source ready so I started with it first. Building it out and made it boot was not too difficult. With a few attempts, my first custom ROM for k3-note was out. Some of the features were not working as expected. RILD not started, no audio and GPS, camera crash, etc... RIL logs are disabled by default so I started fixing the camera which I thought would be easier. That was proved over optimistic soon. My experience told me CM always one step ahead so I downloaded the source when I stated. It's time switching to CM. In a week or two, I finally built a barely presentable ROM. There were questions from a few guys from time to time. All I heard were camera not a problem, audio not a problem, etc... I'm new to K3-note and I just can't imagine how "easy". I don't think I'm that good. I also don't have the patience and experience to try all the blobs. Therefore I upload the test builds for those guys to try. Sadly, up to this moment, no respond yet.
Although there is no complete source from Lenovo, other devices might provide something here and there. Fortunately, only a few pieces are required. The source we can found are for LP and for other devices. Make if work for us would be quite a challenge. I finally managed to fix a few things. I seldom release anything that early but there are just so many requests. I don't think I have enough time to make everything work soon. Seeking for other opinions is never a bad move.
I'm now sharing my experiences again. You are welcome to use and share my works. All I asked is "don't keep it to yourself, share yours too!"
If possible, I'll build a few different ROMs later. However, there won't be any weekly or monthly in schedule. This thread is more or less a stepping stone.
At this stage, report is not essential. You don't have to repeat what already mentioned. Thanks!
Existing issues:
I. Missing symbols
To deal with missing smybols (usually name space changed in platform upgrade), we may use a shim library and assigned it to LD_PRELOAD at init. GCC doesn't care who provide it. As long as it was loaded, others can access it. The up side is, this way would not touch the original source. The down side is it would be loaded/checked whenever a dlopen() is called. Clearly, it would increase overheads and affect the performance. For our K3-Note, there are also some missing symbols in blobs.
I personally don't like LD_PRELOAD libraries. I would usually add a build flag to Android.mk and add a new file if possible.
**In CM14.1, it already added the build flag BOARD_USES_MTK_HARDWARE in vendor_cm.
Set it to true would define a global flag MTK_HARDWARE.**
The patches are grouped in the device tree. At this moment, there are 4 group of patches:-
1. system_core
1.1 liblog (add the xlog function __xlog_buf_printf() and override the RLOG, see following section)
1.2 libnetutils (required by thermal and RIL). Can use the blob from stock ROM.
2. framework_av
2.1 a file mtkaudio_stubs.cpp was added
2.2 missing CameraParameteres
2.3 add extra profiles to AudioPolicy (2016/12/17)
2.4 fix audio recording in AudioFlinger (2016/12/17)
3. framework_native
3.1 Add a few symbols for backward compatible with MM calls.
4. sepolicy. - not compulsory
Mediatek never takes sepolicy seriously. They use permissive all the time. I planed to use enforcing eventually so I dealt with all the sepolicy from day one.
II. The RIL
Tool: To find out what's wrong, the logs are essential. I had made a patch to liblog. A new property "persist.ril.log" is added. Set it to 1 will push all RLOGs to main.
1. A missing symbol in mtkrild
With this help, I found a missing symbol in mtkrild. This symbol is in libnetutils.so. You may either use the file in stock ROM as a blob or rebuilt it.
2. The ccc_util
During debugging, I noticed there were garbage in the ccc_util logs. A source can be found for mt6595. After disassembled the binary blob, I found a few differences. I rewrote some part and added support for the two new properties. The final sources are grouped in the new project android_hardware_lenovo_aio_otfp
3. Default modem selection
There are two modem binaries in stock ROMs -- 5 (LWG) and 6 (LTG). They are in /system/etc/firware. In stock ROMs, the default modem is read from nvram. For some unknown reason (seems protection issue), ccci_mdinit can't get this value from nvram in custom ROMs. It would use the default value in Kernel (was 6). I noticed LWG was shown in About of stock ROM so I changed the kernel default to 5. Other areas might required this to be 6. Check the Modem in About for your area. If it is LTG, you may either swap the names of the two modems or change the kernel default. I wanted to use a build.prop but turn out that ccci_dminit is a blob from Mediatek. There are only binaries available. No way to add anything.
4. Custom RIL Class
This class is to handle MTK specific modem messages. Usually its for emergency dialling and modem info. It is not handled in AOSP. CM14.1 already taken care of it and that's one of the reason I switched to CM for testing.
A Custom class can be found in CM's device tree for mt6735. I think its too much to handle the emergency number list but don't want to waste time rewriting it. With a few modifications, it can work for us in Nougat. Seems there are unused/unhandled messages. **Need to verify it later.**
III. The Camera
After my first ROM was out, the most eye catching in the log would be the stack corruption in libcam.halsensor.so.
Code:
11-24 21:53:55.967 490 490 F DEBUG : #08 pc 00017459 /system/lib/libcam.halsensor.so (_ZN12ImgSensorDrv13getResolutionEPP34ACDK_SENSOR_RESOLUTION_INFO_STRUCT+60)
After study the source for mt6735, I found it was called within the blob libcam.halsensor.so. In the function ImgSensorDrv::getResolution(), an ioctl() call was passed to the kernel. I was thinking it was caused by user space data handling in the kernel. After a series of trials and dumping, I remarked that part of code from the kernel. The crash persisted. That means it was from the blob itself. I tried a shim library to replace the function ImgSensorDrv::getResolution() but the result is the same. That means the callee was responsible.
After some digging, I was pretty sure it was caused by the alignment (address sanitize) of struct addresses. The latest blob from Lenovo dev.1631 (also the latest for mt6752 devices) were built with gcc 4.9 Clang 3.6. Nougat now use Clang 3.8 by default. Those blob already have alignment support in Clang 3.6 might have issues with the new Clang 3.8.
What is address alignment? In short, a 32 bit processor can handle 32 bit at a time. It would be a easier for the register to locate memories in 32 bits (4 bytes) cells (aligned). If the head or tail for a block of memory is not aligned, extra code would required to separately handle those loose ends. The new clang compiler would fill leading bytes with its own algorithm to make the pointer or variable aligned. Why is ImgSensorDrv::getResolution() being "affected"? The argument of it is a pointer to ACDK_SENSOR_RESOLUTION_INFO_STRUCT. Its definition can be found in the kernel. It is a struct of an array of pointers to another struct. The source from Mediatek use direct reference to the address of struct variables all the time. This is inappropriate in sense of address alignment. Early compilers didn't handle alignments and won't have problem with that. Newer compiler would use its own algorithm to align the structs and pointers. I guess Clang 3.6 didn't handle the above complex struct as argument well. Nougat linker and loader are all built with Clang 3.8. Local variables are allocated at load time which might be handled differently. Thus a call to ImgSensorDrv::getResolution() would cause the stack corruption.
** Those interested may read this article for detail. **
1. Work around
Using older blobs built by gcc 4.8 or earlier might work. Jiayu S3's AOSP were using those old blobs. I'm new to K3-note. I don't think I have the patience and experience to test all the existing blobs. That's the main reason I uploaded the last two test ROM. Trying blobs and hoping some combination would work is passive. Stlport is also obsolete for some time now. I rather deal with the problem directly.
2. The solution
Without the source, building the whole blob is impossible. Even if we have the source from other devices, those custom parameters are unique to each image sensor. It's impossible to guess or back engineer...
If we can change the way ImgSensorDrv::getResolution() is being called or didn't touch the argument within the function. It would avoid the crash. Unfortunately, the function need to fill a local struct within the ImgSensorDrv class. That means it is not seen outside ImgSensorDrv. The only way is to replace the whole ImgSensorDrv class. Fortunately, it is self contained. We can write a wrapper to replace the ImgSensorDrv class only. The source from mt6735 or mt6595 are a bit different and obviously can't be used directly. Most of the struct can be cross referenced to the kernel source. There are two local sturct left unknown. One is for the commands sent to the kernel. The other is some info. collected from the kernel.
With the wrapper, the crash was gone but still no preview. I wrote a test HAL to dump the values in stock ROM. Guessing the values against the names was not a decent job. Fortunately, there were only a few differences. After nights of trial and error, I finally pulled everything together. Camera is working now! Video recording is still not working. Seems codec related. Some say it's not a problem "again". Hoping there will be some real solutions and helps soon...
TODO: HDR crashed
IV. GPS
While comparing my log to the stock's, I found all daemons are working properly. It must be the problem of the interface. The java interface of GPS was changed in Nougat. Seems there were transitions from GPS struct to GNSS struct. I accidentally noticed a line in the thousands lines of log.
Code:
gps_mtk : copy_GpsCallbacks_mtk: line = 4124Bad callback, size: 96, expected: 88 or 80
This showed some proof for my guess. After comparing the hardware/gps.h from MM and Nougat, I think the main problem is the difference in callbacks. There were a few ways in my mind. We can change the JNI and handle MTK differently to adopt the old style. Or, use another wrapper to shield the GPS HAL.
The solution
The best way is naturally to rebuild the GPS HAL. The sources I had were outdated. After another intensive search, I found the source for mt6795 from xiaomi and another source for mt6753 from ulefone. They were almost identical and matched all the symbols in the blob from Vibeui 3.5 1631. Their contents were quite standard GPS HAL but a lot had to patch for Nougat. Mediatek already handled some transitions to GNSS which made things a bit easier. The last piece left was the prebuilt libepos. There was no 64 bit library from xioami but there were a few from other devices. Nougat already have the open source curl in extension so everything seemed ready. In a few attempts, I managed to build the new HAL out. I also include Mediatek's apk YGPS for testing. Another reason is the uniqueness of GPS from MTK. Common GPS utilities like GPS Status doesn't work. Anyway, GPS is working now! Cheers!
update (2017/2/17): I was using a mt6795 source from github. Turn out that it was already modified. There were something missing. I rewrote the HAL from the official mt6797 source. Now it is fully support GPS, GLONASS and BEIDOU. It is also backward compatible with the AOSP callbacks. Most of the GPS apks (eg. GPS status which was not working in stock MM) would be working now.
update (2017/6/5): For some unknown reason, the country code can not be read from nvram. Thus mnld would use default value which disabled the GLONASS access. I made a patch in post #520. It would generate the file /data/misc/gps/mnl.prop. This is the default property file which never been used. Read the comment inside this file for detail. There are other default settings available. Anyone interested may PM me for detail.
V. Audio recording
After checking with a few test apks, I'm pretty sure the issue was the audio recording solely not Mic. related. Actually, I already fixed it for some time but I didn't know. I was mislead by the pause feature in CM's SoundRecorder apk. That pause feature is unique to CM. MTK's (probably some others) HAL didn't handle it at all. Whenever I pressed the pause, it would call the missing function in HAL and hang. I wrote a test apk myself and found that it worked! I then looked into the source of AOSP. That cleared things up immediately. I don't want to modify CM's apk so I replace it with the one from AOSP.
The solution
The definition of the struct audio_stream_in has changed in Nougat. The function get_capture_position() was added. It's just for reporting the time stamp. The audio HAL blob from MTK didn't have this function. When the input streams were loaded, it would crash. I reinstated the untouched BOARD_USES_LEGACY_MTK_AV_BLOB flag and made a patch in AudioFlinger service. I added the specific header "audio.h" in device tree. Check the source on my github for detal.
One less thing on the list now! Cheers!
VI. MTK Codec
Codecs are essential for recording and playback. Although we can use the software codec from CM or Google for playback, video recording normally required the codec from the manufacturer. That's why I spent a lot of time to make them work first. Samsung and Qcom usually put the codecs in kernel drivers but Mediatek didn't. MTK's codec use the gralloc_ext, ui_ext and gui_ext helper libraries to "assist" the allocations and queries. Unfortunately, platform changes arose some issues in these blobs.
The solution
Naturally, to make it fully support Nougat, we have to rebuild it. I found the sources for mt6797. They are small but have some dependencies. Only minor changes would make them Nougat compliant. Both depend on the dpframework and gralloc.mt6752 which are proprietary. I already rebuilt gralloc_ext from source. Proved to be the right move now. I grouped them into the graphics folder in the hardware_lenovo_aio_otfp project. With these newly built libraries, all codecs are working now.
update (2017/3/18): Found the latest codecs for mt6750t. They work for YouTube, Snapchat, etc. Check the attachment in post #272.
TODO: WVM not handled
VII. Video Recording
For my Samsung devices and Tilapia, I can make the cameraservice work on both camera and camcorder. I don't need the HAL1 flag reverting to the mediaserver. After fixing the extra allocation libraries for my K3-note, I could record the video to a mp4 file. Audio was normal but video wasn't. I had studied for a while. I thought it was colour format related but I don't know why yet. There would be too much changes to the original source so I decided to put aside first.
The solution
Although it's not my wish, I compromised. Everything went well when I use the HAL1 flag switching back to mediaserver. It's time to move on to the WifiHAL now. Would return to this part later. Anyway, it's kinda fixed now!
TODO: Reinstate Cameraserver
VIII. WifiHAL for Nougat
WifiHAL has been introduced for a few generations. It provides another way to access the WiFi in the frameworks. MediaTek's WifiHAL was clearly derived from Broadcom's source. LP and MM only used a small portion of the callbacks. Nougat uses a few more and some of them haven't supported in the kernel driver yet. I used a patched Brodcom's WifiHAL in my earlier builds. It could only be loaded to pass the check. Things like hotspot, 5G, hidden ssid, etc. were not handled. I then ported the sources from mt6795 and mt6797 to my early WiFiHAL. It took me a few days to handle most of the Wifi commands and queries. Together with the minor patch in netd, hotspot is working. An immediate issue arose -- WiFi wouldn't auto reconnect. It required to turn on manually. Hidden ssid was still not working. When a network was manually added, Wifi would fail to scan for APs. Clearly it was another major problem I overlooked...
A long road to the solution
I enabled the logs in all the relevant java and c files. Nothing seemed special pop up. I then added my own extra logs. An odd scenario appeared on the channel list. I traced back to the callee in libwifi-service. It was a query message for the available channel lists for 2.4G, 5G and 5G DFS bands. However, the lists to all bands were the same. There were 3 channels all started with 2412 (which is the 1st channel of 2.4G band). The default log in GetChannelListCommand only dump the first entry so I add a for loop to dump all. I got 2412,2413 and 2414! That was definitely impossible. I realized there must be something wrong with this vendor data. Clearly the firmware and proprietary blobs won't be the problem. There were also nothing similar in the nvram. I then traced back to its source -- the kernel driver. Following the defconfig and Makefiles, I found the handler for this message in drivers/misc/mediatek/connectivity/conn_soc/drv_wlan/mt_wifi/wlan/os/linux/gl_cfg80211.c.
Looking at the function mtk_cfg80211_vendor_get_channel_list() made me cry and laugh...
Code:
kalMemZero(channels, sizeof(wifi_channel) * 4);
/*rStatus = kalIoctl(prGlueInfo,
wlanoidQueryStatistics,
&channel,
sizeof(channel),
TRUE,
TRUE,
TRUE,
FALSE,
&u4BufLen); */
/* only for test */
num_channel = 3;
channels[0] = 2412;
channels[1] = 2413;
channels[2] = 2414;
NLA_PUT_U32(skb, GSCAN_ATTRIBUTE_NUM_CHANNELS, num_channel);
NLA_PUT(skb, GSCAN_ATTRIBUTE_CHANNEL_LIST, (sizeof(wifi_channel) * num_channel), channels);
It was clearly not handled! I found similar codes among all mt67xx and mt65xx devices. The latest MTK's 3.18 kernel, however, paid back. The codes seemed promising. Only minor adjustments were required but this time I got nothing... I then dumped all the arguments and results after each function calls. Things were clear instantly. Platform used band 1,2,4 for 2.4G, 5G and 5G DFS respectively but MTK use 0 for 2.4G which was also different from its own enum definition (which is similar to the platform). I believed they didn't test it in 3.18 too! I used the parameter band directly. Then simplified the code to have both 2.4G and 5G sharing the same call. After that the channels were reported correctly to the platform. As a bonus, I found the part handled 5G which was disabled by default. I enabled it in the kernel now. As expected, both 2.4G and 5G channels are reported correctly now. After this fix, WiFi can now auto reconnect. To avoid further land mines, I checked all the WiFi commands in the WifiHAL. Turn out that only a handful was actually handled in the kernel. Most of the useless codes are removed and the rest are properly handled now. It took me over a week! The WifiHAL turn out to be a big chapter!
The next and more annoyed issue was Hidden SSID. I'm pretty sure the WifiHAL was OK so I looked into the vendor lib lib_driver_cmd_mt66xx. Enabled a few MTK flags and started with a very limited code all resulted the same. Finally, the following line in log caught my attention:
Code:
E wpa_supplicant: wlan0: nl80211: Scan trigger failed: ret=-22 (Invalid argument)
A block of similar lines show repeatedly when a network was manually added. I believed wrong arguments were sent to wpa_supplicant. I downloaded the full wpa_supplicant manual and redirected the wpa_supplicants commands to the console. Nothing seemed special but I noticed there was an empty entry being pushed to the argument list. The error only occured when the added SSID appeared. With the empty entry, the arguments were one less. Even if its MTK's problem, wpa_supplicant should take care that. I saw a potential problem and I decided to add a check first. It really really paid back! That's the reason why hidden ssid not working! After two sweaty weeks of work, I would said WiFi is fully working now....
update (2017/6/22): p2p and WiFi-display is working.
VIII. FM radio
update (2017/2/27): After taking another look, I found that the FM radio was already fixed. Probably after the audio recording fix. So everything is more or less working now. Cheers!
Credits:
- With no doublt the LineageOS community should have most of the credits
- The CarbonROM, OmniROM, SlimROM and many other custom ROM teams who bring us the alternatives.
- Those who release the sources for MTK devices.
- And finally Lenovo who had released a castrated kernel source which motivate us to DIY.
Sources: https://github.com/danielhk
Download: AFH LineageOS, AFH SlimRoms, AFH CarbonROM
(百度网盘)LineageOS , (百度网盘)SlimRoms, (百度网盘)CarbonROM
My version of TWRP-3.1.1
Installation:
** backup your current /boot, /data and /system partition first **
TWRP 3.0.x is the only recovery tested. There are many TWRP using different device names out there. I already included a few but there would be more. If you got error (6) at flashing, you may change the line in updater-script or use different TWRP.
1. Do a factory reset (wipe /data and /cache)
2. Flash the ROM
3. Flash the Gapps
4. Flash latest SuperSU​Step 1. is essential if you are from other ROMs, otherwise you might get ERROR:7.
Reboot and hoping its not a night mare...
** Note: you don't need to wipe other partitions. Some important device specific data are in nvram and misc. **
Change Log:
Code:
[COLOR="Blue"][B]2018/1/27 - LineageOS-14.1[/B][/COLOR]
[INDENT]- The latest LineageOS-14.1 source, Android-7.1.2_r36 (NJH47F)
- Security patch Dec. 5,2017
- Kernel: New Bluetooth driver
- Bluetooth HAL build from source
- Adjust some Heap and VM settings[/INDENT]
[COLOR="Blue"][B]2018/1/2 - [COLOR="Black"]CarbonRom[/COLOR] CR-5.1[/B][/COLOR]
[INDENT]- The latest Carbon CR-5.1 source, Android-7.1.2_r36 (NJH47F??)
- Kernel: a few minor patches
- Fix Hotspot issue in the last build[/INDENT]
[B]2017/12/29 - [COLOR="Black"]CarbonRom[/COLOR] CR-5.1[/B][/COLOR]
[INDENT]- The latest Carbon CR-5.1 source, Android-7.1.2_r36 (NJH47F??)
- Cumulated patches from my previous Lineage-15.1 builds
- Kernel: a few drivers update
- Adjust some Heap and VM settings
- Security patch Dec. 5, 2017[/INDENT]
[COLOR="Blue"][B]2017/12/16 - LineageOS-14.1[/B][/COLOR]
[INDENT]- The latest LineageOS-14.1 source, Android-7.1.2_r36 (NJH47F)
- Security patch Dec. 5,2017[/INDENT]
[COLOR="Blue"][B]2017/12/3 - LineageOS-14.1[/B][/COLOR]
[INDENT]- The latest LineageOS-14.1 source, Android-7.1.2_r29 (NJH47F)
- Update SELinux rules[/INDENT]
[COLOR="Blue"][B]2017/10/31 - LineageOS-14.1[/B][/COLOR]
[INDENT]- The latest LineageOS-14.1 source, Android-7.1.2_r29 (NJH47F)
- Fix Sim settings crash
- Kernel: binder update[/INDENT]
[COLOR="Blue"][B]2017/10/15 - [COLOR="Black"]CarbonRom[/COLOR] CR-5.1[/B][/COLOR]
[INDENT]- The latest Carbon CR-5.1 source, Android-7.1.2_r29 (NJH47F)
- Kernel: binder update[/INDENT]
[COLOR="Blue"][B]2017/10/1 - LineageOS-14.1[/B][/COLOR]
[INDENT]- The latest LineageOS-14.1 source, Android-7.1.2_r29 (NJH47F)
- Fix PicoTTS from Lineage
- Security patch Aug. 5,2017[/INDENT]
[COLOR="Blue"][B]2017/9/9 - [COLOR="Black"]CarbonRom[/COLOR] CR-5.1[/B][/COLOR]
[INDENT]- The latest Carbon CR-5.1 source, Android-7.1.2_r29 (NJH47F)
- Security patch Aug. 5,2017[/INDENT]
[COLOR="Blue"][B]2017/8/20 - LineageOS-14.1[/B][/COLOR]
[INDENT]- The latest LineageOS-14.1 source, Android-7.1.2_r29 (NJH47F)
- Clean up unused RIL daemon and services
- Security patch Aug. 5,2017[/INDENT]
[COLOR="Blue"][B]2017/8/13 - [COLOR="Black"]CarbonRom[/COLOR] CR-5.1[/B][/COLOR]
[INDENT]- The latest Carbon CR-5.1 source, Android-7.1.2_r29 (NJH47F)
- Clean up unused RIL daemon and services
- Settings: Enable the Ambient Display switch
- Security patch Aug. 5,2017[/INDENT]
[COLOR="Blue"][B]2017/7/29 - LineageOS-14.1[/B][/COLOR]
[INDENT]- The latest LineageOS-14.1 source, Android-7.1.2_r24 (NJH47D)
- Kernel: a few minor patches (mainly for O ready)
- Settings: Enable the Ambient Display switch
- Security patch July 5,2017[/INDENT]
[COLOR="Blue"][B]2017/7/21 - [COLOR="Black"]CarbonRom[/COLOR] CR-5.1[/B][/COLOR]
[INDENT]- The latest Carbon CR-5.1 source, Android-7.1.2_r24 (NJH47D)
- Security patch July 5,2017[/INDENT]
[COLOR="Blue"][B]2017/7/2 - LineageOS-14.1[/B][/COLOR]
[INDENT]- The latest LineageOS-14.1 source, Android-7.1.2_r17 (NJH47B)
- With all patches from the last Carbon.
- AudioFX is removed. Seems useless now.
- PerformanceControl: With Arabic translation from @ziad shawki
- PerformanceControl: Improve the battery interface to report the battery voltage from MTK devices
- Kernel: fix a bug in Lenovo's code.
- Kernel: Further simplify the code in the touchscreen driver.[/INDENT]
[COLOR="Blue"][B]2017/6/29 - [COLOR="Black"]CarbonRom[/COLOR] CR-5.1[/B][/COLOR]
[INDENT]- The latest Carbon CR-5.1 source, Android-7.1.2_r17 (NJH47B)
- Kernel: enable native gesture support
- Kernel: new touchscreen interface for gesture
- Kernel: enter pocket mode when gesture wakeup enabled
- PerformanceControl: upgrade to version 2.1.7
- PerformanceControl: New MediaTek settings with Slide and Gesture O and V handler
- PerformanceControl: fix a bug in drawer
- PerformanceControl: Filter out unnecessary system apps in Freezer[/INDENT]
[COLOR="Blue"][B]2017/6/20 - Kernel update[/B][/COLOR]
[INDENT]- Touchscreen: driver patch and clean up
- enable native gesture support
- enable native DT2W support, add double tap Home key to wakeup
- Enter low power mode at suspend
- pocket mode automatically enabled in native driver[/INDENT]
[COLOR="Blue"][B]2017/6/16 - LineageOS-14.1[/B][/COLOR]
[INDENT]- The latest LineageOS-14.1 source, Android-7.1.2_r17 (NJH47B)
- all patches/fixes from CR-5.1 are included
- Security patch June 5,2017[/INDENT]
[COLOR="Blue"][B]2017/6/14 - [COLOR="Black"]CarbonRom[/COLOR] CR-5.1[/B][/COLOR]
[INDENT]- The latest Carbon CR-5.1 source, Android-7.1.2_r17 (NJH47B)
- Rewrite fstab
- Kernel: patches to a few drivers
- Bug fixes in CarbonFibers
- Security patch June 5,2017[/INDENT]
[COLOR="Blue"][B]2017/6/2 - [COLOR="Black"]CarbonRom[/COLOR] CR-5.1[/B][/COLOR]
[INDENT]- The latest Carbon CR-5.1 source, Android-7.1.2_r8 (N2G47O)
- Default Carbon Browser
- Bug fixes in CarbonFibers
- Security patch May 5,2017[/INDENT]
[COLOR="Blue"][B]2017/5/3 - [COLOR="Black"]CarbonRom[/COLOR] CR-5.1[/B][/COLOR]
[INDENT]- The latest Carbon CR-5.1 source, Android-7.1.2_r8 (N2G47O)
- Fixes from latest LOS-14.1
- codec update
- Fix longpress and doubletap behaviour of nav buttons[/INDENT]
[COLOR="Blue"][B]2017/4/30 - LineageOS-14.1[/B][/COLOR]
[INDENT]- The latest LineageOS-14.1 source, Android-7.1.2_r2 (N2G47E)
- kernel: default at 1.8G now
- New HDR approach[/INDENT]
[COLOR="Blue"][B]2017/4/12 - AOSP-7.1.2_r6[/B][/COLOR]
[INDENT]- The Android-7.1.2_r6 (NHG47K) source
- All fixes from previous builds
- PerformanceControl is included
- Equipped with the O/C kernel, default at 1.8G now
- Fix the Camera crash in 7.1.2
[COLOR="Red"][B]*** see [URL="https://forum.xda-developers.com/showpost.php?p=71828345&postcount=330"]post #330[/URL] for how to install and download link ***[/B][/COLOR][/INDENT]
[COLOR="Blue"][B]2017/4/8 - LineageOS 14.1[/B][/COLOR]
[INDENT]- The latest LineageOS-14.1 source, Android-7.1.1_r25 (NOF27B)
- All fixes from previous builds
- Workaround for HDR. Don't know if its better but faster than stock algorithm
- Equipped with the O/C kernel
- PerformanceControl is included
- Update codecs
- Include App Switch (Recent) in button settings.[/INDENT]
[COLOR="Blue"][B]2017/3/30 - [COLOR="Black"]CarbonRom[/COLOR] CR-5.1[/B][/COLOR]
[INDENT]- The latest Carbon CR-5.1 source, Android-7.1.1_r25 (NOF27B)
- All fixes from previous builds
- patches to adapt the new Carbon build scripts.
- Fix the flashlight while taking picture
- Fix the custom key definition for menu key.
- The O/C kernel is equipped[/INDENT]
[COLOR="Blue"][B]2017/3/19 Kernel update, see [URL="https://forum.xda-developers.com/showpost.php?p=71490161&postcount=275"]post#275[/URL] [/B][/COLOR] for detail and download link.
[INDENT]- O/C for CPU upto 2GHz (Adjustable with PerformanceControl and other kernel tools)
- Voltage table control (Adjustable with PerformanceControl and other kernel tools)
[COLOR="Red"]*** The default values are already optimized for the PLL and power chip.
Don't mess with them if you don't know how. I already set the upper and lower limits.
Should there be any damage caused, it would be at your own risk ***[/COLOR]
- OC for GPU upto 819MHz.
- Work for most (hoping all, including stock) Roms with the VibeUI dev. 1631(and s433) blobs.[/INDENT]
[COLOR="Blue"][B]2017/3/18 Codec update, see [URL="https://forum.xda-developers.com/showpost.php?p=71476388&postcount=272"]post#272[/URL] [/B][/COLOR] and download link.
[INDENT]- Fix YouTube zooming issue
- Fix SnapChat recording.[/INDENT]
[COLOR="Blue"][B]2017/3/12 - [COLOR="Navyblue"]SlimRoms[/COLOR] build 0.15[/B][/COLOR]
[INDENT]- The latest SlimRom 0.15 source, Android-7.1.1_r26 (NOF27C)
- All patches/fixes in my 20170312 LineageOS-14.1
- Add long press AppSwitch (Recent) key for menu[/INDENT]
[COLOR="Blue"][B]2017/3/12 - LineageOS 14.1[/B][/COLOR]
[INDENT]- The latest LineageOS-14.1 source, Android-7.1.1_r25 (NOF27B)
- The latest GPS HAL from CarbonROM
- FMRadio: Fixed
- Media Profiles: update to support common video formats.
- Limit background processes to increase available RAM
- Camera app: replaced with Snap by Lineage
- [COLOR="Red"]Lineage is not ROOTED[/COLOR] by default now[/INDENT]
[COLOR="Blue"][B]2017/2/18 - [COLOR="Black"]CarbonRom[/COLOR] CR-5.1[/B][/COLOR]
[INDENT]- The latest Carbon CR-5.1 source, Android-7.1.1_r21 (NOF26W)
- Initial beta release
- New GPS HAL (fully working and faster)
- Add long press AppSwitch (Recent) key for menu
- All fixes from LineageOS-14.1[/INDENT]
[COLOR="Blue"][B]2017/2/14 - [COLOR="Navyblue"]SlimRoms[/COLOR] build 0.11[/B][/COLOR]
[INDENT]- The latest SlimRom 0.11 source, Android-7.1.1_r21 (NOF26W)
- Initial alpha test build 0.11
- All fixes from LineageOS-14.1
- Add prebuilt Chromium (from CarbonROM)[/INDENT]
[COLOR="Blue"][B]2017/2/14 - LineageOS 14.1[/B][/COLOR]
[INDENT]- The latest LineageOS-14.1 source, Android-7.1.1_r9 (NMF26V)
- Libstagefright: Add fixes to media streaming (Don't know if it work or not)
- LiveDisplay: Add support and settings
- RIL: Handle a few more MTK specific messages (WIP)
- GPS: Add backwards support for MM and earlier
- GPS: Fill up the extra fields in GNSS struct
- GPS: Add a override property to select GPS mode (GNSS/GPS) (Testing only)
- Fixed Power off charging screen
- kpoc_charger: keep the stock images (which are in the LOGO partition)
- Fixed LED notifications
- liblight: Rewrite the lights HAL for better support in Nougats and beyond (WIP)
- liblight: Add dual color support (WIP) [/INDENT]
[COLOR="Blue"][B]2017/1/17 - LineageOS 14.1[/B][/COLOR]
[INDENT]- The latest LineageOS-14.1 source, Android-7.1.1_r9 (NMF26V)
- RIL: Add a fix in custom RIL class (thx. @Moyster for the tip), don't know if it helps.
- hostap: build from source
- netd: a minor patch (wlan0 to ap0) for hotspot
- WifiHAL: Rewrite a new one (almost from scratch...)
- WifiHAL: Handle extra callbacks for Nougat
- Kernel: Handle the mtk_cfg80211_vendor_get_channel_list() correctly
- Kernel: Enabled 5G by default
- wpa_supplicant: Fix a potential bug (which fixed MTK's hidden SSID issue)[/INDENT]
[COLOR="Blue"][B]2017/1/5 - LineageOS 14.1[/B][/COLOR]
[INDENT]- The latest LineageOS-14.1 source, Android-7.1.1_r6 (NMF26Q)
- RIL: use the full set of blobs from S433 (newer than dev. 1631)
- MTKCodec: Fix the storage issue in MTK Codec
- MTKCodec: Include the complete set of MTK codec in dev. 1631
- media_profiles.xml: Include the vorbis decoder
- libion: Rebuilt with open source libion
- VideoRecording: Fix video recording
- SEPolicy: update for codec and media server
- kpoc_charger: rebuilt kpoc_charger from source [WIP][/INDENT]
[COLOR="Blue"][B]2016/12/17 - CM14.1[/B][/COLOR]
[INDENT]- The latest CM-14.1 source, Android-7.1.1_r6 (NMF26Q)
- Camera: Fix the flashlight in taking picture
- AudioRecording:Fix audio recording
- SoundRecorder: Replaced with the one from AOSP
- SEPolicy: update for 7.1.1_r6
- media_profiles.xml: Rewrote with the values in stock log
- AudioPolicy: Add extra profiles
- OMX: Fix the crash of nativeHandle in video recording (WIP)
- libhealthd: fix a few things (WIP)
- WifiHAL: Rewrote a new one for Nougat (WIP)[/INDENT]
[COLOR="Blue"][B]2016/12/11 - CM14.1[/B][/COLOR]
[INDENT]- The latest CM-14.1 source, Android-7.1.1_r4 (NMF26O)
- init.mt6752.rc: A few patches
- gps.mt6752.so: Rebuilt the GPS HAL from source
- libcurl.so: Use opensource curl
- YGPS: Include MTK's test apk for GPS
- SEPolicy: Further patches
- Built-in VPN is working now
- healthd: Add standard charging routines to (WIP)[/INDENT]
[COLOR="Blue"][B]2016/12/6 - CM14.1[/B][/COLOR]
[INDENT]- The latest DC-MTK kernel
- Kernel: Enable UID CPU time
- Kernel: Emulate the hardware random sysfs
- Kernel: Treat all A/C chargers the same (same charging current and limits)
- Kernel: rename led sysfs to AOSP defaults
- Kernel: set default modem to 5
- Handle all extra SEPolicy
- Fix the audio output
- Add the RLOG override and xlog suppress properties
- Fix RIL and mobile data
- Fix all sensors
- Add libhealthd.mt6752 to report battery status
- Fix the camera[/INDENT]
Known Issues:
Code:
- may be more...
Donations:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
XDA:DevDB Information
Nougat and beyond?, ROM for the Lenovo K3 Note
Contributors
daniel_hk
Source Code: https://github.com/danielhk
ROM OS Version: 7.x Nougat
ROM Kernel: Linux 3.10.x
Based On: AOSP, LineageOS, SlimRoms, CarbonROM
Version Information
Status: Stable
Stable Release Date: 2017-06-14
Beta Release Date: 2017-06-03
Created 2016-12-05
Last Updated 2018-01-27
Never bear more than one kind of trouble at a time. Some people bear three kinds of trouble - the ones they've had, the ones they have, and the ones they expect to have.
- Everett Hale
I might just know who that person is...
Cheers mate
theres a bug when i flash modem of a7000 plus the simcard don't detected but the baseband is written in the build prop
thanks
thanks for your work
Maybe you can ask Jiayu S3 developers to provide you with the source code, as they have nougat 7.1.1 already with everything working. Jiayu S3 is very similar to our device's hardware with MT6752 chipset.
Thanks for your hard work.
agdroubi said:
Maybe you can ask Jiayu S3 developers to provide you with the source code, as they have nougat 7.1.1 already with everything working. Jiayu S3 is very similar to our device's hardware with MT6752 chipset.
Thanks for your hard work.
Click to expand...
Click to collapse
Lenovo Has Different source I have spoke with M.A.D.
Thanks for the effort . I am able to use jio4gvoice in this ROM mic is accessible and Gapps are also working fine, but as described in issue section wifi tethering , video recording is not working I tried so many apps but no success and also battery is draining fast so Best of luck for next release
Is it compatible with k50a40?
Is it compatible with k50a40?
assaultsethu said:
Is it compatible with k50a40?
Click to expand...
Click to collapse
Yes
Flypast said:
Yes
Click to expand...
Click to collapse
Are you tested in k50a40?
not working
sir,
i have lenovo k3 note k50a40, india version, at first have installed miui 8 rom from gooddeath version 6.11.24, and was working fine with rom version 5.0.1 blispop, but i wanted to upgrade so i tried urs but it is not working i have downloaded ur last 11 dec file with 400mb approx and have installed twrp 3.0.2.7 with SuperSU v2.78 SR5, but ur rom is not installing the error says "e3004:THIS PACKAGE IS FOR DEVICE :K50-T5.AIO_M,K3NOTE;THIS DEVICE IS AIO_O.FP"
ERROR 7 , SO PLEASE HELP AND I HAVE ALSO TRIED TO INSTALL GAPPS FROM OPENGAPPS NANO FILE IT GENERATES ERROR TOO WITH "INCOMPATIBLE ROM DETECTED, THIS GAPS IS FOR 7.1.X ONLY BUT THIS IS 5.1.1 SDK 22" SO PLS HELP....
use other twrp ver to try.
---------- Post added at 11:39 AM ---------- Previous post was at 11:37 AM ----------
twrp 3.0.0-2 couco92 maybe work for you. any idea broda
SID_BAN said:
sir,
i have lenovo k3 note k50a40, india version, at first have installed miui 8 rom from gooddeath version 6.11.24, and was working fine with rom version 5.0.1 blispop, but i wanted to upgrade so i tried urs but it is not working i have downloaded ur last 11 dec file with 400mb approx and have installed twrp 3.0.2.7 with SuperSU v2.78 SR5, but ur rom is not installing the error says "e3004:THIS PACKAGE IS FOR DEVICE :K50-T5.AIO_M,K3NOTE;THIS DEVICE IS AIO_O.FP"
ERROR 7 , SO PLEASE HELP AND I HAVE ALSO TRIED TO INSTALL GAPPS FROM OPENGAPPS NANO FILE IT GENERATES ERROR TOO WITH "INCOMPATIBLE ROM DETECTED, THIS GAPS IS FOR 7.1.X ONLY BUT THIS IS 5.1.1 SDK 22" SO PLS HELP....
Click to expand...
Click to collapse
ezhome2046 said:
use other twrp ver to try.
---------- Post added at 11:39 AM ---------- Previous post was at 11:37 AM ----------
twrp 3.0.0-2 couco92 maybe work for you. any idea broda
Click to expand...
Click to collapse
There are just too many versions of TWRP and each carry different device names. Of course, it's up to the builders' will. But, I think the stock recovery's device name would be the best compromise for everyone. It would also work for official updates. I hope most of the fellow developers would accept and make the life of everyone easier.
For the time being, you have to edit the updater-script manually or use another TWRP....
The new CM-14.1 Android-7.1.1_r6 is out now.
Audio recording is fixed in this build. Cheers!
Plz help me iam a7000 plus user when I flash the modem my sim can't be detected but i can receive calls but I can't make calls plz reply
Thank you for your work you are amazing
ziad shawki said:
Plz help me iam a7000 plus user when I flash the modem my sim can't be detected but i can receive calls but I can't make calls plz reply
Thank you for your work you are amazing
Click to expand...
Click to collapse
This is the 2nd time I saw your post. I seldom ignore anyone but I honestly don't know what you meant. I was thinking someone wiser would know and answer you.
You flash the modem? I never mention any modem in my entire thread. What modem?
You don't need the correct grammar or even nice words. If you want help, please help others understand first. Having problem is frustrated but you need to list the detail so that anyone might help. A few word normally won't tell your story. You need to slow down and have some patience to describe your situation in detail first.
At least you have to tell.
1. Where are you? If you are not in my area, it's out of my reach. Hoping someone in your region might help.
2.. What else have you flashed or installed? It would let someone in your region to understand your problem clearer.
This would be my final answer. No one would have time and patience to ask again and again. You ask for help, it's your basic responsibility to provide the detail. Otherwise, you left others no choice but ignore you.
Good luck.
finally audio recording is working. thank you daniel_hk for your hard working.
Hi daniel_hk
Lenovo a7000 plus have another baseband version from k3 note so there's a modem patch zip that make lenovo k3 note custom ROMs works on lenovo a7000 plus and to make the SIM card detected but when I flashed with your ROM i get SIM card not detected but I can receive calls and massages only but i can't make calls so can you make a fix for that
Thank you for reply
By the way I am from Egypt :laugh:
hello daniel_hk ,
does internet video/audio call for whatsapp work?
hows the battery backup?
can work for ext access read/write?
thank you for your hardwork, itwill be the great if all bugs free.
is it port from Jiayu S3
in lenovo a7000+ indonesia sim not working. please fix for lenovo a7000+
You're doing such a great job with this rom! Thank you so much, really apreciate your effort and keep it up!

Self-compiled kernel doesn't work on S8

I'm curently using LineageOS 17, but I want to build a custom kernel to get some drivers done, so got the source at https://github.com/exynos8895/android_kernel_samsung_universal8895/ added `ARCH=arm64`, `CROSS_COMPILE=aarch64-linux-android-`, `CC=clang`.
So it builds, it generates this image, `unpack` replace the `zImage` then `repack`. It doesn't work, it doesn't even update the `/proc/last_kmsg`.
Also to ensure it was not my tooling that was broken, I used the same clang version as the lineageos one, clang-r353983c1 and tried to swap kernels between different boot.img(the lineage one and the rzkernel) it did work, so what in hell is happening? There is any trick? Signing it with some magic?
zImage below,
https://mega.nz/file/astFzIgQ#EDdd5fyEcOhfEJOgmRoDtv8DRwarMPcgqWKVxol-Q5E

Attempt to build LineageOS 15.1/16.0 with HW decoding

Hello,
I am currently trying to build a custom build of LineageOS 15.1
ATM I have followed the official LineageOS guide to compile and have added vendor repo from Steel01 Gitlab (CM-Shield)
Afterthat, I have applied the patch for exposing the arm libm intrinisics with repopick.
Compiling is success, the tablet can boot but Youtube 1080p/60fps videos are still laggy (a lot of dropped frames).
Do you know what other things can be done?
Edit: I am also trying to build 16.0 releases. Build successfully completed but cannot boot.
How this can be troubleshooted?
I had look at the kernel and recovery logs. Kernel log show strange errors but cannot say if these are the cause of the 'non-booting'

Extract vendor blobs and make a device tree

I'm trying since many time to get a Lineage os build for my device, which is a Samsung A20s |SM-A207F| (codename: a20s) with OneUI 3 (android R) but i'm limited for the following reasons:
There are no device tree to work with.
No vendor blobs to work with
How I get device tree and vendor blob using stock rom or from any other methods

trying to get lineage 20 to boot on both xperia 1 and 5

so yeah, i trying to build lineage os 20 to boot on both xperia 1 and 5, but right now it didn't boot. based on testers
here's the proof
xperia 5 :
https://github.com/lolipuru/device_sony_bahamut
https://github.com/lolipuru/vendor_sony_bahamut
xperia 1 :
https://github.com/lolipuru/device_sony_griffin
https://github.com/lolipuru/vendor_sony_griffin
kumano common tree :
https://github.com/lolipuru/device_sony_sm8150-common
https://github.com/lolipuru/vendor_sony_sm8150-common
kernel :
https://github.com/lolipuru/kernel_sony_sm8150
these tree is very different than currently tree, due to no longer rely on stock vendor. and camera already fix to works with newer android
first time i tried it give me black screen , with hwcomposer 2.4 not running. but with rebased tree it didn't boot at all (and both tree are rebased on same pdx206, which i currently own.)
without pstore or console ramoops it's hard to know the real issues
should i open donation to buy device (xperia 1 or 5 is fine, since it share same hardware) to fix the issues? (i already have tester, but seem like i need ramoops or console ramoops log for point out the real issues)
actually i didn't want to open for donation, until ferdian (who maintain xperia 1 twrp), told me to try)
I build kernel for griffin with both your kernel source and Sjll's kernel source.
I found a strange(?) thing: If I build kernel without "techpack/audio", everything works well expect audio (Yep, drop audio kernel so audio dead), but If I build kernel with "techpack/audio", then I got bootloop, surfaceflinger and hwcomposer dead.
This is TOO Strange.....I tested on my Xperia 1 (802SO), not only your kernel source but also Sjll's kernel source have this issue.
And another strange thing is that the kernel source is working well for bahamut (Xperia 5) :\
Okay, I just find that two strange things.So I guess here are something strange with Sony's Open Archive
Do you need dmesg or something else? I got griffin but I have no idea with this issue.
RealNoobKanger said:
I build kernel for griffin with both your kernel source and Sjll's kernel source.
I found a strange(?) thing: If I build kernel without "techpack/audio", everything works well expect audio (Yep, drop audio kernel so audio dead), but If I build kernel with "techpack/audio", then I got bootloop, surfaceflinger and hwcomposer dead.
This is TOO Strange.....I tested on my Xperia 1 (802SO), not only your kernel source but also Sjll's kernel source have this issue.
And another strange thing is that the kernel source is working well for bahamut (Xperia 5) :\
Okay, I just find that two strange things.So I guess here are something strange with Sony's Open Archive
Do you need dmesg or something else? I got griffin but I have no idea with this issue.
Click to expand...
Click to collapse
Sjll source have main issues,
first, it's mostly modify kernel with stock dtb (due to rom built "without" vendor at all, so it still using stock vendor)
second, even you manage to fix it. but most of blobs are pretty outdated now (espepcially camera blobs, you still need to do a manually patch)
i tried with full source build, yea. it booted but blacked screen due to hwc 2.4 isn't running at all. (when i was address all missing blobs, it doesn't boot)
* kernel is pretty fine, it can boot to twrp but i didn't want to use it (due to nature of a/b twrp, so it broke many things if you use with sjll source.) so i tell ferdian to do an installer script
i already have a chat with creamdraft and bbn about this, seem like that issues isn't easy to deal with

Categories

Resources