yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Original Android Development] the.gangster:
Hi [MENTION=6250062]IonutGherman[/MENTION]

Even if [MENTION=1601710]daniu[/MENTION] doesn't understand it.

I was about to answere exactly the same as [MENTION=5397920]xhoster[/MENTION] if he had not done that already.

Because: I had exactly that behavior on my S2. In battery statistics it showed me I would have charged although I wasn't. Later the damage got even more severe and I could no longer transfer data to it. All that happened shortly after it fell into water (just for a second and I also thought I'd dried it enough afterwards).

So I took it apart yet another time and changed USB sub board and all was back to normal.

Meanwhile I've already bought two and changed them on each of my two devices. No big deal if you are not totally unskilled.
[Galaxy S II Original Android Development] IonutGherman:
I have that problem with file transfer from the beginning. I tried to copy some files but my laptop just don't detect my phone...I guess that my USB broked when I maked shower last days with my phone in hands...but I didn't wet it. Only USB I guess
[Galaxy S II Original Android Development] the.gangster:
Well, then you can try cleaning with alcohol, and if that doesn't help buy a new USB board. It's really inexpensive and afterwards both will work again.
[Galaxy S II Original Android Development] daniu:
Hi

Sorry for not quoting anyone and sorry that I never heard of this symptoms for a broken usb connector.

Yeah - clean it: check youtube for the video that explains how to do it with some plastic hook.

And again: if you replace it (which is really quite simple) - don't just look 4 a cheap one but also 4 good replacement policy. You can read about all suppliers that they sold doa connectors and my first connector was also doa ...

Regards
[Galaxy S II Original Android Development] forgetmyname:
Upgrade from CM 11 to CM 12.1 - Google Play Services not working, sudo missing

Hi,

My partner's phone upgraded itself yesterday from 11 to 12.1. She does not know how.

Google Play Services crashed continuously and spammed the screen. Google Play did not work because it has dependancy on a Services.

Bootloader was CMW but now has a new bootloader that does not have the Advanced Options so I cannot restore from CMW backups, nor wipe Dalvik cache.

Titanium Backup no longer works, telling us no root access. Under Privacy Guard but there is not option for Superaccess for applications.

Developer options are enabled.

I can use ADB and type su to gain root.

I uninstalled Google Play Services to get rid of the popups from Google Play Services, which broke other apps. e.g YouTube.

I decided to try adding a Google Account and backup settings to them but no longer exists, so expect this depended on Google Play Services.

How could I :-

Install a working Google Play Services?

Regain root access for Titanium Backup?

I did find this http://downloadandroidrom.com/file/gapps/5.1/gapps-L-4-21-15.zip but don't know if this will make things better or worse.

Please help?!
[Galaxy S II Original Android Development] zeitferne:
You could have googled the root access problem: http://forum.cyanogenmod.org/topic/103447-cm-12-root-how-to/#entry496845

For the Google Play Service problem, I don't know, but you could try following the instructions in the OP on how to initially install them (i.e. flash Pico from http://xdaforums.com/android/software/tk-gapps-t3116347).
[Galaxy S II Original Android Development] forgetmyname:
This was already done.

Root is enabled for Apps and ADB.

But root remains inaccessible to Titanium Backup, for example.
[Galaxy S II Original Android Development] the.gangster:
[MENTION=3071046]forgetmyname[/MENTION]

It's all already explained several times. If you need detailed instructions, read this thread, starting on release date of the Snapshot.

In short: Download ROM and e.g. matching OpenGApps (Pico for Stock size system partition) and a signed kernel with recovery like Philz or TWRP to your SD -> boot into CM-Recovery -> flash the new recovery -> boot into recovery -> format /system -> flash ROM and GApps again -> reboot -> done

No data will be deleted. If you need details to any of the steps: it's all in here already so please search before posting.
[Galaxy S II Original Android Development] forgetmyname:
Previous reply because I did not understand.

ROM: I have cm-12.1-20151211-NIGHTLY-i9100.zip Is this OK?

OpenGApps: Selected Pico/Android 5.1/ ARM ( not 64)

---------- Post added at 12:06 PM ---------- Previous post was at 11:50 AM ----------

> it's all in here already so please search before posting.

I did for three hours before hand. The difference is that you know you right keywords and I do not. Thus searching will fail for me and not for you.

I had not heard of opengapps.

I had not never heard of Philz or TWRP.

