<html>
  <head>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi,<br>
    <br>
    I have problems streaming live PCM audio. Audio comes either
    directly<br>
    from microphone (16-bit LE) or from hardware encoder (A-LAW).
    Sampling<br>
    frequency is 8k, mono. In both cases I receive a buffer (320 bytes
    for 16-bit,<br>
    160 bytes for 8-bit) in the thread interfacing hardware and use
    event trigger<br>
    to signal my live555 thread. I've created my own class based on
    DeviceSource<br>
    template, that sets fFrameSize and fPresentationTime (using
    gettimeoofday())<br>
    and delivers the buffer to SimpleRTPSink via deliverFrame(). 16-bit
    data is also<br>
    converted to BE. I'm setting OutPacketBuffer:: maxSize to 20480.<br>
    <br>
    I know that audio is correct, because if I save it to file instead
    of sending to<br>
    RTPSink, convert to WAV and stream via testWAVAudioStreamer, VLC
    reproduces<br>
    it correctly. I also know that my DeviceSource class is correct,
    because I use it<br>
    successfully to stream live H.264 video. However with PCM audio, VLC
    <br>
    correctly recognizes stream format, sampling frequency and numbers
    of channels,<br>
    but produces noisy output that cuts frequently. I get the following
    errors in VLC:<br>
    <br>
    <span style=" font-style:italic; color:#00008b;">main</span><span
      style=" font-style:italic; color:#ff0000;"> error: </span><span
      style=" color:#000000;">ES_OUT_RESET_PCR called</span>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">PTS is out of range (-9982), dropping
        buffer</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">buffer too early (-55875), down-sampling</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">timing screwed, stopping resampling</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">buffer too early (-86375), down-sampling</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">resampling stopped after 256448 usec
        (drift: 58884)</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">buffer too early (-56084), down-sampling</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">timing screwed, stopping resampling</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">buffer way too early (-125031), clearing
        queue</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">buffer too late (60316), up-sampling</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">resampling stopped after 610634 usec
        (drift: -7483)</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">buffer too early (-54829), down-sampling</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">timing screwed, stopping resampling</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">buffer too early (-80356), down-sampling</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">buffer way too early (-133937), clearing
        queue</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">timing screwed, stopping resampling</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">buffer too early (-97938), down-sampling</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">buffer way too early (-150441), clearing
        queue</span></p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
        style=" font-style:italic; color:#00008b;">main</span><span
        style=" font-style:italic; color:#008000;"> warning: </span><span
        style=" color:#000000;">timing screwed, stopping resampling</span></p>
    <p style="-qt-paragraph-type:empty; margin-top:0px;
      margin-bottom:0px; margin-left:0px; margin-right:0px;
      -qt-block-indent:0; text-indent:0px; color:#000000;"><br>
      I'm currently out of ideas what I'm doing wrong. Any help would be<br>
      greatly appreciated.<br>
      <br>
    </p>
    <p style="-qt-paragraph-type:empty; margin-top:0px;
      margin-bottom:0px; margin-left:0px; margin-right:0px;
      -qt-block-indent:0; text-indent:0px; color:#000000;">Thanks.<br>
      <br>
    </p>
    <p style="-qt-paragraph-type:empty; margin-top:0px;
      margin-bottom:0px; margin-left:0px; margin-right:0px;
      -qt-block-indent:0; text-indent:0px; color:#000000;">Felix.<br>
    </p>
  </body>
</html>