yashsingh1/xdaforums huggingface dataset:
[Atrix 4G Android Development] draxx31:
Kernel issues

Hello Krystian,

I have a question about the kernel improvement. Do you will work on some remaining issues like (i run on epinter's JB):

- headphone / headset connected always put in mute the phone on a call (it should not)

- headset without a micro causes on a call a lot cracks and cut the communication sound (but the recipient can hear you)

- play a music with appolo / soundcloud highly (very very highly) drains the battery

- the power button awak the phone (sensitive button are highlithed) but the screen does not turn on. I have to repeat the operation to have the screen on. Even the phone freeze and I cannot awake my phone

- on video capture done with video recorder the sound is accelerated and cannot be understand.

- the sound raise up / down is not taken into account in games if the setup is done in the games

All these issues are not present with android 2.3 kernel / cyanogen 7.

Thank you for your reply :)
[Atrix 4G Android Development] ohnez:
Please post the Link again to your Dropbox. Thank you.
[Atrix 4G Android Development] Zn7mkUKzN1r8aCIV:
K, in case you are not aware, there is a 3.1.10 actively developing in LG Optimus 2x forum:

http://xdaforums.com/showthread.php?t=2769308

& the github is https://github.com/Firtecy/kowalski/
[Atrix 4G Android Development] sanaldi:
yes deep sleep procedure is working like a charm. the problem is waking atrix up :) i am tryig to wake atrix up periodically but it costs huge battery usage.
[Atrix 4G Android Development] VipeRsan:
And I also recomend to look at KatKernel from timduru. It's not for phone (Tegra 2 tablet) and not 3.1 (it's 2.6.39), but it has great performance and stability. Also timduru KatKiss-KitKat rom has few great improvements.

Wysłane z mojego Transformer TF101 przy użyciu Tapatalka
[Atrix 4G Android Development] PolesApart:
I have a problem with 3.10 kernel in 3G mode: it works for a while (sometimes for hours, but frequenty half an hour or so) and them i got the "sim card absent" or "invalid sim card" (depending on rom) and there's no reconnect. The phone is still usable for calls (incoming and outgoing), but only a reboot restores data functionality. In 2G mode it works fine, and in most recent kernels (excluding the one in Z's KitKat) it recovers fine after a drop. Does anyone else have similar behavior?
[Atrix 4G Android Development] cb5264:
Had the same issue, but in my case the SIM card was really broken...

Gesendet von meinem GT-N7100 mit Tapatalk
[Atrix 4G Android Development] thecjan:
@K

wonder, from dropbox 2014-07-04 & from git 2014-8-28 are the same thing, just cleaned code?
[Atrix 4G Android Development] krystianp:
Just pushed changes that were in my kernels. Tbh not all but some are still in the middle of implementing. I only wanted to push what is fairly stable.
[Atrix 4G Android Development] draxx31:
Hello krystianp,

