[vorbis-dev] vorbis tool ogg123/oggenc running out of sync while streaming.

Stan Seibert volsung at mailsnare.net
Sun Sep 8 18:32:12 PDT 2002



On Sun, 2002-09-08 at 18:23, Dirk-Willem van Gulik wrote:
> Now the problem I have is that regardless of how large I make the Zaurus
> its input buffer; the decoder always seems to run a little fast - and will
> generally deplete the input buffer after a minute or so. I.e. it nicely
> buffers 200-300k; and the after a minute or so is down to 0 on the input
> buffer - and will linger around that point.
> 
> Is there any way to prevent this ? Is it normal to expect some PID like
> feedback loop to adjust the time/keep the buffer roughly ? Or are there
> clever time stamps in the protocol to ensure this - and should I look for
> a bug in ogg123 ?

I'm not sure if I understand the problem.  As long as oggenc is encoding
at faster than realtime, then you shouldn't have any streaming issues. 
Since ogg123 is multithreaded, the player works like this (simplified):

[Input buffer] --> (Decoder thread) --> [Output buffer] --> (Playback
thread)-->[Audio device]

(Input buffer contains compressed Vorbis data, Output buffer contains
decoded PCM audio)

The decoder thread in this setup will run as fast as it can until one of
two conditions occurs:

1) The input buffer is empty
2) The output buffer is full

Then it will wait until the condition goes away.  #2 is the usual
blocking condition when playing from disk, and #1 is the usual condition
when streaming.

So having an empty input buffer is actually to be expected (unless you
have a really small output buffer).  Are you losing audio?  If not, I
wouldn't worry.


---
Stan Seibert

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.




More information about the Vorbis-dev mailing list