[WIP]CyanogenMod 12.1 for Xiaomi Mi 4i

Search This thread

dh.harald

Senior Member
May 20, 2010
594
1,611
London
SOURCES

I've worked on this in the last 4-5 days... Unfortunately, i've no too much spare time, so I've published my sources, because I'm stucked on several areas...
I'm asking every Developer to collaborate.

This source is very experimental. I'm not responsible if you transform your phone into a brick!

kernel: https://github.com/dh-harald/android_kernel_xiaomi_ferrari
device: https://github.com/dh-harald/android_device_xiaomi_ferrari
optional:
vendor: https://github.com/dh-harald/android_vendor_xiaomi_ferrari

so your local_manifest must be something like this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
    <project path="kernel/xiaomi/ferrari" name="dh-harald/android_kernel_xiaomi_ferrari" />
    <project path="device/xiaomi/ferrari" name="dh-harald/android_device_xiaomi_ferrari" />
    <project path="vendor/xiaomi/ferrari" name="dh-harald/android_vendor_xiaomi_ferrari" />
    <project path="device/qcom/common" name="CyanogenMod/android_device_qcom_common" />
    <project path="external/mm-dash" name="CyanogenMod/android_external_mm-dash" />
    <project path="hardware/qcom/fm" name="CyanogenMod/android_hardware_qcom_fm" />
</manifest>

Quick compile guide:
Code:
cd <your source>
. build/envsetup.sh 
brunch cm_ferrari-userdebug

This topic is strictly for developers, so it will be enough for help :)
 
Last edited:

dh.harald

Senior Member
May 20, 2010
594
1,611
London
IMPORTANT
The binary base of my rom is 5.6.11.
If you have unexcepted behaviours, try to install developer edition 5.6.11, before you install CM

Latest alpha builds:
From: @dh.harald
cm-12.1-20151015-UNOFFICIAL-ferrari.zip - 348.13 MB
Sensor patch:
patch-sensors.zip - 204.43 KB (only libsensorservice.so needs)
I'm currently testing this build as a daily driver

From: @smoki3
Sensors patch already applied:
cm-12.1-20150722-UNOFFICIAL-ferrari.zip