Sorry to ask you again, but do you will work on some remaining issues like (i run on epinter's JB):

- headphone / headset connected always put in mute the phone on a call (it should not)

- headset without a micro causes on a call a lot cracks and cut the communication sound (but the recipient can hear you)

- play a music with appolo / soundcloud highly (very very highly) drains the battery

- the power button awak the phone (sensitive button are highlithed) but the screen does not turn on. I have to repeat the operation to have the screen on. Even the phone freeze and I cannot awake my phone

- on video capture done with video recorder the sound is accelerated and cannot be understand.

- the sound raise up / down is not taken into account in games if the setup is done in the games

All these issues are not present with android 2.3 kernel / cyanogen 7.

Thank you for your reply
[Atrix 4G Android Development] krystianp:
What I can tell without much investigation is that waking issue is caused by faulty tegra. You have to find working config for your panel. We did some tests and there is no one solution. Go back some pages and you will find all the info needed. Video capture audio recording speed issue is problably caused by my settings that I used for skype to make it work better. It looks it doesn't solve Skype issue completly and breaks video recording. Some issues might not be kernel issues but rather lib issues, it might be hard to fix but I'll try to find solutions or some workarounds.
[Atrix 4G Android Development] thecjan:
@K

K.K. branch git clone seems wrong link path?
[Atrix 4G Android Development] krystianp:
You clone repository not branches. When you have cloned repo you can switch branches to your liking.
[Atrix 4G Android Development] thecjan:
i do switch to KK branch, then

$ git clone https://github.com/CyanogenMod-Atrix/android_kernel_motorola_olympus/tree/kitkat#
Cloning into 'kitkat#'...
fatal: https://github.com/CyanogenMod-Atrix/android_kernel_motorola_olympus/tree/kitkat#/info/refs not valid: is this a git repository?
[Atrix 4G Android Development] krystianp:
you do

git clone https://github.com/CyanogenMod-Atrix/android_kernel_motorola_olympus.git

when it's done, you do

git checkout -b kitkat origin/kitkat

I'm not 100% sure remote repository is stored under "origin" name in local repository. You can check that with this command:

git branch -a

It should list all your cloned remote repositories and their branches and local ones. In this case it will be one repository with 3 branches (cm10.1, ics and kitkat).
[Atrix 4G Android Development] IanTester:
Oops, kristian replied first.
[Atrix 4G Android Development] thecjan:
thank you K, now i figure out how git branches work and try to build my 1st kernel.
[Atrix 4G Android Development] J()KER:
оr

git clone -b kitkat --single-branch https://github.com/CyanogenMod-Atrix/android_kernel_motorola_olympus.git
[Atrix 4G Android Development] rhcohen:
You are talking about building the KitKat branch of the kernel, presumably to apply to Z's kitkat ROM. But since that branch dates from Aug 31, and according to the Atrix KitKat OP, the v2 build of Z's KitKat ROM comes with kernel patches to Aug 31 (with a kernel link to the same git branch) -- unless you make some changes, won't you just be building what is in the v2 ROM build?
[Atrix 4G Android Development] palmbeach05:
That's exactly what he will be doing, he'll be building v2's kernel but under his name and not z's
[Atrix 4G Android Development] thecjan:
hey guys, just practice build kernel things and change bcmdhd module to bcm4329.
[Atrix 4G Android Development] thecjan:
and try build a default branch kernel for miui-rom.
[Atrix 4G Android Development] krystianp:
I've build two kernels (for cm9 and cm10.2) with some tweaks to wlan settings. Please check if waking from deepsleep works (in Skype and other apps). I hope kernel boots, i forgot to backup my scripts and I had to do it by hand (scripts are nice but makes you forget stuff :D)
[Atrix 4G Android Development] todobarato:
Hello krystianp,

Sorry but the kernel doesn't boot, something go wrong.

I get one loop with the Motorola logo.

Best regards,
[Atrix 4G Android Development] andresrivas:
Which one? And on what rom?

Enviado desde mi Moto X usando Tapatalk 2
[Atrix 4G Android Development] todobarato:
CM9 one.
[Atrix 4G Android Development] luckysquid:
thanks [MENTION=4641721]krystianp[/MENTION]

where is the kernel for cm10.2?

I find cm9

https://www.dropbox.com/sh/npbgtozd4w0ahiv/VIA6JjSf4l
[Atrix 4G Android Development] PolesApart:
It seems like kitkat is sticking with bcmhd. I have very poor performance with it. Could we try upgrading it, i.e. merging stuff like http://review.cyanogenmod.org/#/c/34928/ ?
[Atrix 4G Android Development] Zn7mkUKzN1r8aCIV:
Is that Samsung kernel in 3.1 version, if it is higher, cut & paste won't work...
[Atrix 4G Android Development] PolesApart:
Yep, I know the drill. That was just an example, those changes come from AOSP's releases (at least most bcmdhd's changes are being pushed there directly by "some google guy"). I'll take a look on AOSP's tegra tree and see how things are going. If it's worth the trouble I'll try to merge myself and see if it gains anything.

BTW, I compiled our 3.1 straight from git using an updated toolchain and a minor tweaks and got a 20-hour uptime. Previously it would reboot every hour or so. Still can't say it's not a coincidence, for the weather is also cooler and most reboots seemed to happen to me when the phone gets hot. Will report back in a few days.
[Atrix 4G Android Development] lincer556:
Tried to install the latest cm9 kernel from this page: https://www.dropbox.com/sh/npbgtozd4w0ahiv/VIA6JjSf4l (Latest)

And the phone won't boot at all... Tested on MROM ICS (CM9), Epinter CM9, and another CM9 based rom over there.
[Atrix 4G Android Development] Zn7mkUKzN1r8aCIV:
Sorry, I have every plan to upgrade to kernel;s BigPart v2 that ditches /preinstall to give /data an extra 300M space in KitKat v3 and install more apks than ever

Sorry, I have every plan to post Android L BigPart for Moto Atrix 4G here if I can manage to build from source
[Atrix 4G Android Development] wedgess:
Please keep negative remarks about the devices future out of a development thread, show some respect for the developer(s) who worked/have worked on this device.

Thread cleaned
[Atrix 4G Android Development] PolesApart:
[MENTION=5181088]Zn7mkUKzN1r8aCIV[/MENTION] did you change the partition scheme from v1 -> v2? I ask because I'm running a modified kernel on v2 (from [MENTION=4641721]krystianp[/MENTION] github) to test purposes and it probably has the wrong layout then, Ooops.
[Atrix 4G Android Development] Zn7mkUKzN1r8aCIV:
No worry, I was just saying my plan to upgrade bigpart in V3 rom release, feel safe to test with current kernel and V2 :)
[Atrix 4G Android Development] rhcohen:
I am not sure if this post is better here or at the CM11 thread, but anyway, hopefully the following will be of interest to Z, [MENTION=4641721]krystianp[/MENTION] and others.

First, thanks to Z and K for their amazing work! And now...

I finally got around this evening to installing Z's CM11 v2 ROM. Taking care to not have cell and WiFi data on simultaneously, it has been running for four hours without reboots. So I've tried several of the things that were issues here on the kernel thread -- hoping this would help sort out what issues are kernel related and what are ROM related. What I have found so far is:

Skype: the proximity sensor problem is gone with CM11 -- Skype does not blank out when the screen turns off due to proximity. Great! On the other hand the intermittent white noise problem is still there; that is, at random, some calls work fine, while for some the other party (as indicated by the Skype test call) gets only static. So it seems the proximity sensor problem was ROM related, but white noise is kernel.

Stereo recording apps (e.g. RecForge II): as with CM10.1, there is a problem recognizing both microphones when set to stereo recording and "front microphone". Stereo recording worked fine in CM10 (which I believe had pre-3.1.10 kernel) but has not worked properly in CM10.1, and now not in CM11. Occasionally both mics are recognized, but usually not. Rear microphone setting usually does work in stereo. So my conclusion is that this is a problem with the kernel. Doesn't have the sped-up voice problem that was present in the July kernels on CM10.1

Google voice typing: Seems to work, as it was also with relatively recent kernels on CM10.1. But voice search causes google search to crash ("Unfortunately, Google Search has stopped"), whereas that worked with recent kernels on CM10.1, so apparently a ROM issue (and I think others have noted it and sent in the appropriate diagnostic files?).

Camera, and camera flash: seem to work about as on CM10.1

YouTube: current version from Play Store opens, can browse content, but crashes upon actually playing anything (as others have noted).

Modem: I had been having fairly frequent modem drops (with fairly quick restoration most of the time; but other times requiring turning on then off airplane mode) on CM10.1. With CM11, so far, the modem seems to stay solidly on. So apparently a ROM issue vs kernel issue.
[Atrix 4G Android Development] lincer556:
The latest Kernels from THIS PAGE developed on 2014_09_12 doesn't seems to work at all, both CM9 & CM10.1, both given a complete shutdown after Motorola logo.

