Lines Matching refs:substream
107 struct snd_pcm_substream *substream; in snd_pcm_control_ioctl() local
128 for (substream = pstr->substream; substream; in snd_pcm_control_ioctl()
129 substream = substream->next) in snd_pcm_control_ioctl()
130 if (substream->number == (int)subdevice) in snd_pcm_control_ioctl()
132 if (substream == NULL) in snd_pcm_control_ioctl()
135 return snd_pcm_info_user(substream, info); in snd_pcm_control_ioctl()
328 static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream, in snd_pcm_proc_info_read() argument
333 if (! substream) in snd_pcm_proc_info_read()
341 err = snd_pcm_info(substream, info); in snd_pcm_proc_info_read()
362 snd_pcm_proc_info_read(((struct snd_pcm_str *)entry->private_data)->substream, in snd_pcm_stream_proc_info_read()
375 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_hw_params_read() local
378 guard(mutex)(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
379 runtime = substream->runtime; in snd_pcm_substream_proc_hw_params_read()
396 if (substream->oss.oss) { in snd_pcm_substream_proc_hw_params_read()
410 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_sw_params_read() local
413 guard(mutex)(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
414 runtime = substream->runtime; in snd_pcm_substream_proc_sw_params_read()
436 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_status_read() local
441 guard(mutex)(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
442 runtime = substream->runtime; in snd_pcm_substream_proc_status_read()
448 err = snd_pcm_status64(substream, &status); in snd_pcm_substream_proc_status_read()
454 snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid)); in snd_pcm_substream_proc_status_read()
466 snd_iprintf(buffer, "xrun_counter: %d\n", substream->xrun_counter); in snd_pcm_substream_proc_status_read()
474 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_xrun_injection_write() local
476 snd_pcm_stop_xrun(substream); in snd_pcm_xrun_injection_write()
533 create_substream_info_entry(struct snd_pcm_substream *substream, in create_substream_info_entry() argument
540 entry = snd_info_create_card_entry(substream->pcm->card, name, in create_substream_info_entry()
541 substream->proc_root); in create_substream_info_entry()
543 snd_info_set_text_ops(entry, substream, read); in create_substream_info_entry()
547 static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) in snd_pcm_substream_proc_init() argument
553 card = substream->pcm->card; in snd_pcm_substream_proc_init()
555 sprintf(name, "sub%i", substream->number); in snd_pcm_substream_proc_init()
557 substream->pstr->proc_root); in snd_pcm_substream_proc_init()
561 substream->proc_root = entry; in snd_pcm_substream_proc_init()
563 create_substream_info_entry(substream, "info", in snd_pcm_substream_proc_init()
565 create_substream_info_entry(substream, "hw_params", in snd_pcm_substream_proc_init()
567 create_substream_info_entry(substream, "sw_params", in snd_pcm_substream_proc_init()
569 create_substream_info_entry(substream, "status", in snd_pcm_substream_proc_init()
573 entry = create_substream_info_entry(substream, "xrun_injection", NULL); in snd_pcm_substream_proc_init()
586 static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; } in snd_pcm_substream_proc_init() argument
631 struct snd_pcm_substream *substream, *prev; in snd_pcm_new_stream() local
660 substream = kzalloc_obj(*substream); in snd_pcm_new_stream()
661 if (!substream) in snd_pcm_new_stream()
663 substream->pcm = pcm; in snd_pcm_new_stream()
664 substream->pstr = pstr; in snd_pcm_new_stream()
665 substream->number = idx; in snd_pcm_new_stream()
666 substream->stream = stream; in snd_pcm_new_stream()
667 sprintf(substream->name, "subdevice #%i", idx); in snd_pcm_new_stream()
668 substream->buffer_bytes_max = UINT_MAX; in snd_pcm_new_stream()
670 pstr->substream = substream; in snd_pcm_new_stream()
672 prev->next = substream; in snd_pcm_new_stream()
675 err = snd_pcm_substream_proc_init(substream); in snd_pcm_new_stream()
680 pstr->substream = NULL; in snd_pcm_new_stream()
683 kfree(substream); in snd_pcm_new_stream()
687 substream->group = &substream->self_group; in snd_pcm_new_stream()
688 snd_pcm_group_init(&substream->self_group); in snd_pcm_new_stream()
689 list_add_tail(&substream->link_list, &substream->self_group.substreams); in snd_pcm_new_stream()
690 atomic_set(&substream->mmap_count, 0); in snd_pcm_new_stream()
691 prev = substream; in snd_pcm_new_stream()
816 struct snd_pcm_substream *substream, *substream_next; in snd_pcm_free_stream() local
824 substream = pstr->substream; in snd_pcm_free_stream()
825 while (substream) { in snd_pcm_free_stream()
826 substream_next = substream->next; in snd_pcm_free_stream()
827 snd_pcm_timer_done(substream); in snd_pcm_free_stream()
828 kfree(substream); in snd_pcm_free_stream()
829 substream = substream_next; in snd_pcm_free_stream()
880 struct snd_pcm_substream *substream; in snd_pcm_attach_substream() local
893 if (pstr->substream == NULL || pstr->substream_count == 0) in snd_pcm_attach_substream()
902 for (substream = pcm->streams[opposite].substream; substream; in snd_pcm_attach_substream()
903 substream = substream->next) { in snd_pcm_attach_substream()
904 if (SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
913 substream = pstr->substream; in snd_pcm_attach_substream()
915 for (substream = pstr->substream; substream; in snd_pcm_attach_substream()
916 substream = substream->next) in snd_pcm_attach_substream()
917 if (substream->number == prefer_subdevice) in snd_pcm_attach_substream()
920 if (! substream) in snd_pcm_attach_substream()
922 if (! SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
924 substream->ref_count++; in snd_pcm_attach_substream()
925 *rsubstream = substream; in snd_pcm_attach_substream()
929 for (substream = pstr->substream; substream; substream = substream->next) { in snd_pcm_attach_substream()
930 if (!SUBSTREAM_BUSY(substream) && in snd_pcm_attach_substream()
932 substream->number == prefer_subdevice)) in snd_pcm_attach_substream()
935 if (substream == NULL) in snd_pcm_attach_substream()
967 substream->runtime = runtime; in snd_pcm_attach_substream()
968 substream->private_data = pcm->private_data; in snd_pcm_attach_substream()
969 substream->ref_count = 1; in snd_pcm_attach_substream()
970 substream->f_flags = file->f_flags; in snd_pcm_attach_substream()
971 substream->pid = get_pid(task_pid(current)); in snd_pcm_attach_substream()
973 *rsubstream = substream; in snd_pcm_attach_substream()
975 substream->xrun_counter = 0; in snd_pcm_attach_substream()
980 void snd_pcm_detach_substream(struct snd_pcm_substream *substream) in snd_pcm_detach_substream() argument
984 if (PCM_RUNTIME_CHECK(substream)) in snd_pcm_detach_substream()
986 runtime = substream->runtime; in snd_pcm_detach_substream()
995 if (substream->timer) { in snd_pcm_detach_substream()
996 scoped_guard(spinlock_irq, &substream->timer->lock) in snd_pcm_detach_substream()
997 substream->runtime = NULL; in snd_pcm_detach_substream()
999 substream->runtime = NULL; in snd_pcm_detach_substream()
1004 put_pid(substream->pid); in snd_pcm_detach_substream()
1005 substream->pid = NULL; in snd_pcm_detach_substream()
1006 substream->pstr->substream_opened--; in snd_pcm_detach_substream()
1047 struct snd_pcm_substream *substream; in snd_pcm_dev_register() local
1060 if (pcm->streams[cidx].substream == NULL) in snd_pcm_dev_register()
1079 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) in snd_pcm_dev_register()
1080 snd_pcm_timer_init(substream); in snd_pcm_dev_register()
1090 struct snd_pcm_substream *substream; in snd_pcm_dev_disconnect() local
1098 for_each_pcm_substream(pcm, cidx, substream) { in snd_pcm_dev_disconnect()
1099 snd_pcm_stream_lock_irq(substream); in snd_pcm_dev_disconnect()
1100 if (substream->runtime) { in snd_pcm_dev_disconnect()
1101 if (snd_pcm_running(substream)) in snd_pcm_dev_disconnect()
1102 snd_pcm_stop(substream, SNDRV_PCM_STATE_DISCONNECTED); in snd_pcm_dev_disconnect()
1104 __snd_pcm_set_state(substream->runtime, in snd_pcm_dev_disconnect()
1106 wake_up(&substream->runtime->sleep); in snd_pcm_dev_disconnect()
1107 wake_up(&substream->runtime->tsleep); in snd_pcm_dev_disconnect()
1109 snd_pcm_stream_unlock_irq(substream); in snd_pcm_dev_disconnect()
1112 for_each_pcm_substream(pcm, cidx, substream) in snd_pcm_dev_disconnect()
1113 snd_pcm_sync_stop(substream, false); in snd_pcm_dev_disconnect()
1174 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) in snd_pcm_proc_read()
1177 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) in snd_pcm_proc_read()