Lines Matching refs:substream

105 	struct snd_pcm_substream *substream;  member
151 int device = dpcm->substream->pstr->pcm->device; in get_setup()
153 if (dpcm->substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in get_setup()
155 return &dpcm->loopback->setup[dpcm->substream->number][device]; in get_setup()
211 substream->runtime; in loopback_check_format()
213 substream->runtime; in loopback_check_format()
223 substream, SNDRV_PCM_STATE_DRAINING); in loopback_check_format()
226 substream->runtime; in loopback_check_format()
255 static int loopback_trigger(struct snd_pcm_substream *substream, int cmd) in loopback_trigger() argument
257 struct snd_pcm_runtime *runtime = substream->runtime; in loopback_trigger()
260 int err, stream = 1 << substream->stream; in loopback_trigger()
264 err = loopback_check_format(cable, substream->stream); in loopback_trigger()
275 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in loopback_trigger()
284 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in loopback_trigger()
313 if (dpcm == NULL || dpcm->substream == NULL) in params_change_substream()
315 dst_runtime = dpcm->substream->runtime; in params_change_substream()
321 static void params_change(struct snd_pcm_substream *substream) in params_change() argument
323 struct snd_pcm_runtime *runtime = substream->runtime; in params_change()
338 static int loopback_prepare(struct snd_pcm_substream *substream) in loopback_prepare() argument
340 struct snd_pcm_runtime *runtime = substream->runtime; in loopback_prepare()
353 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { in loopback_prepare()
367 if (!(cable->valid & ~(1 << substream->stream)) || in loopback_prepare()
369 substream->stream == SNDRV_PCM_STREAM_PLAYBACK)) in loopback_prepare()
370 params_change(substream); in loopback_prepare()
371 cable->valid |= 1 << substream->stream; in loopback_prepare()
379 struct snd_pcm_runtime *runtime = dpcm->substream->runtime; in clear_capture_buf()
407 struct snd_pcm_runtime *runtime = play->substream->runtime; in copy_play_buf()
409 char *dst = capt->substream->runtime->dma_area; in copy_play_buf()
538 if (loopback_pos_update(dpcm->cable) & (1 << dpcm->substream->stream)) { in loopback_timer_function()
544 snd_pcm_period_elapsed(dpcm->substream); in loopback_timer_function()
551 static snd_pcm_uframes_t loopback_pointer(struct snd_pcm_substream *substream) in loopback_pointer() argument
553 struct snd_pcm_runtime *runtime = substream->runtime; in loopback_pointer()
593 static int loopback_hw_params(struct snd_pcm_substream *substream, in loopback_hw_params() argument
596 return snd_pcm_lib_alloc_vmalloc_buffer(substream, in loopback_hw_params()
600 static int loopback_hw_free(struct snd_pcm_substream *substream) in loopback_hw_free() argument
602 struct snd_pcm_runtime *runtime = substream->runtime; in loopback_hw_free()
607 cable->valid &= ~(1 << substream->stream); in loopback_hw_free()
609 return snd_pcm_lib_free_vmalloc_buffer(substream); in loopback_hw_free()
612 static unsigned int get_cable_index(struct snd_pcm_substream *substream) in get_cable_index() argument
614 if (!substream->pcm->device) in get_cable_index()
615 return substream->stream; in get_cable_index()
617 return !substream->stream; in get_cable_index()
661 static int loopback_open(struct snd_pcm_substream *substream) in loopback_open() argument
663 struct snd_pcm_runtime *runtime = substream->runtime; in loopback_open()
664 struct loopback *loopback = substream->private_data; in loopback_open()
668 int dev = get_cable_index(substream); in loopback_open()
677 dpcm->substream = substream; in loopback_open()
681 cable = loopback->cables[substream->number][dev]; in loopback_open()
691 loopback->cables[substream->number][dev] = cable; in loopback_open()
694 cable->streams[substream->stream] = dpcm; in loopback_open()
731 static int loopback_close(struct snd_pcm_substream *substream) in loopback_close() argument
733 struct loopback *loopback = substream->private_data; in loopback_close()
734 struct loopback_pcm *dpcm = substream->runtime->private_data; in loopback_close()
736 int dev = get_cable_index(substream); in loopback_close()
740 cable = loopback->cables[substream->number][dev]; in loopback_close()
741 if (cable->streams[!substream->stream]) { in loopback_close()
743 cable->streams[substream->stream] = NULL; in loopback_close()
746 loopback->cables[substream->number][dev] = NULL; in loopback_close()