Lines Matching defs:substream

107 			struct snd_pcm_substream *substream;
128 for (substream = pstr->substream; substream;
129 substream = substream->next)
130 if (substream->number == (int)subdevice)
132 if (substream == NULL)
135 return snd_pcm_info_user(substream, info);
328 static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream,
334 if (! substream)
341 err = snd_pcm_info(substream, info);
362 snd_pcm_proc_info_read(((struct snd_pcm_str *)entry->private_data)->substream,
375 struct snd_pcm_substream *substream = entry->private_data;
378 guard(mutex)(&substream->pcm->open_mutex);
379 runtime = substream->runtime;
396 if (substream->oss.oss) {
410 struct snd_pcm_substream *substream = entry->private_data;
413 guard(mutex)(&substream->pcm->open_mutex);
414 runtime = substream->runtime;
436 struct snd_pcm_substream *substream = entry->private_data;
441 guard(mutex)(&substream->pcm->open_mutex);
442 runtime = substream->runtime;
448 err = snd_pcm_status64(substream, &status);
454 snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid));
471 struct snd_pcm_substream *substream = entry->private_data;
473 snd_pcm_stop_xrun(substream);
530 create_substream_info_entry(struct snd_pcm_substream *substream,
537 entry = snd_info_create_card_entry(substream->pcm->card, name,
538 substream->proc_root);
540 snd_info_set_text_ops(entry, substream, read);
544 static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
550 card = substream->pcm->card;
552 sprintf(name, "sub%i", substream->number);
554 substream->pstr->proc_root);
558 substream->proc_root = entry;
560 create_substream_info_entry(substream, "info",
562 create_substream_info_entry(substream, "hw_params",
564 create_substream_info_entry(substream, "sw_params",
566 create_substream_info_entry(substream, "status",
570 entry = create_substream_info_entry(substream, "xrun_injection", NULL);
583 static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; }
630 struct snd_pcm_substream *substream, *prev;
659 substream = kzalloc(sizeof(*substream), GFP_KERNEL);
660 if (!substream)
662 substream->pcm = pcm;
663 substream->pstr = pstr;
664 substream->number = idx;
665 substream->stream = stream;
666 sprintf(substream->name, "subdevice #%i", idx);
667 substream->buffer_bytes_max = UINT_MAX;
669 pstr->substream = substream;
671 prev->next = substream;
674 err = snd_pcm_substream_proc_init(substream);
679 pstr->substream = NULL;
682 kfree(substream);
686 substream->group = &substream->self_group;
687 snd_pcm_group_init(&substream->self_group);
688 list_add_tail(&substream->link_list, &substream->self_group.substreams);
689 atomic_set(&substream->mmap_count, 0);
690 prev = substream;
786 * by userspace. It provides existing ASoC components drivers with a substream
815 struct snd_pcm_substream *substream, *substream_next;
823 substream = pstr->substream;
824 while (substream) {
825 substream_next = substream->next;
826 snd_pcm_timer_done(substream);
827 kfree(substream);
828 substream = substream_next;
879 struct snd_pcm_substream *substream;
892 if (pstr->substream == NULL || pstr->substream_count == 0)
901 for (substream = pcm->streams[opposite].substream; substream;
902 substream = substream->next) {
903 if (SUBSTREAM_BUSY(substream))
912 substream = pstr->substream;
914 for (substream = pstr->substream; substream;
915 substream = substream->next)
916 if (substream->number == prefer_subdevice)
919 if (! substream)
921 if (! SUBSTREAM_BUSY(substream))
923 substream->ref_count++;
924 *rsubstream = substream;
928 for (substream = pstr->substream; substream; substream = substream->next) {
929 if (!SUBSTREAM_BUSY(substream) &&
931 substream->number == prefer_subdevice))
934 if (substream == NULL)
966 substream->runtime = runtime;
967 substream->private_data = pcm->private_data;
968 substream->ref_count = 1;
969 substream->f_flags = file->f_flags;
970 substream->pid = get_pid(task_pid(current));
972 *rsubstream = substream;
976 void snd_pcm_detach_substream(struct snd_pcm_substream *substream)
980 if (PCM_RUNTIME_CHECK(substream))
982 runtime = substream->runtime;
991 if (substream->timer) {
992 scoped_guard(spinlock_irq, &substream->timer->lock)
993 substream->runtime = NULL;
995 substream->runtime = NULL;
1000 put_pid(substream->pid);
1001 substream->pid = NULL;
1002 substream->pstr->substream_opened--;
1043 struct snd_pcm_substream *substream;
1056 if (pcm->streams[cidx].substream == NULL)
1075 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next)
1076 snd_pcm_timer_init(substream);
1086 struct snd_pcm_substream *substream;
1094 for_each_pcm_substream(pcm, cidx, substream) {
1095 snd_pcm_stream_lock_irq(substream);
1096 if (substream->runtime) {
1097 if (snd_pcm_running(substream))
1098 snd_pcm_stop(substream, SNDRV_PCM_STATE_DISCONNECTED);
1100 __snd_pcm_set_state(substream->runtime,
1102 wake_up(&substream->runtime->sleep);
1103 wake_up(&substream->runtime->tsleep);
1105 snd_pcm_stream_unlock_irq(substream);
1108 for_each_pcm_substream(pcm, cidx, substream)
1109 snd_pcm_sync_stop(substream, false);
1170 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream)
1173 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream)