Android 屏幕关闭时会降低下载速率吗?
我观察到,如果在 屏幕上使用 wget,我可以更快地下载文件 应用程序, 获取屏幕昏暗唤醒锁定而不是在没有此操作的情况下执行相同操作应用程序和 屏幕关闭。我下载了完全相同的文件(从我的 apache Web 服务器),当我在应用程序上使用屏幕时,时间几乎快了两倍。为了下载该文件,我使用了 wget 的移植版本。这是我的问题:
当屏幕关闭时,Android 会降低下载速率吗?
或者由于应用程序上的屏幕获取唤醒锁,强制CPU始终处于开启状态,因此下载过程花费了更多的CPU周期..我有点困惑..
I observed that I can download a file faster if I use wget with the screen on application,
that acquires a screen dim wake lock than doing the same without this application and
having the screen turned off.. I downloaded exactly the same file (from my apache web server) and the time is almost two times faster when I used the screen on application. To download the file I use a ported versions of wget.. And here is my question:
Does Android lower the download rate when the screen turns off?
Or due to the fact that the screen on app acquires a wake lock, forces the CPU to be always on, so more CPU cycles are spent for the download process.. I am a little bit confused..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简短的回答是是,Android 有时会在屏幕关闭时降低下载速率。根据此 Android 错误报告(由 90 位用户加星标),
这或多或少与您所描述的行为相关。此问题仅影响部分手机,并非所有手机,并且仅影响部分 Android 版本。我建议你访问上面的错误报告,这个问题有很长的讨论。
如何解决这个问题
Android 2.3 至少有一个解决方法:您需要获取 WIFI_MODE_HIGH_PERF 锁定:
Android 中的 CPU 时钟缩放
Android 基于 Linux 内核,并使用 CPUFreq Governors< /a> 调整 CPU 频率以节省电池。确切的政策和频率因供应商而异,并且可能会发生变化。还有实用程序可让您调整这些政策,但它们都需要 root 的手机。通常,Android 手机会在屏幕关闭时降低 CPU 频率并使用“省电”调节器。
但是,我不认为手机上的网络流量受 CPU 限制。也就是说,即使处于省电安全模式,网络吞吐量也是瓶颈,而不是 CPU 速度。
Short answer is yes, Android sometimes does lower the download rate when the screen turns off. According to this Android bug report (starred by 90 users),
This more or less correlates with the behavior you're describing. This issue affects only some phones, not all, and only some versions of Android. I suggest you visit the bug report above, there is a long discussion of this issue.
How to solve this issue
There is a workaround for Android 2.3 at least: You need to acquire WIFI_MODE_HIGH_PERF lock:
CPU clock scaling in Android
Android is based on Linux kernel, and uses CPUFreq Governors to adjust CPU frequency to conserve the battery. Exact policies and frequencies vary from vendor to vendor and are subject to change. There are also utilities that let you adjust these policies, but they all require rooted phone. Usually, Android phones lower CPU frequency and use "powersave" governor when the screen is turned off.
However, I don't think network traffic on a phone is CPU-bound. That is, even when in power-safe mode, network throughput is a bottleneck, not CPU speed.