My phone is the BLU Life One, Android 4.4.4. Kernel 3.10.28. Build KTU84P. Custom build version BLU_XO11Q_V04_GENERIC 14-08-2015 12:15. Model Number BLU LIFE ONE. Processor info. Qualcomm Technologies, Inc MSM8916
So first, straight to the solutions... 3 things I had to do.
1) Install this app: http://ift.tt/1J3Y5yI ....and select "PARTIAL_WAKE_LOCK"
2) Enable developer mode by going to Settings->AboutDevice-> Tap on the Build Number 8 times.... then go into DeveloperOptions and enable the "Show CPU usage" thing so you see that small text in the upper-right hand corner showing processes that are running. You can see examples by going to GoogleImages and search "Show CPU usage".
3) .....run my ridiculous script.... copy the below bash script and adb push it to /data/local/tmp/crazy_sdcard_wakelock.sh, then "adb shell chmod 777 /data/local/tmp/crazy_sdcard_wakelock.sh" run it by doing "adb shell /data/local/tmp/crazy_sdcard_wakelock.sh"
First, note that the "/storage/sdcard1" is where my phone mounts the microSD to. Your phone might be different, be sure to change it to wherever your phone mounts the microSD to. That last adb shell command to run the script will hang because it's an infinite loop. You'll just have to yank out the usb-cord of your phone to break the connection. On my phone, the script continues to run. I know this because using a file-manager on the phone I can constantly refresh the file list on my microSD and see the logfile appear and disappear in 10-second intervals.
CONS
If my phone ever reboots, I need to go back to a PC with "adb" so I can rerun the command. This app: http://ift.tt/1lF9q3u ....can run the script but the user the script is started with doesn't have write-permissions to the microSD card for whatever reason. I have this problem because my phone is NOT rooted. I rooted it once before, but then used SuperSu's option to "unroot" and since then haven't been able to root again. If you have root, I'm sure a command like "su -c '/data/local/tmp/crazy_sdcard_wakelock.sh'" would start the script as root and it'll be able to write to the microSD. ......I rarely reboot my phone, so this isn't a big issue for me.
How did I come up with this?
Random googling about this problem lead me to a bunch of people talking about it on different devices with different symptoms: http://ift.tt/1J3Y5yK , but more or less the same core issue. When the screen is off for awhile(for me it's 30mins), the microSD is unmounted apparently by faulty power-management in Android's OS or Manufacturer's hardware or whatever and if you're like me with tons of music on the microSD... your musicplayer(PowerAmp or whatever), stops working. So I started thinking about all the ways to prevent the microSD card from unmounting. On my home PC, running Linux mint, a mounted USB device cannot be unmounted if there's a bash process that is using it; i.e. if I open a terminal and "cd" to a directory on the usb-drive, I cannot unmount it until I exit that bash shell. That's why in the above script I do the cd command to the microSD card hoping for the same effect on Android. Then you see the infinite loop of "while true", where I repeatedly do:
With a shell process having the microSD as its CWD and the constant opening, writing, deleting of a file every 10 seconds, along with the PowerManagerWakelock app and the periodically CPU usage reporting.... I've been doing this for a full day and the music never stops, no sdcard unmounting. This is the microSD I'm using: http://ift.tt/1lF9q3z
I haven't done any testing to try and narrow stuff down to see if I truly need all 3 of these things to be running, but I don't care. It works for me and my battery life doesn't seem to be draining any faster than normal.
I'm posting this solution so maybe the hackers on this forum can understand exactly why my solution is working and maybe write an apk that'll do all this stuff by just tapping a button. :D
That is all.
So first, straight to the solutions... 3 things I had to do.
1) Install this app: http://ift.tt/1J3Y5yI ....and select "PARTIAL_WAKE_LOCK"
2) Enable developer mode by going to Settings->AboutDevice-> Tap on the Build Number 8 times.... then go into DeveloperOptions and enable the "Show CPU usage" thing so you see that small text in the upper-right hand corner showing processes that are running. You can see examples by going to GoogleImages and search "Show CPU usage".
3) .....run my ridiculous script.... copy the below bash script and adb push it to /data/local/tmp/crazy_sdcard_wakelock.sh, then "adb shell chmod 777 /data/local/tmp/crazy_sdcard_wakelock.sh" run it by doing "adb shell /data/local/tmp/crazy_sdcard_wakelock.sh"
Code:
echo -------------------------
id
echo -------------------------
cd /storage/sdcard1
while true; do
ls -la . > ./ls_la.log 2>&1
sleep 1
ls -la . >> ./ls_la.log 2>&1
sleep 1
rm ./ls_la.log
sleep 10
done
CONS
If my phone ever reboots, I need to go back to a PC with "adb" so I can rerun the command. This app: http://ift.tt/1lF9q3u ....can run the script but the user the script is started with doesn't have write-permissions to the microSD card for whatever reason. I have this problem because my phone is NOT rooted. I rooted it once before, but then used SuperSu's option to "unroot" and since then haven't been able to root again. If you have root, I'm sure a command like "su -c '/data/local/tmp/crazy_sdcard_wakelock.sh'" would start the script as root and it'll be able to write to the microSD. ......I rarely reboot my phone, so this isn't a big issue for me.
How did I come up with this?
Random googling about this problem lead me to a bunch of people talking about it on different devices with different symptoms: http://ift.tt/1J3Y5yK , but more or less the same core issue. When the screen is off for awhile(for me it's 30mins), the microSD is unmounted apparently by faulty power-management in Android's OS or Manufacturer's hardware or whatever and if you're like me with tons of music on the microSD... your musicplayer(PowerAmp or whatever), stops working. So I started thinking about all the ways to prevent the microSD card from unmounting. On my home PC, running Linux mint, a mounted USB device cannot be unmounted if there's a bash process that is using it; i.e. if I open a terminal and "cd" to a directory on the usb-drive, I cannot unmount it until I exit that bash shell. That's why in the above script I do the cd command to the microSD card hoping for the same effect on Android. Then you see the infinite loop of "while true", where I repeatedly do:
- I run "ls -la" to print out all details of files & folders at the root-level of the microSD card and save the output to a logfile.
- I pause for 1 second.
- I run "ls -la" command again, and append the already existing file so now the list is in that file twice.
- I pause again for 1 second.
- I delete the file
- Pause for 10 seconds... then do it all again, and again, and again...
With a shell process having the microSD as its CWD and the constant opening, writing, deleting of a file every 10 seconds, along with the PowerManagerWakelock app and the periodically CPU usage reporting.... I've been doing this for a full day and the music never stops, no sdcard unmounting. This is the microSD I'm using: http://ift.tt/1lF9q3z
I haven't done any testing to try and narrow stuff down to see if I truly need all 3 of these things to be running, but I don't care. It works for me and my battery life doesn't seem to be draining any faster than normal.
I'm posting this solution so maybe the hackers on this forum can understand exactly why my solution is working and maybe write an apk that'll do all this stuff by just tapping a button. :D
That is all.
from xda-developers http://ift.tt/1J3Y5yN
via IFTTT
No comments:
Post a Comment