Lines Matching refs:substream
108 struct snd_pcm_substream *substream;
136 for (substream = pstr->substream; substream;
137 substream = substream->next)
138 if (substream->number == (int)subdevice)
140 if (substream == NULL) {
145 err = snd_pcm_info_user(substream, info);
331 static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream,
337 if (! substream)
344 err = snd_pcm_info(substream, info);
367 snd_pcm_proc_info_read(((struct snd_pcm_str *)entry->private_data)->substream,
380 struct snd_pcm_substream *substream = entry->private_data;
383 mutex_lock(&substream->pcm->open_mutex);
384 runtime = substream->runtime;
401 if (substream->oss.oss) {
411 mutex_unlock(&substream->pcm->open_mutex);
417 struct snd_pcm_substream *substream = entry->private_data;
420 mutex_lock(&substream->pcm->open_mutex);
421 runtime = substream->runtime;
439 mutex_unlock(&substream->pcm->open_mutex);
445 struct snd_pcm_substream *substream = entry->private_data;
450 mutex_lock(&substream->pcm->open_mutex);
451 runtime = substream->runtime;
457 err = snd_pcm_status64(substream, &status);
463 snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid));
475 mutex_unlock(&substream->pcm->open_mutex);
482 struct snd_pcm_substream *substream = entry->private_data;
484 snd_pcm_stop_xrun(substream);
541 create_substream_info_entry(struct snd_pcm_substream *substream,
548 entry = snd_info_create_card_entry(substream->pcm->card, name,
549 substream->proc_root);
551 snd_info_set_text_ops(entry, substream, read);
555 static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
561 card = substream->pcm->card;
563 sprintf(name, "sub%i", substream->number);
565 substream->pstr->proc_root);
569 substream->proc_root = entry;
571 create_substream_info_entry(substream, "info",
573 create_substream_info_entry(substream, "hw_params",
575 create_substream_info_entry(substream, "sw_params",
577 create_substream_info_entry(substream, "status",
581 entry = create_substream_info_entry(substream, "xrun_injection", NULL);
594 static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; }
641 struct snd_pcm_substream *substream, *prev;
667 substream = kzalloc(sizeof(*substream), GFP_KERNEL);
668 if (!substream)
670 substream->pcm = pcm;
671 substream->pstr = pstr;
672 substream->number = idx;
673 substream->stream = stream;
674 sprintf(substream->name, "subdevice #%i", idx);
675 substream->buffer_bytes_max = UINT_MAX;
677 pstr->substream = substream;
679 prev->next = substream;
682 err = snd_pcm_substream_proc_init(substream);
687 pstr->substream = NULL;
690 kfree(substream);
694 substream->group = &substream->self_group;
695 snd_pcm_group_init(&substream->self_group);
696 list_add_tail(&substream->link_list, &substream->self_group.substreams);
697 atomic_set(&substream->mmap_count, 0);
698 prev = substream;
794 * by userspace. It provides existing ASoC components drivers with a substream
825 struct snd_pcm_substream *substream, *substream_next;
833 substream = pstr->substream;
834 while (substream) {
835 substream_next = substream->next;
836 snd_pcm_timer_done(substream);
837 kfree(substream);
838 substream = substream_next;
889 struct snd_pcm_substream *substream;
902 if (pstr->substream == NULL || pstr->substream_count == 0)
911 for (substream = pcm->streams[opposite].substream; substream;
912 substream = substream->next) {
913 if (SUBSTREAM_BUSY(substream))
922 substream = pstr->substream;
924 for (substream = pstr->substream; substream;
925 substream = substream->next)
926 if (substream->number == prefer_subdevice)
929 if (! substream)
931 if (! SUBSTREAM_BUSY(substream))
933 substream->ref_count++;
934 *rsubstream = substream;
938 for (substream = pstr->substream; substream; substream = substream->next) {
939 if (!SUBSTREAM_BUSY(substream) &&
941 substream->number == prefer_subdevice))
944 if (substream == NULL)
976 substream->runtime = runtime;
977 substream->private_data = pcm->private_data;
978 substream->ref_count = 1;
979 substream->f_flags = file->f_flags;
980 substream->pid = get_pid(task_pid(current));
982 *rsubstream = substream;
986 void snd_pcm_detach_substream(struct snd_pcm_substream *substream)
990 if (PCM_RUNTIME_CHECK(substream))
992 runtime = substream->runtime;
1001 if (substream->timer) {
1002 spin_lock_irq(&substream->timer->lock);
1003 substream->runtime = NULL;
1004 spin_unlock_irq(&substream->timer->lock);
1006 substream->runtime = NULL;
1010 put_pid(substream->pid);
1011 substream->pid = NULL;
1012 substream->pstr->substream_opened--;
1053 struct snd_pcm_substream *substream;
1066 if (pcm->streams[cidx].substream == NULL)
1085 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next)
1086 snd_pcm_timer_init(substream);
1099 struct snd_pcm_substream *substream;
1107 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) {
1108 snd_pcm_stream_lock_irq(substream);
1109 if (substream->runtime) {
1110 if (snd_pcm_running(substream))
1111 snd_pcm_stop(substream,
1114 substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED;
1115 wake_up(&substream->runtime->sleep);
1116 wake_up(&substream->runtime->tsleep);
1118 snd_pcm_stream_unlock_irq(substream);
1123 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next)
1124 snd_pcm_sync_stop(substream, false);
1185 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream)
1188 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream)