SD Card Lag - Current Research? - T-Mobile Samsung Galaxy S 5

Hello,
I'm curious, has anyone has done any research into why, for some phones, using the SD card causes extremely severe degraded performance of the device? I realize there is a "Lag and sd card" thread, but most I'm looking more for developers input. Do any of the 5.1.1-based ROMs out there eliminate this lag? I am an experienced developer and although I'm not highly adept at embedded device kernel drivers I'm planning on taking a look there unless anyone has some general pointers on where else the issue may be.
All of the workarounds I've seen on this forum (reset/hard reset/full wipe/reflash/disable auto brightness/reformat SD card) have resulted in no help to narrow down the problem, so post away and let me know your thoughts!
Thanks

nbetcher said:
Hello,
I'm curious, has anyone has done any research into why, for some phones, using the SD card causes extremely severe degraded performance of the device? I realize there is a "Lag and sd card" thread, but most I'm looking more for developers input. Do any of the 5.1.1-based ROMs out there eliminate this lag? I am an experienced developer and although I'm not highly adept at embedded device kernel drivers I'm planning on taking a look there unless anyone has some general pointers on where else the issue may be.
All of the workarounds I've seen on this forum (reset/hard reset/full wipe/reflash/disable auto brightness/reformat SD card) have resulted in no help to narrow down the problem, so post away and let me know your thoughts!
Thanks
Click to expand...
Click to collapse
Right now I think the lag is based upon samsungs SD card implementation
Im using shinys kernel in my build
After I enabled full SD card permissions I'm am yet to see any lag but the occasion hiccups most of my users use sdcards so you should broaden what you are looking for. I think the better approach is to see in the lag and 5.1.1 thread those using stock kernel and stock rom vs etc...
Sent from my SM-G900T using Tapatalk

malbert16442 said:
Right now I think the lag is based upon samsungs SD card implementation
Im using shinys kernel in my build
After I enabled full SD card permissions I'm am yet to see any lag but the occasion hiccups most of my users use sdcards so you should broaden what you are looking for. I think the better approach is to see in the lag and 5.1.1 thread those using stock kernel and stock rom vs etc...
Click to expand...
Click to collapse
It may very well be in Samsung's implementation, but unfortunately that's not open source, at least from what I've found.
When you say, "full SD card permissions" what exactly does that entail? I am curious so I can extrapolate what you did to what might be affected.
Finally, do we know for sure if 5.0 also suffered from the same issue? I thought I recall it didn't... but my memory isn't that great sometimes.

5.0 doesnt have this issue
nbetcher said:
It may very well be in Samsung's implementation, but unfortunately that's not open source, at least from what I've found.
When you say, "full SD card permissions" what exactly does that entail? I am curious so I can extrapolate what you did to what might be affected.
Finally, do we know for sure if 5.0 also suffered from the same issue? I thought I recall it didn't... but my memory isn't that great sometimes.
Click to expand...
Click to collapse
My lag is memory based could be resolved my memory additions to build prop or some other methods of memory mangement
and also tweaking the autobightness in framework
I also disabled all animations for different task in framework under integers.

malbert16442 said:
My lag is memory based could be resolved my memory additions to build prop or some other methods of memory mangement
and also tweaking the autobightness in framework
I also disabled all animations for different task in framework under integers.
Click to expand...
Click to collapse
Define "memory additions" please. After some more research I am starting to agree, I believe it is memory based. I've largely noticed it seems to get triggered by Wifi and going out of range of a cell site (e.g. underground) or very weak signal. Yesterday I tried to reproduce the issue without those conditions and I could not. I was able to again reproduce them today by having Wifi on (not connected) and weak cell signal.
Once the issue occurred I dumped the kernel log (dmesg) and noticed that there are commands (e.g. ls and setprop) returning 'undefined instruction' at a particular memory address. One of the few ways this could happen is if the memory address is being overwritten or cleared.
Code:
<6>[14735.260878] ls (24699): undefined instruction: pc=b6e0cf48
<6>[14735.260886] Code: ea000002 00000000 f26ee1fe e12fff1e (ee190f1d)
<6>[14735.267542] setprop (24702): undefined instruction: pc=b6e8ef48
<6>[14735.267550] Code: ea000002 00000000 f26ee1fe e12fff1e (ee190f1d)
What would be valuable to know is if these messages are showing up for anyone else when they're not having the issue.
From the top of my head I recall there being a new version of the wifi driver (complete re-write) in 5.1.1. This might be the issue. For the nay-sayers that think Marshmellow won't fix the issue, there's actually a good chance it will since it'll likely have a refresh of the BCM module (wifi).
More investigation still is being done, however...

