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()
330 static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream, in snd_pcm_proc_info_read() argument
336 if (! substream) in snd_pcm_proc_info_read()
343 err = snd_pcm_info(substream, info); in snd_pcm_proc_info_read()
366 snd_pcm_proc_info_read(((struct snd_pcm_str *)entry->private_data)->substream, in snd_pcm_stream_proc_info_read()
379 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_hw_params_read() local
382 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
383 runtime = substream->runtime; in snd_pcm_substream_proc_hw_params_read()
400 if (substream->oss.oss) { in snd_pcm_substream_proc_hw_params_read()
410 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
416 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_sw_params_read() local
419 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
420 runtime = substream->runtime; in snd_pcm_substream_proc_sw_params_read()
438 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
444 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_status_read() local
449 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
450 runtime = substream->runtime; in snd_pcm_substream_proc_status_read()
456 err = snd_pcm_status64(substream, &status); in snd_pcm_substream_proc_status_read()
462 snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid)); in snd_pcm_substream_proc_status_read()
474 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
481 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_xrun_injection_write() local
483 snd_pcm_stop_xrun(substream); in snd_pcm_xrun_injection_write()
540 create_substream_info_entry(struct snd_pcm_substream *substream, in create_substream_info_entry() argument
547 entry = snd_info_create_card_entry(substream->pcm->card, name, in create_substream_info_entry()
548 substream->proc_root); in create_substream_info_entry()
550 snd_info_set_text_ops(entry, substream, read); in create_substream_info_entry()
554 static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) in snd_pcm_substream_proc_init() argument
560 card = substream->pcm->card; in snd_pcm_substream_proc_init()
562 sprintf(name, "sub%i", substream->number); in snd_pcm_substream_proc_init()
564 substream->pstr->proc_root); in snd_pcm_substream_proc_init()
568 substream->proc_root = entry; in snd_pcm_substream_proc_init()
570 create_substream_info_entry(substream, "info", in snd_pcm_substream_proc_init()
572 create_substream_info_entry(substream, "hw_params", in snd_pcm_substream_proc_init()
574 create_substream_info_entry(substream, "sw_params", in snd_pcm_substream_proc_init()
576 create_substream_info_entry(substream, "status", in snd_pcm_substream_proc_init()
580 entry = create_substream_info_entry(substream, "xrun_injection", NULL); in snd_pcm_substream_proc_init()
593 static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; } in snd_pcm_substream_proc_init() argument
640 struct snd_pcm_substream *substream, *prev; in snd_pcm_new_stream() local
666 substream = kzalloc(sizeof(*substream), GFP_KERNEL); in snd_pcm_new_stream()
667 if (!substream) in snd_pcm_new_stream()
669 substream->pcm = pcm; in snd_pcm_new_stream()
670 substream->pstr = pstr; in snd_pcm_new_stream()
671 substream->number = idx; in snd_pcm_new_stream()
672 substream->stream = stream; in snd_pcm_new_stream()
673 sprintf(substream->name, "subdevice #%i", idx); in snd_pcm_new_stream()
674 substream->buffer_bytes_max = UINT_MAX; in snd_pcm_new_stream()
676 pstr->substream = substream; in snd_pcm_new_stream()
678 prev->next = substream; in snd_pcm_new_stream()
681 err = snd_pcm_substream_proc_init(substream); in snd_pcm_new_stream()
686 pstr->substream = NULL; in snd_pcm_new_stream()
689 kfree(substream); in snd_pcm_new_stream()
693 substream->group = &substream->self_group; in snd_pcm_new_stream()
694 snd_pcm_group_init(&substream->self_group); in snd_pcm_new_stream()
695 list_add_tail(&substream->link_list, &substream->self_group.substreams); in snd_pcm_new_stream()
696 atomic_set(&substream->mmap_count, 0); in snd_pcm_new_stream()
697 prev = substream; in snd_pcm_new_stream()
820 struct snd_pcm_substream *substream, *substream_next; in snd_pcm_free_stream() local
828 substream = pstr->substream; in snd_pcm_free_stream()
829 while (substream) { in snd_pcm_free_stream()
830 substream_next = substream->next; in snd_pcm_free_stream()
831 snd_pcm_timer_done(substream); in snd_pcm_free_stream()
832 kfree(substream); in snd_pcm_free_stream()
833 substream = substream_next; in snd_pcm_free_stream()
884 struct snd_pcm_substream *substream; in snd_pcm_attach_substream() local
897 if (pstr->substream == NULL || pstr->substream_count == 0) in snd_pcm_attach_substream()
906 for (substream = pcm->streams[opposite].substream; substream; in snd_pcm_attach_substream()
907 substream = substream->next) { in snd_pcm_attach_substream()
908 if (SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
917 substream = pstr->substream; in snd_pcm_attach_substream()
919 for (substream = pstr->substream; substream; in snd_pcm_attach_substream()
920 substream = substream->next) in snd_pcm_attach_substream()
921 if (substream->number == prefer_subdevice) in snd_pcm_attach_substream()
924 if (! substream) in snd_pcm_attach_substream()
926 if (! SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
928 substream->ref_count++; in snd_pcm_attach_substream()
929 *rsubstream = substream; in snd_pcm_attach_substream()
933 for (substream = pstr->substream; substream; substream = substream->next) { in snd_pcm_attach_substream()
934 if (!SUBSTREAM_BUSY(substream) && in snd_pcm_attach_substream()
936 substream->number == prefer_subdevice)) in snd_pcm_attach_substream()
939 if (substream == NULL) in snd_pcm_attach_substream()
969 substream->runtime = runtime; in snd_pcm_attach_substream()
970 substream->private_data = pcm->private_data; in snd_pcm_attach_substream()
971 substream->ref_count = 1; in snd_pcm_attach_substream()
972 substream->f_flags = file->f_flags; in snd_pcm_attach_substream()
973 substream->pid = get_pid(task_pid(current)); in snd_pcm_attach_substream()
975 *rsubstream = substream; in snd_pcm_attach_substream()
979 void snd_pcm_detach_substream(struct snd_pcm_substream *substream) in snd_pcm_detach_substream() argument
983 if (PCM_RUNTIME_CHECK(substream)) in snd_pcm_detach_substream()
985 runtime = substream->runtime; in snd_pcm_detach_substream()
994 if (substream->timer) { in snd_pcm_detach_substream()
995 spin_lock_irq(&substream->timer->lock); in snd_pcm_detach_substream()
996 substream->runtime = NULL; in snd_pcm_detach_substream()
997 spin_unlock_irq(&substream->timer->lock); in snd_pcm_detach_substream()
999 substream->runtime = NULL; in snd_pcm_detach_substream()
1002 put_pid(substream->pid); in snd_pcm_detach_substream()
1003 substream->pid = NULL; in snd_pcm_detach_substream()
1004 substream->pstr->substream_opened--; in snd_pcm_detach_substream()
1045 struct snd_pcm_substream *substream; in snd_pcm_dev_register() local
1058 if (pcm->streams[cidx].substream == NULL) in snd_pcm_dev_register()
1077 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) in snd_pcm_dev_register()
1078 snd_pcm_timer_init(substream); in snd_pcm_dev_register()
1091 struct snd_pcm_substream *substream; in snd_pcm_dev_disconnect() local
1099 for_each_pcm_substream(pcm, cidx, substream) { in snd_pcm_dev_disconnect()
1100 snd_pcm_stream_lock_irq(substream); in snd_pcm_dev_disconnect()
1101 if (substream->runtime) { in snd_pcm_dev_disconnect()
1102 if (snd_pcm_running(substream)) in snd_pcm_dev_disconnect()
1103 snd_pcm_stop(substream, SNDRV_PCM_STATE_DISCONNECTED); in snd_pcm_dev_disconnect()
1105 substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED; 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()