I would think this would have the affect on start-up time if Turbo-Play is turned OFF since the Preroll is computed as media_preroll + minimum_audio_pushdown.
Thus I would expect that with this change the start-up time will go up by ~4 seconds.


Do we have an explanation of why 4seconds of minimum audio pushdown are needed?

I think we need to find the exact reason why re-buffering occurs before we can justify increasing pushdown to 4 seconds.

Milko


At 02:28 PM 4/11/2005, Greg Wright wrote:
Liam Murray wrote:
Regardless of HELIX_CONFIG_MIN_PCM_PUSHDOWN_BYTES we are #defin'ing MINIMUM_AUDIO_STARTUP_PUSHDOWN to 100 ms. Do we still need HELIX_CONFIG_MIN_PCM_PUSHDOWN_BYTES?

I agree and will remove the redundant #if/else.

--greg.


The code changes look good otherwise.
Liam

At 01:54 PM 4/11/2005, Greg Wright wrote:

Synopsis:

    The Symbian player, built off of the new Cayenne branch, is exhibiting
    problems with rebuffering and playback of AMR audio. Compared to
    the old 130NepX branch it would rebuffer a lot more then it should and
    some AMR clips would not play back at all.

Fix:


Several things are changing:


o Fix a #define what wasn't updated when all the changes to the core were made for instant-on/LLL/etc. The logic changed on how we decide if we really need to rebuffer or not. One of our #defines was change quite a bit but the same #define for mobile profiles was not updated, MINIMUM_AUDIO_STARTUP_PUSHDOWN was changed from 1000 on the old branches to 100 on the HEAD.

o Check in part of a audio fix Liam is working on. This just rounds up
the number of blocks remaining to play in the device instead of rounding
to the nearest number. This makes the Symbian audio device return block
numbers that match the other platforms.


o Add the ability to override the renderer's audio pushdown amount. On
embedded/mobile devices we often need more then that to help alleviate
underflow problems:


           +#if defined(ENFORCE_MINIMUM_PUSHDOWN)
           +    if( ulMinimumPushdown < MINIMUM_AUDIO_PUSHDOWN )
           +    {
           +        ulMinimumPushdown = MINIMUM_AUDIO_PUSHDOWN;
           +    }
           +#endif

I added the new define ENFORCE_MINIMUM_PUSHDOWN to a Symbian only audio
file and increased the amount of pushdown from 1 second to 4 seconds. This
was found by trial and error from playing back a very problematic clip at
high CPU load. I am thinking about making this a preference so users can
increase it on their device without a re-compile if they run into problems.


           +#define MINIMUM_AUDIO_PUSHDOWN 4000
           +#define ENFORCE_MINIMUM_PUSHDOWN


o Removed an unused function that get the pushdown amount:

           CHXAudioPlayer::GetInitialPushdown().

o Moving the initialization of the audio code to farther down in the Init
method. This lets the logging system get initialized early enough so that
we can log the audio subsystem initialization.




Files Modified:


Image Size and Heap Use impact: Increase in amount of HEAP used for decoded audio(pcm) data.
Platforms and Profiles Affected: All MIN_HEAP builds.
Distribution Libraries affected: none.



Platforms and Profiles Build Verified: Symbian emulator/device.

Branch:  HEAD, 150Cay.


--greg.


Index: platform/symbian/audiosvr/mmf/audio_session-mmf.cpp
===================================================================
RCS file: /cvsroot/audio/device/platform/symbian/audiosvr/mmf/audio_session-mmf.cpp,v
retrieving revision 1.4.2.2
diff -u -w -r1.4.2.2 audio_session-mmf.cpp
--- platform/symbian/audiosvr/mmf/audio_session-mmf.cpp 4 Apr 2005 23:12:29 -0000 1.4.2.2
+++ platform/symbian/audiosvr/mmf/audio_session-mmf.cpp 11 Apr 2005 20:21:48 -0000
@@ -657,7 +657,7 @@
cbBuffered += m_cbBufferList - m_cbFrontBufferWritten;


     // convert bytes to block count (rounded)