I assume memory additions refers to the JVM memory and other memory allocations? That could certainly affect the issue. Would be interesting to see the various memory related arguments in your build.prop.
I've continued to do some more research here and there and last night I found that there was a new buffer added into the wifi driver that allocates more memory than previous drivers. My next steps are to a.) validate that the memory pre-allocated is always sufficient to cover the max size of all buffers and b.) To adjust the buffer sizes and/or revert the new changes in the wifi driver regarding this new buffer.

Ill look into this
nbetcher said:
I assume memory additions refers to the JVM memory and other memory allocations? That could certainly affect the issue. Would be interesting to see the various memory related arguments in your build.prop.
I've continued to do some more research here and there and last night I found that there was a new buffer added into the wifi driver that allocates more memory than previous drivers. My next steps are to a.) validate that the memory pre-allocated is always sufficient to cover the max size of all buffers and b.) To adjust the buffer sizes and/or revert the new changes in the wifi driver regarding this new buffer.
Click to expand...
Click to collapse
@ShinySide any thoushts

malbert16442 said:
@ShinySide any thoushts
Click to expand...
Click to collapse
Since then I'm not entirely convinced that it's the wifi driver, but I haven't entirely ruled it out because turning Wifi off from Android doesn't actually unload the wifi driver itself.
I'm fully capable of fixing this issue, but what I'm really still lost on is finding out EXACTLY how to reproduce this issue. I spent half of Saturday trying to reproduce various ways with no success. If someone has any way of specifically reproducing the issue that would be of immense help.

I've found a way to reproduce the issue, at least with my phone. Basically whenever your cell connection is downgraded to HSPA+ (instead of LTE) the issue starts occurring the more time you're on HSPA+. I found this as the cause because at work we have a cell booster that boosts HSPA+, but not LTE, causing the HSPA+ signal to be preferred. At work the issue occurs all day long until I leave (where I get LTE) and the issue very quickly goes away. Now today at home I was briefly downgraded to HSPA+ and my phone started to slow down to a grinding halt. It's worth mentioning that I did re-flash the FOG radio last night, but the issue still happens.
Is anyone else able to reproduce this issue when on HSPA+? When downgraded to HSPA+ use a bit of data and see if it happens.

Related

[Q] with regard to Voltage Control

I have been experiencing some strange behavior, but I am a backup whore, so this is more curiosity than anything else...
Whenever I read up on VC, ti seems that a best practice is to test setting for at least a day to ensure that you are stable with them before saving as boot settings.
I do this - on the regular. The weird thing is that I will test settings for days on end with no issue, but as soon as I save as boot settings, teh next boot chugs me into FC hell and/or boot loops.
I *think* I may have noted the issue lying in the fact that the app was on teh SD card, and I a *hoping* that that is where the issue lies. I mean, until the media scanner is complete (and I have the scripts that speed that up [running the 3072 version at present]) most, if not all apps that are on the SD card are not listed in the app drawer, and it seems to populate as they are scanned... So it would make sense in my noob-mind that the settings cannot be made at boot per se until teh scan is past voltage control... Does this make sense?
I have moved it back to the internal memory and am ready to give it a try, but thought I'd toss the thought out there and see what others think...
TIA.
i would think you'll have better results this way. just like you said it couldn't possibly get the information as it boots if it hasn't scanned the card yet. or at least i wouldn't think it could.
post your results, im curious.
Well it was a sound presumption. Went ahead and set boot settings, rebooted and it did the trick.
Very pleased.
Swyped on my Fascinate - please excuse any swypo's...

[Q] Apps Force Closes

