Lines Matching refs:substream

117 			struct snd_pcm_substream *substream;  in snd_pcm_control_ioctl()  local
144 for (substream = pstr->substream; substream; in snd_pcm_control_ioctl()
145 substream = substream->next) in snd_pcm_control_ioctl()
146 if (substream->number == (int)subdevice) in snd_pcm_control_ioctl()
148 if (substream == NULL) { in snd_pcm_control_ioctl()
152 err = snd_pcm_info_user(substream, info); in snd_pcm_control_ioctl()
336 static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream, in snd_pcm_proc_info_read() argument
342 if (! substream) in snd_pcm_proc_info_read()
349 err = snd_pcm_info(substream, info); in snd_pcm_proc_info_read()
372 snd_pcm_proc_info_read(((struct snd_pcm_str *)entry->private_data)->substream, in snd_pcm_stream_proc_info_read()
385 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_hw_params_read() local
388 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
389 runtime = substream->runtime; in snd_pcm_substream_proc_hw_params_read()
406 if (substream->oss.oss) { in snd_pcm_substream_proc_hw_params_read()
416 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
422 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_sw_params_read() local
425 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
426 runtime = substream->runtime; in snd_pcm_substream_proc_sw_params_read()
444 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
450 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_status_read() local
455 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
456 runtime = substream->runtime; in snd_pcm_substream_proc_status_read()
462 err = snd_pcm_status(substream, &status); in snd_pcm_substream_proc_status_read()
468 snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid)); in snd_pcm_substream_proc_status_read()
480 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
487 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_xrun_injection_write() local
490 snd_pcm_stream_lock_irq(substream); in snd_pcm_xrun_injection_write()
491 runtime = substream->runtime; in snd_pcm_xrun_injection_write()
493 snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); in snd_pcm_xrun_injection_write()
494 snd_pcm_stream_unlock_irq(substream); in snd_pcm_xrun_injection_write()
570 static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) in snd_pcm_substream_proc_init() argument
576 card = substream->pcm->card; in snd_pcm_substream_proc_init()
578 sprintf(name, "sub%i", substream->number); in snd_pcm_substream_proc_init()
579 if ((entry = snd_info_create_card_entry(card, name, substream->pstr->proc_root)) == NULL) in snd_pcm_substream_proc_init()
586 substream->proc_root = entry; in snd_pcm_substream_proc_init()
588 if ((entry = snd_info_create_card_entry(card, "info", substream->proc_root)) != NULL) { in snd_pcm_substream_proc_init()
589 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
596 substream->proc_info_entry = entry; in snd_pcm_substream_proc_init()
598 if ((entry = snd_info_create_card_entry(card, "hw_params", substream->proc_root)) != NULL) { in snd_pcm_substream_proc_init()
599 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
606 substream->proc_hw_params_entry = entry; in snd_pcm_substream_proc_init()
608 if ((entry = snd_info_create_card_entry(card, "sw_params", substream->proc_root)) != NULL) { in snd_pcm_substream_proc_init()
609 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
616 substream->proc_sw_params_entry = entry; in snd_pcm_substream_proc_init()
618 if ((entry = snd_info_create_card_entry(card, "status", substream->proc_root)) != NULL) { in snd_pcm_substream_proc_init()
619 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
626 substream->proc_status_entry = entry; in snd_pcm_substream_proc_init()
630 substream->proc_root); in snd_pcm_substream_proc_init()
632 entry->private_data = substream; in snd_pcm_substream_proc_init()
641 substream->proc_xrun_injection_entry = entry; in snd_pcm_substream_proc_init()
647 static int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) in snd_pcm_substream_proc_done() argument
649 snd_info_free_entry(substream->proc_info_entry); in snd_pcm_substream_proc_done()
650 substream->proc_info_entry = NULL; in snd_pcm_substream_proc_done()
651 snd_info_free_entry(substream->proc_hw_params_entry); in snd_pcm_substream_proc_done()
652 substream->proc_hw_params_entry = NULL; in snd_pcm_substream_proc_done()
653 snd_info_free_entry(substream->proc_sw_params_entry); in snd_pcm_substream_proc_done()
654 substream->proc_sw_params_entry = NULL; in snd_pcm_substream_proc_done()
655 snd_info_free_entry(substream->proc_status_entry); in snd_pcm_substream_proc_done()
656 substream->proc_status_entry = NULL; in snd_pcm_substream_proc_done()
658 snd_info_free_entry(substream->proc_xrun_injection_entry); in snd_pcm_substream_proc_done()
659 substream->proc_xrun_injection_entry = NULL; in snd_pcm_substream_proc_done()
661 snd_info_free_entry(substream->proc_root); in snd_pcm_substream_proc_done()
662 substream->proc_root = NULL; in snd_pcm_substream_proc_done()
668 static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; } in snd_pcm_substream_proc_init() argument
669 static inline int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) { return 0; } in snd_pcm_substream_proc_done() argument
691 struct snd_pcm_substream *substream, *prev; in snd_pcm_new_stream() local
716 substream = kzalloc(sizeof(*substream), GFP_KERNEL); in snd_pcm_new_stream()
717 if (!substream) in snd_pcm_new_stream()
719 substream->pcm = pcm; in snd_pcm_new_stream()
720 substream->pstr = pstr; in snd_pcm_new_stream()
721 substream->number = idx; in snd_pcm_new_stream()
722 substream->stream = stream; in snd_pcm_new_stream()
723 sprintf(substream->name, "subdevice #%i", idx); in snd_pcm_new_stream()
724 substream->buffer_bytes_max = UINT_MAX; in snd_pcm_new_stream()
726 pstr->substream = substream; in snd_pcm_new_stream()
728 prev->next = substream; in snd_pcm_new_stream()
731 err = snd_pcm_substream_proc_init(substream); in snd_pcm_new_stream()
736 pstr->substream = NULL; in snd_pcm_new_stream()
739 kfree(substream); in snd_pcm_new_stream()
743 substream->group = &substream->self_group; in snd_pcm_new_stream()
744 spin_lock_init(&substream->self_group.lock); in snd_pcm_new_stream()
745 mutex_init(&substream->self_group.mutex); in snd_pcm_new_stream()
746 INIT_LIST_HEAD(&substream->self_group.substreams); in snd_pcm_new_stream()
747 list_add_tail(&substream->link_list, &substream->self_group.substreams); in snd_pcm_new_stream()
748 atomic_set(&substream->mmap_count, 0); in snd_pcm_new_stream()
749 prev = substream; in snd_pcm_new_stream()
854 struct snd_pcm_substream *substream, *substream_next; in snd_pcm_free_stream() local
858 substream = pstr->substream; in snd_pcm_free_stream()
859 while (substream) { in snd_pcm_free_stream()
860 substream_next = substream->next; in snd_pcm_free_stream()
861 snd_pcm_timer_done(substream); in snd_pcm_free_stream()
862 snd_pcm_substream_proc_done(substream); in snd_pcm_free_stream()
863 kfree(substream); in snd_pcm_free_stream()
864 substream = substream_next; in snd_pcm_free_stream()
908 struct snd_pcm_substream *substream; in snd_pcm_attach_substream() local
921 if (pstr->substream == NULL || pstr->substream_count == 0) in snd_pcm_attach_substream()
930 for (substream = pcm->streams[opposite].substream; substream; in snd_pcm_attach_substream()
931 substream = substream->next) { in snd_pcm_attach_substream()
932 if (SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
941 substream = pstr->substream; in snd_pcm_attach_substream()
943 for (substream = pstr->substream; substream; in snd_pcm_attach_substream()
944 substream = substream->next) in snd_pcm_attach_substream()
945 if (substream->number == prefer_subdevice) in snd_pcm_attach_substream()
948 if (! substream) in snd_pcm_attach_substream()
950 if (! SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
952 substream->ref_count++; in snd_pcm_attach_substream()
953 *rsubstream = substream; in snd_pcm_attach_substream()
957 for (substream = pstr->substream; substream; substream = substream->next) { in snd_pcm_attach_substream()
958 if (!SUBSTREAM_BUSY(substream) && in snd_pcm_attach_substream()
960 substream->number == prefer_subdevice)) in snd_pcm_attach_substream()
963 if (substream == NULL) in snd_pcm_attach_substream()
993 substream->runtime = runtime; in snd_pcm_attach_substream()
994 substream->private_data = pcm->private_data; in snd_pcm_attach_substream()
995 substream->ref_count = 1; in snd_pcm_attach_substream()
996 substream->f_flags = file->f_flags; in snd_pcm_attach_substream()
997 substream->pid = get_pid(task_pid(current)); in snd_pcm_attach_substream()
999 *rsubstream = substream; in snd_pcm_attach_substream()
1003 void snd_pcm_detach_substream(struct snd_pcm_substream *substream) in snd_pcm_detach_substream() argument
1007 if (PCM_RUNTIME_CHECK(substream)) in snd_pcm_detach_substream()
1009 runtime = substream->runtime; in snd_pcm_detach_substream()
1021 substream->runtime = NULL; in snd_pcm_detach_substream()
1022 put_pid(substream->pid); in snd_pcm_detach_substream()
1023 substream->pid = NULL; in snd_pcm_detach_substream()
1024 substream->pstr->substream_opened--; in snd_pcm_detach_substream()
1065 struct snd_pcm_substream *substream; in snd_pcm_dev_register() local
1081 if (pcm->streams[cidx].substream == NULL) in snd_pcm_dev_register()
1100 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) in snd_pcm_dev_register()
1101 snd_pcm_timer_init(substream); in snd_pcm_dev_register()
1116 struct snd_pcm_substream *substream; in snd_pcm_dev_disconnect() local
1124 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) { in snd_pcm_dev_disconnect()
1125 snd_pcm_stream_lock_irq(substream); in snd_pcm_dev_disconnect()
1126 if (substream->runtime) { in snd_pcm_dev_disconnect()
1127 substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED; in snd_pcm_dev_disconnect()
1128 wake_up(&substream->runtime->sleep); in snd_pcm_dev_disconnect()
1129 wake_up(&substream->runtime->tsleep); in snd_pcm_dev_disconnect()
1131 snd_pcm_stream_unlock_irq(substream); in snd_pcm_dev_disconnect()
1198 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) in snd_pcm_proc_read()
1201 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) in snd_pcm_proc_read()