-    TUint32 blockCount = (cbBuffered + m_cbBlock/2)/m_cbBlock;
+    TUint32 blockCount = cbBuffered/m_cbBlock+1;

HXLOGL4(HXLOG_ADEV, "HXSymbianAudioSession::GetBlocksBuffered(): block count = %lu (%lu bytes)", blockCount, cbBuffered);


Index: pub/platform/symbian/audsymbian.h
===================================================================
RCS file: /cvsroot/audio/device/pub/platform/symbian/audsymbian.h,v
retrieving revision 1.10.2.1
diff -u -w -r1.10.2.1 audsymbian.h
--- pub/platform/symbian/audsymbian.h 30 Mar 2005 20:58:41 -0000 1.10.2.1
+++ pub/platform/symbian/audsymbian.h 11 Apr 2005 20:21:48 -0000
@@ -58,11 +58,8 @@
#include "hxaudply.h"
#include "chxmapptrtoptr.h"


-#ifdef HELIX_CONFIG_MIN_PCM_PUSHDOWN_BYTES
-#define MINIMUM_AUDIO_PUSHDOWN    100
-#else
-#define MINIMUM_AUDIO_PUSHDOWN    1000
-#endif
+#define MINIMUM_AUDIO_PUSHDOWN 4000
+#define ENFORCE_MINIMUM_PUSHDOWN

 struct IHXAudioDeviceResponse;
 class CHXSimpleList;


Index: hxcleng.cpp =================================================================== RCS file: /cvsroot/client/core/hxcleng.cpp,v retrieving revision 1.69.2.7 diff -u -w -r1.69.2.7 hxcleng.cpp --- hxcleng.cpp 31 Mar 2005 01:31:44 -0000 1.69.2.7 +++ hxcleng.cpp 11 Apr 2005 20:20:37 -0000 @@ -772,6 +772,7 @@

 void HXClientEngine::_Initialize(void)
 {
+
     IHXBuffer* pValue = NULL;
 #if defined(HELIX_FEATURE_AUDIO)
     if (!m_pAudioSession)
@@ -943,13 +944,6 @@
     }
 #endif /*_WIN32*/

-#if defined(HELIX_FEATURE_AUDIO)
- if (!m_LastError)
- {
- m_LastError = m_pAudioSession->Init((IUnknown*) (IHXClientEngine*)this);
- m_pAudioSession->SetCoreMutex(m_pCoreMutex);
- }
-#endif /* HELIX_FEATURE_AUDIO */


 #if defined(HELIX_FEATURE_OPTIMIZED_SCHEDULER)
     if (m_pOptimizedScheduler)
@@ -1031,9 +1025,19 @@

 #endif /* HELIX_FEATURE_PLUGINHANDLER2 */

+    } //End of outer if statement
+
+
     InitLogging();

- } //End of outer if statement
+
+#if defined(HELIX_FEATURE_AUDIO)
+ if (!m_LastError)
+ {
+ m_LastError = m_pAudioSession->Init((IUnknown*) (IHXClientEngine*)this);
+ m_pAudioSession->SetCoreMutex(m_pCoreMutex);
+ }
+#endif /* HELIX_FEATURE_AUDIO */


     // get the resource manager instance
 #if defined(HELIX_FEATURE_RESOURCEMGR)

Index: hxaudply.cpp
===================================================================
RCS file: /cvsroot/client/audiosvc/hxaudply.cpp,v
retrieving revision 1.36.2.3
diff -u -w -r1.36.2.3 hxaudply.cpp
--- hxaudply.cpp        25 Mar 2005 03:33:38 -0000      1.36.2.3
+++ hxaudply.cpp        11 Apr 2005 20:19:38 -0000
@@ -97,15 +97,8 @@
 #include "hxprefutil.h"
 #endif /* HELIX_FEATURE_PREFERENCES */