Hi, I'm running the latest rootfs and Ril on Rhod400, even though this issue is almost definitely not related. I think that the battery died in middle of the night (I forgot to plug it in), and when I turned it on after charging it, a lot of apps started to Force-Close. This happens even after a reboot.
Thanks for all the help.
yelped said:
Hi, I'm running the latest rootfs and Ril on Rhod400, even though this issue is almost definitely not related. I think that the battery died in middle of the night (I forgot to plug it in), and when I turned it on after charging it, a lot of apps started to Force-Close. This happens even after a reboot.
Thanks for all the help.
Click to expand...
Click to collapse
Delete the data.img, let the system create a new one. Problem solved.
So it got corrupted? I feared so. At the rate I'm re-creating Data Images, I should buy the Pro version of Titanium Backup for Batch Restore.
yelped said:
So it got corrupted? I feared so. At the rate I'm re-creating Data Images, I should buy the Pro version of Titanium Backup for Batch Restore.
Click to expand...
Click to collapse
That's what I did! I found myself using the app so frequently, I decided to pay for it.
Advanced users willing to do a little research will also find that sometimes the fix_permissions script will fix your data.img in these situations, it fixed mine a few days ago.
rpierce99 said:
Advanced users willing to do a little research will also find that sometimes the fix_permissions script will fix your data.img in these situations, it fixed mine a few days ago.
Click to expand...
Click to collapse
Yea, I always forget that. I haven't had to blast out a data.img in a while tho... Hrm.
yelped said:
Hi, I'm running the latest rootfs and Ril on Rhod400, even though this issue is almost definitely not related. I think that the battery died in middle of the night (I forgot to plug it in), and when I turned it on after charging it, a lot of apps started to Force-Close. This happens even after a reboot.
Thanks for all the help.
Click to expand...
Click to collapse
Happened to me also after it paniced and rebooted one day. I had to install all of the apps that force closed over again after uninstalling them. Seems like info got corrupted. I didn't want to start from scratch, especially since I just successfully got my work VPN working, so I just spent the time to uninstall and reinstall the stuff as I go. Have no clue what causes this other than something got corrupted.
slickdaddy96 said:
Happened to me also after it paniced and rebooted one day. I had to install all of the apps that force closed over again after uninstalling them. Seems like info got corrupted. I didn't want to start from scratch, especially since I just successfully got my work VPN working, so I just spent the time to uninstall and reinstall the stuff as I go. Have no clue what causes this other than something got corrupted.
Click to expand...
Click to collapse
I ran into a similar issue. My phone hard locked after running Android for the better part of a day. When I rebooted it ran extensive disk checks on the system. It still does every time I boot and I am get force close messages constantly. Windows also found and fixed errors with the FAT32 partition on the card. It's possible my card is dying but I also didn't notice any of that until the forced reboot. It didn't say what file was damaged but I can take a guess.
I believe that the FAT32 file system on the card was corrupted because files were open when I was forced to reboot. Because the linux file system is hosted as a file on the fat32 partition, it is subject to damage if the host file system gets messed up. It's sort of like when MS offered the option in DOS to compress your hard drive. It was all stored as a giant compressed file on your disk. If something happened to the integrity of that file it caused all sorts of problems.
This is why I use a partitioned build...
might be a stupid question but what is that ^
manny05 said:
might be a stupid question but what is that ^
Click to expand...
Click to collapse
Instead of using looped files (system.ext2 file is really an entire file system that is 'loop mounted' within Linux/Android) you use native partitions.
So a separate partition for data, separate partition for system, etc. It's a little more difficult to setup, but in theory it causes less corruption. Not sure if it's true or not, hyc is pretty convinced it does .
arrrghhh said:
Instead of using looped files (system.ext2 file is really an entire file system that is 'loop mounted' within Linux/Android) you use native partitions.
So a separate partition for data, separate partition for system, etc. It's a little more difficult to setup, but in theory it causes less corruption. Not sure if it's true or not, hyc is pretty convinced it does .
Click to expand...
Click to collapse
I've been running with the same data partition since the middle of January, haven't needed to recreate it even once. It boggles my mind how often you tell people to blow away their data.img and start over whenever they run into problems. That just ain't right, and an approach that encourages that style of problem-solving is inherently flawed, IMO. And a build layout that leads to that type of solution is also inherently flawed.
Plus the simple existence proof - my /data partition is fine, despite having reinstalled /system several times, switching between original FRX05 and FRX06, rewritten rootfs scripts, plus all of the built-from-scratch system images I've tested, replacing framework.jar, etc. etc... My SDcard has seen a lot of churn, but all of my downloaded apps, settings, and data have come thru unscathed.
A couple times I've needed to run fix_permissions. But now with my current framework and rootfs that does a clean shutdown and unmount of /data, I haven't needed that in a while either.
Oh, and also, with a partitioned build, you get full use of USB mass storage. Everything just works.
highlandsun said:
I've been running with the same data partition since the middle of January, haven't needed to recreate it even once. It boggles my mind how often you tell people to blow away their data.img and start over whenever they run into problems. That just ain't right, and an approach that encourages that style of problem-solving is inherently flawed, IMO. And a build layout that leads to that type of solution is also inherently flawed.
Click to expand...
Click to collapse
I agree, it's horrible troubleshooting - but it works, and until we get a solid fix then there's really not much to do...
I know you love your partitions, but that's not going to be for everyone. Anyone can do it, and how many do?
highlandsun said:
Everything just works.
Click to expand...
Click to collapse
LOL at this statement. I won't poke holes in it, c'mon guy, that's just silly.
arrrghhh said:
LOL at this statement. I won't poke holes in it, c'mon guy, that's just silly.
Click to expand...
Click to collapse
Ok fine. 500 patches later, and everything works...
Sent from my TP2 using Tapatalk
highlandsun said:
Ok fine. 500 patches later, and everything works...
Click to expand...
Click to collapse
Heh, much more accurate statement .
Also good to note - everything works, related to USB mass storage, etc. This isn't some magic voodoo fix for BT, so don't take this out of context people!
rpierce99 said:
Advanced users willing to do a little research will also find that sometimes the fix_permissions script will fix your data.img in these situations, it fixed mine a few days ago.
Click to expand...
Click to collapse
Nearly all other post-crash forceclose issues seem to be database corruption.
Android seems to like to store a LOT of stuff other than contacts (including call logs) in the contacts database. As a result it tends to be more prone to corruption.
Piece of advice - when complaining about an issue like this where obtaining a logcat is possible, please do so. (A logcat would be able to narrow down exactly where your problems likely were.)
DB corruption can still happen even on partitioned builds. I forget where the best HOWTO for this is, but it involves partitioning your SD card such that:
Partition 1 is FAT (main sdcard stuff)
Partition 3 is ext2 (system partition)
Partition 4 is ext2 (data partition)
I can provide a reasonably good HOWTO for doing this on a Linux box when I return from business travel, can't help the Windows-only users.
fix permission script? where can i find more about this?

