Lines Matching refs:substream
108 struct snd_pcm_substream *substream; in snd_pcm_control_ioctl() local
136 for (substream = pstr->substream; substream; in snd_pcm_control_ioctl()
137 substream = substream->next) in snd_pcm_control_ioctl()
138 if (substream->number == (int)subdevice) in snd_pcm_control_ioctl()
140 if (substream == NULL) { in snd_pcm_control_ioctl()
145 err = snd_pcm_info_user(substream, info); in snd_pcm_control_ioctl()
333 static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream, in snd_pcm_proc_info_read() argument
339 if (! substream) in snd_pcm_proc_info_read()
346 err = snd_pcm_info(substream, info); in snd_pcm_proc_info_read()
369 snd_pcm_proc_info_read(((struct snd_pcm_str *)entry->private_data)->substream, in snd_pcm_stream_proc_info_read()
382 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_hw_params_read() local
385 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
386 runtime = substream->runtime; in snd_pcm_substream_proc_hw_params_read()
403 if (substream->oss.oss) { in snd_pcm_substream_proc_hw_params_read()
413 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
419 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_sw_params_read() local
422 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
423 runtime = substream->runtime; in snd_pcm_substream_proc_sw_params_read()
441 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
447 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_status_read() local
452 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
453 runtime = substream->runtime; in snd_pcm_substream_proc_status_read()
459 err = snd_pcm_status64(substream, &status); in snd_pcm_substream_proc_status_read()
465 snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid)); in snd_pcm_substream_proc_status_read()
477 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
484 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_xrun_injection_write() local
486 snd_pcm_stop_xrun(substream); in snd_pcm_xrun_injection_write()
543 create_substream_info_entry(struct snd_pcm_substream *substream, in create_substream_info_entry() argument
550 entry = snd_info_create_card_entry(substream->pcm->card, name, in create_substream_info_entry()
551 substream->proc_root); in create_substream_info_entry()
553 snd_info_set_text_ops(entry, substream, read); in create_substream_info_entry()
557 static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) in snd_pcm_substream_proc_init() argument
563 card = substream->pcm->card; in snd_pcm_substream_proc_init()
565 sprintf(name, "sub%i", substream->number); in snd_pcm_substream_proc_init()
567 substream->pstr->proc_root); in snd_pcm_substream_proc_init()
571 substream->proc_root = entry; in snd_pcm_substream_proc_init()
573 create_substream_info_entry(substream, "info", in snd_pcm_substream_proc_init()
575 create_substream_info_entry(substream, "hw_params", in snd_pcm_substream_proc_init()
577 create_substream_info_entry(substream, "sw_params", in snd_pcm_substream_proc_init()
579 create_substream_info_entry(substream, "status", in snd_pcm_substream_proc_init()
583 entry = create_substream_info_entry(substream, "xrun_injection", NULL); in snd_pcm_substream_proc_init()
596 static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; } in snd_pcm_substream_proc_init() argument
643 struct snd_pcm_substream *substream, *prev; in snd_pcm_new_stream() local
672 substream = kzalloc(sizeof(*substream), GFP_KERNEL); in snd_pcm_new_stream()
673 if (!substream) in snd_pcm_new_stream()
675 substream->pcm = pcm; in snd_pcm_new_stream()
676 substream->pstr = pstr; in snd_pcm_new_stream()
677 substream->number = idx; in snd_pcm_new_stream()
678 substream->stream = stream; in snd_pcm_new_stream()
679 sprintf(substream->name, "subdevice #%i", idx); in snd_pcm_new_stream()
680 substream->buffer_bytes_max = UINT_MAX; in snd_pcm_new_stream()
682 pstr->substream = substream; in snd_pcm_new_stream()
684 prev->next = substream; in snd_pcm_new_stream()
687 err = snd_pcm_substream_proc_init(substream); in snd_pcm_new_stream()
692 pstr->substream = NULL; in snd_pcm_new_stream()
695 kfree(substream); in snd_pcm_new_stream()
699 substream->group = &substream->self_group; in snd_pcm_new_stream()
700 snd_pcm_group_init(&substream->self_group); in snd_pcm_new_stream()
701 list_add_tail(&substream->link_list, &substream->self_group.substreams); in snd_pcm_new_stream()
702 atomic_set(&substream->mmap_count, 0); in snd_pcm_new_stream()
703 prev = substream; in snd_pcm_new_stream()
828 struct snd_pcm_substream *substream, *substream_next; in snd_pcm_free_stream() local
836 substream = pstr->substream; in snd_pcm_free_stream()
837 while (substream) { in snd_pcm_free_stream()
838 substream_next = substream->next; in snd_pcm_free_stream()
839 snd_pcm_timer_done(substream); in snd_pcm_free_stream()
840 kfree(substream); in snd_pcm_free_stream()
841 substream = substream_next; in snd_pcm_free_stream()
892 struct snd_pcm_substream *substream; in snd_pcm_attach_substream() local
905 if (pstr->substream == NULL || pstr->substream_count == 0) in snd_pcm_attach_substream()
914 for (substream = pcm->streams[opposite].substream; substream; in snd_pcm_attach_substream()
915 substream = substream->next) { in snd_pcm_attach_substream()
916 if (SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
925 substream = pstr->substream; in snd_pcm_attach_substream()
927 for (substream = pstr->substream; substream; in snd_pcm_attach_substream()
928 substream = substream->next) in snd_pcm_attach_substream()
929 if (substream->number == prefer_subdevice) in snd_pcm_attach_substream()
932 if (! substream) in snd_pcm_attach_substream()
934 if (! SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
936 substream->ref_count++; in snd_pcm_attach_substream()
937 *rsubstream = substream; in snd_pcm_attach_substream()
941 for (substream = pstr->substream; substream; substream = substream->next) { in snd_pcm_attach_substream()
942 if (!SUBSTREAM_BUSY(substream) && in snd_pcm_attach_substream()
944 substream->number == prefer_subdevice)) in snd_pcm_attach_substream()
947 if (substream == NULL) in snd_pcm_attach_substream()
979 substream->runtime = runtime; in snd_pcm_attach_substream()
980 substream->private_data = pcm->private_data; in snd_pcm_attach_substream()
981 substream->ref_count = 1; in snd_pcm_attach_substream()
982 substream->f_flags = file->f_flags; in snd_pcm_attach_substream()
983 substream->pid = get_pid(task_pid(current)); in snd_pcm_attach_substream()
985 *rsubstream = substream; in snd_pcm_attach_substream()
989 void snd_pcm_detach_substream(struct snd_pcm_substream *substream) in snd_pcm_detach_substream() argument
993 if (PCM_RUNTIME_CHECK(substream)) in snd_pcm_detach_substream()
995 runtime = substream->runtime; in snd_pcm_detach_substream()
1004 if (substream->timer) { in snd_pcm_detach_substream()
1005 spin_lock_irq(&substream->timer->lock); in snd_pcm_detach_substream()
1006 substream->runtime = NULL; in snd_pcm_detach_substream()
1007 spin_unlock_irq(&substream->timer->lock); in snd_pcm_detach_substream()
1009 substream->runtime = NULL; in snd_pcm_detach_substream()
1014 put_pid(substream->pid); in snd_pcm_detach_substream()
1015 substream->pid = NULL; in snd_pcm_detach_substream()
1016 substream->pstr->substream_opened--; in snd_pcm_detach_substream()
1057 struct snd_pcm_substream *substream; in snd_pcm_dev_register() local
1070 if (pcm->streams[cidx].substream == NULL) in snd_pcm_dev_register()
1089 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) in snd_pcm_dev_register()
1090 snd_pcm_timer_init(substream); in snd_pcm_dev_register()
1103 struct snd_pcm_substream *substream; in snd_pcm_dev_disconnect() local
1111 for_each_pcm_substream(pcm, cidx, substream) { in snd_pcm_dev_disconnect()
1112 snd_pcm_stream_lock_irq(substream); in snd_pcm_dev_disconnect()
1113 if (substream->runtime) { in snd_pcm_dev_disconnect()
1114 if (snd_pcm_running(substream)) in snd_pcm_dev_disconnect()
1115 snd_pcm_stop(substream, SNDRV_PCM_STATE_DISCONNECTED); in snd_pcm_dev_disconnect()
1117 __snd_pcm_set_state(substream->runtime, in snd_pcm_dev_disconnect()
1119 wake_up(&substream->runtime->sleep); in snd_pcm_dev_disconnect()
1120 wake_up(&substream->runtime->tsleep); in snd_pcm_dev_disconnect()
1122 snd_pcm_stream_unlock_irq(substream); in snd_pcm_dev_disconnect()
1125 for_each_pcm_substream(pcm, cidx, substream) in snd_pcm_dev_disconnect()
1126 snd_pcm_sync_stop(substream, false); in snd_pcm_dev_disconnect()
1190 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) in snd_pcm_proc_read()
1193 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) in snd_pcm_proc_read()