Energy Consumption Anatomy of Live Video ...

10 downloads 235225 Views 159KB Size Report
Samsung Galaxy S3 and its successor S4, iPhone 4S, Nokia. Lumia 820 .... power draw in active states. Camera App WiFi. 3G. 4G. 0. 1000. 2000. 3000. 4000.
Energy Consumption Anatomy of Live Video Streaming from a Smartphone Swaminathan Vasanth Rajaraman, Matti Siekkinen

Mohammad A. Hoque

Aalto University, School of Science, Finland Email: [email protected]

University of Helsinki, Finland Email: [email protected]

Abstract—Smartphones are frequently used to shoot and share videos online and emerging applications, such as Augmented Reality, will increase the usage of the camera. Unfortunately, shooting and streaming video drains a modern smartphone’s battery very quickly. We report results from a measurement study to dissect the smartphone energy consumption when using such an application. Our main findings are that the majority of power is drawn already when the camera is in focus mode and not yet recording. This power is drawn by the camera internal hardware and some other hardware of the smartphone related to the video processing, and none of this hardware seems to scale the power draw with the video resolution or bit rate. We also study the effectiveness of two simple optimization techniques, namely frame bundling to optimize the radio usage and more aggressive frequency and voltage scaling to reduce the computational power draw. We conclude that while the mechanisms are effective, their potential is overshadowed by the large power draw of other hardware.

I. I NTRODUCTION Real-time video capturing and streaming from smartphones can enable interesting new applications [1]. However, the energy consumption of such activity is a major concern. It requires many of the most power hungry hardware subsystems of the phone to draw power, namely display, camera, CPU/GPU, and wireless network interfaces. In this paper, we perform a measurement study to dissect the power consumption of smartphones when streaming live video. We also discuss and test a few possible straightforward techniques to reduce the power draw. A few papers have looked at the energy consumption of video streaming applications in smartphones. Most studies have focused on on-demand streaming to mobile devices and particularly on the energy spent on wireless communication [4], [6], [8], [2]. A few recent pieces of work are more related to our study. Rajaraman et al. performed a simulation study on the energy consumption of streaming video from a LTE UE [10]. Chen et al. investigate the energy consumption of display applications on smartphones [5]. Our methodology is in part similar to theirs, although they used also some simulated results, but we focus especially on the live video streaming scenario and explore also the possibilities for power optimizations. Some of our results also contradict theirs. LiKamWa et al. studied the energy consumption of CMOS image sensors which are the core of cameras embedded in modern mobile devices [9]. They also demonstrated a couple of ways to greatly improve c 978-1-4799-4912-0/14/$31.00 2014 IEEE

their energy efficiency. Our results in part corroborate theirs but also suggest that the image sensor might not explain the energy inefficiency in its entirety. In summary, our main observations are the following. • Our power break-down analysis reveals that the largest fraction of total power is consumed already when the camera is on but not yet recording (focus mode). • The focus mode power draw does not scale with the quality of video. The magnitude of power drawn suggests that in addition to the image sensor of the camera, also other hardware components play a role in this energy inefficiency. • Frame bundling is an effective way to reduce the portion of power consumed by wireless communication. Selecting a more aggressive DVFS strategy can also reduce some power but may worsen the user experience. The benefits from both techniques are overshadowed by the large power draw of other hardware components. II. S MARTPHONE P OWER M ANAGEMENT A. Wireless Communication Wi-Fi uses a Power Saving Mode (PSM) to improve energy efficiency of data communication. The client device goes to sleep mode and powers its radio off (at least partially) in case no packets are being received or transmitted. In sleep mode, the client device wakes up periodically to check whether new packets are queued at the AP. The power draw in sleep mode is an order of magnitude smaller than in active idle mode. Modern mobile devices usually employ so called adaptive PSM in which a timer, typically 100-200ms, is associated with the transition to the sleep mode. HSPA UE’s power consumption is characterised by different power states corresponding to the different transport channels of the radio resource control (RRC) protocol [2]. The power draw during active data transfer can be four times the power drawn in the idle (paging) channel. Transitions to lower power states are triggered by inactivity timers, which are network operator controlled and typical values are in the order of seconds The RRC protocol of LTE has a connected and an idle state. Similar to HSPA, an inactivity timer controls the transition from connected to idle state. In LTE, discontinuous reception and transfer mechanisms (DRX/DTX) are used in the connected mode in order to improve energy efficiency. DRX/DTX