[Q] MP3 issue

Weird thing I've noticed: I've been using the Erebos theme, flashing it over both Axura and Bionix. After flashing (so, with a fresh system), I've copied a few mp3 files from my system to my phone. I've played them via the music player, and then I've set them for my notifications (a song for my ringtone, a sound effect for my SMS. Both as mp3 sounds).
After a day or so, though, my system stops recognizing them as valid audio files. First, the ringtone defaults to silent because it's set to the MP3 but the system no longer recognizes the file. After I've noticed that, I've gone into the music player, which informs me that it no longer recognizes the file.
After some troubleshooting, it appears that setting the phone to silent is what has caused it. I've done that via the dropdown menu the lock screen. The system seems to re-recognize the files after a reboot, but not after simply going from silent to not-silent.
Anyone else ever heard of this? Is there any work around? The idea of rebooting my phone after I put it on silent is kind of irritating...
Never had this issue, and I've gone through this same process before. Has it only occured on new ROMs? (If they're not already) have you tried placing on your internal SD card?
If placing on your internal SD card, it may be a problem with your external SD.
treleung said:
Never had this issue, and I've gone through this same process before. Has it only occured on new ROMs? (If they're not already) have you tried placing on your internal SD card?
If placing on your internal SD card, it may be a problem with your external SD.
Click to expand...
Click to collapse
Those are the only two roms I've used. Might have to try a third, I guess. I've actually not been using an external SD lately. Not even a card in the slot. Maybe I should try one in there, see if that fixes it.
willentrekin said:
Those are the only two roms I've used. Might have to try a third, I guess. I've actually not been using an external SD lately. Not even a card in the slot. Maybe I should try one in there, see if that fixes it.
Click to expand...
Click to collapse
Tried using a 16gb sd card today, but didn't notice a difference. Any guidance? Change roms? Different kernel?
Oddly enough, I have had the same issue, and I'm really glad you posted this thread, as my troubleshooting didn't get as far as isolating to putting my phone on silent. I will definitely try to leave it off of silent for a few days and see if that makes a difference.
I had this problem with KB5 released by Samsung, then had the same problem using Trigger, which is built off of KB5. It's possible that it is a bug in KB5, but obviously, not many people seem to be hitting it, so who knows...
Edit - just noticed that you had the same problems with Bionix and Axura, which I don't think are KB5, so there goes my theory...
I am also having the same exact problem. I am using bionix 1.3.2. I have Odin'd back to stock and re-installed but that didn't solve my problem. I believe this also causes other functions to stop working, like you tube. Therefore, many people have this same problem but have been putting it under many topics. Does anyone know a solution to this?
has to be a hardware issue i have tried 8 diff roms and have never had a problem
nhorn1983 said:
has to be a hardware issue i have tried 8 diff roms and have never had a problem
Click to expand...
Click to collapse
I would hardly say it HAS to be hardware. It could be any range of other software related things, such as settings we use or apps we have installed.
Here are the things that make it seem NOT hardware related-
-Rebooting fixes it. That doesn't eliminate hardware, but it's evidence against it.
-It seems to impact local audio files whether they are system sounds, or MP3s stored on any on-board storage, which doesn't seem like a hardware issue.
-It also impacts streamed audio, since when I'm in the bug state, it impacts amazon cloud player, pandora AND youtube.
I would say it's possibly hardware in that "anything's possible" sort of way, but I think it's more likely to be software. That is not to say it's the particular ROMs or kernels we're running - more likely the way we have some settings set or apps configured, etc.

