Lines Matching refs:substream
122 struct snd_pcm_substream *substream; in snd_pcm_control_ioctl() local
149 for (substream = pstr->substream; substream; in snd_pcm_control_ioctl()
150 substream = substream->next) in snd_pcm_control_ioctl()
151 if (substream->number == (int)subdevice) in snd_pcm_control_ioctl()
153 if (substream == NULL) { in snd_pcm_control_ioctl()
158 err = snd_pcm_info_user(substream, info); in snd_pcm_control_ioctl()
343 static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream, in snd_pcm_proc_info_read() argument
349 if (! substream) in snd_pcm_proc_info_read()
356 err = snd_pcm_info(substream, info); in snd_pcm_proc_info_read()
379 snd_pcm_proc_info_read(((struct snd_pcm_str *)entry->private_data)->substream, in snd_pcm_stream_proc_info_read()
392 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_hw_params_read() local
395 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
396 runtime = substream->runtime; in snd_pcm_substream_proc_hw_params_read()
413 if (substream->oss.oss) { in snd_pcm_substream_proc_hw_params_read()
423 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
429 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_sw_params_read() local
432 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
433 runtime = substream->runtime; in snd_pcm_substream_proc_sw_params_read()
451 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
457 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_status_read() local
462 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
463 runtime = substream->runtime; in snd_pcm_substream_proc_status_read()
469 err = snd_pcm_status(substream, &status); in snd_pcm_substream_proc_status_read()
475 snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid)); in snd_pcm_substream_proc_status_read()
487 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
494 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_xrun_injection_write() local
496 snd_pcm_stop_xrun(substream); in snd_pcm_xrun_injection_write()
575 static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) in snd_pcm_substream_proc_init() argument
581 card = substream->pcm->card; in snd_pcm_substream_proc_init()
583 sprintf(name, "sub%i", substream->number); in snd_pcm_substream_proc_init()
585 substream->pstr->proc_root); in snd_pcm_substream_proc_init()
593 substream->proc_root = entry; in snd_pcm_substream_proc_init()
594 entry = snd_info_create_card_entry(card, "info", substream->proc_root); in snd_pcm_substream_proc_init()
596 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
603 substream->proc_info_entry = entry; in snd_pcm_substream_proc_init()
605 substream->proc_root); in snd_pcm_substream_proc_init()
607 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
614 substream->proc_hw_params_entry = entry; in snd_pcm_substream_proc_init()
616 substream->proc_root); in snd_pcm_substream_proc_init()
618 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
625 substream->proc_sw_params_entry = entry; in snd_pcm_substream_proc_init()
627 substream->proc_root); in snd_pcm_substream_proc_init()
629 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
636 substream->proc_status_entry = entry; in snd_pcm_substream_proc_init()
640 substream->proc_root); in snd_pcm_substream_proc_init()
642 entry->private_data = substream; in snd_pcm_substream_proc_init()
651 substream->proc_xrun_injection_entry = entry; in snd_pcm_substream_proc_init()
657 static int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) in snd_pcm_substream_proc_done() argument
659 snd_info_free_entry(substream->proc_info_entry); in snd_pcm_substream_proc_done()
660 substream->proc_info_entry = NULL; in snd_pcm_substream_proc_done()
661 snd_info_free_entry(substream->proc_hw_params_entry); in snd_pcm_substream_proc_done()
662 substream->proc_hw_params_entry = NULL; in snd_pcm_substream_proc_done()
663 snd_info_free_entry(substream->proc_sw_params_entry); in snd_pcm_substream_proc_done()
664 substream->proc_sw_params_entry = NULL; in snd_pcm_substream_proc_done()
665 snd_info_free_entry(substream->proc_status_entry); in snd_pcm_substream_proc_done()
666 substream->proc_status_entry = NULL; in snd_pcm_substream_proc_done()
668 snd_info_free_entry(substream->proc_xrun_injection_entry); in snd_pcm_substream_proc_done()
669 substream->proc_xrun_injection_entry = NULL; in snd_pcm_substream_proc_done()
671 snd_info_free_entry(substream->proc_root); in snd_pcm_substream_proc_done()
672 substream->proc_root = NULL; in snd_pcm_substream_proc_done()
678 static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; } in snd_pcm_substream_proc_init() argument
679 static inline int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) { return 0; } in snd_pcm_substream_proc_done() argument
701 struct snd_pcm_substream *substream, *prev; in snd_pcm_new_stream() local
726 substream = kzalloc(sizeof(*substream), GFP_KERNEL); in snd_pcm_new_stream()
727 if (!substream) in snd_pcm_new_stream()
729 substream->pcm = pcm; in snd_pcm_new_stream()
730 substream->pstr = pstr; in snd_pcm_new_stream()
731 substream->number = idx; in snd_pcm_new_stream()
732 substream->stream = stream; in snd_pcm_new_stream()
733 sprintf(substream->name, "subdevice #%i", idx); in snd_pcm_new_stream()
734 substream->buffer_bytes_max = UINT_MAX; in snd_pcm_new_stream()
736 pstr->substream = substream; in snd_pcm_new_stream()
738 prev->next = substream; in snd_pcm_new_stream()
741 err = snd_pcm_substream_proc_init(substream); in snd_pcm_new_stream()
746 pstr->substream = NULL; in snd_pcm_new_stream()
749 kfree(substream); in snd_pcm_new_stream()
753 substream->group = &substream->self_group; in snd_pcm_new_stream()
754 spin_lock_init(&substream->self_group.lock); in snd_pcm_new_stream()
755 mutex_init(&substream->self_group.mutex); in snd_pcm_new_stream()
756 INIT_LIST_HEAD(&substream->self_group.substreams); in snd_pcm_new_stream()
757 list_add_tail(&substream->link_list, &substream->self_group.substreams); in snd_pcm_new_stream()
758 atomic_set(&substream->mmap_count, 0); in snd_pcm_new_stream()
759 prev = substream; in snd_pcm_new_stream()
882 struct snd_pcm_substream *substream, *substream_next; in snd_pcm_free_stream() local
886 substream = pstr->substream; in snd_pcm_free_stream()
887 while (substream) { in snd_pcm_free_stream()
888 substream_next = substream->next; in snd_pcm_free_stream()
889 snd_pcm_timer_done(substream); in snd_pcm_free_stream()
890 snd_pcm_substream_proc_done(substream); in snd_pcm_free_stream()
891 kfree(substream); in snd_pcm_free_stream()
892 substream = substream_next; in snd_pcm_free_stream()
944 struct snd_pcm_substream *substream; in snd_pcm_attach_substream() local
957 if (pstr->substream == NULL || pstr->substream_count == 0) in snd_pcm_attach_substream()
966 for (substream = pcm->streams[opposite].substream; substream; in snd_pcm_attach_substream()
967 substream = substream->next) { in snd_pcm_attach_substream()
968 if (SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
977 substream = pstr->substream; in snd_pcm_attach_substream()
979 for (substream = pstr->substream; substream; in snd_pcm_attach_substream()
980 substream = substream->next) in snd_pcm_attach_substream()
981 if (substream->number == prefer_subdevice) in snd_pcm_attach_substream()
984 if (! substream) in snd_pcm_attach_substream()
986 if (! SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
988 substream->ref_count++; in snd_pcm_attach_substream()
989 *rsubstream = substream; in snd_pcm_attach_substream()
993 for (substream = pstr->substream; substream; substream = substream->next) { in snd_pcm_attach_substream()
994 if (!SUBSTREAM_BUSY(substream) && in snd_pcm_attach_substream()
996 substream->number == prefer_subdevice)) in snd_pcm_attach_substream()
999 if (substream == NULL) in snd_pcm_attach_substream()
1029 substream->runtime = runtime; in snd_pcm_attach_substream()
1030 substream->private_data = pcm->private_data; in snd_pcm_attach_substream()
1031 substream->ref_count = 1; in snd_pcm_attach_substream()
1032 substream->f_flags = file->f_flags; in snd_pcm_attach_substream()
1033 substream->pid = get_pid(task_pid(current)); in snd_pcm_attach_substream()
1035 *rsubstream = substream; in snd_pcm_attach_substream()
1039 void snd_pcm_detach_substream(struct snd_pcm_substream *substream) in snd_pcm_detach_substream() argument
1043 if (PCM_RUNTIME_CHECK(substream)) in snd_pcm_detach_substream()
1045 runtime = substream->runtime; in snd_pcm_detach_substream()
1054 if (substream->timer) in snd_pcm_detach_substream()
1055 spin_lock_irq(&substream->timer->lock); in snd_pcm_detach_substream()
1056 substream->runtime = NULL; in snd_pcm_detach_substream()
1057 if (substream->timer) in snd_pcm_detach_substream()
1058 spin_unlock_irq(&substream->timer->lock); in snd_pcm_detach_substream()
1060 put_pid(substream->pid); in snd_pcm_detach_substream()
1061 substream->pid = NULL; in snd_pcm_detach_substream()
1062 substream->pstr->substream_opened--; in snd_pcm_detach_substream()
1103 struct snd_pcm_substream *substream; in snd_pcm_dev_register() local
1116 if (pcm->streams[cidx].substream == NULL) in snd_pcm_dev_register()
1135 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) in snd_pcm_dev_register()
1136 snd_pcm_timer_init(substream); in snd_pcm_dev_register()
1149 struct snd_pcm_substream *substream; in snd_pcm_dev_disconnect() local
1157 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) { in snd_pcm_dev_disconnect()
1158 snd_pcm_stream_lock_irq(substream); in snd_pcm_dev_disconnect()
1159 if (substream->runtime) { in snd_pcm_dev_disconnect()
1160 if (snd_pcm_running(substream)) in snd_pcm_dev_disconnect()
1161 snd_pcm_stop(substream, in snd_pcm_dev_disconnect()
1164 substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED; in snd_pcm_dev_disconnect()
1165 wake_up(&substream->runtime->sleep); in snd_pcm_dev_disconnect()
1166 wake_up(&substream->runtime->tsleep); in snd_pcm_dev_disconnect()
1168 snd_pcm_stream_unlock_irq(substream); in snd_pcm_dev_disconnect()
1231 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) in snd_pcm_proc_read()
1234 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) in snd_pcm_proc_read()