B. Computation Dynamic Voltage and Frequency Scaling (DVFS) is a widely utilized technique to reduce the power draw of processors. DVFS enables to save power by reducing the operating frequency of the CPU when the workload allows it. The energy savings come from the fact that the power draw is proportional to the clock frequency, capacitance, and square of the voltage. Voltage can be scaled down together with frequency, which yields a greater total power reduction. Android provides an interface to control the operating frequency of the CPUs. There are different kernel-level managers, a.k.a. governors, that use this interface to change the operating frequency. For example, Performance governor always operates the CPU at the maximum frequency, Ondemand changes the frequency based on the CPU utilization, Userspace allows to control the frequency from the user-space (application), and the Powersave governor forces the CPU to operate always at the lowest frequency. Smartphone manufacturers can also employ their own governors. For example, Samsung uses its own governor “pegasysq” which scales the frequency between the minimum and maximum by maintaining a queue for scheduling applications. C. Camera The core of the camera in a smartphone is typically a CMOS image sensor. The power draw of these image sensors is in large part determined by their clock frequency. The image sensors are integrated into modern smartphones in such a way that the clock is not scaled in the same way as, e.g., the CPU (DVFS) is [9]. As a result, the power draw of the sensor does not scale with the captured image quality leading to a potentially large energy waste. III. P OWER B REAKDOWN A NALYSIS A. Methodology In order to investigate the anatomy of the smartphone energy consumption while shooting and streaming video in real time, we perform a series of measurements. In such a scenario, energy is being consumed by the different hardware subsystems including display, file system or wireless network interfaces, camera, CPU/GPU, and the hardware audio/video codec. We decompose the aggregate power draw, which we measure using Monsoon power monitor (www.msoon.com), into components by separately measuring the power drawn by the different subsystems when possible. We start by measuring a completely idle phone in airplane mode and screen off. Then, we activate more subsystems in the subsequent measurement scenarios and at each stage compare the aggregate power draw to that of the previous scenario in order to eventually derive a complete power consumption breakdown. We also present the results in a step by step manner in the following sections.

We used five different smartphones in the measurements: Samsung Galaxy S3 and its successor S4, iPhone 4S, Nokia Lumia 820, and Jolla. Jointly they cover the three most widely deployed mobile operating systems, namely Android, iOS, and Windows Phone, respectively. The recent Jolla phone was included out of curiosity because it runs the new Sailfish OS. We emphasize that our intention here is not to provide a ranking of these phones with respect to energy efficiency. We perform this comparative study for the sake of capturing the different kinds of hardware and OS combinations available in the market today in order to get a more comprehensive idea of the energy efficiency in our target scenario. In some scenarios drilling more into the detail, we only used the Galaxy S3. When doing experiments with wireless access, we used Netgear WNR612v2 router for Wi-Fi and commercial cellular networks with HSPA and LTE access. B. Display Average Power Consumption (mW)

triggers duty cycling in case active data transfer is not in progress [8].

1000

iPhone_4S Nokia_Lumia_820 Samsung_Galaxy_S3

800 600 400 200 0 OFF

LOW MEDIUM Display Mode of Phone

HIGH

Fig. 1. Comparison of display power consumption

We first measure the power draw of the display. The tested smartphones do not all have the same kind of display. The Samsung and Nokia phones have an AMOLED (Active-Matrix Organic Light Emitting Diode) display, while the iPhone has an IPS (In Plane Switching) LCD display. To evaluate the display power consumption, we varied the brightness level and measured the power draw of the phone while the display was showing either a completely white or completely black screen. During the measurements there were no background applications running and the device was in airplane mode. We chose white and black in order to capture the dynamics in the power consumption by the display panels for color reproduction. The resulting average of the power drawn by white and black screen is shown in Figure 1. We observe that the AMOLED consumes clearly more power compared to the IPS LCD display. However, we should note that also the display sizes differ: iPhone has the smallest one (3.5 in), Lumia the second smallest (4.3 in), and S3 the largest one (4.8 in). Also the brightness level plays an important role: Compared to a bright daylight environment, an average of 125 mW extra power was consumed in a dark environment for color reproduction. C. Video Camera Next, we used the camera to record videos which involves the use of the image sensor of the camera, encoding of the

3000 2500

display off display on focus mode shoot mode

2000 1500 1000 500 0

iPhone Lumia