Sadly, i just wanted to test another kernel.
[Atrix 4G Android Development] palmbeach05:
We've known about that issue for 10 days now. Wait for K to release a fixed version.
[Atrix 4G Android Development] lincer556:
Oh, no prob then, i was thinking that was a 21h release as stated on the Dropbox.
[Atrix 4G Android Development] palmbeach05:
Check the kernel build date, its from 9/12.

Sent from my MB886 CM10.2/4.3.1
[Atrix 4G Android Development] DooMaster:
Hi Krystianp. I'm back with more testings and have to questions:

- ¿Kernel development for AtrICS (and related) ROMs is done for now?

- I cannot change the shrking (for overscan canceling) at will in HDMI out (http://xdaforums.com/showpost.php?p=54968810&postcount=1038), when Lapdock is enabled, the 1366x768 resolution without overscan is activated, so it appears shrinked. In HD Dock the history is different, because you can change resolution, and some resolutions has shrinked and others dont:

1080P, perfectly fit and sized in screen

720P, overscaned, need to be shriked

So it's like it's defined in some part of resolutions settings.

I try to edit the line "hdmi_overscan" in Settings.db but it does nothing, so I think it need a direct command to enable/disable shrink/overscan

- ¿Could you use USB Audio in AtrICS and related ROMs?, I couldnt get to work, try to put DockAudio.APK in AtrICS and ICSRom without success. It doesnt work in all docks (Car, Standard and HD)
[Atrix 4G Android Development] attrixnor:
Hello Krystian

Do you plan to update your kernel for next android 5.0 , perhaps i can fix the reboot problem of kitkat version ?

Best regards
[Atrix 4G Android Development] mak_v_:
Me 2. I realy need working lapdock for atrix 4g. Webtop 3.0 working perfect, but resolution kills my eyes:eek:

Where resolution problem? In kernel's or app's side?
[Atrix 4G Android Development] DooMaster:
Dont know yet, if you se the first image in my last post, when I plug the HD Dock in TV [MENTION=921577]1080P[/MENTION] it fits perfectly, it looks awesome. Maybe it is pre-configured in the resolutions lists, and overide the Shrink option in menu.

Some months ago I read a post about resolutions, but didnt find it again to search the file source in the atrix, to see further and what can be changed. So probably I can be more ROM related. Unfortunaley, unpwn4par leave the proyect. :crying:
[Atrix 4G Android Development] mak_v_:
on my Lapgock for atrix4g - 2nd image with wellset 1366*768 and wrong and sad black borders......
[Atrix 4G Android Development] DooMaster:
It's shrinked, the =1366x768 pixels are put in aprox. 1300x700 pixeles, thats why it looks bad and ilegible.
[Atrix 4G Android Development] mak_v_:
Different apps say that resolution is 1366x768.

If it 1300x700 , maybe kernel developer will fix wrong resolution? Or this settings is in app for mirroring?

Maybe autodetect resolution woks wron?
[Atrix 4G Android Development] DooMaster:
I mean physically shrinked. If you count the "black bars" you'll se youre are missing aprox. 1366-1300=66 pixels, please take a look in my other post of AtrICS about "overscan" it's better explained.

In summary it's a software shrinked/overscan phenomenon.

Best regards.
[Atrix 4G Android Development] PolesApart:
[MENTION=4641721]krystianp[/MENTION] [MENTION=5181088]Zn7mkUKzN1r8aCIV[/MENTION] I think I've found why the wlan is not taking the cpu out of deep sleep. At least for the bcmdhd scenario (I didn't look to see how bcm4329 was hooked).

On bcmdhd there are two modes of operation. With so-called Out-of-Band Interrupts and without. With it, there's a dedicated pin for irq. This pin could be set to wake the cpu as usual. The thing is that in current setup, we're using the driver without OOB interrupts, i.e. notifications in form of interrupts comes from SDIO events. The bcm chip is programmed to drive it's pin as a interrupt selectively, so it probably just sets idle when OOB mode is not in use, therefore we couldn't simply cheat and enable_irq_wake() (or something) on the pin, as it would either do nothing or permanently inhibit deep sleep.

