Lines Matching refs:substream
123 struct snd_pcm_substream *substream; in snd_pcm_control_ioctl() local
151 for (substream = pstr->substream; substream; in snd_pcm_control_ioctl()
152 substream = substream->next) in snd_pcm_control_ioctl()
153 if (substream->number == (int)subdevice) in snd_pcm_control_ioctl()
155 if (substream == NULL) { in snd_pcm_control_ioctl()
160 err = snd_pcm_info_user(substream, info); in snd_pcm_control_ioctl()
345 static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream, in snd_pcm_proc_info_read() argument
351 if (! substream) in snd_pcm_proc_info_read()
358 err = snd_pcm_info(substream, info); in snd_pcm_proc_info_read()
381 snd_pcm_proc_info_read(((struct snd_pcm_str *)entry->private_data)->substream, in snd_pcm_stream_proc_info_read()
394 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_hw_params_read() local
397 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
398 runtime = substream->runtime; in snd_pcm_substream_proc_hw_params_read()
415 if (substream->oss.oss) { in snd_pcm_substream_proc_hw_params_read()
425 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
431 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_sw_params_read() local
434 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
435 runtime = substream->runtime; in snd_pcm_substream_proc_sw_params_read()
453 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
459 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_status_read() local
464 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
465 runtime = substream->runtime; in snd_pcm_substream_proc_status_read()
471 err = snd_pcm_status(substream, &status); in snd_pcm_substream_proc_status_read()
477 snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid)); in snd_pcm_substream_proc_status_read()
489 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
496 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_xrun_injection_write() local
499 snd_pcm_stream_lock_irq(substream); in snd_pcm_xrun_injection_write()
500 runtime = substream->runtime; in snd_pcm_xrun_injection_write()
502 snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); in snd_pcm_xrun_injection_write()
503 snd_pcm_stream_unlock_irq(substream); in snd_pcm_xrun_injection_write()
582 static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) in snd_pcm_substream_proc_init() argument
588 card = substream->pcm->card; in snd_pcm_substream_proc_init()
590 sprintf(name, "sub%i", substream->number); in snd_pcm_substream_proc_init()
592 substream->pstr->proc_root); in snd_pcm_substream_proc_init()
600 substream->proc_root = entry; in snd_pcm_substream_proc_init()
601 entry = snd_info_create_card_entry(card, "info", substream->proc_root); in snd_pcm_substream_proc_init()
603 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
610 substream->proc_info_entry = entry; in snd_pcm_substream_proc_init()
612 substream->proc_root); in snd_pcm_substream_proc_init()
614 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
621 substream->proc_hw_params_entry = entry; in snd_pcm_substream_proc_init()
623 substream->proc_root); in snd_pcm_substream_proc_init()
625 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
632 substream->proc_sw_params_entry = entry; in snd_pcm_substream_proc_init()
634 substream->proc_root); in snd_pcm_substream_proc_init()
636 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
643 substream->proc_status_entry = entry; in snd_pcm_substream_proc_init()
647 substream->proc_root); in snd_pcm_substream_proc_init()
649 entry->private_data = substream; in snd_pcm_substream_proc_init()
658 substream->proc_xrun_injection_entry = entry; in snd_pcm_substream_proc_init()
664 static int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) in snd_pcm_substream_proc_done() argument
666 snd_info_free_entry(substream->proc_info_entry); in snd_pcm_substream_proc_done()
667 substream->proc_info_entry = NULL; in snd_pcm_substream_proc_done()
668 snd_info_free_entry(substream->proc_hw_params_entry); in snd_pcm_substream_proc_done()
669 substream->proc_hw_params_entry = NULL; in snd_pcm_substream_proc_done()
670 snd_info_free_entry(substream->proc_sw_params_entry); in snd_pcm_substream_proc_done()
671 substream->proc_sw_params_entry = NULL; in snd_pcm_substream_proc_done()
672 snd_info_free_entry(substream->proc_status_entry); in snd_pcm_substream_proc_done()
673 substream->proc_status_entry = NULL; in snd_pcm_substream_proc_done()
675 snd_info_free_entry(substream->proc_xrun_injection_entry); in snd_pcm_substream_proc_done()
676 substream->proc_xrun_injection_entry = NULL; in snd_pcm_substream_proc_done()
678 snd_info_free_entry(substream->proc_root); in snd_pcm_substream_proc_done()
679 substream->proc_root = NULL; in snd_pcm_substream_proc_done()
685 static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; } in snd_pcm_substream_proc_init() argument
686 static inline int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) { return 0; } in snd_pcm_substream_proc_done() argument
708 struct snd_pcm_substream *substream, *prev; in snd_pcm_new_stream() local
733 substream = kzalloc(sizeof(*substream), GFP_KERNEL); in snd_pcm_new_stream()
734 if (!substream) in snd_pcm_new_stream()
736 substream->pcm = pcm; in snd_pcm_new_stream()
737 substream->pstr = pstr; in snd_pcm_new_stream()
738 substream->number = idx; in snd_pcm_new_stream()
739 substream->stream = stream; in snd_pcm_new_stream()
740 sprintf(substream->name, "subdevice #%i", idx); in snd_pcm_new_stream()
741 substream->buffer_bytes_max = UINT_MAX; in snd_pcm_new_stream()
743 pstr->substream = substream; in snd_pcm_new_stream()
745 prev->next = substream; in snd_pcm_new_stream()
748 err = snd_pcm_substream_proc_init(substream); in snd_pcm_new_stream()
753 pstr->substream = NULL; in snd_pcm_new_stream()
756 kfree(substream); in snd_pcm_new_stream()
760 substream->group = &substream->self_group; in snd_pcm_new_stream()
761 spin_lock_init(&substream->self_group.lock); in snd_pcm_new_stream()
762 mutex_init(&substream->self_group.mutex); in snd_pcm_new_stream()
763 INIT_LIST_HEAD(&substream->self_group.substreams); in snd_pcm_new_stream()
764 list_add_tail(&substream->link_list, &substream->self_group.substreams); in snd_pcm_new_stream()
765 atomic_set(&substream->mmap_count, 0); in snd_pcm_new_stream()
766 prev = substream; in snd_pcm_new_stream()
885 struct snd_pcm_substream *substream, *substream_next; in snd_pcm_free_stream() local
889 substream = pstr->substream; in snd_pcm_free_stream()
890 while (substream) { in snd_pcm_free_stream()
891 substream_next = substream->next; in snd_pcm_free_stream()
892 snd_pcm_timer_done(substream); in snd_pcm_free_stream()
893 snd_pcm_substream_proc_done(substream); in snd_pcm_free_stream()
894 kfree(substream); in snd_pcm_free_stream()
895 substream = substream_next; in snd_pcm_free_stream()
947 struct snd_pcm_substream *substream; in snd_pcm_attach_substream() local
960 if (pstr->substream == NULL || pstr->substream_count == 0) in snd_pcm_attach_substream()
969 for (substream = pcm->streams[opposite].substream; substream; in snd_pcm_attach_substream()
970 substream = substream->next) { in snd_pcm_attach_substream()
971 if (SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
980 substream = pstr->substream; in snd_pcm_attach_substream()
982 for (substream = pstr->substream; substream; in snd_pcm_attach_substream()
983 substream = substream->next) in snd_pcm_attach_substream()
984 if (substream->number == prefer_subdevice) in snd_pcm_attach_substream()
987 if (! substream) in snd_pcm_attach_substream()
989 if (! SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
991 substream->ref_count++; in snd_pcm_attach_substream()
992 *rsubstream = substream; in snd_pcm_attach_substream()
996 for (substream = pstr->substream; substream; substream = substream->next) { in snd_pcm_attach_substream()
997 if (!SUBSTREAM_BUSY(substream) && in snd_pcm_attach_substream()
999 substream->number == prefer_subdevice)) in snd_pcm_attach_substream()
1002 if (substream == NULL) in snd_pcm_attach_substream()
1032 substream->runtime = runtime; in snd_pcm_attach_substream()
1033 substream->private_data = pcm->private_data; in snd_pcm_attach_substream()
1034 substream->ref_count = 1; in snd_pcm_attach_substream()
1035 substream->f_flags = file->f_flags; in snd_pcm_attach_substream()
1036 substream->pid = get_pid(task_pid(current)); in snd_pcm_attach_substream()
1038 *rsubstream = substream; in snd_pcm_attach_substream()
1042 void snd_pcm_detach_substream(struct snd_pcm_substream *substream) in snd_pcm_detach_substream() argument
1046 if (PCM_RUNTIME_CHECK(substream)) in snd_pcm_detach_substream()
1048 runtime = substream->runtime; in snd_pcm_detach_substream()
1057 if (substream->timer) in snd_pcm_detach_substream()
1058 spin_lock_irq(&substream->timer->lock); in snd_pcm_detach_substream()
1059 substream->runtime = NULL; in snd_pcm_detach_substream()
1060 if (substream->timer) in snd_pcm_detach_substream()
1061 spin_unlock_irq(&substream->timer->lock); in snd_pcm_detach_substream()
1063 put_pid(substream->pid); in snd_pcm_detach_substream()
1064 substream->pid = NULL; in snd_pcm_detach_substream()
1065 substream->pstr->substream_opened--; in snd_pcm_detach_substream()
1106 struct snd_pcm_substream *substream; in snd_pcm_dev_register() local
1121 if (pcm->streams[cidx].substream == NULL) in snd_pcm_dev_register()
1140 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) in snd_pcm_dev_register()
1141 snd_pcm_timer_init(substream); in snd_pcm_dev_register()
1154 struct snd_pcm_substream *substream; in snd_pcm_dev_disconnect() local
1162 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) { in snd_pcm_dev_disconnect()
1163 snd_pcm_stream_lock_irq(substream); in snd_pcm_dev_disconnect()
1164 if (substream->runtime) { in snd_pcm_dev_disconnect()
1165 substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED; in snd_pcm_dev_disconnect()
1166 wake_up(&substream->runtime->sleep); in snd_pcm_dev_disconnect()
1167 wake_up(&substream->runtime->tsleep); in snd_pcm_dev_disconnect()
1169 snd_pcm_stream_unlock_irq(substream); in snd_pcm_dev_disconnect()
1234 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) in snd_pcm_proc_read()
1237 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) in snd_pcm_proc_read()