• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

Cyanogenmod for mediatek devices

Search This thread

cakehonolulu

Senior Member
Sep 5, 2017
53
9
There's a s# load of stuff you need to upstream , but let me check if I can find this old test kernel repo...
From the top of my head: it needs
ssome platform / drivers upstreamed (video being one)
Some mediatek/kernel drivers upstream( video as well)
And add several includes on kernel common ( defines used by this drvs)

Even so that this fixed the pvr upgrade issue with video, I moved on to an newer kernel baseline , and things are better ( and cleaner as well) haha

Cheers

Edit: as for audio I rebuilt audio libs using MTK MT6589 KK BSP, and included MTK KK 6589 new audio policy on frameworks

Sorry for asking, but where can I find thoose commits you mention? I've tried all ways I know to boot a higher version mediatek kernel (Using my device-specific configs) but to no avail, so I'd like to try upstreaming my current one.

EDIT:
And how doable is Marshmallow on the 6589 platform? I think you said somewhere you were working on it and I'm geniunely curious about it

EDIT 2:
After experimenting a bunch, I've tried:
Reverting all the 'upstreaming' video/mtkfb changes and then, pvr updates plus booting with a matching version jellybean pvr blobs (And even my stock ones but by changing the pvr versions so that they didn't 'collision' and they loaded even though they were version-mismatching), out of all the possible combinations I've been doing, only 1 has given me a positive (Kinda) outcome, replacing cust_gpio headers from the stock kernel source's (They were still intact at mediatek/custom/out...) residual build files. That has fixed the 'error' that made me unable to power on the screen back to android (Even tho it keeps being switched on if I push the power button) after some time had passed. Also tried the kernel's LCM, but it gave me colour glitches and the problem persisted so I've rollback't that too. I don't really know where else to look/debug, just in case, I've grabbed a copy of IDA 7.2 (With the arm decompiler) just in case you need me to debug something on the actual booting official kernel. Thanks for your time, also, all of this testing is being done under CM12.1 just in case you were wondering (Running on the Kitkat partition scheme that gives me 16MB for boot/recovery and it's preloader etc, I tought
there were gonna' be compatibility issues between a JB preloader and a LP rom but it doesn't look like it, only change I made was on to the partition_defines on kernel source to adapt it to the kitkat partition scheme my brand gave us).

EDIT3:
@superdragonpt USB works now (I'm not sure what has made it work, but it does so...) and I've managed to get a logcat when I power the screen on:

Code:
I/PowerManagerService(  461): Going to sleep due to power button (uid 1000)...
D/Sensors (  461): hwm__activate: handle 0, enable or disable 0!
I/PowerManagerService(  461): Sleeping (uid 1000)...
D/PhoneStatusBar(  574): disable: < expand ICONS alerts SYSTEM_INFO back HOME RECENT clock SEARCH >
W/SurfaceFlinger(  131): captureScreen: error creating EGL fence: 0x3004
E/WifiStateMachine(  461): cancelDelayedScan -> 16
D/lights  (  461): write_int open fd=166
D/lights  (  461): write_int open fd=166
I/DisplayManagerService(  461): Display device changed: DisplayDeviceInfo{"Pantalla integrada": uniqueId="local:0", 720 x 1280, 60.000004 fps, supportedRefreshRates [60.000004], density 320, 320.0 x 320.0 dpi, appVsyncOff 0, presDeadline 17666666, touch INTERNAL, rotation 0, type BUILT_IN, state OFF, FLAG_DEFAULT_DISPLAY, FLAG_ROTATES_WITH_CONTENT, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS}
V/ActivityManager(  461): Display changed displayId=0
D/SurfaceFlinger(  131): Set power mode=0, type=0 flinger=0x40882000

EDIT Added DMESG's:

Screen poweroff:
https://pastebin.com/aQsC8s2W

Screen Poweron:
https://pastebin.com/ctft8WJX

Do you see anything suspicious?
Also, upstreamed the kernel to 3.4.113 without issues and added a bunch of missing optimization stuff and built a cortex-a7 specific toolchain to build the source with special compile flags.
 
Last edited:

mjdr

New member
May 1, 2020
1
0
Drivers for MK6761

Hi I'm trying to get wifi, audio working on my Redmi 6A (cactus) MT6761. Native rom insmoding .ko modules, but when I try to do this in mine it gives an error
Code:
[B][ +0.219944] .(1)[1978:insmod]wmt_drv: disagrees about version of symbol module_layout[/B]
Can I somehow extract offsets and configure gcc?
Or get sources and compile all together?
 

Kaijones23

Recognized Developer
Dec 7, 2018
281
601
Las Vegas
Sorry missed this...



From what I remembered there's some ioctl you need to fix for framebuffer or something like that

( Moving on kernel baseline it's a pain ...) But ye 3.18 is EOL...



To have uart working, you'll need to have uart open

( defined) on lk (littlekernel) and also on preloader



I assume your not an OEM engineer ( : p ) ...so your likely using an retail (user) build, uart is disabled for retail user builds...



Iim not at work, when I get back , I'll check the ioctl issue on help desk...



Cheers



Edit( picture) example of uart on .lk src



Ok so I got the logs

https://paste.ubuntu.com/p/kmkkB5sZ2Z/

One of my testers were able to do the uart and got the stuff spitting out :)
 

superdragonpt

Recognized Developer
Apr 27, 2013
4,906
19,255
Lisbon / Taiwan / USA
www.caixamagica.pt
And how doable is Marshmallow on the 6589 platform? I think you said somewhere you were working on it and I'm geniunely curious about it
My tablet is wifi only , so pretty much all I need is now all working ( except wonky healthd) on los13

I didn't forward port this time 6589 hwc, I have no use for it really
( my kernel has absolutely no support for cameras)

Ram footprint is a bit bigger compared with LP, dlmalloc & other optimizations really makes a difference when you have only 1gb ram

There's some MM percs that are working nicely, multi-window , and video decoding 720p, (in los 12.1) was somehow capped to 360p when watching YouTube ( app)

Again if you use gapps, experience is kinda awful when you use some "bigger" memory hungry apps
( chrome , fb, etc)

Except that, and even better if you don't use gapps, and/or switch to MicroG device runs smoothly ;)

I should be releasing soon first build, really want to fix healthd (offline charging) ...

Next target is los14.1 , and should probably be my last bring up for mt6589
 
Last edited:

bigrammy

Senior Member
Apr 8, 2011
2,939
2,546
huddersfield
My tablet is wifi only , so pretty much all I need is now all working ( except wonky healthd) on los13
Hi, Have you come across binary called /system/bin or vendor/bin/modemsbp_con2 in any ROM's before it is in all our Sony Mediatek devices except the XA1 (which has the 4.4 kernel).
I think this maybe the cause of the RIL issues we have in ALL the Sony MTK Range but not sure if it's mediatek or sony's source?
https://github.com/PineDevelopment/vendor_sony_pine/blob/cm-14.1/proprietary/bin/modemsbp_con2
 

superdragonpt

Recognized Developer
Apr 27, 2013
4,906
19,255
Lisbon / Taiwan / USA
www.caixamagica.pt
Hi, Have you come across binary called /system/bin or vendor/bin/modemsbp_con2 in any ROM's before it is in all our Sony Mediatek devices except the XA1 (which has the 4.4 kernel).
I think this maybe the cause of the RIL issues we have in ALL the Sony MTK Range but not sure if it's mediatek or sony's source?
https://github.com/PineDevelopment/vendor_sony_pine/blob/cm-14.1/proprietary/bin/modemsbp_con2

The binary and service aren't from MediaTek , this is part of Sony's implementation.
It's like an second ccci init, it reads values from nvram and start the service.

I bet there's an extra partition (or more) on Sony MediaTek devices

Last Sony mtk device I work was on Xperia c4 I believe (mt6589)
The locked BL completely killed any development...

If memory serves me...
 
Last edited:
  • Like
Reactions: bigrammy

bigrammy

Senior Member
Apr 8, 2011
2,939
2,546
huddersfield
The binary and service aren't from MediaTek , this is part of Sony's implementation.
It's like an second ccci init, it reads values from nvram and start the service.

I bet there's an extra partition (or more) on Sony MediaTek devices

Last Sony mtk device I work was on Xperia c4 I believe (mt6589)
The locked BL completely killed any development...

If memory serves me...
Hi, Thanks for your reply :good: and sorry for my late response :eek:
I have been digging through trying to put the pieces together and "I Think" it gets and writes values from various places. I think these determine which modem specifics get loaded "Bands etc" region dependent eg a USA device would get different bands to a Europe device. I do not think Sony ship different modems with each device but unlock the required parts instead. :confused:
The Sony C4 was a mt6752 cpu and the bootloader is officially unlock-able on all MTK Sony's I have M5, L1, C4, XA, XA1
There was a early model with that CPU mt6589 called the sony xperia c https://www.gsmarena.com/sony_xperia_c-5541.php So maybe thats what you are referring to.

While the bootloader is unlocked messing with the preloader, LK is not advised as Sony use there own "s1 loader" so no SPFlashTool for recovering any bricks. :eek:
Everything else is modifiable.
The L1 is coming along nicely and we have a booting AEX rom (AOSP based as you suggested) Just this darn RIL to fix. :crying:
 

jmpf_bmx

Senior Member
Sep 16, 2018
86
48
The binary and service aren't from MediaTek , this is part of Sony's implementation.
It's like an second ccci init, it reads values from nvram and start the service.

I bet there's an extra partition (or more) on Sony MediaTek devices

Last Sony mtk device I work was on Xperia c4 I believe (mt6589)
The locked BL completely killed any development...

If memory serves me...

Hi, Thanks for your reply :good: and sorry for my late response :eek:
I have been digging through trying to put the pieces together and "I Think" it gets and writes values from various places. I think these determine which modem specifics get loaded "Bands etc" region dependent eg a USA device would get different bands to a Europe device. I do not think Sony ship different modems with each device but unlock the required parts instead. :confused:
The Sony C4 was a mt6752 cpu and the bootloader is officially unlock-able on all MTK Sony's I have M5, L1, C4, XA, XA1
There was a early model with that CPU mt6589 called the sony xperia c https://www.gsmarena.com/sony_xperia_c-5541.php So maybe thats what you are referring to.

While the bootloader is unlocked messing with the preloader, LK is not advised as Sony use there own "s1 loader" so no SPFlashTool for recovering any bricks. :eek:
Everything else is modifiable.
The L1 is coming along nicely and we have a booting AEX rom (AOSP based as you suggested) Just this darn RIL to fix. :crying:

Hi,
@superdragonpt would you like to help to @bigrammy, rote66, r0Rt1z2, kjones and me make ril work.
I find the issue but we don't know what we can make, i send the issue.
Code:
E/RIL-DATA: [setLceMode] got error response
E/RIL-NW  : Recevice an invalid value from modem for <rxlevel>
E/RIL-OEM : updateSignalStrength ERROR: -1
The question is, can we make a hack on the modem or something for make it work?
What will you do if you trouble this problem?
If someone donate you a XPERIA L1 would you love to help us?
Thanks!
Regards,
Jose!
 
Last edited:

blakegriplingph

Senior Member
May 13, 2011
969
145
Amazon Fire
Realme C3
Missing GUI issue

Any idea on what's causing this? I traced it to a few files which is apparently causing the issue I am having with getting CM12.1 to work on my LeapFrog Epic:

Code:
 #02 pc 0002a883  /system/lib/libgui.so (_ZNK7android19BufferQueueProducer25waitForFreeSlotThenRelockEPKcbPiS3_+386)
  #03 pc 0002b051  /system/lib/libgui.so (_ZN7android19BufferQueueProducer13dequeueBufferEPiPNS_2spINS_5FenceEEEbjjjj+192)
  #04 pc 00030da9  /system/lib/libgui.so (_ZN7android23BnGraphicBufferProducer10onTransactEjRKNS_6ParcelEPS1_j+248)

I've also attached a ZIP containing some log files for your perusal.
 

Attachments

  • traces.zip
    149.2 KB · Views: 9
Aug 17, 2020
6
0
easy workaround fix non-emulated storage

Nice nice. Though I've noticed in my tablet's stock boot.img fstab that there doesn't appear to be a line for mounting /system:
Code:
# Android fstab file.
#<src>           <mnt_point>         <type>    <mnt_flags and options>                 <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK

/[email protected]     /data               ext4      noatime,nosuid,nodev,noauto_da_alloc    wait,check,encryptable=footer
/[email protected]_f   /protect_f          ext4      noatime,nosuid,nodev,noauto_da_alloc    wait,check
/[email protected]_s   /protect_s          ext4      noatime,nosuid,nodev,noauto_da_alloc    wait,check
/devices/platform/mtk-msdc.0/mmc_host   auto      vfat      defaults        voldmanaged=sdcard0:[email protected],noemulatedsd
/devices/platform/mtk-msdc.1/mmc_host   auto      vfat      defaults        voldmanaged=sdcard1:auto
/devices/platform/mt_usb                auto      vfat      defaults        voldmanaged=usbotg:auto
Does this mean I have to manually add the appropriate line for /system?

EDIT: I got even further and managed to load up boot.img, well, sort of. Now the tablet just hangs up at the boot logo instead of power-cycling as before due to a missing MTK header. The device is detected by ADB but while I can successfully query it through 'adb devices', attempting to use any other command especially 'adb shell' results in the following error:
Code:
exec '/system/bin/sh' failed: No such file or directory (2)

flash modded ebr1 and ebr2 via flashtool.just repartition your device rom and you don't need to edit fstab. and you can also replace uevented.rc in case stuck on logo.
 

superdragonpt

Recognized Developer
Apr 27, 2013
4,906
19,255
Lisbon / Taiwan / USA
www.caixamagica.pt
Any idea on what's causing this? I traced it to a few files which is apparently causing the issue I am having with getting CM12.1 to work on my LeapFrog Epic:

Code:
 #02 pc 0002a883  /system/lib/libgui.so (_ZNK7android19BufferQueueProducer25waitForFreeSlotThenRelockEPKcbPiS3_+386)
  #03 pc 0002b051  /system/lib/libgui.so (_ZN7android19BufferQueueProducer13dequeueBufferEPiPNS_2spINS_5FenceEEEbjjjj+192)
  #04 pc 00030da9  /system/lib/libgui.so (_ZN7android23BnGraphicBufferProducer10onTransactEjRKNS_6ParcelEPS1_j+248)

I've also attached a ZIP containing some log files for your perusal.

Issue with dpframework

Cheers
 

kalwardin

Member
Mar 18, 2020
13
0
Meizu M2 / M2 Mini
Error: While building kernel with codegen.dws

While building kernel error pops
make no rule to target /home/linux/build/src/kernel_source/drivers/misc/mediatek/mach///dct/dct/codegen.dws
needed by /home/linux/build/src/kernel_source/out/drivers/misc/mediatek/mach///dct/dct/inc/cust_kpd.h
 

Top Liked Posts

  • There are no posts matching your filters.
  • 79
    Hey guys, We are going to try something new for our china phones - cyanogenmod.

    But we need some more devs to get everything going.



    For now we have:

    -Github tree for Lenovo P700i(mediatek 6577, android 4.0.4, kernel 3.0.8)

    -Lens_flare - original port author(may work with system folder and configs)

    -some kernel source from other devices like liquid gallant



    The main problem is getting adb to work that could help a lot on remaining development. For now even zygote not starting, but all partitions seems mounted successfully.

    We need more devs (especially that could assemble working kernel for device), working with p700i may lead to following porting for other mtk devices, as sources are nearly the same.
    40
    Lollipop on MT6577

    Hi there .

    Just to let you know, that lollipop is now booting on ZTE v970 [MT6577- w/ ComBo-Chip MT6620]
    With my custom 3.4.67 KK Kernel + some cherry-picks from the new MTK 3.10.54 LL Kernel

    Still very early, baseband is recognized , but still needs a lot more work on Telephony, Platform, etc.


    ;)

    Regards
    39
    More progress on this one: http://forum.xda-developers.com/showthread.php?t=2467400

    I have 3G data and incoming voice calls working now.

    Next: kitkat.

    Chris

    Please hit the thx button. And please thank also dr shadow and xplodwild from omnirom.
    27
    KitKat Sources MT6582 / 6592

    Since my Cloud host, removed the sources,that i uploaded twice

    Using MEGA now, should be on for some days..


    Edit: no more source leaks, noobies will always be noobies
    I won't be sharing more source stuff

    Learn to comply with GPL and respect others



    Regards
    27
    I'm working now since 1 day on CM13 and here the first screenshot on mt6592 :).