I enabled the OOB interrupts and although the system boots up to the lock screen, it reboots in the sequence, probably from a crash - and I lack the machinery (jtag?) to capture the kernel dump at that point.

With the bcmdhd, the steps would be to fix whatever is causing this, and then see if there's need for enable_irq_wake() or something.
[Atrix 4G Android Development] attrixnor:
Hello Dev Team

could you precise the actual source kernel link to use for this kernel. (because Krystianp kernel seems to be not updated since one month, PolesApart kernel seems ok )

why don't you use the same github for futur update ?

although , thank for all :)
[Atrix 4G Android Development] PolesApart:
The official kernel, currently maintained by [MENTION=4641721]krystianp[/MENTION] for both cm9, cm10 and Z's kitkat is at https://github.com/CyanogenMod-Atrix/android_kernel_motorola_olympus/ .

The branch I maintain is forked from it, it's *way* experimental and for Z's kitkat only. Also I'm not part of the dev team or actually any team, <sarcasm>I'm just a trouble maker trying to burn it's own phone</sarcasm>.

I'm merging fixes/updates from different sources and if and only if they prove useful and minimally stable, I'll ask krystianp to merge. Of course he may cherry pick anything in there. The ext4 fixes (hmmm perhaps I didn't push these yet, but if not, will soon) all comes from upstream, the mm changes comes from faux123 and other sources. IIRC There's also a few memory leaks that comes from upstream (either linux itself or google android branch).

I currently cannot recommend people to try my branch as some changes may set your house on fire, kill your neighbor, or, more likely, bring some damage to your phone or data loss. If and only if I see some improvement such as make the phone reboots less, then I'll post an experimental zip update to kitkat's thread, as I don't want to unnecessarily bother krystianp as I'll be the one to blame for whatever.
[Atrix 4G Android Development] attrixnor:
ok, it's clear now :)

but for me you have join the dev team :D
[Atrix 4G Android Development] PolesApart:
Bluetooth wake

I've tracked down the following messages to bcm4329_rfkill.c

It seems the desired effect of enabling/disabling wakepads for the bluetooth pins are not exactly working.

<3>[ 122.179910] Failed gpio lp0 enable for irq=353, error=-22
<3>[ 122.193628] Failed gpio lp0 enable for irq=353, error=-22
<4>[ 123.193661] ------------[ cut here ]------------
<4>[ 123.193704] WARNING: at kernel/irq/manage.c:510 irq_set_irq_wake+0xbc/0xec()
<4>[ 123.193714] Unbalanced IRQ 353 wake disable
<4>[ 123.193720] Modules linked in: bcmdhd
<4>[ 123.193757] [<c0014418>] (unwind_backtrace+0x0/0xec) from [<c004d1f4>] (warn_slowpath_common+0x54/0x64)
<4>[ 123.193774] [<c004d1f4>] (warn_slowpath_common+0x54/0x64) from [<c004d234>] (warn_slowpath_fmt+0x30/0x40)
<4>[ 123.193790] [<c004d234>] (warn_slowpath_fmt+0x30/0x40) from [<c009009c>] (irq_set_irq_wake+0xbc/0xec)
<4>[ 123.193820] [<c009009c>] (irq_set_irq_wake+0xbc/0xec) from [<c03018d8>] (enter_lpm+0x54/0x84)
<4>[ 123.193848] [<c03018d8>] (enter_lpm+0x54/0x84) from [<c006b1f0>] (__run_hrtimer.isra.33+0x44/0xd4)
<4>[ 123.193866] [<c006b1f0>] (__run_hrtimer.isra.33+0x44/0xd4) from [<c006bb0c>] (hrtimer_interrupt+0x104/0x27c)
<4>[ 123.193882] [<c006bb0c>] (hrtimer_interrupt+0x104/0x27c) from [<c00131ac>] (ipi_timer+0x38/0x40)
<4>[ 123.193897] [<c00131ac>] (ipi_timer+0x38/0x40) from [<c0008338>] (do_local_timer+0x60/0x74)
<4>[ 123.193918] [<c0008338>] (do_local_timer+0x60/0x74) from [<c000de14>] (__irq_usr+0x34/0xc0)
[Atrix 4G Android Development] Zn7mkUKzN1r8aCIV:
Do you have any clues to fix it? me thinks only K / M know how to do these irq stuffs with tegra2 soc... Thx a lot for being still around :)
[Atrix 4G Android Development] PolesApart:
I'm looking a bit deeper. It seems that the approach for the bluetooth module to wake the cpu isn't formally right, altough it might be working anyway (or not, but I don't think we would notice).

On another subject, I've enabled the ram console (which saves the last syslog entries on /proc/last_kmsg in case of a crash) and I'm using it to debug the wifi w/ the dedicated irq handler (as per one of my previous messages). There's a NULL pointer dereference in the driver, although fixing it won't make the driver work, it'll only prevents a reboot. But I was bored and decided to debug the reboots triggered by leaving the phone idle when powered on battery and both mobile data and wifi on, and then checking /proc/last_kmsg.

I don't like what I don't see in there: I expected a kernel crash, that would be (relatively) easy to fix. What I see instead (repeatedly) is the phone leaving deep sleep, the wifi reconnecting to AP, and crashing afterwards. No indication of a driver problem, so it can either means the crash is very bad deep inside an irq handler or some other deep low-level thing (that could crash before the system had a chance to log it), or it's not triggered by the tegra cpu at all.

I have a few theories but no data to support them. One is that there's a bad interaction between the CPCAP (the power controller, it's actually a Texas Instruments TPS65950 / TWL5030 which Motorola rebrands), the modem and the CPU. The CPCAP is responsible for powering all devices and it have a builtin firmware with some monitors and both software and hardware watchdogs. If something is not done in the right sequence or time, the CPCAP may assert a hard reset on everything (that would mean a reboot). For instance, suppose for some reason on our side (i.e. kernel) we leave some CPCAP notification masked out, i.e. the cpu don't wake up from deep sleep to service this notification. CPCAP could assume the cpu crashed and assert a reboot. If the modem crashes and is not serviced by the cpu while in deep sleep, the CPCAP could detect that (I don't have evidence that it does) and reboot too.