[Q] SD Card and Internal Memory Labels switched

I'm having a strange issue...file explorer apps and other ones that view your files like Solid Explorer show my SD card as Internal Storage. my SD Card files are viewed under Internal Storage..This is a bit confusing and is possibly leading to problems that i'm having. I would like to know how I can fix this so it displays accurately. Thanks
AOSP/AOKP roms switch the two, and I'm not sure if there is any fix for it. I suppose you're running either CM9 or AOKP?
iamwalterwhite said:
AOSP/AOKP roms switch the two, and I'm not sure if there is any fix for it. I suppose you're running either CM9 or AOKP?
Click to expand...
Click to collapse
yep. 1.6 AOKP Linaro . So if i ran a sense ROM (ugh) then it would display properly?....say...do you think that the switched labels is why Boot Manager is not working for me?
http://forum.xda-developers.com/showthread.php?p=33382770#post33382770
Wonder if these problems are linked....
Thanked you for your assistance
stanleyopar2000 said:
yep. 1.6 AOKP Linaro . So if i ran a sense ROM (ugh) then it would display properly?....say...do you think that the switched labels is why Boot Manager is not working for me?
http://forum.xda-developers.com/showthread.php?p=33382770#post33382770
Wonder if these problems are linked....
Click to expand...
Click to collapse
I'm probably not the best person to answer this question, but I'll try anyways (take this with a grain of salt). Sense will display the internal and external storage correctly. I believe that the way that AOSP has been done for the Rezound specifically creates the problem of having the two switched. This would mean that the AOSP ROMs are interpreting the storage differently, so it shouldn't affect boot manager because that is something that occurs outside of the ROM. Honestly, I'd say avoid boot manager. If you keep two nandroids (since you're s-off, switching between the two is as simple as hitting 'restore') one sense, and one AOKP it's much easier to switch back and forth without issues. It's good to maintain both if you need them in good working condition. I use an SMS backup program so my switches are seamless.

Tab S6: 2nd profile with restricted access to sd card

Hi Community!
I've discovered that since the upgrade to the latest OTA ( Android 11, One Ui 3.1, SAOMC_SM-T860-OXM_DBT_RR_0003) my second user profile is in some kind restricted. No access to sd card ("sd card is not available") and several short cuts in the upper area above the notifications are missing.
So I already deleted the second profile just in case the OTA scrambled something there. I've created a new profile (not a restricted profile) but experiencing the same behavior. I tried to find something about this issue. But seems that everybody is fine with that or doesn't have the same issue.
Anybody noticed it? Any hints on what to do to use sd card under an alternative profile again? BTW I'm not using sd card encryption.
Thanks! Any help is appreciated.
bdc
It probably would be necessary to install a kernel that has selinux disabled in order to accomplish what you're trying to do. But that is not a trivial undertaking for the average user and may require a wipe.
I still do have 12 months of warranty left. I use whatever Samsung gives me
Did you succeed?

Categories

Resources