Lines Matching refs:runtime

55 	struct snd_pcm_runtime *runtime = substream->runtime;  in snd_pcm_playback_silence()  local
58 if (runtime->silence_size < runtime->boundary) { in snd_pcm_playback_silence()
60 if (runtime->silence_start != runtime->control->appl_ptr) { in snd_pcm_playback_silence()
61 n = runtime->control->appl_ptr - runtime->silence_start; in snd_pcm_playback_silence()
63 n += runtime->boundary; in snd_pcm_playback_silence()
64 if ((snd_pcm_uframes_t)n < runtime->silence_filled) in snd_pcm_playback_silence()
65 runtime->silence_filled -= n; in snd_pcm_playback_silence()
67 runtime->silence_filled = 0; in snd_pcm_playback_silence()
68 runtime->silence_start = runtime->control->appl_ptr; in snd_pcm_playback_silence()
70 if (runtime->silence_filled >= runtime->buffer_size) in snd_pcm_playback_silence()
72 noise_dist = snd_pcm_playback_hw_avail(runtime) + runtime->silence_filled; in snd_pcm_playback_silence()
73 if (noise_dist >= (snd_pcm_sframes_t) runtime->silence_threshold) in snd_pcm_playback_silence()
75 frames = runtime->silence_threshold - noise_dist; in snd_pcm_playback_silence()
76 if (frames > runtime->silence_size) in snd_pcm_playback_silence()
77 frames = runtime->silence_size; in snd_pcm_playback_silence()
80 snd_pcm_sframes_t avail = snd_pcm_playback_hw_avail(runtime); in snd_pcm_playback_silence()
81 if (avail > runtime->buffer_size) in snd_pcm_playback_silence()
82 avail = runtime->buffer_size; in snd_pcm_playback_silence()
83 runtime->silence_filled = avail > 0 ? avail : 0; in snd_pcm_playback_silence()
84 runtime->silence_start = (runtime->status->hw_ptr + in snd_pcm_playback_silence()
85 runtime->silence_filled) % in snd_pcm_playback_silence()
86 runtime->boundary; in snd_pcm_playback_silence()
88 ofs = runtime->status->hw_ptr; in snd_pcm_playback_silence()
91 frames += runtime->boundary; in snd_pcm_playback_silence()
92 runtime->silence_filled -= frames; in snd_pcm_playback_silence()
93 if ((snd_pcm_sframes_t)runtime->silence_filled < 0) { in snd_pcm_playback_silence()
94 runtime->silence_filled = 0; in snd_pcm_playback_silence()
95 runtime->silence_start = new_hw_ptr; in snd_pcm_playback_silence()
97 runtime->silence_start = ofs; in snd_pcm_playback_silence()
100 frames = runtime->buffer_size - runtime->silence_filled; in snd_pcm_playback_silence()
102 if (snd_BUG_ON(frames > runtime->buffer_size)) in snd_pcm_playback_silence()
106 ofs = runtime->silence_start % runtime->buffer_size; in snd_pcm_playback_silence()
108 transfer = ofs + frames > runtime->buffer_size ? runtime->buffer_size - ofs : frames; in snd_pcm_playback_silence()
109 if (runtime->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED || in snd_pcm_playback_silence()
110 runtime->access == SNDRV_PCM_ACCESS_MMAP_INTERLEAVED) { in snd_pcm_playback_silence()
116 char *hwbuf = runtime->dma_area + frames_to_bytes(runtime, ofs); in snd_pcm_playback_silence()
117 snd_pcm_format_set_silence(runtime->format, hwbuf, transfer * runtime->channels); in snd_pcm_playback_silence()
121 unsigned int channels = runtime->channels; in snd_pcm_playback_silence()
129 size_t dma_csize = runtime->dma_bytes / channels; in snd_pcm_playback_silence()
131 char *hwbuf = runtime->dma_area + (c * dma_csize) + samples_to_bytes(runtime, ofs); in snd_pcm_playback_silence()
132 snd_pcm_format_set_silence(runtime->format, hwbuf, transfer); in snd_pcm_playback_silence()
136 runtime->silence_filled += transfer; in snd_pcm_playback_silence()
174 struct snd_pcm_runtime *runtime = substream->runtime; in xrun() local
177 if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE) in xrun()
178 snd_pcm_gettime(runtime, (struct timespec *)&runtime->status->tstamp); in xrun()
206 struct snd_pcm_runtime *runtime) in snd_pcm_update_state() argument
211 avail = snd_pcm_playback_avail(runtime); in snd_pcm_update_state()
213 avail = snd_pcm_capture_avail(runtime); in snd_pcm_update_state()
214 if (avail > runtime->avail_max) in snd_pcm_update_state()
215 runtime->avail_max = avail; in snd_pcm_update_state()
216 if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) { in snd_pcm_update_state()
217 if (avail >= runtime->buffer_size) { in snd_pcm_update_state()
222 if (avail >= runtime->stop_threshold) { in snd_pcm_update_state()
227 if (runtime->twake) { in snd_pcm_update_state()
228 if (avail >= runtime->twake) in snd_pcm_update_state()
229 wake_up(&runtime->tsleep); in snd_pcm_update_state()
230 } else if (avail >= runtime->control->avail_min) in snd_pcm_update_state()
231 wake_up(&runtime->sleep); in snd_pcm_update_state()
239 struct snd_pcm_runtime *runtime = substream->runtime; in update_audio_tstamp() local
243 if (runtime->tstamp_mode != SNDRV_PCM_TSTAMP_ENABLE) in update_audio_tstamp()
247 (runtime->audio_tstamp_report.actual_type == in update_audio_tstamp()
255 audio_frames = runtime->hw_ptr_wrap + runtime->status->hw_ptr; in update_audio_tstamp()
257 if (runtime->audio_tstamp_config.report_delay) { in update_audio_tstamp()
259 audio_frames -= runtime->delay; in update_audio_tstamp()
261 audio_frames += runtime->delay; in update_audio_tstamp()
264 runtime->rate); in update_audio_tstamp()
267 runtime->status->audio_tstamp = *audio_tstamp; in update_audio_tstamp()
268 runtime->status->tstamp = *curr_tstamp; in update_audio_tstamp()
274 snd_pcm_gettime(substream->runtime, (struct timespec *)&driver_tstamp); in update_audio_tstamp()
275 runtime->driver_tstamp = driver_tstamp; in update_audio_tstamp()
281 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_update_hw_ptr0() local
291 old_hw_ptr = runtime->status->hw_ptr; in snd_pcm_update_hw_ptr0()
301 if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE) { in snd_pcm_update_hw_ptr0()
303 (runtime->audio_tstamp_config.type_requested != SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT)) { in snd_pcm_update_hw_ptr0()
306 &runtime->audio_tstamp_config, in snd_pcm_update_hw_ptr0()
307 &runtime->audio_tstamp_report); in snd_pcm_update_hw_ptr0()
310 if (runtime->audio_tstamp_report.actual_type == SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT) in snd_pcm_update_hw_ptr0()
311 snd_pcm_gettime(runtime, (struct timespec *)&curr_tstamp); in snd_pcm_update_hw_ptr0()
313 snd_pcm_gettime(runtime, (struct timespec *)&curr_tstamp); in snd_pcm_update_hw_ptr0()
320 if (pos >= runtime->buffer_size) { in snd_pcm_update_hw_ptr0()
326 name, pos, runtime->buffer_size, in snd_pcm_update_hw_ptr0()
327 runtime->period_size); in snd_pcm_update_hw_ptr0()
331 pos -= pos % runtime->min_align; in snd_pcm_update_hw_ptr0()
333 hw_base = runtime->hw_ptr_base; in snd_pcm_update_hw_ptr0()
338 delta = runtime->hw_ptr_interrupt + runtime->period_size; in snd_pcm_update_hw_ptr0()
341 hdelta = curr_jiffies - runtime->hw_ptr_jiffies; in snd_pcm_update_hw_ptr0()
342 if (hdelta > runtime->hw_ptr_buffer_jiffies/2 + 1) { in snd_pcm_update_hw_ptr0()
343 hw_base += runtime->buffer_size; in snd_pcm_update_hw_ptr0()
344 if (hw_base >= runtime->boundary) { in snd_pcm_update_hw_ptr0()
356 hw_base += runtime->buffer_size; in snd_pcm_update_hw_ptr0()
357 if (hw_base >= runtime->boundary) { in snd_pcm_update_hw_ptr0()
366 delta += runtime->boundary; in snd_pcm_update_hw_ptr0()
368 if (runtime->no_period_wakeup) { in snd_pcm_update_hw_ptr0()
374 jdelta = curr_jiffies - runtime->hw_ptr_jiffies; in snd_pcm_update_hw_ptr0()
375 if (jdelta < runtime->hw_ptr_buffer_jiffies / 2) in snd_pcm_update_hw_ptr0()
377 hdelta = jdelta - delta * HZ / runtime->rate; in snd_pcm_update_hw_ptr0()
378 xrun_threshold = runtime->hw_ptr_buffer_jiffies / 2 + 1; in snd_pcm_update_hw_ptr0()
380 delta += runtime->buffer_size; in snd_pcm_update_hw_ptr0()
381 hw_base += runtime->buffer_size; in snd_pcm_update_hw_ptr0()
382 if (hw_base >= runtime->boundary) { in snd_pcm_update_hw_ptr0()
387 hdelta -= runtime->hw_ptr_buffer_jiffies; in snd_pcm_update_hw_ptr0()
393 if (delta >= runtime->buffer_size + runtime->period_size) { in snd_pcm_update_hw_ptr0()
409 if (runtime->hw.info & SNDRV_PCM_INFO_BATCH) in snd_pcm_update_hw_ptr0()
412 if (hdelta < runtime->delay) in snd_pcm_update_hw_ptr0()
414 hdelta -= runtime->delay; in snd_pcm_update_hw_ptr0()
415 jdelta = curr_jiffies - runtime->hw_ptr_jiffies; in snd_pcm_update_hw_ptr0()
416 if (((hdelta * HZ) / runtime->rate) > jdelta + HZ/100) { in snd_pcm_update_hw_ptr0()
418 (((runtime->period_size * HZ) / runtime->rate) in snd_pcm_update_hw_ptr0()
426 new_hw_ptr += runtime->period_size; in snd_pcm_update_hw_ptr0()
427 if (new_hw_ptr >= runtime->boundary) { in snd_pcm_update_hw_ptr0()
428 new_hw_ptr -= runtime->boundary; in snd_pcm_update_hw_ptr0()
437 (long)runtime->period_size, jdelta, in snd_pcm_update_hw_ptr0()
438 ((hdelta * HZ) / runtime->rate), hw_base, in snd_pcm_update_hw_ptr0()
443 hw_base = new_hw_ptr - (new_hw_ptr % runtime->buffer_size); in snd_pcm_update_hw_ptr0()
446 if (delta > runtime->period_size + runtime->period_size / 2) { in snd_pcm_update_hw_ptr0()
456 if (runtime->status->hw_ptr == new_hw_ptr) { in snd_pcm_update_hw_ptr0()
462 runtime->silence_size > 0) in snd_pcm_update_hw_ptr0()
466 delta = new_hw_ptr - runtime->hw_ptr_interrupt; in snd_pcm_update_hw_ptr0()
468 delta += runtime->boundary; in snd_pcm_update_hw_ptr0()
469 delta -= (snd_pcm_uframes_t)delta % runtime->period_size; in snd_pcm_update_hw_ptr0()
470 runtime->hw_ptr_interrupt += delta; in snd_pcm_update_hw_ptr0()
471 if (runtime->hw_ptr_interrupt >= runtime->boundary) in snd_pcm_update_hw_ptr0()
472 runtime->hw_ptr_interrupt -= runtime->boundary; in snd_pcm_update_hw_ptr0()
474 runtime->hw_ptr_base = hw_base; in snd_pcm_update_hw_ptr0()
475 runtime->status->hw_ptr = new_hw_ptr; in snd_pcm_update_hw_ptr0()
476 runtime->hw_ptr_jiffies = curr_jiffies; in snd_pcm_update_hw_ptr0()
479 runtime->hw_ptr_wrap += runtime->boundary; in snd_pcm_update_hw_ptr0()
484 return snd_pcm_update_state(substream, runtime); in snd_pcm_update_hw_ptr0()
521 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_set_sync() local
523 runtime->sync.id32[0] = substream->pcm->card->number; in snd_pcm_set_sync()
524 runtime->sync.id32[1] = -1; in snd_pcm_set_sync()
525 runtime->sync.id32[2] = -1; in snd_pcm_set_sync()
526 runtime->sync.id32[3] = -1; in snd_pcm_set_sync()
1139 int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond, in snd_pcm_hw_rule_add() argument
1144 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; in snd_pcm_hw_rule_add()
1198 int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, in snd_pcm_hw_constraint_mask() argument
1201 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; in snd_pcm_hw_constraint_mask()
1220 int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, in snd_pcm_hw_constraint_mask64() argument
1223 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; in snd_pcm_hw_constraint_mask64()
1244 int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var) in snd_pcm_hw_constraint_integer() argument
1246 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; in snd_pcm_hw_constraint_integer()
1264 int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, in snd_pcm_hw_constraint_minmax() argument
1267 struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints; in snd_pcm_hw_constraint_minmax()
1297 int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, in snd_pcm_hw_constraint_list() argument
1302 return snd_pcm_hw_rule_add(runtime, cond, var, in snd_pcm_hw_constraint_list()
1329 int snd_pcm_hw_constraint_ranges(struct snd_pcm_runtime *runtime, in snd_pcm_hw_constraint_ranges() argument
1334 return snd_pcm_hw_rule_add(runtime, cond, var, in snd_pcm_hw_constraint_ranges()
1364 int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, in snd_pcm_hw_constraint_ratnums() argument
1369 return snd_pcm_hw_rule_add(runtime, cond, var, in snd_pcm_hw_constraint_ratnums()
1399 int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime, in snd_pcm_hw_constraint_ratdens() argument
1404 return snd_pcm_hw_rule_add(runtime, cond, var, in snd_pcm_hw_constraint_ratdens()
1443 int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime, in snd_pcm_hw_constraint_msbits() argument
1449 return snd_pcm_hw_rule_add(runtime, cond, -1, in snd_pcm_hw_constraint_msbits()
1473 int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime, in snd_pcm_hw_constraint_step() argument
1478 return snd_pcm_hw_rule_add(runtime, cond, var, in snd_pcm_hw_constraint_step()
1505 int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime, in snd_pcm_hw_constraint_pow2() argument
1509 return snd_pcm_hw_rule_add(runtime, cond, var, in snd_pcm_hw_constraint_pow2()
1533 int snd_pcm_hw_rule_noresample(struct snd_pcm_runtime *runtime, in snd_pcm_hw_rule_noresample() argument
1536 return snd_pcm_hw_rule_add(runtime, SNDRV_PCM_HW_PARAMS_NORESAMPLE, in snd_pcm_hw_rule_noresample()
1762 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_lib_ioctl_reset() local
1767 runtime->status->hw_ptr %= runtime->buffer_size; in snd_pcm_lib_ioctl_reset()
1769 runtime->status->hw_ptr = 0; in snd_pcm_lib_ioctl_reset()
1770 runtime->hw_ptr_wrap = 0; in snd_pcm_lib_ioctl_reset()
1780 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_lib_ioctl_channel_info() local
1782 if (!(runtime->info & SNDRV_PCM_INFO_MMAP)) { in snd_pcm_lib_ioctl_channel_info()
1786 width = snd_pcm_format_physical_width(runtime->format); in snd_pcm_lib_ioctl_channel_info()
1790 switch (runtime->access) { in snd_pcm_lib_ioctl_channel_info()
1794 info->step = runtime->channels * width; in snd_pcm_lib_ioctl_channel_info()
1799 size_t size = runtime->dma_bytes / runtime->channels; in snd_pcm_lib_ioctl_channel_info()
1819 params->fifo_size = substream->runtime->hw.fifo_size; in snd_pcm_lib_ioctl_fifo_size()
1820 if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_FIFO_IN_FRAMES)) { in snd_pcm_lib_ioctl_fifo_size()
1872 struct snd_pcm_runtime *runtime; in snd_pcm_period_elapsed() local
1877 runtime = substream->runtime; in snd_pcm_period_elapsed()
1890 kill_fasync(&runtime->fasync, SIGIO, POLL_IN); in snd_pcm_period_elapsed()
1904 struct snd_pcm_runtime *runtime = substream->runtime; in wait_for_avail() local
1913 add_wait_queue(&runtime->tsleep, &wait); in wait_for_avail()
1915 if (runtime->no_period_wakeup) in wait_for_avail()
1919 if (runtime->rate) { in wait_for_avail()
1920 long t = runtime->period_size * 2 / runtime->rate; in wait_for_avail()
1940 avail = snd_pcm_playback_avail(runtime); in wait_for_avail()
1942 avail = snd_pcm_capture_avail(runtime); in wait_for_avail()
1943 if (avail >= runtime->twake) in wait_for_avail()
1951 switch (runtime->status->state) { in wait_for_avail()
1982 remove_wait_queue(&runtime->tsleep, &wait); in wait_for_avail()
1992 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_lib_write_transfer() local
1994 char __user *buf = (char __user *) data + frames_to_bytes(runtime, off); in snd_pcm_lib_write_transfer()
1999 char *hwbuf = runtime->dma_area + frames_to_bytes(runtime, hwoff); in snd_pcm_lib_write_transfer()
2000 if (copy_from_user(hwbuf, buf, frames_to_bytes(runtime, frames))) in snd_pcm_lib_write_transfer()
2016 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_lib_write1() local
2026 switch (runtime->status->state) { in snd_pcm_lib_write1()
2042 runtime->twake = runtime->control->avail_min ? : 1; in snd_pcm_lib_write1()
2043 if (runtime->status->state == SNDRV_PCM_STATE_RUNNING) in snd_pcm_lib_write1()
2045 avail = snd_pcm_playback_avail(runtime); in snd_pcm_lib_write1()
2054 runtime->twake = min_t(snd_pcm_uframes_t, size, in snd_pcm_lib_write1()
2055 runtime->control->avail_min ? : 1); in snd_pcm_lib_write1()
2061 cont = runtime->buffer_size - runtime->control->appl_ptr % runtime->buffer_size; in snd_pcm_lib_write1()
2065 runtime->twake = 0; in snd_pcm_lib_write1()
2069 appl_ptr = runtime->control->appl_ptr; in snd_pcm_lib_write1()
2070 appl_ofs = appl_ptr % runtime->buffer_size; in snd_pcm_lib_write1()
2076 switch (runtime->status->state) { in snd_pcm_lib_write1()
2087 if (appl_ptr >= runtime->boundary) in snd_pcm_lib_write1()
2088 appl_ptr -= runtime->boundary; in snd_pcm_lib_write1()
2089 runtime->control->appl_ptr = appl_ptr; in snd_pcm_lib_write1()
2097 if (runtime->status->state == SNDRV_PCM_STATE_PREPARED && in snd_pcm_lib_write1()
2098 snd_pcm_playback_hw_avail(runtime) >= (snd_pcm_sframes_t)runtime->start_threshold) { in snd_pcm_lib_write1()
2105 runtime->twake = 0; in snd_pcm_lib_write1()
2107 snd_pcm_update_state(substream, runtime); in snd_pcm_lib_write1()
2115 struct snd_pcm_runtime *runtime; in pcm_sanity_check() local
2118 runtime = substream->runtime; in pcm_sanity_check()
2119 if (snd_BUG_ON(!substream->ops->copy && !runtime->dma_area)) in pcm_sanity_check()
2121 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) in pcm_sanity_check()
2128 struct snd_pcm_runtime *runtime; in snd_pcm_lib_write() local
2135 runtime = substream->runtime; in snd_pcm_lib_write()
2138 if (runtime->access != SNDRV_PCM_ACCESS_RW_INTERLEAVED && in snd_pcm_lib_write()
2139 runtime->channels > 1) in snd_pcm_lib_write()
2152 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_lib_writev_transfer() local
2155 int channels = runtime->channels; in snd_pcm_lib_writev_transfer()
2165 char __user *buf = *bufs + samples_to_bytes(runtime, off); in snd_pcm_lib_writev_transfer()
2172 size_t dma_csize = runtime->dma_bytes / channels; in snd_pcm_lib_writev_transfer()
2174 char *hwbuf = runtime->dma_area + (c * dma_csize) + samples_to_bytes(runtime, hwoff); in snd_pcm_lib_writev_transfer()
2176 snd_pcm_format_set_silence(runtime->format, hwbuf, frames); in snd_pcm_lib_writev_transfer()
2178 char __user *buf = *bufs + samples_to_bytes(runtime, off); in snd_pcm_lib_writev_transfer()
2179 if (copy_from_user(hwbuf, buf, samples_to_bytes(runtime, frames))) in snd_pcm_lib_writev_transfer()
2191 struct snd_pcm_runtime *runtime; in snd_pcm_lib_writev() local
2198 runtime = substream->runtime; in snd_pcm_lib_writev()
2201 if (runtime->access != SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) in snd_pcm_lib_writev()
2214 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_lib_read_transfer() local
2216 char __user *buf = (char __user *) data + frames_to_bytes(runtime, off); in snd_pcm_lib_read_transfer()
2221 char *hwbuf = runtime->dma_area + frames_to_bytes(runtime, hwoff); in snd_pcm_lib_read_transfer()
2222 if (copy_to_user(buf, hwbuf, frames_to_bytes(runtime, frames))) in snd_pcm_lib_read_transfer()
2234 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_lib_read1() local
2244 switch (runtime->status->state) { in snd_pcm_lib_read1()
2246 if (size >= runtime->start_threshold) { in snd_pcm_lib_read1()
2267 runtime->twake = runtime->control->avail_min ? : 1; in snd_pcm_lib_read1()
2268 if (runtime->status->state == SNDRV_PCM_STATE_RUNNING) in snd_pcm_lib_read1()
2270 avail = snd_pcm_capture_avail(runtime); in snd_pcm_lib_read1()
2275 if (runtime->status->state == in snd_pcm_lib_read1()
2284 runtime->twake = min_t(snd_pcm_uframes_t, size, in snd_pcm_lib_read1()
2285 runtime->control->avail_min ? : 1); in snd_pcm_lib_read1()
2293 cont = runtime->buffer_size - runtime->control->appl_ptr % runtime->buffer_size; in snd_pcm_lib_read1()
2297 runtime->twake = 0; in snd_pcm_lib_read1()
2301 appl_ptr = runtime->control->appl_ptr; in snd_pcm_lib_read1()
2302 appl_ofs = appl_ptr % runtime->buffer_size; in snd_pcm_lib_read1()
2308 switch (runtime->status->state) { in snd_pcm_lib_read1()
2319 if (appl_ptr >= runtime->boundary) in snd_pcm_lib_read1()
2320 appl_ptr -= runtime->boundary; in snd_pcm_lib_read1()
2321 runtime->control->appl_ptr = appl_ptr; in snd_pcm_lib_read1()
2331 runtime->twake = 0; in snd_pcm_lib_read1()
2333 snd_pcm_update_state(substream, runtime); in snd_pcm_lib_read1()
2340 struct snd_pcm_runtime *runtime; in snd_pcm_lib_read() local
2347 runtime = substream->runtime; in snd_pcm_lib_read()
2349 if (runtime->access != SNDRV_PCM_ACCESS_RW_INTERLEAVED) in snd_pcm_lib_read()
2361 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_lib_readv_transfer() local
2364 int channels = runtime->channels; in snd_pcm_lib_readv_transfer()
2371 buf = *bufs + samples_to_bytes(runtime, off); in snd_pcm_lib_readv_transfer()
2376 snd_pcm_uframes_t dma_csize = runtime->dma_bytes / channels; in snd_pcm_lib_readv_transfer()
2383 hwbuf = runtime->dma_area + (c * dma_csize) + samples_to_bytes(runtime, hwoff); in snd_pcm_lib_readv_transfer()
2384 buf = *bufs + samples_to_bytes(runtime, off); in snd_pcm_lib_readv_transfer()
2385 if (copy_to_user(buf, hwbuf, samples_to_bytes(runtime, frames))) in snd_pcm_lib_readv_transfer()
2396 struct snd_pcm_runtime *runtime; in snd_pcm_lib_readv() local
2403 runtime = substream->runtime; in snd_pcm_lib_readv()
2404 if (runtime->status->state == SNDRV_PCM_STATE_OPEN) in snd_pcm_lib_readv()
2408 if (runtime->access != SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) in snd_pcm_lib_readv()
2501 if (!substream->runtime) in pcm_chmap_ctl_get()
2505 if (map->channels == substream->runtime->channels && in pcm_chmap_ctl_get()