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()
332 static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream, in snd_pcm_proc_info_read() argument
338 if (! substream) in snd_pcm_proc_info_read()
345 err = snd_pcm_info(substream, info); in snd_pcm_proc_info_read()
368 snd_pcm_proc_info_read(((struct snd_pcm_str *)entry->private_data)->substream, in snd_pcm_stream_proc_info_read()
381 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_hw_params_read() local
384 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
385 runtime = substream->runtime; in snd_pcm_substream_proc_hw_params_read()
402 if (substream->oss.oss) { in snd_pcm_substream_proc_hw_params_read()
412 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
418 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_sw_params_read() local
421 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
422 runtime = substream->runtime; in snd_pcm_substream_proc_sw_params_read()
440 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
446 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_status_read() local
451 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
452 runtime = substream->runtime; in snd_pcm_substream_proc_status_read()
458 err = snd_pcm_status64(substream, &status); in snd_pcm_substream_proc_status_read()
464 snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid)); in snd_pcm_substream_proc_status_read()
476 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
483 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_xrun_injection_write() local
485 snd_pcm_stop_xrun(substream); in snd_pcm_xrun_injection_write()
542 create_substream_info_entry(struct snd_pcm_substream *substream, in create_substream_info_entry() argument
549 entry = snd_info_create_card_entry(substream->pcm->card, name, in create_substream_info_entry()
550 substream->proc_root); in create_substream_info_entry()
552 snd_info_set_text_ops(entry, substream, read); in create_substream_info_entry()
556 static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) in snd_pcm_substream_proc_init() argument
562 card = substream->pcm->card; in snd_pcm_substream_proc_init()
564 sprintf(name, "sub%i", substream->number); in snd_pcm_substream_proc_init()
566 substream->pstr->proc_root); in snd_pcm_substream_proc_init()
570 substream->proc_root = entry; in snd_pcm_substream_proc_init()
572 create_substream_info_entry(substream, "info", in snd_pcm_substream_proc_init()
574 create_substream_info_entry(substream, "hw_params", in snd_pcm_substream_proc_init()
576 create_substream_info_entry(substream, "sw_params", in snd_pcm_substream_proc_init()
578 create_substream_info_entry(substream, "status", in snd_pcm_substream_proc_init()
582 entry = create_substream_info_entry(substream, "xrun_injection", NULL); in snd_pcm_substream_proc_init()
595 static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; } in snd_pcm_substream_proc_init() argument
642 struct snd_pcm_substream *substream, *prev; in snd_pcm_new_stream() local
668 substream = kzalloc(sizeof(*substream), GFP_KERNEL); in snd_pcm_new_stream()
669 if (!substream) in snd_pcm_new_stream()
671 substream->pcm = pcm; in snd_pcm_new_stream()
672 substream->pstr = pstr; in snd_pcm_new_stream()
673 substream->number = idx; in snd_pcm_new_stream()
674 substream->stream = stream; in snd_pcm_new_stream()
675 sprintf(substream->name, "subdevice #%i", idx); in snd_pcm_new_stream()
676 substream->buffer_bytes_max = UINT_MAX; in snd_pcm_new_stream()
678 pstr->substream = substream; in snd_pcm_new_stream()
680 prev->next = substream; in snd_pcm_new_stream()
683 err = snd_pcm_substream_proc_init(substream); in snd_pcm_new_stream()
688 pstr->substream = NULL; in snd_pcm_new_stream()
691 kfree(substream); in snd_pcm_new_stream()
695 substream->group = &substream->self_group; in snd_pcm_new_stream()
696 snd_pcm_group_init(&substream->self_group); in snd_pcm_new_stream()
697 list_add_tail(&substream->link_list, &substream->self_group.substreams); in snd_pcm_new_stream()
698 atomic_set(&substream->mmap_count, 0); in snd_pcm_new_stream()
699 prev = substream; in snd_pcm_new_stream()
826 struct snd_pcm_substream *substream, *substream_next; in snd_pcm_free_stream() local
834 substream = pstr->substream; in snd_pcm_free_stream()
835 while (substream) { in snd_pcm_free_stream()
836 substream_next = substream->next; in snd_pcm_free_stream()
837 snd_pcm_timer_done(substream); in snd_pcm_free_stream()
838 kfree(substream); in snd_pcm_free_stream()
839 substream = substream_next; in snd_pcm_free_stream()
890 struct snd_pcm_substream *substream; in snd_pcm_attach_substream() local
903 if (pstr->substream == NULL || pstr->substream_count == 0) in snd_pcm_attach_substream()
912 for (substream = pcm->streams[opposite].substream; substream; in snd_pcm_attach_substream()
913 substream = substream->next) { in snd_pcm_attach_substream()
914 if (SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
923 substream = pstr->substream; in snd_pcm_attach_substream()
925 for (substream = pstr->substream; substream; in snd_pcm_attach_substream()
926 substream = substream->next) in snd_pcm_attach_substream()
927 if (substream->number == prefer_subdevice) in snd_pcm_attach_substream()
930 if (! substream) in snd_pcm_attach_substream()
932 if (! SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
934 substream->ref_count++; in snd_pcm_attach_substream()
935 *rsubstream = substream; in snd_pcm_attach_substream()
939 for (substream = pstr->substream; substream; substream = substream->next) { in snd_pcm_attach_substream()
940 if (!SUBSTREAM_BUSY(substream) && in snd_pcm_attach_substream()
942 substream->number == prefer_subdevice)) in snd_pcm_attach_substream()
945 if (substream == NULL) in snd_pcm_attach_substream()
977 substream->runtime = runtime; in snd_pcm_attach_substream()
978 substream->private_data = pcm->private_data; in snd_pcm_attach_substream()
979 substream->ref_count = 1; in snd_pcm_attach_substream()
980 substream->f_flags = file->f_flags; in snd_pcm_attach_substream()
981 substream->pid = get_pid(task_pid(current)); in snd_pcm_attach_substream()
983 *rsubstream = substream; in snd_pcm_attach_substream()
987 void snd_pcm_detach_substream(struct snd_pcm_substream *substream) in snd_pcm_detach_substream() argument
991 if (PCM_RUNTIME_CHECK(substream)) in snd_pcm_detach_substream()
993 runtime = substream->runtime; in snd_pcm_detach_substream()
1002 if (substream->timer) { in snd_pcm_detach_substream()
1003 spin_lock_irq(&substream->timer->lock); in snd_pcm_detach_substream()
1004 substream->runtime = NULL; in snd_pcm_detach_substream()
1005 spin_unlock_irq(&substream->timer->lock); in snd_pcm_detach_substream()
1007 substream->runtime = NULL; in snd_pcm_detach_substream()
1012 put_pid(substream->pid); in snd_pcm_detach_substream()
1013 substream->pid = NULL; in snd_pcm_detach_substream()
1014 substream->pstr->substream_opened--; in snd_pcm_detach_substream()
1055 struct snd_pcm_substream *substream; in snd_pcm_dev_register() local
1068 if (pcm->streams[cidx].substream == NULL) in snd_pcm_dev_register()
1087 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) in snd_pcm_dev_register()
1088 snd_pcm_timer_init(substream); in snd_pcm_dev_register()
1101 struct snd_pcm_substream *substream; in snd_pcm_dev_disconnect() local
1109 for_each_pcm_substream(pcm, cidx, substream) { in snd_pcm_dev_disconnect()
1110 snd_pcm_stream_lock_irq(substream); in snd_pcm_dev_disconnect()
1111 if (substream->runtime) { in snd_pcm_dev_disconnect()
1112 if (snd_pcm_running(substream)) in snd_pcm_dev_disconnect()
1113 snd_pcm_stop(substream, SNDRV_PCM_STATE_DISCONNECTED); in snd_pcm_dev_disconnect()
1115 __snd_pcm_set_state(substream->runtime, in snd_pcm_dev_disconnect()
1117 wake_up(&substream->runtime->sleep); in snd_pcm_dev_disconnect()
1118 wake_up(&substream->runtime->tsleep); in snd_pcm_dev_disconnect()
1120 snd_pcm_stream_unlock_irq(substream); in snd_pcm_dev_disconnect()
1123 for_each_pcm_substream(pcm, cidx, substream) in snd_pcm_dev_disconnect()
1124 snd_pcm_sync_stop(substream, false); in snd_pcm_dev_disconnect()
1187 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) in snd_pcm_proc_read()
1190 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) in snd_pcm_proc_read()