yashsingh1/xdaforums huggingface dataset:
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] p.a.n:
Thanks for this analysis. I am trying to debug this problem and it frustrating. First of all - are you absolutely sure that 1 Feb update made it worse?

I found that these pauses are caused by wrong values returned by clock_gettime(CLOCK_BOOTTIME, &ts), which is supposed to be monotonous, but sometimes it is not, sometimes it returns smaller value than a while ago (returning to the past like a timemachine). This makes the bluetooth audio transfer pause and media player rewinds few seconds back. I don`t know what could be wrong - it could be something in the bluetooth driver, something in libc (bionic), bug in kernel, even hardware error. What is worse - I have no idea what is triggering this problem. It could be bluetooth or something else. As you say, it happens only occasionally and reboot fixes that. But when it happens it affects more than bluetooth, it could be responsible for many other mysterious bugs.

I`ve created a simple C program to detect this state. It is attached to this post, but be aware that it is quick and dirty code - I just wanted to be sure if I am correct. The now() function is lightly modified function from bluetooth driver. If you want to try it, unzip the archive and push the clock_test binary to the phone and execute it in adb shell. If the output is empty, clock is OK and 0 is returned. If you see something like this:

now ERROR now NOT monotonous! prev 1461156 act 1456861
cnt 5149

the clock did a 1461156 - 1456861 us long jump to the past after approximately 5149 us from the moment the clock_test started.

So you if want to help with debugging this, this can be useful. It would be great to know at least how to trigger this problem.

EDIT - I am not entirely sure, but I think that this problem happened even without using bluetooth.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] ymlik:
Hi [MENTION=7112923]p.a.n[/MENTION],

Can you add support exFAT for SD cards please?

Regards.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] p.a.n:
I can add it t my list, but much better would be to ask the CM team. I am just putting pieces together and trying to fix bugs which are (or at least seem to be) related to i9305.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] erosco:
I wonder if this could be some sort of NTP or 'Get time from Network' issue. Could it be that the phone is set to get the time from the network and switching cell towers/network providers gives a close but 'incorrect' time signal?

Could you turn NTP and 'Time from Network' options off to see if the problem goes away - I have no basis for this idea.. just trying to offer a suggestion :)

cheers

erosco
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] p.a.n:
I don`t think this could be NTP or anything like this. AFAIK CLOCK_BOOTTIME doesn`t represent real time, it just something as a counter running since boot. See e.g. here http://linux.die.net/man/2/clock_gettime But thanks for the suggestion :)
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] p.a.n:
Hi,

I have some updates on the bluetooth/clock bug.

1) I am sure now that it can be triggered even without bluetooth audio being used. But I had bt on, so I still cannot rule it completly out.

2) it is bug in kernel (or hw), here is part of strace output for my simple clock_test:

clock_gettime(CLOCK_BOOTTIME, {40986, 148226588}) = 0
nanosleep({0, 1000}, NULL) = 0
clock_gettime(CLOCK_BOOTTIME, {40986, 149481797}) = 0
nanosleep({0, 1000}, NULL) = 0
clock_gettime(CLOCK_BOOTTIME, {40986, 150567338}) = 0
nanosleep({0, 1000}, NULL) = 0
clock_gettime(CLOCK_BOOTTIME, {40986, 151391713}) = 0
nanosleep({0, 1000}, NULL) = 0
clock_gettime(CLOCK_BOOTTIME, {40986, 152434463}) = 0
nanosleep({0, 1000}, NULL) = 0
clock_gettime(CLOCK_BOOTTIME, {40981, 858638501}) = 0
fstat64(1, {st_dev=makedev(0, 7), st_ino=0, st_mode=0, st_nlink=0, st_uid=30791, st_gid=7, st_blksize=0, st_blocks=0, st_size=1, st_atime=0, st_mtime=0, st_ctime=0}) = 0
futex(0x4022a5b4, FUTEX_WAKE_PRIVATE, 2147483647) = 0
mprotect(0x400f1000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0x400f1000, 4096, PROT_READ) = 0
close(0) = 0
write(1, "now ERROR now NOT monotonous! pr"..., 74now ERROR now NOT monotonous! prev 40986152 act 40981858 diff 4294
cnt 94
) = 74