-#ifdef HELIX_CONFIG_MIN_PCM_PUSHDOWN_BYTES
-// These values were arrived at via trial and error on a linux, xi586 (pentium)
#define MINIMUM_AUDIO_GRANULARITY 50
#define MAXIMUM_AUDIO_GRANULARITY 100
-#else
-#define MINIMUM_AUDIO_GRANULARITY 50
-#define MAXIMUM_AUDIO_GRANULARITY 100
-#endif
-
#define MAX_WAIT_AT_SAME_TIME (MAXIMUM_AUDIO_GRANULARITY+50)


 CHXAudioPlayer::CHXAudioPlayer( CHXAudioSession* owner )
@@ -1947,30 +1940,6 @@
     }

m_bHasStreams = TRUE;
-}
-
-ULONG32 CHXAudioPlayer::GetInitialPushdown(BOOL bAtStart /* = FALSE*/)
-{
- /* If there are any audio streams, initial pushdown is session's
- * initial pushdown
- */
- if (m_pStreamList->GetCount() > 0)
- {
- ULONG32 ulRet =
- m_Owner->GetInitialPushdown(bAtStart) + m_ulGranularity;
-
-#ifdef HELIX_FEATURE_MIN_HEAP
- // The MIN_HEAP code seems to need 1 extra block's worth
- // of data to avoid rebuffers during playback. This
- // is a low impact temporary solution that fixes the problem.
- ulRet += m_ulGranularity;
-#endif
- return ulRet;
- }
- else
- {
- return 0;
- }
}


 /************************************************************************
Index: hxaudses.cpp
===================================================================
RCS file: /cvsroot/client/audiosvc/hxaudses.cpp,v
retrieving revision 1.52.2.5
diff -u -w -r1.52.2.5 hxaudses.cpp
--- hxaudses.cpp        30 Mar 2005 21:02:02 -0000      1.52.2.5
+++ hxaudses.cpp        11 Apr 2005 20:19:39 -0000
@@ -128,11 +128,10 @@
 #if defined(HELIX_CONFIG_MIN_PCM_PUSHDOWN_BYTES)
 // The following value was arrived at via trial and error and has been
 // demonstrated to give optimal heap usage values for RA8, ATRAC3, & MP3.
-#define MINIMUM_AUDIO_STARTUP_PUSHDOWN  500 //ms
+#define MINIMUM_AUDIO_STARTUP_PUSHDOWN  100 //ms
 #else
 #define MINIMUM_AUDIO_STARTUP_PUSHDOWN  100 // ms
 #endif
-#define MIN_BLOCKS_TOBEQUEUED
(m_ulMinimumPushdown*1.0/m_ulGranularity)
 #define SOME_INSANELY_LARGE_VALUE       3600000 /* 1 hour */

#ifdef _WIN32
@@ -2904,13 +2903,18 @@
* This is the amount of audio data that is being written
* to the audio device before starting playback.
*/
-STDMETHODIMP CHXAudioSession::SetAudioPushdown(
- UINT32 /*IN*/ ulMinimumPushdown)
+STDMETHODIMP CHXAudioSession::SetAudioPushdown(UINT32 ulMinimumPushdown)
{
- HXLOGL3(HXLOG_ADEV, "CHXAudioSession[%p]::SetAudioPushdown(): push down = %lu", this, ulMinimumPushdown);
+#if defined(ENFORCE_MINIMUM_PUSHDOWN)
+ if( ulMinimumPushdown < MINIMUM_AUDIO_PUSHDOWN )
+ {
+ ulMinimumPushdown = MINIMUM_AUDIO_PUSHDOWN;
+ }
+#endif
m_ulMinimumPushdown = ulMinimumPushdown;
-
UpdateMinimumPushdown();
+
+ HXLOGL3(HXLOG_ADEV, "CHXAudioSession[%p]::SetAudioPushdown(): push down = %lu", this, ulMinimumPushdown);
return HXR_OK;
}


@@ -4091,15 +4095,14 @@
     return theErr;
 }


_______________________________________________ Audio-dev mailing list [email protected] http://lists.helixcommunity.org/mailman/listinfo/audio-dev


_______________________________________________ Client-dev mailing list [EMAIL PROTECTED] http://lists.helixcommunity.org/mailman/listinfo/client-dev



_______________________________________________ Audio-dev mailing list [email protected] http://lists.helixcommunity.org/mailman/listinfo/audio-dev

Reply via email to