I had not never heard of, and so.

Whensomebody asks for help on a previously answered question, they receive a stock reply of "you could have searched/ please search next time". Like me, they did for hours. .But they could not find. I've been searching since yesterday evening.

None the less I do appreciate your help.
[Galaxy S II Original Android Development] makix13:
Hi,

In your case I think it help you the kernel with twrp that LA puts in the OP.

With this kernel that you can flash with the current CM recovery you have, you can install Pico gapps.

Remember to try to make and backup to avoid problems when flash the kernel.

Hope it helps you. [emoji6]

S2 LA Cyanogenmod 5.1.1 [unofficial] [06/17] - Xposed [unofficial romracer's framework] - [rovo's beta 4 apk] - Viper4Android
[Galaxy S II Original Android Development] the.gangster:
I'd expected the phone got updated to the recently published Snapshot release but this should also work with a Nightly (or even your previous ROM). GApps match for that Nightly.

So yes, combination fits.
[Galaxy S II Original Android Development] forgetmyname:
I flashed the OpenGapps pico, and everything worked when it booted up.

Nothing else was needed.

Also when I titanium backup it prompted for root access which it did not do before. however when launched it popes up with an error that could not find /system/bin/su. I looked and this file is there and I can run from a Terminal. Privacy Guard for Titanium Backup lists this as allowed Root access.

Thatlnks to everybody
[Galaxy S II Original Android Development] the.gangster:
Don't quote me wrong. I gave you all steps that are necessary.

I did not blame you for not having searched before. All I wrote was, if you needed details on one of the steps you should search first before asking for them.

Edit:

Nice, that it worked for you now.

If you didn't need to format /system then you really properly removed former GApps from your device. Otherwise OpenGApps would have exited with error. That was the only reason for the format.
[Galaxy S II Original Android Development] PolishVodka:
Welcome.

Lysergic-Acid I have a something for you. Probably you know that, but its idea to have any recovery even on official CM builds which coming with CM Recovery, and most of users hate this because all the time when user want to flash something, he cannot and finally he must change a kernel to unofficial's one.

My idea is to save original, inbuilt CM Recovery (maybe someone like or doesn't need to flash unofficial stuff, etc.) but add to kernel sources possibility to load Recovery cpio (any recovery) from other place, like /preload partition which is mounted anyway and not used by AOSP Roms.

For all this thanks to [MENTION=5695278]ChronoMonochrome[/MENTION] and his method to load ramdisk from other partition than kernel's one http://xdaforums.com/galaxy-ace/ace-2-develop/dev-universal-kernel-t2930035 .

So, how to start..

From what I see here: https://github.com/warrior1208/andr...s2-common/blob/cm-12.1/rootdir/fstab.smdk4210

PRELOAD partition is EXT4 /dev/block/mmcblk0p12 . We must mount it before kernel loads image cpio from initramfs, what's we see here: https://github.com/warrior1208/andr...lob/cm-12.1/usr/galaxys2_initramfs_files/init .

This script after editing should looks something like:

And little editing here: https://github.com/warrior1208/andr...4412/blob/cm-12.1/usr/galaxys2_initramfs.list

Will be mounted /preload and if custom recovery exists (in custom_recovery dir, recovery.cpio) then kernel will load it except stock, inbuilted recovery. But when recovery.cpio will be deleted or moved somewhere, then kernel will load stock's one (CM Recovery).

Of course your custom recovery will be always loaded, even after CM update, so this will give you always official's kernel experience.

You need only unpack any boot.img/zImage where is your favorite recovery, got it in recovery.cpio format and move to /preload/custom_recovery. I'm sure on first post you can provide some flashable recoveries for users.

#######################################

I've made a kernel after applied these changes, so someone can test and post reply (I don't have this device). Stock CM kernel with CM Recovery inbuilted, make a folder named "custom_recovery" on /preload and put here "recovery.cpio" (first rename it of course).

Kernel - http://www.mediafire.com/?465waudp14u1dlg

TWRP - http://www.mediafire.com/?w5s7jyv69xv2jwb

CWM - http://www.mediafire.com/?1epicm1isp782h1

Recoveries isn't mine so all credits goes to [MENTION=4217277]Gustavo_s[/MENTION]
[Galaxy S II Original Android Development] lukss12:
Was it necessary to spam all the message again?

