Lines Matching refs:runtime
33 struct snd_pcm_runtime *runtime) in snd_usb_pcm_delay() argument
41 queued = bytes_to_frames(runtime, subs->inflight_bytes); in snd_usb_pcm_delay()
58 est_delay = frame_diff * runtime->rate / 1000; in snd_usb_pcm_delay()
74 struct snd_pcm_runtime *runtime = substream->runtime; in snd_usb_pcm_pointer() local
75 struct snd_usb_substream *subs = runtime->private_data; in snd_usb_pcm_pointer()
82 runtime->delay = snd_usb_pcm_delay(subs, runtime); in snd_usb_pcm_pointer()
84 return bytes_to_frames(runtime, hwptr_done); in snd_usb_pcm_pointer()
277 struct snd_usb_substream *subs = substream->runtime->private_data; in snd_usb_pcm_sync_stop()
470 struct snd_usb_substream *subs = substream->runtime->private_data; in snd_usb_hw_params()
567 struct snd_usb_substream *subs = substream->runtime->private_data; in snd_usb_hw_free()
585 static int in_free_wheeling_mode(struct snd_pcm_runtime *runtime) in in_free_wheeling_mode() argument
587 return runtime->stop_threshold > runtime->buffer_size; in in_free_wheeling_mode()
591 static int lowlatency_playback_available(struct snd_pcm_runtime *runtime, in lowlatency_playback_available() argument
601 if (in_free_wheeling_mode(runtime)) in lowlatency_playback_available()
616 struct snd_pcm_runtime *runtime = substream->runtime; in snd_usb_pcm_prepare() local
617 struct snd_usb_substream *subs = runtime->private_data; in snd_usb_pcm_prepare()
634 subs->buffer_bytes = frames_to_bytes(runtime, runtime->buffer_size); in snd_usb_pcm_prepare()
640 runtime->delay = 0; in snd_usb_pcm_prepare()
642 subs->lowlatency_playback = lowlatency_playback_available(runtime, subs); in snd_usb_pcm_prepare()
978 static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substream *subs) in setup_hw_info() argument
985 runtime->hw.formats = subs->formats; in setup_hw_info()
987 runtime->hw.rate_min = 0x7fffffff; in setup_hw_info()
988 runtime->hw.rate_max = 0; in setup_hw_info()
989 runtime->hw.channels_min = 256; in setup_hw_info()
990 runtime->hw.channels_max = 0; in setup_hw_info()
991 runtime->hw.rates = 0; in setup_hw_info()
995 runtime->hw.rates |= fp->rates; in setup_hw_info()
996 if (runtime->hw.rate_min > fp->rate_min) in setup_hw_info()
997 runtime->hw.rate_min = fp->rate_min; in setup_hw_info()
998 if (runtime->hw.rate_max < fp->rate_max) in setup_hw_info()
999 runtime->hw.rate_max = fp->rate_max; in setup_hw_info()
1000 if (runtime->hw.channels_min > fp->channels) in setup_hw_info()
1001 runtime->hw.channels_min = fp->channels; in setup_hw_info()
1002 if (runtime->hw.channels_max < fp->channels) in setup_hw_info()
1003 runtime->hw.channels_max = fp->channels; in setup_hw_info()
1006 runtime->hw.period_bytes_min = runtime->hw.period_bytes_max = in setup_hw_info()
1021 err = snd_pcm_hw_constraint_minmax(runtime, in setup_hw_info()
1027 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, in setup_hw_info()
1037 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, in setup_hw_info()
1046 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT, in setup_hw_info()
1056 err = snd_pcm_hw_rule_add(runtime, 0, in setup_hw_info()
1068 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT, in setup_hw_info()
1073 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, in setup_hw_info()
1078 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, in setup_hw_info()
1083 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIODS, in setup_hw_info()
1091 runtime->hw.info |= SNDRV_PCM_INFO_JOINT_DUPLEX; in setup_hw_info()
1103 struct snd_pcm_runtime *runtime = substream->runtime; in snd_usb_pcm_open() local
1107 runtime->hw = snd_usb_hardware; in snd_usb_pcm_open()
1111 runtime->hw.info |= SNDRV_PCM_INFO_SYNC_APPLPTR; in snd_usb_pcm_open()
1112 runtime->private_data = subs; in snd_usb_pcm_open()
1121 ret = setup_hw_info(runtime, subs); in snd_usb_pcm_open()
1163 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; in retire_capture_urb() local
1173 stride = runtime->frame_bits >> 3; in retire_capture_urb()
1192 if (bytes % (runtime->sample_bits >> 3) != 0) { in retire_capture_urb()
1207 if (subs->transfer_done >= runtime->period_size) { in retire_capture_urb()
1208 subs->transfer_done -= runtime->period_size; in retire_capture_urb()
1220 memcpy(runtime->dma_area + oldptr, cp, bytes1); in retire_capture_urb()
1221 memcpy(runtime->dma_area, cp + bytes1, bytes - bytes1); in retire_capture_urb()
1223 memcpy(runtime->dma_area + oldptr, cp, bytes); in retire_capture_urb()
1246 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; in fill_playback_urb_dsd_dop() local
1251 u8 *src = runtime->dma_area; in fill_playback_urb_dsd_dop()
1278 if (++subs->dsd_dop.channel % runtime->channels == 0) { in fill_playback_urb_dsd_dop()
1303 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; in fill_playback_urb_dsd_bitrev() local
1304 const u8 *src = runtime->dma_area; in fill_playback_urb_dsd_bitrev()
1320 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; in copy_to_urb() local
1327 runtime->dma_area + subs->hwptr_done, bytes1); in copy_to_urb()
1329 runtime->dma_area, bytes - bytes1); in copy_to_urb()
1332 runtime->dma_area + subs->hwptr_done, bytes); in copy_to_urb()
1368 struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime; in prepare_playback_urb() local
1389 runtime->status->state != SNDRV_PCM_STATE_DRAINING) { in prepare_playback_urb()
1393 avail = (runtime->control->appl_ptr - runtime->hw_ptr_base) in prepare_playback_urb()
1394 % runtime->buffer_size; in prepare_playback_urb()
1396 avail += runtime->buffer_size; in prepare_playback_urb()
1411 if (transfer_done >= runtime->period_size) { in prepare_playback_urb()
1412 transfer_done -= runtime->period_size; in prepare_playback_urb()
1471 snd_pcm_gettime(runtime, &runtime->trigger_tstamp); in prepare_playback_urb()
1528 struct snd_usb_substream *subs = substream->runtime->private_data; in snd_usb_pcm_playback_ack()
1547 struct snd_usb_substream *subs = substream->runtime->private_data; in snd_usb_substream_playback_trigger()
1561 if (in_free_wheeling_mode(substream->runtime)) in snd_usb_substream_playback_trigger()
1577 stop_endpoints(subs, substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING); in snd_usb_substream_playback_trigger()
1605 struct snd_usb_substream *subs = substream->runtime->private_data; in snd_usb_substream_capture_trigger()