GS3

720p

GS4

Jolla iPhone Lumia

GS3

GS4

1080p

Average Power Consumption (mW)

avg power consumption (mW)

3500

3000

176_144 320_240 640_480 720_480

2500 2000 1500 1000 500 0 250kbps

500kbps 750kbps Video Bitrates

1000kbps

Fig. 2. Power consumed by camera application

Fig. 3. Impact of video resolution and bitrate

video, and storing it to the file system. During the measurements, the camera was focused on a static object. 1) Focus vs. Shoot Mode: We first compared the case when the camera is ON and the captured image is displayed (focus mode) to the case where the video is being recorded and stored to the file system (shoot mode). The results are shown in Figure 2. The bit rate of the Galaxy S3 was roughly 8 Mbps and 14 Mbps when recording the 720p and 1080p video, respectively. We also measured separately the power consumed by writing to the phone’s file system at rates corresponding to different video encoding rates. By comparing the additional power draw caused by the shoot mode on top of the focus mode to the power drawn by writing to file system strongly suggests that most of the power overhead in shoot mode compared to focus mode goes to the file I/O and the contribution of encoding alone is rather small. On the other hand, both operations activate the CPU which then needs to operate in a higherpower drawing P-state. Hence, it is difficult to know the exact share of power consumed by each operation. The full HD display of GS4 draws slightly more power than the smaller resolution and size display of GS3 and the shoot mode portion of the total power draw is larger and focus mode is smaller in GS4 compared to GS3. Jolla has clearly room for further optimizations from the power consumption perspective. We also measured the power consumption in the focus and shoot modes when the target scenery changes continuously. The focus mode draws approximately 2100 mW which is an increase of 200-300 mW compared to the static scenery. The power increment by shoot mode over focus mode does not increase, which means that the impact of the changing scenery seems to mostly impact the work done by the image sensor and other hardware active in the focus mode. 2) Impact of Resolution and Bit-rate: To understand the power consumed for different resolutions, we shot video of a static object for 60 seconds with resolutions of 176x144, 320x240, 640x480 and 720x480 pixels. We then studied the impact of bit rate on video camera power consumption by varying the video bit rate from 250 kbps to 1000 kbps in steps of 250 kbps. In these experiments, we used the Galaxy S3 with our own Android app that discards the generated video frames

without storing them to the file system. Hence, the results should correspond to those measured in the focus mode of the native camera app shown above except that in this case the video frames are generated ready for transfer. The results presented in Figure 3 confirm the fact that was already suggested by the first camera results that the power draw is insensitive to the different resolutions and bit-rates. We also checked the power consumption while changing the frame rate and the results were similar. 3) Comparison to Related Work: Our results corroborate the findings in [9] concerning the lack of power proportionality in the way that image sensors integrated in modern mobile devices operate. However, assuming that their results concerning the total power draw of different image sensors (140-340 mW in active mode) are representative to those integrated into smartphones currently in the market, the image sensor explains only a minor part of the additional power draw caused by activating the camera in focus mode (850-1500 mW). Hence, our measurement results suggests that some other pieces of hardware draws even more power than the image sensor and that this hardware’s power draw does not scale either with the video quality. Note that if software encoding was used, the power draw would scale according to the workload because of DVFS. We cannot exactly point out the power sink in this study but the results suggest that further optimizations could be possible, e.g., by clock scaling some of the hardware responsible for the majority of the non-scaling power draw. In the study presented in [3], the authors instrumented a Galaxy S3 in order to perform component-wise power measurements. Their results show that when shooting a video with the smartphone camera, the camera draws roughly 650 mW of power and that the other hardware components that draw notably more power compared to other scenarios are related to the SoC (two internal parts of it). Unfortunately, they did not distinguish between focus mode and recording of the video. It is noteworthy that our results partially contradict those presented in [5]. Particularly, the total power draw while shooting video using the camera reported in [5] is clearly smaller than what our measurements yield for the same device. Equivalent results in [3] are in better accordance with ours and

D. Wireless Communication

Average Power Consumption (mW)

Finally, we measure a test case where the video is actually streamed to the Internet in order to understand how much additional power is consumed by the wireless communication. We show results when streaming a 250 kbps 720x480p video stream with the Galaxy S3 over different wireless access technologies in Figure 4. The power drawn by wireless communication is included in the shoot mode part. The results indicate that while accessing the network using a cellular network consumes significantly more power than the WiFi, the overall wireless communication power remains far below that consumed by the camera and encoding. We also measured with 750 kbps bit rate video stream but the results were roughly the same for the wireless streaming part, which indicates that the wireless communication, especially over cellular network, yields an almost constant power overhead because of the long inactivity timers and relatively stable power draw in active states. 4000 3000