The values returned by the clock_gettime syscall are wrong. I also tried to compile and run the clock_test in debian chroot, the result is the same.

3) the jump is almost constant - mostly 4294 or 4295 ms, other values are rare, but still not too different from this one (some kind of overflow, arithmetic error?)

4) I still have no idea what triggers this :(

EDIT:

5) I tested other clocks CLOCK_REALTIME, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC, CLOCK_MONOTONIC_COARSE, CLOCK_MONOTONIC_RAW and they are OK (wrong values for sleep time?)
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] ymlik:
The exFAT fixes should get included in CM. (The fixes to wait for are this and this)

Regards
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] nevarion:
- Google apps stock 6.0 / pico 6.0 (tried both)

- recovery philz_touch_6.59.0

cannot conect to camera

any suggestions?
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Sectorian:
Format your Sd card again.

My SdCard is formate to exFAT.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] ymlik:
I format my sd card in exFAT and it works by against titanium backup and snapshot camera can not write to it. Why? Can you solve this problem?

Regards.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Minto107:
Lol so it's not ROMs fault. May it's apps fault

Wysłane z mojego Lenovo TAB S8-50LC przy użyciu Tapatalka
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] ymlik:
Would there be another good application as Titanium Backup to backup my apps? Which you advise me please?

Regards.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Minto107:
ES File?

Wysłane z mojego GT-I9305 przy użyciu Tapatalka
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] qasim799:
[MENTION=7112923]p.a.n[/MENTION]

Using your latest build some apps are crashing on opening

1- snapchat

2-asphalt 8

3-need for speed

4-spotify

5-netflix

And i think many other apps will crash too. And there is a common reason behind this issue. Do you have any idea about this crashing??
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] idylliq:
The last build is unstable with me. I back on the build 20160127.

I have PB of stability of 3g/4g connexion, dolphin broser, ...

Envoyé de mon GT-I9305 en utilisant Tapatalk
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Sectorian:
[MENTION=7112923]p.a.n[/MENTION] leatest build have big whit cm ril bad signal.

Cm fix whit next version.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Pe1ican0:
Have you tried both SD card paths for backup folder location in the preferences (/extSdCard & /storage/sdcard1) when testing TB?

Sent with Tapatalk
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Hubik82:
That's true. I have signal drops every 3 seconds on latest build.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] daedric:
Helium ?
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Denpech:
Petition!

Ask Cyanogenmod Developers add SGS3 i9305 LTE to list supported devices CM 13.

https://goo.gl/JUyWWp
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] ymlik:
Hello everyone,

For those like me who have problems to save on SD card with titanium backup, see here

I tested it and it works.

Regards
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Minto107:
Snapchat doesn't work on rooted devices anymore, FC is normal thing. Just uninstall root log in and install again. Should be fine but most of Snapchat features won't work on CM

Wysłane z mojego GT-I9305 przy użyciu Tapatalka
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] p.a.n:
Hi,

there are several messages about problems in the latest build, you may have felling that I am ignoring those messages. Here are my reasons:

1) I simply don`t have enough time, energy etc. to respond to everyhting

2) I am using the latest build and except the bugs mentioned in OP and the clock bug I don`t have any problem with it (and I can`t do anything with a problem that I can`t replicate - even if you`d pay me million dollars or point a gun at my head :) )

3) message saying just that application xy is crashing or doesn`t work is useless

4) as I mentioned before - I am just putting pieces together - there is over 20GiB of source code, I`ve seen only a little fraction of it

So if you have a problem - google it, try debug it. I realize that not everyone is experienced it expert but using logcat is not rocket science. AFAIK every application crash creates some kind of log there. Googling this message often helps.

Some application crashes are caused by a different permission handling in MM. In MM apps are expected to explicitly ask for a permission. In the old way they simply expected to have it. If an app tries to do something forbidden, it probable it crashes (again google will give more details :) )

Another thing is the clock bug. As mentioned - this may be responsible for several other problems, not just the audio bluetooth bug. It is difficult to say. I have a lead (right now I suppose that is simply an arithmetic/overflow error), but it is still kind of mystery for me.

The petition to make cm13 for i9305 official is not a good idea. If anything else then the way how ril works is kind of a hack (even if it is not anything unusual in Linux world).

I`ll make another build, maybe this weekend, but more probably during next week, hopefully it will fix some problems :)
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] p.a.n:
Hi,

