[Clientapps-cvs] symbianMmf hxmmfstatectrl.cpp,1.4.2.30,1.4.2.31
sgrosdes at helixcommunity.org sgrosdes at helixcommunity.orgUpdate of /cvsroot/clientapps/symbianMmf
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv23576
Modified Files:
Tag: hxclient_2_1_0_cayennes
hxmmfstatectrl.cpp
Log Message:
"Nokia submits this code under the terms of a commercial contribution agreement with RealNetworks, and I am authorized to contribute this code under said agreement."
Modified by: EXT-Sebastien.Gros2 at nokia.com
Reviewed by:
Date: February 25th -2010
ErrorId: TPUA-7Y5A78
Description:
Current consumption too high for music playback with WMA content
Origin of the problem:
Helix framework uses a 20-30ms timer to manage audio buffering in WMA audio playback case.
This timer ruins the deep sleep periods thus increasing the current consumption in WMA audio (no video) playback use-case significantly.
Solution:
Increasing the amount of data available in Audio device so as to allow sleep period of several seconds. Thus, some energy can be saved.
That will be the case when the following conditions are met:
-One source is available
-local audio playback
-Power save feature is enabled
-WMA DSP decoder is used
If the above conditions are met, Helix will activate this mode. This can only be done from AudioController.
Helix will exit this mode when one of the following conditions is met:
Error is thrown such as device taken
when playback is paused
End of file is reached.
We have introduced mainly to new notions:
the Lower Water Marl is reached (LWM)
the high water Mart (HWM) or WakeUpinterval
Both of these values are configurable.
They are validated by mdfAuddevice.
The data level available is controlled in mdfdevsound. When LWM is reached, mdfAuddevice goes out of sleep mode,
Then, Audio session tries to pass as much packets as possible so as to get the HWM data level reached again.
So, mdfAuddevice goes to sleep again
Files Modified:
\client\audiosvc\hxaudply.cpp
\client\audiosvc\hxaudses.cpp
\client\audiosvc\pub\hxaudply.h
\client\audiosvc\pub\hxaudses.h
\client\core\hxcleng.cpp
\client\core\hxplay.cpp
\client\core\pub\hxcleng.h
\client\core\pub\hxplay.h
\clientapps\symbianMmf\hxmmfstatectrl.cpp
\clientapps\symbianMmf\hxmmfstatectrl.h
\clientapps\symbianMmf\audiocontroller\hxmmfaudioctrl.cpp
\clientapps\symbianMmf\audiocontroller\hxmmfaudioctrl.h
\common\include\hxevent.h
\common\include\hxiids.h
\common\include\hxpiids.h
\datatype\mdf\audio\dsp\mdfauddevice.cpp
\datatype\mdf\audio\dsp\mdfauddevice.h
\datatype\mdf\audio\dsp\mdfdevsound.cpp
\datatype\mdf\audio\dsp\mdfdevsound.h
New files added: YES
\common\include\hxPowerSave.h
\common\include\hxTimelineLimit.h
Image Size and Heap Use impact: moderate impact
Module Release testing (STIF) : Ongoing
Memory Leaks testing: Passed
Test case(s) Added : Yes.
Playlist played with BT headset for more than one hour.
Platforms and Profiles Build Verified: helix-client-s60-52-mmf-mdf-dsp
Platforms and Profiles Functionality verified: armv5
Branch: 210 Cayennes, HEAD
Index: hxmmfstatectrl.cpp
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/hxmmfstatectrl.cpp,v
retrieving revision 1.4.2.30
retrieving revision 1.4.2.31
diff -u -d -r1.4.2.30 -r1.4.2.31
--- hxmmfstatectrl.cpp 23 Feb 2010 22:30:21 -0000 1.4.2.30
+++ hxmmfstatectrl.cpp 2 Mar 2010 00:28:29 -0000 1.4.2.31
@@ -295,7 +295,21 @@
ULONG32
HXMMFStateCtrl::GetPosition()
{
- return(m_posLength);
+ ULONG32 ulRetPos = m_posLength;
+
+#ifdef HELIX_FEATURE_POWER_SAVE_MODE
+ if(m_pScheduler3
+ && m_pScheduler3->IsPaused()
+ && m_pPlayerControl
+ && m_pPlayerControl->m_pHXPlayer)
+ {
+ ulRetPos = m_pPlayerControl->m_pHXPlayer->GetCurrentPlayTime();
+ }
+#endif /*HELIX_FEATURE_POWER_SAVE_MODE*/
+
+ return ulRetPos;
+
+ // return(m_posLength);
}
ULONG32
@@ -387,6 +401,10 @@
HX_RELEASE(m_pRegistry);
HX_RELEASE(m_pSiteSupplier);
HX_RELEASE(m_pClientEngine);
+#ifdef HELIX_FEATURE_POWER_SAVE_MODE
+ HX_RELEASE(m_pPowerSave);
+ HX_RELEASE(m_pScheduler3);
+#endif /*HELIX_FEATURE_POWER_SAVE_MODE*/
if(m_pPlayerControl != NULL)
{
@@ -421,6 +439,10 @@
, m_pTitleChangeObs(NULL)
, m_pAuthorChangeObs(NULL)
, m_clientTid(0)
+#ifdef HELIX_FEATURE_POWER_SAVE_MODE
+ ,m_pPowerSave(NULL)
+ ,m_pScheduler3(NULL)
+#endif /*HELIX_FEATURE_POWER_SAVE_MODE*/
{
m_pSiteSupplier = NULL;
m_pPrefs = NULL;
@@ -500,6 +522,14 @@
{
User::Leave(KErrNoMemory);
}
+
+#ifdef HELIX_FEATURE_POWER_SAVE_MODE
+ //no need to check the memory allocation here. It is done above.
+ m_pClientEngine->QueryInterface(IID_IHXPowerSave, (void**)&m_pPowerSave);
+
+ HX_RELEASE(m_pScheduler3);
+ QueryInterface(IID_IHXScheduler3, (void**)&m_pScheduler3);
+#endif /*HELIX_FEATURE_POWER_SAVE_MODE*/
InitAdviseSinks();
SetupAPSelectorL();
@@ -1021,6 +1051,38 @@
HXLOGL2(HXLOG_SMMF, "HXMMFStateCtrl::GetClientThreadId");
return m_clientTid;
}
+void HXMMFStateCtrl::StartPowerSave()
+{
+ HX_RESULT retVal = HXR_FAIL;
+
+
+#ifdef HELIX_FEATURE_POWER_SAVE_MODE
+ HXLOGL2( HXLOG_SMMF, "HXMMFStateCtrl::StartPowerSave m_pPowerSave:%p", m_pPowerSave);
+ if(m_pPowerSave)
+ {
+ retVal = m_pPowerSave->StartPowerSave();
+ HXLOGL1( HXLOG_SMMF, "HXMMFStateCtrl::StartPowerSave retVal:%lu", retVal);
+ }
+#endif
+
+ return;
+}
+
+
+void HXMMFStateCtrl::EndPowerSave()
+{
+ HX_RESULT retVal = HXR_OK;
+
+#ifdef HELIX_FEATURE_POWER_SAVE_MODE
+ HXLOGL2( HXLOG_SMMF, "HXMMFStateCtrl::EndPowerSave m_pPowerSave:%p", m_pPowerSave);
+ if(m_pPowerSave)
+ {
+ retVal = m_pPowerSave->EndPowerSave();
+ }
+#endif
+
+ return;
+}
//Ensure timer is active.
void HXMMFStateCtrl::SetOnPostSeekTimer()