Display OFF Display ON Focus Mode Shoot Mode

2000

2500

−4% −7%

−20%

2000

−10%

1500 1000 500 0 0

1000 0

the bit-rate, frame-rate and resolution defined by the user. We used the application to stream live video over Wi-Fi, HSPA, and LTE access networks to a laptop client using the Galaxy S3 phone. Figure 5 shows the power consumed with different bundle sizes for a 250 kbps video. As expected, when the size of the bundle increases, power draw decreases. With a bundle size of 60s, power draw can be reduced by approximately 10% for Wi-Fi and 20% for 3G and LTE. Streaming 750 kbps video yielded again similar results to that of a 250 kbps video. The results demonstrate that bundling can reduce the wireless communication power by up to 80%, but the net effect is limited to 20% of power reduction because of the dominant role of other hardware in the total power draw. Obviously, the technique is not applicable with applications having strict timing constraints, such as video calls.

average power consumption (mW)

contradict those in [5] as well.

LTE 3G WiFi Video Camera

1

3

5 10 15 bundling period (s)

20

30

60

Fig. 5. Frame bundling effective reduces wireless communication power

Camera App WiFi

3G

4G

B. Can We Reduce the Computing Power?

A. Trading Delay for Energy Through Frame Bundling There is a possibility to save energy by relaxing the realtime constraint from the video stream. The idea is to buffer frames and transmit a whole bunch of them together instead of transmitting each frame individually in constant bit rate manner. Frame bundling saves energy because the idle buffering time in between bundle transmissions allow the radio to sleep for some time in contrast to CBR traffic which keeps the radio powered on most of the time. The power savings come mostly from reducing the total amount of tail energy (only once per frame bundle vs. each frame) but it also may reduce the required amount of radio access signaling traffic and packet header overhead. Simulation results presented in [10] suggest that the mechanism is effective with LTE access. We have reason to believe that the same holds for Wi-Fi and 3G as well, since earlier research has demonstrated it to be effective for wireless video streaming to smartphones[7]. We developed an Android application that streams a CBR live video feed from the mobile device camera to a client over the Internet using RTP and UDP. It can be tuned to use

60

2800 power 2600

CPU 40

2400 20 2200

200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 CPU frequency (MHz)

CPU utilization (%)

IV. O PTIMIZING THE P OWER C ONSUMPTION

Next, we tried to optimize the power drawn by the CPU using different DVFS settings. On one hand, we wanted to understand better to which parts of the power breakdown in Section III the CPU/GPU power contributes. On the other hand, we wanted to know whether the default DVFS settings are non optimal for this application scenario.

average power consumption (mW)

Fig. 4. Power consumption breakdown in the wireless streaming scenario

0

Fig. 6. CPU utilization vs. power draw

We first checked how the default DVFS scales the CPU frequency while shooting video, which revealed that irrespective of the resolution, the CPU operates at 500 MHz most of the time. We then explored the different possible

P-states by manually varying the maximum frequency from 200 MHz to 1400 MHz in order to check how the power consumption varies with the frequency. Figure 6 shows the results. While using the minimum P-State (200 MHz), the smartphone drew an average of 2200 mW power and with maximum P-State (1400 MHz) it used an average of 2650 mW power. With every 100 MHz increase in P-State the power consumption increased by 1.5 to 2%. However, we observed unsatisfactory user experience while shooting video using the lowest frequencies. Specifically, the system becomes sluggish and exiting the camera app after the shooting may take a few seconds. We then checked how the application power consumption behave when changing the CPU governor. We tested the following different governors explained in Section II-B: Power Save, Ondemand, Pegasysq, and Performance.

average power consumption (mW)

3500 3000 2500

