Hi Greg,

The variable m_bUseMMAPTStamps is already TRUE in constructor but this
TRUE variable is never used for any platform. Always its assigned FALSE
value. So i am setting it TRUE for XANDROS and FALSE for others.

Here is the updated diff:

Index: audlinux_alsa.cpp
===================================================================
RCS file: /cvsroot/audio/device/platform/unix/audlinux_alsa.cpp,v
retrieving revision 1.9.2.5
diff -u -r1.9.2.5 audlinux_alsa.cpp
--- audlinux_alsa.cpp   23 Jul 2008 10:25:48 -0000      1.9.2.5
+++ audlinux_alsa.cpp   5 Mar 2009 05:55:33 -0000
@@ -98,7 +98,11 @@
     m_PeriodSize(0),
 #endif //HELIX_FEATURE_ALSA_WRITE_PERIOD_SIZE
     m_bGotInitialTrigger(FALSE),
+#ifdef _XANDROS
     m_bUseMMAPTStamps(TRUE)
+#else
+    m_bUseMMAPTStamps(FALSE)
+#endif 
 {
 }
 
@@ -1146,9 +1150,6 @@
         break;
     }
 
-    // XXXRGG: Always use the delay method for now.
-    m_bUseMMAPTStamps = FALSE;
-
     if (m_bUseMMAPTStamps)
     {
         retVal = GetBytesActuallyPlayedUsingTStamps(nBytesPlayed);


Thanks,
Deepak Jain

On Wed, 2009-03-04 at 08:54 -0800, Greg Wright wrote:
> Deepak Jain wrote:
> > Project: Real Player for Netbook on ARM.
> > 
> > Synopsis: Fix for audio device not updating on ARM
> > 
> > Overview:
> > The audio device was not updating for the ARM while playing a audio only
> > or A/v file. The reason is that in file audlinux_alsa.cpp in function
> > _GetBytesActualyPlayed, we are always using the method
> > GetBytesActuallyPlayedUsingDelay().
> > 
> > But this method is resulting in a very high bytes_delay, due to which
> > the value of nBytesPlayed comes to be very huge which is wrong and
> > therefore the audio device keeps stuck to a point and we see continuous
> > OnPosLength calls on the same time stamp.
> > 
> > Now by using GetBytesActuallyPlayedUsingTStamps(), the audio device is
> > updating fine.
> [snip]
> > Index: audlinux_alsa.cpp
> > ===================================================================
> > RCS file: /cvsroot/audio/device/platform/unix/audlinux_alsa.cpp,v
> > retrieving revision 1.9.2.5
> > diff -u -r1.9.2.5 audlinux_alsa.cpp
> > --- audlinux_alsa.cpp       23 Jul 2008 10:25:48 -0000      1.9.2.5
> > +++ audlinux_alsa.cpp       4 Mar 2009 14:08:44 -0000
> > @@ -1146,6 +1146,16 @@
> >          break;
> >      }
> >  
> > +#ifdef _XANDROS
> > +    //For Xandros ARM, delay method is resulting in the bytes_delay
> > +    //to be vey large and therefore audio device was not updating.
> > +    //Using TimeStamps method is working in this case.
> > +    m_bUseMMAPTStamps = TRUE; 
> > +    if (m_bUseMMAPTStamps)
> > +    {
> > +        retVal = GetBytesActuallyPlayedUsingTStamps(nBytesPlayed);
> > +    }
> > +#else
> 
> You should go ahead and use the m_bUseMMAPTStamps correctly. That is,
> set it to TRUE for your platform instead of hard coding it right there
> in line with the code that used it.
> 
> for now, set it to true with an #ifdef in 
> CAudioOutLinuxAlsa::CAudioOutLinuxAlsa().
> then in the code above, key off of that member var to do it each
> different way (delay or MMAP).
> 
> If you are so motivated, this would be a good place to read a preference
> so you could go between the two methods at runtime for testing.
> 
> --greg.
> 
> 
> >      // XXXRGG: Always use the delay method for now.
> >      m_bUseMMAPTStamps = FALSE;
> >  
> > @@ -1159,6 +1169,7 @@
> >          /* MMAP'd timestamps are fishy. Try using snd_pcm_delay. */
> >          retVal =
> > GetBytesActuallyPlayedUsingDelay(nBytesPlayed);            
> >      }
> > +#endif //#ifdef _XANDROS
> >  
> >      m_nLastBytesPlayed = nBytesPlayed;
> >      return nBytesPlayed;
> > 
> > 
> > 
> > _______________________________________________
> > Audio-dev mailing list
> > [email protected]
> > http://lists.helixcommunity.org/mailman/listinfo/audio-dev
> > 
> 


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

Reply via email to