Lines Matching refs:substream
119 struct snd_pcm_substream *substream; in snd_pcm_control_ioctl() local
147 for (substream = pstr->substream; substream; in snd_pcm_control_ioctl()
148 substream = substream->next) in snd_pcm_control_ioctl()
149 if (substream->number == (int)subdevice) in snd_pcm_control_ioctl()
151 if (substream == NULL) { in snd_pcm_control_ioctl()
156 err = snd_pcm_info_user(substream, info); in snd_pcm_control_ioctl()
341 static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream, in snd_pcm_proc_info_read() argument
347 if (! substream) in snd_pcm_proc_info_read()
354 err = snd_pcm_info(substream, info); in snd_pcm_proc_info_read()
377 snd_pcm_proc_info_read(((struct snd_pcm_str *)entry->private_data)->substream, in snd_pcm_stream_proc_info_read()
390 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_hw_params_read() local
393 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
394 runtime = substream->runtime; in snd_pcm_substream_proc_hw_params_read()
411 if (substream->oss.oss) { in snd_pcm_substream_proc_hw_params_read()
421 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
427 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_sw_params_read() local
430 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
431 runtime = substream->runtime; in snd_pcm_substream_proc_sw_params_read()
449 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
455 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_status_read() local
460 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
461 runtime = substream->runtime; in snd_pcm_substream_proc_status_read()
467 err = snd_pcm_status(substream, &status); in snd_pcm_substream_proc_status_read()
473 snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid)); in snd_pcm_substream_proc_status_read()
485 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
492 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_xrun_injection_write() local
495 snd_pcm_stream_lock_irq(substream); in snd_pcm_xrun_injection_write()
496 runtime = substream->runtime; in snd_pcm_xrun_injection_write()
498 snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); in snd_pcm_xrun_injection_write()
499 snd_pcm_stream_unlock_irq(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()
584 if ((entry = snd_info_create_card_entry(card, name, substream->pstr->proc_root)) == NULL) in snd_pcm_substream_proc_init()
591 substream->proc_root = entry; in snd_pcm_substream_proc_init()
593 if ((entry = snd_info_create_card_entry(card, "info", substream->proc_root)) != NULL) { in snd_pcm_substream_proc_init()
594 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
601 substream->proc_info_entry = entry; in snd_pcm_substream_proc_init()
603 if ((entry = snd_info_create_card_entry(card, "hw_params", substream->proc_root)) != NULL) { in snd_pcm_substream_proc_init()
604 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
611 substream->proc_hw_params_entry = entry; in snd_pcm_substream_proc_init()
613 if ((entry = snd_info_create_card_entry(card, "sw_params", substream->proc_root)) != NULL) { in snd_pcm_substream_proc_init()
614 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
621 substream->proc_sw_params_entry = entry; in snd_pcm_substream_proc_init()
623 if ((entry = snd_info_create_card_entry(card, "status", substream->proc_root)) != NULL) { in snd_pcm_substream_proc_init()
624 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
631 substream->proc_status_entry = entry; in snd_pcm_substream_proc_init()
635 substream->proc_root); in snd_pcm_substream_proc_init()
637 entry->private_data = substream; in snd_pcm_substream_proc_init()
646 substream->proc_xrun_injection_entry = entry; in snd_pcm_substream_proc_init()
652 static int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) in snd_pcm_substream_proc_done() argument
654 snd_info_free_entry(substream->proc_info_entry); in snd_pcm_substream_proc_done()
655 substream->proc_info_entry = NULL; in snd_pcm_substream_proc_done()
656 snd_info_free_entry(substream->proc_hw_params_entry); in snd_pcm_substream_proc_done()
657 substream->proc_hw_params_entry = NULL; in snd_pcm_substream_proc_done()
658 snd_info_free_entry(substream->proc_sw_params_entry); in snd_pcm_substream_proc_done()
659 substream->proc_sw_params_entry = NULL; in snd_pcm_substream_proc_done()
660 snd_info_free_entry(substream->proc_status_entry); in snd_pcm_substream_proc_done()
661 substream->proc_status_entry = NULL; in snd_pcm_substream_proc_done()
663 snd_info_free_entry(substream->proc_xrun_injection_entry); in snd_pcm_substream_proc_done()
664 substream->proc_xrun_injection_entry = NULL; in snd_pcm_substream_proc_done()
666 snd_info_free_entry(substream->proc_root); in snd_pcm_substream_proc_done()
667 substream->proc_root = NULL; in snd_pcm_substream_proc_done()
673 static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; } in snd_pcm_substream_proc_init() argument
674 static inline int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) { return 0; } in snd_pcm_substream_proc_done() argument
696 struct snd_pcm_substream *substream, *prev; in snd_pcm_new_stream() local
721 substream = kzalloc(sizeof(*substream), GFP_KERNEL); in snd_pcm_new_stream()
722 if (!substream) in snd_pcm_new_stream()
724 substream->pcm = pcm; in snd_pcm_new_stream()
725 substream->pstr = pstr; in snd_pcm_new_stream()
726 substream->number = idx; in snd_pcm_new_stream()
727 substream->stream = stream; in snd_pcm_new_stream()
728 sprintf(substream->name, "subdevice #%i", idx); in snd_pcm_new_stream()
729 substream->buffer_bytes_max = UINT_MAX; in snd_pcm_new_stream()
731 pstr->substream = substream; in snd_pcm_new_stream()
733 prev->next = substream; in snd_pcm_new_stream()
736 err = snd_pcm_substream_proc_init(substream); in snd_pcm_new_stream()
741 pstr->substream = NULL; in snd_pcm_new_stream()
744 kfree(substream); in snd_pcm_new_stream()
748 substream->group = &substream->self_group; in snd_pcm_new_stream()
749 spin_lock_init(&substream->self_group.lock); in snd_pcm_new_stream()
750 mutex_init(&substream->self_group.mutex); in snd_pcm_new_stream()
751 INIT_LIST_HEAD(&substream->self_group.substreams); in snd_pcm_new_stream()
752 list_add_tail(&substream->link_list, &substream->self_group.substreams); in snd_pcm_new_stream()
753 atomic_set(&substream->mmap_count, 0); in snd_pcm_new_stream()
754 prev = substream; in snd_pcm_new_stream()
871 struct snd_pcm_substream *substream, *substream_next; in snd_pcm_free_stream() local
875 substream = pstr->substream; in snd_pcm_free_stream()
876 while (substream) { in snd_pcm_free_stream()
877 substream_next = substream->next; in snd_pcm_free_stream()
878 snd_pcm_timer_done(substream); in snd_pcm_free_stream()
879 snd_pcm_substream_proc_done(substream); in snd_pcm_free_stream()
880 kfree(substream); in snd_pcm_free_stream()
881 substream = substream_next; in snd_pcm_free_stream()
926 struct snd_pcm_substream *substream; in snd_pcm_attach_substream() local
939 if (pstr->substream == NULL || pstr->substream_count == 0) in snd_pcm_attach_substream()
948 for (substream = pcm->streams[opposite].substream; substream; in snd_pcm_attach_substream()
949 substream = substream->next) { in snd_pcm_attach_substream()
950 if (SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
959 substream = pstr->substream; in snd_pcm_attach_substream()
961 for (substream = pstr->substream; substream; in snd_pcm_attach_substream()
962 substream = substream->next) in snd_pcm_attach_substream()
963 if (substream->number == prefer_subdevice) in snd_pcm_attach_substream()
966 if (! substream) in snd_pcm_attach_substream()
968 if (! SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
970 substream->ref_count++; in snd_pcm_attach_substream()
971 *rsubstream = substream; in snd_pcm_attach_substream()
975 for (substream = pstr->substream; substream; substream = substream->next) { in snd_pcm_attach_substream()
976 if (!SUBSTREAM_BUSY(substream) && in snd_pcm_attach_substream()
978 substream->number == prefer_subdevice)) in snd_pcm_attach_substream()
981 if (substream == NULL) in snd_pcm_attach_substream()
1011 substream->runtime = runtime; in snd_pcm_attach_substream()
1012 substream->private_data = pcm->private_data; in snd_pcm_attach_substream()
1013 substream->ref_count = 1; in snd_pcm_attach_substream()
1014 substream->f_flags = file->f_flags; in snd_pcm_attach_substream()
1015 substream->pid = get_pid(task_pid(current)); in snd_pcm_attach_substream()
1017 *rsubstream = substream; in snd_pcm_attach_substream()
1021 void snd_pcm_detach_substream(struct snd_pcm_substream *substream) in snd_pcm_detach_substream() argument
1025 if (PCM_RUNTIME_CHECK(substream)) in snd_pcm_detach_substream()
1027 runtime = substream->runtime; in snd_pcm_detach_substream()
1036 if (substream->timer) in snd_pcm_detach_substream()
1037 spin_lock_irq(&substream->timer->lock); in snd_pcm_detach_substream()
1038 substream->runtime = NULL; in snd_pcm_detach_substream()
1039 if (substream->timer) in snd_pcm_detach_substream()
1040 spin_unlock_irq(&substream->timer->lock); in snd_pcm_detach_substream()
1042 put_pid(substream->pid); in snd_pcm_detach_substream()
1043 substream->pid = NULL; in snd_pcm_detach_substream()
1044 substream->pstr->substream_opened--; in snd_pcm_detach_substream()
1085 struct snd_pcm_substream *substream; in snd_pcm_dev_register() local
1101 if (pcm->streams[cidx].substream == NULL) in snd_pcm_dev_register()
1120 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) in snd_pcm_dev_register()
1121 snd_pcm_timer_init(substream); in snd_pcm_dev_register()
1136 struct snd_pcm_substream *substream; in snd_pcm_dev_disconnect() local
1144 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) { in snd_pcm_dev_disconnect()
1145 snd_pcm_stream_lock_irq(substream); in snd_pcm_dev_disconnect()
1146 if (substream->runtime) { in snd_pcm_dev_disconnect()
1147 substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED; in snd_pcm_dev_disconnect()
1148 wake_up(&substream->runtime->sleep); in snd_pcm_dev_disconnect()
1149 wake_up(&substream->runtime->tsleep); in snd_pcm_dev_disconnect()
1151 snd_pcm_stream_unlock_irq(substream); in snd_pcm_dev_disconnect()
1215 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) in snd_pcm_proc_read()
1218 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) in snd_pcm_proc_read()