hardware is also active. We also demonstrate that the wireless communication power caused by live streaming the video can be reduced by introducing some delay through frame bundling. CPU power can be optimized by choosing the right kind of DVFS governor but the net effect of energy savings is relatively small and the most aggressive governor leads to poor user experience. A possible follow-up of this work would be to examine which hardware components, in addition to the image sensor, are responsible for the high and non-scalable power draw in camera focus mode, and to investigate the applicability of common power saving mechanisms, such as clock scaling, with these hardware components. However, such in-depth analysis may prove difficult, if not impossible, with off-the-shelf smartphones. VI. ACKNOWLEDGMENTS This work is supported by the Internet of Things (IoT) program of Tivit funded by Tekes, and by the Academy of Finland Grant No. 253860.

Display OFF Display ON Focus Mode Shoot Mode

R EFERENCES

2000 1500 1000 500 0

Power Save

On Demand

Pegasysq

User Space

Performance

Fig. 7. Comparison of CPU Governors

We plot the results in Figure 7. As expected, Power Save governor leads to a smallest power draw, but, similar to the experiments with the lowest manually set frequencies, we observed poor user experience while shooting video in that mode. Performance provides the best user experience but also draws the largest amount of power. The overall power draw and User Experience with Pegasysq and Ondemand were similar, however Pegasysq draws more power in focus mode and less power in shoot mode. We also investigated the impact of GPU clock frequency on power consumption. We set the frequency manually to 160, 266, 350, and 440 MHz and noted that the settings has virtually no impact on the power draw or the user experience while shooting video. V. C ONCLUSION We have studied how energy is consumed when using the camera to record and stream video with smartphones. We performed break-down analysis of the power draw and concluded that the largest amount of power is already drawn when the camera is switched on but not yet recording. This power draw is insensitive to the video quality and much higher than the power draw of plain image sensors reported in other studies suggesting that some other non-power proportional

[1] P. Bahl, M. Philipose, and L. Zhong. Vision: cloud-powered sight for all: showing the cloud what you see. In Proceedings of the third ACM workshop on Mobile cloud computing and services, MCS ’12, pages 53–60. ACM, 2012. [2] N. Balasubramanian, A. Balasubramanian, and A. Venkataramani. Energy consumption in mobile phones: a measurement study and implications for network applications. In Proceedings of the 9th ACM SIGCOMM conference on Internet measurement conference, IMC ’09, pages 280–293. ACM, 2009. [3] A. Carroll and G. Heiser. The systems hacker’s guide to the galaxy energy usage in a modern smartphone. In Proceedings of the 4th AsiaPacific Workshop on Systems, APSys ’13, pages 5:1–5:7. ACM, 2013. [4] S. Chandra and A. Vahdat. Application-specific network management for energy-aware streaming of popular multimedia formats. In Proceedings of the General Track of the annual conference on USENIX Annual Technical Conference, ATEC ’02, pages 329–342. USENIX Association, 2002. [5] X. Chen, Y. Chen, Z. Ma, and F. C. A. Fernandes. How is energy consumed in smartphone display applications? In Proceedings of the 14th Workshop on Mobile Computing Systems and Applications, HotMobile ’13, pages 3:1–3:6. ACM, 2013. [6] M. A. Hoque, M. Siekkinen, J. K. Nurminen, and M. Aalto. Dissecting mobile video services: An energy consumption perspective. In Proceedings of the 14th IEEE International Symposium on a World of Wireless, Mobile and Multimedia Networks (WoWMoM), June 2013. [7] M. A. Hoque, M. Siekkinen, J. K. Nurminen, S. Tarkoma, and M. Aalto. Saving energy in mobile devices for on-demand multimedia streaming – a cross-layer approach. ACM Trans. Multimedia Comput. Commun. Appl., 10(3):25:1–25:23, Apr. 2014. [8] J. Huang, F. Qian, A. Gerber, Z. M. Mao, S. Sen, and O. Spatscheck. A close examination of performance and power characteristics of 4g lte networks. In Proceedings of the 10th international conference on Mobile systems, applications, and services, MobiSys ’12, pages 225–238. ACM, 2012. [9] R. LiKamWa, B. Priyantha, M. Philipose, L. Zhong, and P. Bahl. Energy characterization and optimization of image sensing toward continuous mobile vision. In Proceeding of the 11th Annual International Conference on Mobile Systems, Applications, and Services, MobiSys ’13, pages 69–82. ACM, 2013. [10] S. V. Rajaraman, M. Siekkinen, V. Virkki, and J. Torsner. Bundling frames to save energy while streaming video from lte mobile device. In Proceedings of the Eighth ACM International Workshop on Mobility in the Evolving Internet Architecture, MobiArch ’13, pages 35–40. ACM, 2013.