Jump to ID:
Multimedia

Project Home

Documents

Discussions

Wiki

Project Info
Forum Topic - io-media mmf buffers: (2 Items)
   
 
 
io-media mmf buffers  
I have a project asking about lowering the queue1-size and queue2-size options in io-media's config file to save memory.
  Specifically, they're interested in how much memory one buffer element uses so that they could pick a number and 
calculate a theoretical maximum amount of memory that the audio buffer will use.  The docs are pretty clear in saying 
that the size of a buffer element will differ based on the media.

That said, is there any general rule that io-media components use to pick the size of a buffer?  ie, does it try to make
 one buffer element equal to 100 ms of playback, or to one frame, or something like this?  I just wonder if I can give a
 better answer than "it varies", even if it's an undocumented/no-promises explanation.

Thanks,


Ryan.
Re: io-media mmf buffers  
Just to follow-up in case anyone comes across this in a search, here's the answer I got.  In brief: it depends.

The first queue holds data that comes straight from the file/source.  The size of those buffers is generally what the 
streamer suggested, possibly rounded up to a multiple of a frame (for formats with a fixed frame size).  For regular 
files accessed via the filedes streamer, I think that will be around 32K.

The second queue holds decompressed data coming from the decoder.  The buffer size here is in general up to the decoder.
  It should be OK to set the queue2 size to two or three unless some of your decoders have trouble delivering data at a 
consistent rate, either because the format is such that some frames take longer to decode than they take to play, or 
because you're running some higher-priority stuff that preempts the decode.

Things may be more complicated if you play video rather than just audio.