I think I have a solution for the clock (originally bluetooth) bug. The problem is simple overflow of long in kernel. There is this code function get_monotonic_boottime:

set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec + sleep.tv_sec,
ts->tv_nsec + tomono.tv_nsec + sleep.tv_nsec + nsecs);

It looks quite OK until you realize that the nsec values (the second sum) can be really big. If the first 3 values are close to 10^9 (they can`t be bigger if they are normalized), their sum is bigger than maximal value which can be stored in long and it overflows. The last variable is OK - it 64 bits long. So the value returned by this code is sometimes wrong. If the delay between calls to get_monotonic_boottime is short enough (as in bluetooth audio), the value can be even that wrong that it is lower than the previous one. This is also the reason why it is so difficult to recreate and rebooting fixes it (at least for a while). I still think that this may be responsible also for other strange bugs, but I can`t tell for sure.

So here is the fix:

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index e188977..49dca76 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1059,7 +1059,7 @@ void get_monotonic_boottime(struct timespec *ts)
} while (read_seqretry(&xtime_lock, seq));

set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec + sleep.tv_sec,
- ts->tv_nsec + tomono.tv_nsec + sleep.tv_nsec + nsecs);
+ (s64)ts->tv_nsec + (s64)tomono.tv_nsec + (s64)sleep.tv_nsec + nsecs);
}
EXPORT_SYMBOL_GPL(get_monotonic_boottime);

I hope there is no similar situation in the kernel, it is difficult to find.

If you want to try it, I attached boot.img to this post containing kernel with this fix. If everything goes well I`ll do tomorrow a full build with this fix and fresh code.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Ridvan86:
Aicp 11 is on its way

Hi guys,

today i checked the aicp community and found out that there is gonna be a test i9305 version. I am still waiting for the reply what code sources are gonna be used for it. Have a look at it.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] :
should have posted that in the appropriate thread though
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] AGRM:
All hail the great pan lol

I think you cracked it mate. No more instances of the problem for me since I installed the boot.img file.

btw I did try to run your clock test file but was defeated by my lack of android knowledge. I am also not certain that your latest build really did suffer from more of the bug that the earlier build. The problem happened more often with the latest build but it may just have been because i was using my phone in a different setting where I was pausing the Bluetooth streaming more often than before.

FYI I did install Rodman's VRToxin ROM and observed that it also currently suffers from the clock bug so your hard work might have more universal application than just your own ROM.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] paul_cad44:
Do you jut flash this in twrp/cwm/philz recovery or does it need to be flashed using the desktop tool?
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] AGRM:
[MENTION=2083444]paul_cad44[/MENTION]

I just flashed straight over my current running version of the ROM using twrp.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Ridvan86:
And what would be the appropriate thread? I've seen once on this thread that there is an intention to use this code for Aicp 11 (what I find very nice). They have a lot of cool developers and camln also help to improve the rom.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] p.a.n:
Glad to hear it:)

I don`t know ehat you knowledge is, but the commands are (one of several ways how to do it):

adb push clock_test /data/local/tmp/
adb shell chmod +x /data/local/tmp/clock_test
adb shell /data/local/tmp/clock_test

For better understanding use google :)