WORKING
2D acceleration
Touchscreen
HW/SW buttons
RIL/multisim
+ mobile data (big thanks for @smoki3 & @k2wl)
Wifi
Bluetooth
internal SD
MTP
vibrate
gps
camera ( @smoki3)
audio (with proprietary drivers)
fm radio @k2wl
notification lights (see limitations: http://forum.xda-developers.com/showpost.php?p=61954224&postcount=434)
ant +
+ you tell me

NOT WORKING
sensors (use this patch: http://d-h.st/S5m)
+ everything else...

CHANGELOG
+ doze (limited)

If you want buy us a beer, here are the donation links:
dh.harald
smoki3
k2wl
 
Last edited:

Bitti09

Senior Member
Jun 26, 2012
838
3,519
Essen

k2wl

Senior Member
Apr 19, 2008
3,166
7,574
You didn't define msm8916 audio files in your device.mk like inhttps://github.com/CyanogenMod/android_device_cyanogen_msm8939-common/blob/cm-12.1/msm8939.mk
 

k2wl

Senior Member
Apr 19, 2008
3,166
7,574
yes those...but why you put them in full.mk insetad of device.mk

are those building during compilation...check that too..

you must be missing something in your blobs...

and if those are building fine then just put
/system/vendor/lib/hw/sound_trigger.primary.msm8916.so
/system/vendor/lib/libhwdaphal.so
/system/vendor/lib64/libhwdaphal.so

in your vendor tree.

these are vendor files and are not open source files...like

https://github.com/AICP/device_htc_...c21f098ea9e883e156/proprietary-files.txt#L182
https://github.com/AICP/device_htc_...c21f098ea9e883e156/proprietary-files.txt#L400
https://github.com/AICP/device_htc_...c21f098ea9e883e156/proprietary-files.txt#L715

build everything else as open source like audio.primary.msm8916
 
Last edited:

dh.harald

Senior Member
May 20, 2010
594
1,611
London
add DATA is not working.
No mobile data and no LTE option
Thanks... I try to check it, but my mobile provider is not too healthy nowadays... (and I have no LTE subscription)
That's pretty sure, that the following proprietary files are missing for mobile data:
bin/netmgrd
lib/libcnefeatureconfig.so
lib64/libcnefeatureconfig.so
 
Last edited:
  • Like
Reactions: prashant3285

smoki3

Senior Member
Oct 29, 2010
1,713
1,243
Heidenheim
Thanks... I try to check it, but my mobile provider is not too healthy nowadays... (and I have no LTE subscription)
there is no lte option in settings until now. only 2g 3g there. but not working

---------- Post added at 08:18 PM ---------- Previous post was at 07:58 PM ----------

Thanks... I try to check it, but my mobile provider is not too healthy nowadays... (and I have no LTE subscription)
That's pretty sure, that the following proprietary files are missing for mobile data:
bin/netmgrd
lib/libcnefeatureconfig.so
lib64/libcnefeatureconfig.so
Have you tried to add them? does it work?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 61
    SOURCES

    I've worked on this in the last 4-5 days... Unfortunately, i've no too much spare time, so I've published my sources, because I'm stucked on several areas...
    I'm asking every Developer to collaborate.

    This source is very experimental. I'm not responsible if you transform your phone into a brick!

    kernel: https://github.com/dh-harald/android_kernel_xiaomi_ferrari
    device: https://github.com/dh-harald/android_device_xiaomi_ferrari
    optional:
    vendor: https://github.com/dh-harald/android_vendor_xiaomi_ferrari

    so your local_manifest must be something like this:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <manifest>
        <project path="kernel/xiaomi/ferrari" name="dh-harald/android_kernel_xiaomi_ferrari" />
        <project path="device/xiaomi/ferrari" name="dh-harald/android_device_xiaomi_ferrari" />
        <project path="vendor/xiaomi/ferrari" name="dh-harald/android_vendor_xiaomi_ferrari" />
        <project path="device/qcom/common" name="CyanogenMod/android_device_qcom_common" />
        <project path="external/mm-dash" name="CyanogenMod/android_external_mm-dash" />
        <project path="hardware/qcom/fm" name="CyanogenMod/android_hardware_qcom_fm" />
    </manifest>

    Quick compile guide:
    Code:
    cd <your source>
    . build/envsetup.sh 
    brunch cm_ferrari-userdebug

    This topic is strictly for developers, so it will be enough for help :)
    54
    IMPORTANT
    The binary base of my rom is 5.6.11.
    If you have unexcepted behaviours, try to install developer edition 5.6.11, before you install CM

    Latest alpha builds:
    From: @dh.harald
    cm-12.1-20151015-UNOFFICIAL-ferrari.zip - 348.13 MB
    Sensor patch:
    patch-sensors.zip - 204.43 KB (only libsensorservice.so needs)
    I'm currently testing this build as a daily driver

    From: @smoki3
    Sensors patch already applied:
    cm-12.1-20150722-UNOFFICIAL-ferrari.zip

    WORKING
    2D acceleration
    Touchscreen
    HW/SW buttons
    RIL/multisim
    + mobile data (big thanks for @smoki3 & @k2wl)
    Wifi
    Bluetooth
    internal SD
    MTP
    vibrate
    gps
    camera ( @smoki3)
    audio (with proprietary drivers)
    fm radio @k2wl
    notification lights (see limitations: http://forum.xda-developers.com/showpost.php?p=61954224&postcount=434)
    ant +
    + you tell me

    NOT WORKING
    sensors (use this patch: http://d-h.st/S5m)
    + everything else...

    CHANGELOG
    + doze (limited)

    If you want buy us a beer, here are the donation links:
    dh.harald
    smoki3
    k2wl
    13
    @dh.harald: any update? Are you still working on this?
    I'm working on CM-13.0, so I think, there's no more CM-12.1 :(
    11
    OK. I got the sensors working!!!!!

    I added these files from the stock rom :
    Code:
    system/bin/halsensors
    system/lib/libsensorservice.so
    lib64/libsensorservice.so
    vendor/lib/mmi_gsensor.so
    vendor/lib64/mmi_gsensor.so
    vendor/lib/mmi_lsensor.so
    vendor/lib64/mmi_lsensor.so
    vendor/lib/mmi_msensor.so
    vendor/lib64/mmi_msensor.so
    vendor/lib/mmi_psensor.so
    vendor/lib64/mmi_psensor.so
    lib64/hw/sensors.lsm6db0.so
    lib/hw/sensors.lsm6db0.so
    bin/sensor_select.sh
    bin/sensorservice
    bin/test-nusensors

    And added this line to the build.prop file
    Code:
    ro.hardware.sensors=lsm6db0
    11
    For anyone asking how to flash, here goes:

    1. Download the build provided in this thread (post 2)
    2. Download the GAPPS. The build is 64-bit, so you need 64-bit Gapps! . I recommend BaNkS as well:
    Code:
    [url]http://fitsnugly.euroskank.com/?rom=banks&device=gapps[/url]
    3. Download the Recovery from here:
    Code:
    https://drive.google.com/file/d/0B0pkb-PnDIp8cTc4NENOODFRazA/view
    4. to Flash recovery, just run the exe.
    OR
    To only Boot into recovery. (My fav method is to tether boot, this wont flash recovery and keep stock recovery intact.)
    • Extract the twrp.img file from the downloaded zip.
    • Put the device in fastboot bode.

      Code:
      fastboot boot twrp.img
    5. Once in recovery, select wipe, and select ALL the options except OTG.
    This will wipe your entire phone, dalvik, cache, data, system, ALL.
    6. Once done, the internal storage will be mounted automatically to be accessed as a drive.
    7. Copy your build and GApps to the internal storage.
    8. On the TWRP recovery, go back to main screen, and hit Install.
    9. Select your build file, and then Add files-> GApps.
    10. Swipe to flash.
    11. Reboot!

    As again, the first boot takes around 7-10 minutes, grab a coffee or make a kite...

    Hope this helps :D