Re: WaveOutWrite and Sockets

Tech-Archive recommends: Fix windows errors by optimizing your registry



yes Almon,

I have re-readen the thread.
Here is the explain:

>Hi,
>
>Pay attention to the things you have been told.
>
>Anyway, you shouldn't waveOutWrite dozens of buffers
>at a time--It should be "several" or "a handful."
>You should go for attempting to maintain a count of
>several buffers. You have to balance the issues of
>network latency and CPU cycle starvation versus what
>an unacceptable audio delay is. This is the hardest part.
>
////////////////////////
The time of the packets is 100 ms.
I have a timer that when 100ms pass.. it takes a packet of a queue where the
packets arrive from the Socket. but... as the PPC isn't a real time
plataform, when I receive an STILL_PLAYING error it waits 150ms
I have 5 buffers.
///////////////////////
>You need to understand a few more concepts:
>1. One of those concepts, as Robert stated several times,
>is if you have an input samplerate that is even very slightly
>higher than your output rate when they are nominally the
>same, if you don't occasionally hiccup/skip on the output,
>the data backup will CONTINUALLY INCREASE.
/////////////////
That is why when I receive a STILL_PLAYING error I delete that packet and I
wait 150ms.
////////////////
>
>2. Also, packets/buffers that you waveOutWrite, are packets
>that you are handing over to the system. You don't get to
>mess with them/re-waveOutWrite them, until the system
>has flushed them and "given" them back to you. You must
>not ignore this, otherwise you will get anything from an error
>every once in a while to errors all the time.
////////////////////
if I don't use Socket all the time and only playback continuously the first
packet it works fine.
////////////////////
>
>3. You also need to understand keeping the continuity of the
>sample data--ie. The first sample from a buffer should come
>right after the last sample from the previous buffer seamlessly.
>This means you should always have more than one buffer
>queued--And frankly more than 2, because there is a latency
>from a buffer being flushed to when you are notified about it.
>ie. Time goes by, so you are ALREADY playing the next buffer.
/////////////////////////////
yes, I have 5 buffers and I manage the queue to know if there are a lot of
packets or not.
///////////////////////////
>
>Given these, your errors are not surprising at all.
>
>Hope this helps...
>
>Almon B. Strowger
KOOK Pocket Software


"Almon B. Strowger" wrote:

>
> Hi,
>
> I suggest re-reading the thread started by you on March 16th.
>
> Almon B. Strowger
> KOOK Pocket Software

.



Relevant Pages

  • Re: Waveform Audio - MMSYSERR_INVALPARAM
    ... Also, packets/buffers that you waveOutWrite, are packets ... right after the last sample from the previous buffer seamlessly. ... the waveOutWrite function DON'T return the error. ...
    (microsoft.public.pocketpc.developer)
  • Re: In-tree version of new FireWire drivers available
    ... Just to recap, the dual buffer receive mode, as described in section ... quadlet aligned amount of header data can be appended into one buffer ... *either* the header buffer or the payload buffer fills up. ... enough to hold headers for all the packets it takes to fill up the ...
    (Linux-Kernel)
  • Re: Deaf CAsyncSocket on Windows Service.
    ... To read them out I need a buffer to ... Short packets at the sender are coalesced into longer packets. ... THe receiver says "I have this much buffer space" and the sender is free to send ... You get an OnReceive notification if there is input data to be read. ...
    (microsoft.public.vc.mfc)
  • Re: Cisco 7204VXR Interface ignored packet
    ... Input queue drops (ignored packets) are usually due to buffers not being ... The buffer defaults are good 98% of the ... 256 max cache size, 256 in cache ... 22496866 hits in cache, 0 misses in cache ...
    (comp.dcom.sys.cisco)
  • Re: Persistent stall in the Cypress FX2 FIFO
    ... the FX2's firmware code, would be to install some sort of stub routines ... > how long they are (it appends even for 4 byte long packets). ... > a packet from the FIFO before sending the next one all works fine... ... smaller or larger than what a single buffer could hold. ...
    (comp.arch.embedded)