This one the most surprising details about this. The same bug was definitely in all my builds. But not only there. I think that this problem has been there always. At least in the kernel for CM11 has the get_monotonic_boottime function the same code. And this is not code specific for i9305. This is general code not only for Android, but for anything where Linux runs. It wouldn`t be a bug on 64bit platform. There is also a possibility that compiler may do the typecast implicitly, I am not sure. Another question is how much was this clock source used in the past (e.g. bluetooth may have used clock_monotonic, which is OK).

If you try to google get_monotonic_boottime overflow, you find some patches, but usually for 3.4 kernel. The latest Linux version uses completely different code for this.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] p.a.n:
Hi,

there is a new build in OP - fresh code and clock bug fix.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] RaulAkaAlaRau:
For those who dont find Battery Optimisation you can find it in Settings - Battery - right up menu. I saw someone askwd about it. It was there all the time.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Minto107:
Guys is Google Camera working or is there any workaround for that? I really wanted to test it but last time I tried(7.01.16) it wasnt working. Sorry if it was mentioned before but I also don't have time to read everything ;)

Wysłane z mojego GT-I9305 przy użyciu Tapatalka
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] RaulAkaAlaRau:
Hi,

I tested it and worked with no problem. Hope will do for you as well.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Minto107:
I will try it on weekend ;) last time I was flashing this ROM my data got wiped. Is it necessary to wipe all data? :(

Wysłane z mojego Lenovo TAB S8-50LC przy użyciu Tapatalka
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] therav:
Last build works perfect till now. . Thank you p.a.n.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] enesas:
Latest build don't working camera.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Hubik82:
Camera works perfect for me. I started with this rom from 27/01 build. Then I dirty flashed every next build till today and camera was always ok.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] korde:
Hi latest build work perfectly.

For who doesnt work the camera i suggest flash the build from 06.01 with stock gapps and then dirty flash with last build.

I just got a problem... My root are not active anymore(i try already to activate app and adb)

Can someone could help me for that? Would be great!

Thanks [MENTION=5486550]p.a.n.[/MENTION]
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Pe1ican0:
You mean you enable root for adb + apps in settings/developer options & it doesn't work?

Sent with Tapatalk
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] korde:
I dont have anymore the permise of root
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] korde:
bere the pic
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Pe1ican0:
Sorry but this is not an answer to my question. I understood that you don't have root anymore.

So have you followed these steps:

1. You went to setting/developer options.

2. You selected Root access.

3. You chose enable apps+adb

After doing steps 1, 2, & 3 you still don't have root access.

Is this accurate?

Sent with Tapatalk
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] korde:
Sorry for i didnt understand before!

Yes exactly step1,2,3 fine but no root anymore..
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] daedric:
Question: If we're recording in 1080p or 720p, which is a 16:9 resolution, like our screen, why is the picture/preview/live view crammed in a 4:3 box like if we're taking a 8mp 4:3 picture ? Can we tell somehow the camera app to preview in 16:9 ?
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Minto107:
Install systemless root by Chainfare? Look for SuperSU systemless root ;)

Wysłane z mojego GT-I9305 przy użyciu Tapatalka
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] hexisg:
how do you install systemless root?

you set system partition as read only? and flash the latest 2.67 supersu.zip?
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] p.a.n:
No need for supersu, chainfire or anything like this. No need to flash anything. All that is needed for root is already there. I suppose [MENTION=7106353]korde[/MENTION] is doing something wrong. How do you test that you (don`t) have root except the root checker app (root access for this app may be blocked)?
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] korde:
[MENTION=5486550]p.a.n.[/MENTION] The only way i know to test it is with that app (that dont need root access)

Can you tell me another way?

Before android6.0 i had5.0 and 4.4 custom ROM and i had CFautoroot.

With the 5.0 was enough select access root for App and ADB download again supersu et voilà! :)

But know this doesnt work anymore.

When i installato supersu i get an error that i have a obsolete binary and ask me to re-root manually the phone.

Sorry [MENTION=5486550]p.a.n.[/MENTION] i can't understand what in doing wrong.. An help would be great!

---------- Post added at 11:29 AM ---------- Previous post was at 11:04 AM ----------

I did it! Now everything working good! Thanks a lot for the help.

Thanks p.a.n. thanks everyone!
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] korde:
TOP!
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] p.a.n:
Hi,