Nice to see someone doing this finally, btw this phone has already a recovery partition.. I don't know it's format or how it could be mounted but it could be an alternative for those with shrinked /preload if possible.
[Galaxy S II Original Android Development] the.gangster:
[MENTION=5361265]lukss12[/MENTION]

I doubt there are many around who shrinked their preload partition to sth smaller than 8MB, which also is the size of the recovery partition.
[Galaxy S II Original Android Development] lukss12:
You're right :sly: the hangover is killing my brain slowly.
[Galaxy S II Original Android Development] xhoster:
That's right and he has to look for the right rev. of the board (infos can be found in the forum).

Wrong rev. won't let you connect to 3G and H network, but everything else works.
[Galaxy S II Original Android Development] xhoster:
Your findings look promising! And yes, finding the bug would be the best case.

My guess would be, that the bug causes the CPU to switch to wrong frequencies, but only the 150mhz one causes real problems.

Solving this problem could result in better stability and maybe smoother user experience.

Right now I limited my CPU to 1000mhz to see if freezes still occur. If somebody else could try this "workaround", too, this would be nice :)
[Galaxy S II Original Android Development] zeitferne:
Hmm, just changing CPU frequencies via exynos_target and forcing CPU1 to plug in and out via /sys/devices/system/cpu/cpu1/online seems not enough to cause the bug. I tested with these two stress test scripts and could not reproduce it (at least not after a few minutes) by running two instances of each of these scripts. Since the freeze is often caused when touching the touchscreen (do you share this observation?), maybe exynos_cpufreq_lock is involved (called in drivers/input/touchscreen/mxt224_u1.c:1334).

I would really like to find a fast and reliable way to cause a freeze.
[Galaxy S II Original Android Development] the.gangster:
Hi [MENTION=4881398]PolishVodka[/MENTION],

I tried the kernel and the TWRP now but it doesn't work yet. The kernel boots the phone. But after copying the TWRP to /preload/custom_recovery/recovery.cpio it still only launches CM-Recovery, no matter if I trigger from advanced reboot menu, by 3-button-press or by adb reboot recovery.
[Galaxy S II Original Android Development] kai_15:
please help i cant use titanium backup even if i already enable the development option root access apps. it still no root access in titanium backup.
[Galaxy S II Original Android Development] dave202:
[MENTION=5948587]zeitferne[/MENTION]: I've had a look over the logs and the interesting part of the sequence is this:

<5>[25359.641237] c0 CPU1: shutdown

<6>[25359.666876] c0 cpu1 off!

<6>[25359.787295] c0 exynos4210_set_frequency: old_index=4 (500000, r=500000), new_index=3 (800000) (exynos_target)

<6>[25359.887445] c0 exynos4210_set_frequency: old_index=3 (800000, r=800000), new_index=1 (1200000) (exynos_target)

<6>[25360.166854] c0 cpu1 turning on!

<4>[25360.199258] c1 CPU1: Booted secondary processor

<4>[25360.199290] c1 CPU1: Booted secondary processor

<6>[25360.200200] c1 notifier_call_chain : NOTIFY BAD tick_notify

<6>[25360.202558] c1 Switched to NOHz mode on CPU #1

<0>[25361.818397] c0 CLKDIV_CPU: 77143737; CLKDIV_CPU1: 50

<0>[25361.819353] c0 APLL_LOCK: 1c20; APLL_CON0: a0960301

<0>[25361.820347] c0 CLK armclk: r=150000000

<0>[25361.843499] c0 CLK moutcore: r=1200000000

<0>[25361.844222] c0 CLK mout_mpll: r=800000000

<0>[25361.886434] c0 CLK mout_apll: r=1200000000

<6>[25361.956389] c0 exynos_cpufreq_policy_notifier_call: code=3; policy: cpu=1, cur=150000, min=200000, max=1200000

<6>[25361.959113] c0 cpu1 on

<0>[25361.978707] c0 vdd_arm: 1300000 uv; vdd_int: 1025000 uv

<0>[25361.979635] c0 exynos_target: CPU 0: policy->cur is 1200000, but actual speed is 150000; freqs.old=1200000, freqs.new=1200000

<0>[25361.980956] c0 freqs: cpu=0, old=1200000, new=1200000

Note how according to the logs cpu1 is shutdown and restarted, and the subsequent call to exynos_target() gives these values:

c0 exynos_cpufreq_policy_notifier_call: code=3; policy: cpu=1, cur=150000, min=200000, max=1200000

