×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    42

    DevSound internal buffer (AKA Latency with streaming)

    I already posted a similar message about this here:
    http://discussion.forum.nokia.com/fo...ad.php?t=72867
    but I want to start a new thread with a more explanatory title.

    I figured out that CMdaAudioOutputStream latency is due directly (and only) to the internal buffering of DevSound.
    From "How to successfully stream audio on Symbian OS v7.0s"
    http://www.symbian.com/developer/tec...bianOSv1.1.pdf
    It should be noted that unlike many of the other multimedia framework
    (MMF) APIs in Symbian OS v7.0s the streaming utility does not make use of
    MMF controllers or the MMF controller framework. It interfaces directly
    with the MMF DevSound layer which is the highest level abstraction for the
    sound device itself. This allows for very low-latency audio processing to
    be performed without the overhead of the MMF or the MMF plugins."
    Very low latency...but how much? How much of the audio data it needs before starting the playout?
    In my audio streaming app I pass 320byte frames by using the MaoscbufferCopied callback but don't know after how many of them the Devsound starts to play.
    When using CMMFDevSound instead of CMdaAudioOutputStream, there are two method ( Config() and SetConfigL() ) to get and set some settings of the DevSound via a TMMFCapabilities objet which contains an "iBuffersize" member.
    But in my 6630 when querying using Config() , I always get "0" (that might mean "none" or "unlimited") for iBufferSize even if i set it to any other value via SetConfigL() ).The phone reports all zeroes for all the encodings too so I fear these calls are somehow not supported or ignored in this device.
    Also a constant exists, related to DevSound buffer KBufferLength:
    http://www.symbian.com/developer/tec...nddevconstants
    but in my S60 2nd Ed. FP2 SDK it is not present in the SoundDevice.h header...

    Anyone adding some words?... :-)

    Regards

    Rocco

  2. #2
    Registered User
    Join Date
    Nov 2005
    Location
    California, USA
    Posts
    33

    Re: DevSound internal buffer (AKA Latency with streaming)

    Rocco,

    I feel your pain man. DevSound internal buffer for input is 4096 bytes. I do not know any way to change it. As you noted SetConfig produces not effect. That means ~ 250ms delay. Talk about low latency! CmdaAudioInputStream is working through DevSound so it is the same.

    According to comments in Nokia's samples this is true for most S60 phones.

  3. #3
    Registered User
    Join Date
    Nov 2004
    Posts
    42

    Re: DevSound internal buffer (AKA Latency with streaming)

    Hi troyanker, thank you very much for your reply.
    I see only today this post of you
    http://discussion.forum.nokia.com/fo...highlight=4096
    very similar to mine.
    Quote Originally Posted by troyanker
    According to comments in Nokia's samples this is true for most S60 phones.
    Could you point me exactly in which of them, the 4096 limit is stated? I've never found evidences of that in the audio exapmples I have.

    A part from the KBufferLength costant inside symbian 7.0s (and apparently removed in later public sdk like in the "Nokia 2nd ed Fp2" i use), I've never found clearly stated anything about this from NOKIA in current SDKs.
    The CMMFDevSound::requestsize() method too should give an "upper" limit to the chunk of audio data we pass, not a "lower" one...

    Rocco

  4. #4
    Registered User
    Join Date
    Nov 2005
    Location
    California, USA
    Posts
    33

    Re: DevSound internal buffer (AKA Latency with streaming)

    Rocco,

    Take a lot at the fullduplexaudio sample published on Forum PRO. It has a comment that 4096 is the default MMF buffer size. The accompanying doc says they tested on Nokia 6630, Nokia 6680, Nokia N70, Nokia N90

    I can confirm that for Nokia 9500 and E60 phones.


    PS: See if you have had any experience with this http://discussion.forum.nokia.com/fo...ad.php?t=73306

    Thanks
    Vlad

  5. #5
    Registered User
    Join Date
    Nov 2004
    Posts
    42

    Re: DevSound internal buffer (AKA Latency with streaming)

    I'm not a PRO member so I've not access to that document :'-(
    Thanks for the infos.
    I was going to convert my app to use CMMFDevSound but now I don't think so.
    (Obviously) my streaming is based upon CMdaAudioOutputStream and I play audio chunks by calling WriteL() with incoming (decoded) frames as argument. They are now 20ms (320byte) PCM frames. Until now I've been calling WriteL(), the first time inside MAoscOpenComplete, and then in each MaoscBufferCopied callback. Now I'm asking myself if starting by calling WriteL() inside a "for loop" with 13 frames (320*13=4160) could help to speed up thinks a little, beacause in my app I already have prebuffered some frames in a user jitter buffer and I don't want to waste any more ms... But in this new way I get all the callbacks back in a bunch... :-/

    Rocco

Similar Threads

  1. Changing buffer size when streaming with CMMFDevAudio
    By troyanker in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2005-12-15, 19:26
  2. Replies: 6
    Last Post: 2005-10-03, 05:51
  3. Dialog's clipping area (again). Nokia experts, please help
    By synov in forum Symbian User Interface
    Replies: 0
    Last Post: 2004-06-26, 14:35
  4. Nokia 30 SMS sending problem !!!!!
    By pgredelj in forum General Messaging
    Replies: 1
    Last Post: 2004-01-12, 12:48
  5. Low latency audio streaming
    By janiorca in forum Symbian
    Replies: 2
    Last Post: 2003-06-23, 07:50

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×