first of all I don`t use AudioFX (I actually always remove it), but in the log I see two interesting messages:

1) There is some library expected to be in /system/priv-app/AudioFX/lib/arm, but it empty

2) AudioFlinger is asked to do something it cannot do (create effect)

It looks to me more like a general problem in AudioFX...

I can try to dig into this, but honestly if you contact someone who created AudioFX you`d have the result faster.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] p.a.n:
Congratulations :) But I looks to me like solving a settings problem by installing different software. To have root on this ROM you don`t need to install anything else. The application you used, requires root access, it doesn`t anything special, it just calls su. I suppose that you had blocked root access for this app. Another way? Install any app, that uses root and try it. Or you can enable terminal in developer settings and try to run su from there. Or from adb shell.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] woodman:
Thanks, don't dig too much, I will find my way. :)

I just wanted to know if it was AudioFX related or ROM related, I mean something wrong in the ROM that would trigger this FC.

But now I know it's not a ROM issue.

I've already started to find modded audioFX for MM. If no luck, I will use another app.

I will let you know.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] korde:
Yes i saw later that need root access! :D ehrhrh

But i can give thre access by su same with busybox or device control. Alla app that need root access!

So seems like everything is fine!

Before i wasn't enable to installato any app that need root!

I dont know technictly what happens but is working how it supposto to work!

Thanks everyone and thanks [MENTION=5486550]p.a.n.[/MENTION] for this great job and support!
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] korde:
:D
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] Sectorian:
Ril Problem

Leatest version my Gsm signal lose. I need to reboot my phone to get back the gsm signal.

Airplane Mode not working for restoring the Gsm signal.

Leatest version feel verry fluid.

Thank you.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] RaulAkaAlaRau:
I dont have issues with RIL on last build. Maybe its a hardware problem on your device?

Battery is good on the last build 08.02.2016 indeed feels very fluid. No problems so far.

Thanks p.a.n!!
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] squeeworm:
Did you do a dirty install over the old build?

im currently using 20160127 Build.
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] AGRM:
[MENTION=7112923]p.a.n[/MENTION]

I'm not certain if this is the solution to Sectorian's RIL problem, but I note that when I move away from my WiFi router, LTE does not automatically connect as it ought. Instead I have to go into the Developer options and switch on "Agressive Wi-Fi to Mobile handover". Then I turn on Aeroplane mode and then turn it off and LTE connects immediately. If "Agressive Wi-Fi to Mobile handover" remains active, I do not need to switch Aeroplane mode on and off, LTE just connects when required as it ought. My two problems are (1) that "Agressive Wi-Fi to Mobile handover" turns itself off from time to time without any input from me, and (2) I am not certain whether having it switched on in the first place increases the load on the battery or might result in my phone switching from WiFi to LTE sooner than I would want - I want to use WiFi for as long as my signal remains usably connected but then automatically switch to LTE without having to go thought the steps above.

Of course none of this is a deal breaker, just a minor annoyance, and your port of CM13 is still the best ROM that I have used on the device including the Official CM11 that I was previously using.

---------- Post added at 14:06 ---------- Previous post was at 13:56 ----------

[/COLOR [MENTION=7112923]p.a.n[/MENTION]

BTW I am using your 20160208 build (dirty flashed over the previous build to which I had added your boot.img) and not only have no more gaps in the bluetooth streaming with the latest build but have a cleaner bluetooth signal all together. A colleague has a brand new Samsung Note 5 still running Lollipop 5.1.1 and was not pleased to hear that my older and smaller device was now running an almost flawless version of Marshmallow lol
[Galaxy S III I9305 (4G LTE + 2GB RAM) Android Deve] RaulAkaAlaRau:
I have a problem with the Google Camera even in I said that it works good this morning I wanted to open the app and I get "Camera error: Can't connect to the camera". I want to take some logs but don't knoe how to do it from the ES File Explorer quick after the error apears or with the phone connected to PC.

All permisions are on for the app by the way.

Thanks.