Lines Matching defs:runtime

421 	void (*private_free)(struct snd_pcm_runtime *runtime);
472 /* -- runtime information -- */
473 struct snd_pcm_runtime *runtime;
705 return (substream->runtime->state == SNDRV_PCM_STATE_RUNNING ||
706 (substream->runtime->state == SNDRV_PCM_STATE_DRAINING &&
712 * @runtime: PCM runtime to set
717 static inline void __snd_pcm_set_state(struct snd_pcm_runtime *runtime,
720 runtime->state = state;
721 runtime->status->state = state; /* copy for mmap */
726 * @runtime: PCM runtime instance
731 static inline ssize_t bytes_to_samples(struct snd_pcm_runtime *runtime, ssize_t size)
733 return size * 8 / runtime->sample_bits;
738 * @runtime: PCM runtime instance
743 static inline snd_pcm_sframes_t bytes_to_frames(struct snd_pcm_runtime *runtime, ssize_t size)
745 return size * 8 / runtime->frame_bits;
750 * @runtime: PCM runtime instance
755 static inline ssize_t samples_to_bytes(struct snd_pcm_runtime *runtime, ssize_t size)
757 return size * runtime->sample_bits / 8;
762 * @runtime: PCM runtime instance
767 static inline ssize_t frames_to_bytes(struct snd_pcm_runtime *runtime, snd_pcm_sframes_t size)
769 return size * runtime->frame_bits / 8;
774 * @runtime: PCM runtime instance
779 static inline int frame_aligned(struct snd_pcm_runtime *runtime, ssize_t bytes)
781 return bytes % runtime->byte_align == 0;
792 struct snd_pcm_runtime *runtime = substream->runtime;
793 return frames_to_bytes(runtime, runtime->buffer_size);
804 struct snd_pcm_runtime *runtime = substream->runtime;
805 return frames_to_bytes(runtime, runtime->period_size);
810 * @runtime: PCM runtime instance
816 static inline snd_pcm_uframes_t snd_pcm_playback_avail(struct snd_pcm_runtime *runtime)
818 snd_pcm_sframes_t avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr;
820 avail += runtime->boundary;
821 else if ((snd_pcm_uframes_t) avail >= runtime->boundary)
822 avail -= runtime->boundary;
828 * @runtime: PCM runtime instance
834 static inline snd_pcm_uframes_t snd_pcm_capture_avail(struct snd_pcm_runtime *runtime)
836 snd_pcm_sframes_t avail = runtime->status->hw_ptr - runtime->control->appl_ptr;
838 avail += runtime->boundary;
844 * @runtime: PCM runtime instance
848 static inline snd_pcm_sframes_t snd_pcm_playback_hw_avail(struct snd_pcm_runtime *runtime)
850 return runtime->buffer_size - snd_pcm_playback_avail(runtime);
855 * @runtime: PCM runtime instance
859 static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(struct snd_pcm_runtime *runtime)
861 return runtime->buffer_size - snd_pcm_capture_avail(runtime);
874 struct snd_pcm_runtime *runtime = substream->runtime;
875 return snd_pcm_playback_avail(runtime) >= runtime->control->avail_min;
888 struct snd_pcm_runtime *runtime = substream->runtime;
889 return snd_pcm_capture_avail(runtime) >= runtime->control->avail_min;
903 struct snd_pcm_runtime *runtime = substream->runtime;
905 if (runtime->stop_threshold >= runtime->boundary)
907 return snd_pcm_playback_avail(runtime) < runtime->buffer_size;
920 struct snd_pcm_runtime *runtime = substream->runtime;
921 return snd_pcm_playback_avail(runtime) >= runtime->buffer_size;
934 struct snd_pcm_runtime *runtime = substream->runtime;
935 return snd_pcm_capture_avail(runtime) == 0;
955 substream->runtime->trigger_master = master;
1074 int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
1076 int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
1078 int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var);
1079 int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime,
1083 int snd_pcm_hw_constraint_ranges(struct snd_pcm_runtime *runtime,
1087 int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime,
1091 int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime,
1095 int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime,
1099 int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime,
1103 int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime,
1106 int snd_pcm_hw_rule_noresample(struct snd_pcm_runtime *runtime,
1108 int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime,
1116 * @runtime: PCM runtime instance
1124 struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
1127 return snd_pcm_hw_constraint_minmax(runtime, var, val, val);
1226 snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime)
1228 return snd_pcm_hw_limit_rates(&runtime->hw);
1239 * snd_pcm_set_runtime_buffer - Set the PCM runtime buffer
1243 * Copy the buffer information to runtime->dma_buffer when @bufp is non-NULL.
1249 struct snd_pcm_runtime *runtime = substream->runtime;
1251 runtime->dma_buffer_p = bufp;
1252 runtime->dma_area = bufp->area;
1253 runtime->dma_addr = bufp->addr;
1254 runtime->dma_bytes = bufp->bytes;
1256 runtime->dma_buffer_p = NULL;
1257 runtime->dma_area = NULL;
1258 runtime->dma_addr = 0;
1259 runtime->dma_bytes = 0;
1265 * @runtime: PCM runtime instance
1268 static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime,
1271 switch (runtime->tstamp_type) {
1388 #define snd_pcm_get_dma_buf(substream) ((substream)->runtime->dma_buffer_p)