[PROJECT][EXPERIMENTAL] Linux kernel 3.18.31 for Xiaomi Mi A1 (tissot)

Search This thread

cute_prince

Inactive Recognized Developer
May 19, 2012
782
4,300
Trivandrum
@cute_prince after flashing the December patches, I'm unable to boot any kernel from fastboot (except recovery). I've made a couple of changes to the driver which removed the 'maxim,max98927L' from the ID table, but I still don't have any way to test the changes. Also, I think that this dmesg warning is the key.

Code:
[    9.097167] i2c-msm-v2 78b6000.i2c: NACK: slave not responding, ensure its powered: msgs(n:2 cur:0 tx) bc(rx:1 tx:2) mode:FIFO slv_addr:0x3a MSTR_STS:0x0d1300c8 OPER:0x00000010

The slave address matches the one in the device tree, which means that the amp stopped responding to the i2c messages. If you're able to, try to find out the line after which this happens (it is definitely max98927_probe) by adding print statements (I would try doing that but my phone isn't booting any custom kernel at all).

Also, reset_gpio_l isn't saved in the struct, it is local to the function.

Dude, you are awsome mann :) That i2c error message indeed is the key. I see the name of driver in our max98927.c is "max98927" and in the leeco's dts file it is being referenced by "max98927@3a". Whereas in A1 dts file it is being referenced by "spkamp@3a". Maybe changing "spkamp@3a" to "max98927@3a" will solve the problem :). What do you think ?
 
Last edited:

ur0

Senior Member
Jun 17, 2012
118
343
Mumbai
I don't think that renaming the dt entry will have any effect.

Actually, I found a bit of code Xiaomi inserted before the reset pin is written to. I'm still trying to figure out what it does. So far, it's the only thing which is stopping the amp from working.
 
  • Like
Reactions: xactor and ddaggebi

ur0

Senior Member
Jun 17, 2012
118
343
Mumbai
Small update: I've narrowed this down a bit.

The codec device isn't being powered on. In Linux, audio devices' power is controlled by DAPM, which requires pre-defined routes to know when to keep a device on. These routes are specified in the kernel by the machine. Since RN4 doesn't have an amp, the kernel sources don't have any sensible routes for it.

Tomorrow (hopefully), I'll try to RE the stock kernel's audio_map and figure out the labels so that we can fix this.
 

cute_prince

Inactive Recognized Developer
May 19, 2012
782
4,300
Trivandrum
Small update: I've narrowed this down a bit.

The codec device isn't being powered on. In Linux, audio devices' power is controlled by DAPM, which requires pre-defined routes to know when to keep a device on. These routes are specified in the kernel by the machine. Since RN4 doesn't have an amp, the kernel sources don't have any sensible routes for it.

Tomorrow (hopefully), I'll try to RE the stock kernel's audio_map and figure out the labels so that we can fix this.

Yes. We need to add CPU <--> BE DAI links for our codec in sound/soc/msm/msm8952.c. Then DAPM needs to be setup. Probably we need to add new routes in sound/soc/msm/qdspv6/msm-pcm-routing-v2.c too.
 
Last edited:

gregbradley

Retired Forum Moderator
Thread cleaned

Development thread sort of gives it away. Please only post development related posts.
There is no need to say thanks, or post that you clicked thanks
There is no need to ask for ETAs
There is no need to ask for current status, that's in the OP
There is no need to reply to these kind of posts
There is no need to argue in a public forum.

Greg
 

sarfaraz1989

Senior Member
Jan 19, 2011
655
62
New Delhi
Devs,
appreciate all your hardwork! can you please update the op with the the information on what is not working or what you are currently working on.

Request you to do this in your spare time.
 

ur0

Senior Member
Jun 17, 2012
118
343
Mumbai
Any news regarding this PR? :)

Ahh.. I'd been dreading this. While my initial patches worked, something consistently went awry within a few minutes after boot, killing the audio. I've been meaning to get to it since forever, and I'll probably get it done soon after the holiday season (if Xiaomi still doesn't release the kernel sources).
 

zeyaan

Senior Member
Jun 11, 2012
917
644
Bangalore
OnePlus 5T
OnePlus 6
Hope this continues as I don't see Xiaomi interested in the release of kernel sources anytime soon. Hope atleast we have a working and fully functional kernel tree from where the development could kick start.

What a shame a masterclass value for money phone is not supported by the manufacturer itself.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 64
    Since Xiaomi has not released the kernel sources yet, I'm currently trying to port Redmi Note 4 (mido) kernel sources for Mi A1. The porting process may succeed because both these devices are based on same architecture and comes from the same manufacturer. I have shared my kernel sources and those who wanna contribute may send pull request to the same. I'm currently looking for testers and those who wants to volunteer please reply in this thread.

    You can test with stock rom or TWRP recovery.
    Steps for testing:
    1. Download TWRP recovery / boot image of stock rom.
    2. Unpack it and replace the prebuilt kernel with our testing kernel.
    3. Repack it and reboot phone to fastboot mode.
    4. Type fastboot boot <repacked_image_name.img>
    5. If it boots, post here the dmesg and other helpful logs ;)

    Status [Working]
    Boots
    Display
    WiFi
    Touchscreen
    RIL
    Vibration
    IR
    Bluetooth
    Sensors
    SD card
    MTP
    Charging

    XDA:DevDB Information
    Linux kernel 3.18.31 for Xiaomi Mi A1 (tissot), Kernel for the Xiaomi Mi A1

    Contributors
    cute_prince, @ur0
    Source Code: https://github.com/cuteprince/android_kernel_xiaomi_msm8953

    Version Information
    Status: Testing

    Created 2017-12-02
    Last Updated 2017-12-02
    46
    Finally, after spending countless hours reverse engineering stock kernel with hex editing tools I successfully extracted the firmware required for our touch panels to work properly. It was a really daunting task but got all the needed firmware files :). Will publish a new boot image for testing tomorrow :)
    38
    I've managed to fix audio. I'll be sending the pull request on Monday.

    I guess the camera's the next challenge.
    30
    Thread cleaned

    Development thread sort of gives it away. Please only post development related posts.
    There is no need to say thanks, or post that you clicked thanks
    There is no need to ask for ETAs
    There is no need to ask for current status, that's in the OP
    There is no need to reply to these kind of posts
    There is no need to argue in a public forum.

    Greg
    24
    @cute_prince
    Your kernel source works, touchscreen is almost unusable but it boots my lineage build

    Do not ask for an ETA or testers please in its current state its worthless due to the touchscreen being pretty much broken

    20171203_222402.jpg
    20171203_225601.jpg