int snd_pcm_pause(snd_pcm_t *pcm, int enable);
snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm);
int snd_pcm_hwsync(snd_pcm_t *pcm);
-int snd_pcm_hwdiff(snd_pcm_t *pcm, snd_pcm_uframes_t *diff, snd_pcm_uframes_t *old_pos);
int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
int snd_pcm_resume(snd_pcm_t *pcm);
snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
Note that this function does not update the current r/w pointer for applications,
so the function \link ::snd_pcm_avail_update \endlink must be called afterwards
before any read/write begin+commit operations.
-<p>
-To determine the processed frames by hardware, the function \link ::snd_pcm_hwdiff \endlink
-might be used. Note that this function returns cached value which is synchronized with
-hardware using the \link ::snd_pcm_hwsync \endlink function. The application may
-manage the right r/w pointer via \link ::snd_pcm_rewind \endlink and
-\link ::snd_pcm_forward \endlink functions.
\section pcm_action Managing the stream state
return pcm->fast_ops->hwsync(pcm->fast_op_arg);
}
-/**
- * \brief Return count of processed frames by hardware from last call
- * \param pcm PCM handle
- * \param diff Difference between last position and current
- * \param old_pos Old position on entry, actual position on exit
- * \return 0 on success otherwise a negative error code
- *
- * The old_ptr parameter is in range 0 ... (boundary - 1). It contains
- * count_of_ring_buffer_crosses * buffer_size + offset in the ring buffer.
- * Using this value is not intented
- *
- * Note this function does not obtain the real position from hardware.
- * The function \link ::snd_pcm_hwsync \endlink have to be called
- * before to obtain the real hardware position.
- */
-#ifndef DOXYGEN
-int INTERNAL(snd_pcm_hwdiff)(snd_pcm_t *pcm, snd_pcm_uframes_t *diff, snd_pcm_uframes_t *old_pos)
-#else
-int snd_pcm_hwdiff(snd_pcm_t *pcm, snd_pcm_uframes_t *diff, snd_pcm_uframes_t *old_pos)
-#endif
-{
- snd_pcm_uframes_t d, hw_ptr;
-
- assert(pcm && diff && old_pos);
- assert(pcm->setup);
- assert(*old_pos < pcm->boundary);
- hw_ptr = *pcm->hw.ptr;
- if (hw_ptr < *old_pos) {
- d = (pcm->boundary - *old_pos) + hw_ptr;
- } else {
- d = hw_ptr - *old_pos;
- }
- *diff = d;
- *old_pos = hw_ptr;
- return 0;
-}
-default_symbol_version(__snd_pcm_hwdiff, snd_pcm_hwdiff, ALSA_0.9.0rc8);
-
/**
* \brief Obtain delay for a running PCM handle
* \param pcm PCM handle
avail = snd_pcm_mmap_avail(pcm);
if (avail < 0)
return 0;
- if (frames > avail)
+ if (frames > (snd_pcm_uframes_t)avail)
frames = avail;
snd_pcm_mmap_appl_forward(pcm, frames);
return frames;
}
static snd_pcm_sframes_t snd_pcm_hw_mmap_commit(snd_pcm_t *pcm,
- snd_pcm_uframes_t offset,
+ snd_pcm_uframes_t offset ATTRIBUTE_UNUSED,
snd_pcm_uframes_t size)
{
snd_pcm_hw_t *hw = pcm->private_data;
unsigned int *val, int *dir);
#ifdef INTERNAL
-int INTERNAL(snd_pcm_hwdiff)(snd_pcm_t *pcm, snd_pcm_uframes_t *diff, snd_pcm_uframes_t *old_pos);
snd_pcm_sframes_t INTERNAL(snd_pcm_forward)(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
int INTERNAL(snd_pcm_hw_params_get_access)(const snd_pcm_hw_params_t *params, snd_pcm_access_t *access);