I'll keep digging on spare time :P
[Atrix 4G Android Development] Zn7mkUKzN1r8aCIV:
learnt a lot from your writings, Thx. finally flashes of light in this endless tunnel :)
[Atrix 4G Android Development] PolesApart:
Progress

[MENTION=5181088]Zn7mkUKzN1r8aCIV[/MENTION] With a small patch and a change to .config wifi is now working fine in deep sleep. I'm not sure if this is enough to make notifications arrive in a decent time, but it's a must have.

This is the patch.

As you know I have made a lot of changes to my fork at github, so I can't be 100% sure this will work on the mainstream kernel, but I don't see why not.

Cheers!

P.S..: I'll test a little longer, and if we have demand I can push an update zip w/ a kernel image on kitkat thread for people to test.
[Atrix 4G Android Development] Zn7mkUKzN1r8aCIV:
So you fixed wifi wakelock!!! I will try to setup the phone to test your patch :) Thx. a lot!!!
[Atrix 4G Android Development] attrixnor:
great news :)

for sure ,i think your contribution is appreciate by all atrix users

thanks for your work
[Atrix 4G Android Development] PolesApart:
This change requires the CONFIG_BCMDHD_HW_OOB=y in kernel config in order to do anything, but I'm having decent results. Posted a compiled test kernel on your thread today. Sometimes I see erratic behavior i.e. Typing on SSH takes a few secs to come back from deep sleep. But I think the fact that I'm far from my Wi-Fi AP have something to do with it.

On a side-note (but kernel related), I remember you were trying to setup Kitkat to support full-device encryption. It seems we would need to port/merge dm-verify into kernel in order to support that. I don't know what else we would require (I've bookmarked this: http://nelenkov.blogspot.com.br/2014/05/using-kitkat-verified-boot.html - but haven't read it yet).

It seems this will become a standard (mandatory?) feature as of Android L.