These correspond exactly with the values set in exynos_cpufreq_cpu_init() which hints that this function is called when cpu1 is re-enabled. What is more interesting is the comments in exynos_cpufreq_cpu_init() which suggest that the frequency of both CPUs cannot be set independently. The sequence of events then looks like this:

cpu1 starts, defaulting to a frequency of 150MHz

exynos_cpufreq_cpu_init() sets cur=150000, min=200000, max=1200000

BUT because > 1 CPUs are active, both CPUs are set to 150MHz instead as per the comments
[Galaxy S II Original Android Development] zeitferne:
Yes, exynos_cpufreq_cpu_init is definitely called when CPU1 is (re)started. But the above line does not come from exynos_target; it comes from an asynchronous call (from another kernel thread/process) to exynos_cpufreq_policy_notifier_call. Or did you mean something other?

It's not that simple. First, stopping and starting CPU1 happens all the time and usually without problems. Second, the comment means that there really is just one speed: You can see in exynos_getspeed that it completely ignores the cpu argument because (as I understand it) there simply is just a single hardware setting for the speed. Nevertheless, in effect, it really seems to be the case that in this case starting the second CPU somehow caused the frequency to drop to 150 MHz. The same seems to be the case in chrisXL's log.
[Galaxy S II Original Android Development] king_ahmed:
hi ... I use Fusion ROM based on cm + DorimanX kernel and I have set CPU to 1000 MHz and I don't have any freeze .... I hope this help
[Galaxy S II Original Android Development] dave202:
Yes, sorry. What I meant to imply was that the first call to exynos_cpufreq_policy_notifier_call() after the CPU starts up reflects the values set in exynos_cpufreq_cpu_init(), so we know that function gets called by the OS when the cpu1 is enabled.

I see - that log gives a bit more context. Is it possible to add to your test patchset above something to log the result of exynos_getspeed() at both the very start and very end of exynos_cpufreq_cpu_init()? Also is the CPU governor the only way to change the frequency or can the hardware thottle its own clock speed if required?
[Galaxy S II Original Android Development] kai_15:
help i cant access root when i was in the titanium backup
[Galaxy S II Original Android Development] Andrea900:
A 55 h+ uptime is just irrelevant. Keep going and let us know if your terminal can reach a higher value.
[Galaxy S II Original Android Development] sdoc96:
Just a heads up to Australians using these Cyanogenmod nightlies on SGS2's (I'm on 12.1-20151209), who happen to be on TPG network.

(BTW, not blaming CM, as it seems to occasionally happen on stock roms too I read).

If you are being migrated from Optus to Vodafone, I had the problem (which seems to be a bug) where I could not get cell signal, stuck in emergency calls only.

Banged my head against a wall half the day trying to work out why (new sim worked on other phones), when I found this thread:

http://forum.cyanogenmod.org/topic/71052-stuck-in-emergency-calls-only-really-need-expert-help/

The temp fix is to turn on Airplane mode then turn it off again. :confused: Worked for me anyway. :eek:

BTW, thanks to the devs for their continued work on this project. Wonderful stuff.
[Galaxy S II Original Android Development] AloneOnTheDark:
I think it's a modem related problem. Which version are you using?
[Galaxy S II Original Android Development] sdoc96:
Yes, I've read that too.

I9100XXLS8 that came with the ROM.
[Galaxy S II Original Android Development] lukss12:
I don't know how is last_kmsg obtained when forcing reboot... long-press does reboot the phone or does it power off? I think it power off and if last_kmsg is recovered from RAM it should not be recoverable, shouldn't it? May be waiting the device to trigger a soft reboot and use adb is the way to recover "complete" logs (and setting dmesg buffer to the max possible?).
[Galaxy S II Original Android Development] king_ahmed:
I must have +100 uptime but my phone was powered off because I was far away from my charge ..... I have now +70 uptime without any freeze or reboot .
[Galaxy S II Original Android Development] zeitferne:
Adding logging in that function can't hurt, yes. Probably it would be best to create a function exynos_panic_if_bad_freq and sprinkle calls to it in all suspicious places (that is immediately upon booting up the processor, after leaving deep sleep (relevant file), *after* exynos_target, exynos_cpufreq_lock, exynos_cpufreq_upper_limit and immediately after booting up CPU1, both in the code running on CPU0 that triggers the startup (btw, the c0/c1 in the log specifies on which CPU the code printing the message runs) and the code on CPU1 that runs after the startup. This should be exynos_power_up_cpu and secondary_start_kernel (or even before that the assembly code from exynos_secondary_startup).

Regarding your second question: AFAIK the hardware itself should not change the frequency. For thermal throttling there is exynos_cpufreq_upper_limit and there also is exynos_cpufreq_lock to lock to a minimum frequency, e.g. when touching the touchscreen and several other places.

---------- Post added at 11:36 ---------- Previous post was at 11:28 ----------

When you long-press the power button it reboots (unless connected to charger) and then recovers the last_kmsg, even though it is a bit damaged then (see e.g. this). With a panic-reboot, this seems to work much better.
[Galaxy S II Original Android Development] kai_15:
It don't work the headup notification when doing updating of any apps and when doing screenshot.. I don't know why
[Galaxy S II Original Android Development] dave202:
Actually the magic seems to be in arch/arm/mach-exynos/cpufreq-4210.c in exynos4210_set_frequency() - can we log the old/new index for the frequency? What's interesting here is that 150MHz isn't in the frequency table at all so I wonder if we are over or underflowing the frequency table, particularly as I don't see any hard limits on the index values. It's also worth adding a __raw_readl(EXYNOS4_CLKDIV_CPU1) and logging its result right at the very end of that function so that we can confirm exactly what was successfully written.

Sadly my desktop build machine is broken right now so until I get new parts then my ability to generate a build myself is non-existent :(

At least with a panic the kernel has some indication that something has gone wrong and so can attempt to sync disks before coming to a halt where possible.
[Galaxy S II Original Android Development] zeitferne:
I already added logging there. If you look at the logs you will see that the 150 MHz are not coming from there. So maybe they come from some deep sleep / CPU Idle code, like in exynos4_enter_idle.
[Galaxy S II Original Android Development] lukss12:
Not always but I can say 90% of mine.
[Galaxy S II Original Android Development] dave202:
The other alternative might be to work backwards and add logging to clk_get_rate() as called from exynos_getspeed() to see what the corresponding index and frequency values are, just in case something is clobbering the exynos_info struct by accident. exynos_enter_idle() seems interesting although my read on it was that it scales cpu0 rather than cpu1 (although of course they can be related in some cases).
[Galaxy S II Original Android Development] tuxnice:
Guides & Books

[MENTION=6159291]Lysergic Acid[/MENTION] and all others here:

I am still using an SII and tried a lot of custom roms, but I want to learn building AOSP for it. Especially building the AOSP Device is hard if you start from scratch.

Right now I am collecting and sharing some information about it, hope you all have some guides & books you can share:

http://xdaforums.com/general/xda-university/literature-reading-getting-aosp-t3268211

thank you!
[Galaxy S II Original Android Development] zeitferne:
I think I found the bug (in theory, no experimentation done, and it's late ‒ so take this with a grain of salt)! It's funny that it also is in exynos-cpuidle.c like the old FPU register corruption bug that haunted CM11.

That should be the deadly sequence:

Initially, only CPU0 is online.

CPU0 starts to bring CPU1 online. (We can see that in the log file, also that "CPU1 on" is printed only after the panic)

CPU0 is waiting for CPU1 to come online, and meanwhile enters idle. Since it is the only online CPU, it lowers the CPU speed to save power.

CPU1 goes online (NOTE: While CPU0 is still idling!)

Now when CPU0 leaves idle, it sees that not all running CPUs are idling and thus does not restore the frequency. In an alternative scenario, CPU1 enters idle too and remembers the idle-value of the register as the value to restore, so whichever CPU leaves idle, will "restore" the old value.
[Galaxy S II Original Android Development] kai_15:
sir why there is no headup notification when doing a screenshot and when updating apps in playstore or when restoring apps titanium backup? even though i turn on the headup notification in settings? it only show headup notification when i receive messages except that nothing.
[Galaxy S II Original Android Development] dave202:
This is a great analysis. I've briefly had a look at the code and the part that stands out in the logic is "if ((cpu_core == 0x3) || (cpu_online(1) == 0))" on line 861. If cpu1 is online then as you point out the restore logic will never trigger. There is some discussion at http://www.gossamer-threads.com/lists/linux/kernel/2219223 about the different between cpu_online() and cpu_active() where online means "turned on" and active means "ready to accept tasks". Would a change from cpu_online() to cpu_active() catch the race condition you've discovered above?