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);
333 static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream,
339 if (! substream)
346 err = snd_pcm_info(substream, info);
369 snd_pcm_proc_info_read(((struct snd_pcm_str *)entry->private_data)->substream,
382 struct snd_pcm_substream *substream = entry->private_data;
385 mutex_lock(&substream->pcm->open_mutex);
386 runtime = substream->runtime;
403 if (substream->oss.oss) {
413 mutex_unlock(&substream->pcm->open_mutex);
419 struct snd_pcm_substream *substream = entry->private_data;
422 mutex_lock(&substream->pcm->open_mutex);
423 runtime = substream->runtime;
441 mutex_unlock(&substream->pcm->open_mutex);
447 struct snd_pcm_substream *substream = entry->private_data;
452 mutex_lock(&substream->pcm->open_mutex);
453 runtime = substream->runtime;
459 err = snd_pcm_status64(substream, &status);
465 snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid));
477 mutex_unlock(&substream->pcm->open_mutex);
484 struct snd_pcm_substream *substream = entry->private_data;
486 snd_pcm_stop_xrun(substream);
543 create_substream_info_entry(struct snd_pcm_substream *substream,
550 entry = snd_info_create_card_entry(substream->pcm->card, name,
551 substream->proc_root);
553 snd_info_set_text_ops(entry, substream, read);
557 static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
563 card = substream->pcm->card;
565 sprintf(name, "sub%i", substream->number);
567 substream->pstr->proc_root);
571 substream->proc_root = entry;
573 create_substream_info_entry(substream, "info",
575 create_substream_info_entry(substream, "hw_params",
577 create_substream_info_entry(substream, "sw_params",
579 create_substream_info_entry(substream, "status",
583 entry = create_substream_info_entry(substream, "xrun_injection", NULL);
596 static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; }
643 struct snd_pcm_substream *substream, *prev;
672 substream = kzalloc(sizeof(*substream), GFP_KERNEL);
673 if (!substream)
675 substream->pcm = pcm;
676 substream->pstr = pstr;
677 substream->number = idx;
678 substream->stream = stream;
679 sprintf(substream->name, "subdevice #%i", idx);
680 substream->buffer_bytes_max = UINT_MAX;
682 pstr->substream = substream;
684 prev->next = substream;
687 err = snd_pcm_substream_proc_init(substream);
692 pstr->substream = NULL;
695 kfree(substream);
699 substream->group = &substream->self_group;
700 snd_pcm_group_init(&substream->self_group);
701 list_add_tail(&substream->link_list, &substream->self_group.substreams);
702 atomic_set(&substream->mmap_count, 0);
703 prev = substream;
799 * by userspace. It provides existing ASoC components drivers with a substream
828 struct snd_pcm_substream *substream, *substream_next;
836 substream = pstr->substream;
837 while (substream) {
838 substream_next = substream->next;
839 snd_pcm_timer_done(substream);
840 kfree(substream);
841 substream = substream_next;
892 struct snd_pcm_substream *substream;
905 if (pstr->substream == NULL || pstr->substream_count == 0)
914 for (substream = pcm->streams[opposite].substream; substream;
915 substream = substream->next) {
916 if (SUBSTREAM_BUSY(substream))
925 substream = pstr->substream;
927 for (substream = pstr->substream; substream;
928 substream = substream->next)
929 if (substream->number == prefer_subdevice)
932 if (! substream)
934 if (! SUBSTREAM_BUSY(substream))
936 substream->ref_count++;
937 *rsubstream = substream;
941 for (substream = pstr->substream; substream; substream = substream->next) {
942 if (!SUBSTREAM_BUSY(substream) &&
944 substream->number == prefer_subdevice))
947 if (substream == NULL)
979 substream->runtime = runtime;
980 substream->private_data = pcm->private_data;
981 substream->ref_count = 1;
982 substream->f_flags = file->f_flags;
983 substream->pid = get_pid(task_pid(current));
985 *rsubstream = substream;
989 void snd_pcm_detach_substream(struct snd_pcm_substream *substream)
993 if (PCM_RUNTIME_CHECK(substream))
995 runtime = substream->runtime;
1004 if (substream->timer) {
1005 spin_lock_irq(&substream->timer->lock);
1006 substream->runtime = NULL;
1007 spin_unlock_irq(&substream->timer->lock);
1009 substream->runtime = NULL;
1014 put_pid(substream->pid);
1015 substream->pid = NULL;
1016 substream->pstr->substream_opened--;
1057 struct snd_pcm_substream *substream;
1070 if (pcm->streams[cidx].substream == NULL)
1089 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next)
1090 snd_pcm_timer_init(substream);
1103 struct snd_pcm_substream *substream;
1111 for_each_pcm_substream(pcm, cidx, substream) {
1112 snd_pcm_stream_lock_irq(substream);
1113 if (substream->runtime) {
1114 if (snd_pcm_running(substream))
1115 snd_pcm_stop(substream, SNDRV_PCM_STATE_DISCONNECTED);
1117 __snd_pcm_set_state(substream->runtime,
1119 wake_up(&substream->runtime->sleep);
1120 wake_up(&substream->runtime->tsleep);
1122 snd_pcm_stream_unlock_irq(substream);
1125 for_each_pcm_substream(pcm, cidx, substream)
1126 snd_pcm_sync_stop(substream, false);
1190 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream)
1193 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream)