Logo Search packages:      
Sourcecode: alsa-lib version File versions  Download package

snd_pcm_sframes_t snd_pcm_readi ( snd_pcm_t pcm,
void *  buffer,
snd_pcm_uframes_t  size 
)

Read interleaved frames from a PCM.

Parameters:
pcmPCM handle
bufferframes containing buffer
sizeframes to be written
Returns:
a positive number of frames actually read otherwise a negative error code
Return values:
-EBADFDPCM is not in the right state (SND_PCM_STATE_PREPARED or SND_PCM_STATE_RUNNING)
-EPIPEan overrun occurred
-ESTRPIPEa suspend event occurred (stream is suspended and waiting for an application recovery)

If the blocking behaviour was selected, then routine waits until all requested bytes are filled. The count of bytes can be less only if a signal or underrun occurred.

If the non-blocking behaviour is selected, then routine doesn't wait at all.

Definition at line 1238 of file pcm.c.

References snd_pcm_access_name(), and SND_PCM_ACCESS_RW_INTERLEAVED.

{
      assert(pcm);
      assert(size == 0 || buffer);
      if (CHECK_SANITY(! pcm->setup)) {
            SNDMSG("PCM not set up");
            return -EIO;
      }
      if (pcm->access != SND_PCM_ACCESS_RW_INTERLEAVED) {
            SNDMSG("invalid access type %s", snd_pcm_access_name(pcm->access));
            return -EINVAL;
      }
      return _snd_pcm_readi(pcm, buffer, size);
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index