• Home
  • Raw
  • Download

Lines Matching refs:substream

114 			struct snd_pcm_substream *substream;  in snd_pcm_control_ioctl()  local
141 for (substream = pstr->substream; substream; in snd_pcm_control_ioctl()
142 substream = substream->next) in snd_pcm_control_ioctl()
143 if (substream->number == (int)subdevice) in snd_pcm_control_ioctl()
145 if (substream == NULL) { in snd_pcm_control_ioctl()
149 err = snd_pcm_info_user(substream, info); in snd_pcm_control_ioctl()
326 static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream, in snd_pcm_proc_info_read() argument
332 if (! substream) in snd_pcm_proc_info_read()
341 err = snd_pcm_info(substream, info); in snd_pcm_proc_info_read()
364 snd_pcm_proc_info_read(((struct snd_pcm_str *)entry->private_data)->substream, in snd_pcm_stream_proc_info_read()
377 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_hw_params_read() local
380 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
381 runtime = substream->runtime; in snd_pcm_substream_proc_hw_params_read()
398 if (substream->oss.oss) { in snd_pcm_substream_proc_hw_params_read()
408 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
414 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_sw_params_read() local
417 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
418 runtime = substream->runtime; in snd_pcm_substream_proc_sw_params_read()
436 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
442 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_substream_proc_status_read() local
447 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
448 runtime = substream->runtime; in snd_pcm_substream_proc_status_read()
454 err = snd_pcm_status(substream, &status); in snd_pcm_substream_proc_status_read()
460 snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid)); in snd_pcm_substream_proc_status_read()
472 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
549 static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) in snd_pcm_substream_proc_init() argument
555 card = substream->pcm->card; in snd_pcm_substream_proc_init()
557 sprintf(name, "sub%i", substream->number); in snd_pcm_substream_proc_init()
558 if ((entry = snd_info_create_card_entry(card, name, substream->pstr->proc_root)) == NULL) in snd_pcm_substream_proc_init()
565 substream->proc_root = entry; in snd_pcm_substream_proc_init()
567 if ((entry = snd_info_create_card_entry(card, "info", substream->proc_root)) != NULL) { in snd_pcm_substream_proc_init()
568 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
575 substream->proc_info_entry = entry; in snd_pcm_substream_proc_init()
577 if ((entry = snd_info_create_card_entry(card, "hw_params", substream->proc_root)) != NULL) { in snd_pcm_substream_proc_init()
578 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
585 substream->proc_hw_params_entry = entry; in snd_pcm_substream_proc_init()
587 if ((entry = snd_info_create_card_entry(card, "sw_params", substream->proc_root)) != NULL) { in snd_pcm_substream_proc_init()
588 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
595 substream->proc_sw_params_entry = entry; in snd_pcm_substream_proc_init()
597 if ((entry = snd_info_create_card_entry(card, "status", substream->proc_root)) != NULL) { in snd_pcm_substream_proc_init()
598 snd_info_set_text_ops(entry, substream, in snd_pcm_substream_proc_init()
605 substream->proc_status_entry = entry; in snd_pcm_substream_proc_init()
610 static int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) in snd_pcm_substream_proc_done() argument
612 snd_info_free_entry(substream->proc_info_entry); in snd_pcm_substream_proc_done()
613 substream->proc_info_entry = NULL; in snd_pcm_substream_proc_done()
614 snd_info_free_entry(substream->proc_hw_params_entry); in snd_pcm_substream_proc_done()
615 substream->proc_hw_params_entry = NULL; in snd_pcm_substream_proc_done()
616 snd_info_free_entry(substream->proc_sw_params_entry); in snd_pcm_substream_proc_done()
617 substream->proc_sw_params_entry = NULL; in snd_pcm_substream_proc_done()
618 snd_info_free_entry(substream->proc_status_entry); in snd_pcm_substream_proc_done()
619 substream->proc_status_entry = NULL; in snd_pcm_substream_proc_done()
620 snd_info_free_entry(substream->proc_root); in snd_pcm_substream_proc_done()
621 substream->proc_root = NULL; in snd_pcm_substream_proc_done()
627 static inline int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) { return 0; } in snd_pcm_substream_proc_init() argument
628 static inline int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) { return 0; } in snd_pcm_substream_proc_done() argument
648 struct snd_pcm_substream *substream, *prev; in snd_pcm_new_stream() local
665 substream = kzalloc(sizeof(*substream), GFP_KERNEL); in snd_pcm_new_stream()
666 if (substream == NULL) { in snd_pcm_new_stream()
670 substream->pcm = pcm; in snd_pcm_new_stream()
671 substream->pstr = pstr; in snd_pcm_new_stream()
672 substream->number = idx; in snd_pcm_new_stream()
673 substream->stream = stream; in snd_pcm_new_stream()
674 sprintf(substream->name, "subdevice #%i", idx); in snd_pcm_new_stream()
675 substream->buffer_bytes_max = UINT_MAX; in snd_pcm_new_stream()
677 pstr->substream = substream; in snd_pcm_new_stream()
679 prev->next = substream; in snd_pcm_new_stream()
682 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 spin_lock_init(&substream->self_group.lock); in snd_pcm_new_stream()
695 INIT_LIST_HEAD(&substream->self_group.substreams); in snd_pcm_new_stream()
696 list_add_tail(&substream->link_list, &substream->self_group.substreams); in snd_pcm_new_stream()
697 atomic_set(&substream->mmap_count, 0); in snd_pcm_new_stream()
698 prev = substream; in snd_pcm_new_stream()
805 struct snd_pcm_substream *substream, *substream_next; in snd_pcm_free_stream() local
809 substream = pstr->substream; in snd_pcm_free_stream()
810 while (substream) { in snd_pcm_free_stream()
811 substream_next = substream->next; in snd_pcm_free_stream()
812 snd_pcm_timer_done(substream); in snd_pcm_free_stream()
813 snd_pcm_substream_proc_done(substream); in snd_pcm_free_stream()
814 kfree(substream); in snd_pcm_free_stream()
815 substream = substream_next; in snd_pcm_free_stream()
856 struct snd_pcm_substream *substream; in snd_pcm_attach_substream() local
867 if (pstr->substream == NULL || pstr->substream_count == 0) in snd_pcm_attach_substream()
884 …for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; substream; substream = substrea… in snd_pcm_attach_substream()
885 if (SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
892 …for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substre… in snd_pcm_attach_substream()
893 if (SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
906 substream = pstr->substream; in snd_pcm_attach_substream()
908 for (substream = pstr->substream; substream; in snd_pcm_attach_substream()
909 substream = substream->next) in snd_pcm_attach_substream()
910 if (substream->number == prefer_subdevice) in snd_pcm_attach_substream()
913 if (! substream) in snd_pcm_attach_substream()
915 if (! SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
917 substream->ref_count++; in snd_pcm_attach_substream()
918 *rsubstream = substream; in snd_pcm_attach_substream()
923 for (substream = pstr->substream; substream; substream = substream->next) in snd_pcm_attach_substream()
924 if (!SUBSTREAM_BUSY(substream) && substream->number == prefer_subdevice) in snd_pcm_attach_substream()
927 for (substream = pstr->substream; substream; substream = substream->next) in snd_pcm_attach_substream()
928 if (!SUBSTREAM_BUSY(substream)) in snd_pcm_attach_substream()
931 if (substream == NULL) in snd_pcm_attach_substream()
961 substream->runtime = runtime; in snd_pcm_attach_substream()
962 substream->private_data = pcm->private_data; in snd_pcm_attach_substream()
963 substream->ref_count = 1; in snd_pcm_attach_substream()
964 substream->f_flags = file->f_flags; in snd_pcm_attach_substream()
965 substream->pid = get_pid(task_pid(current)); in snd_pcm_attach_substream()
967 *rsubstream = substream; in snd_pcm_attach_substream()
971 void snd_pcm_detach_substream(struct snd_pcm_substream *substream) in snd_pcm_detach_substream() argument
975 if (PCM_RUNTIME_CHECK(substream)) in snd_pcm_detach_substream()
977 runtime = substream->runtime; in snd_pcm_detach_substream()
989 substream->runtime = NULL; in snd_pcm_detach_substream()
990 put_pid(substream->pid); in snd_pcm_detach_substream()
991 substream->pid = NULL; in snd_pcm_detach_substream()
992 substream->pstr->substream_opened--; in snd_pcm_detach_substream()
1021 struct snd_pcm_substream *substream; in snd_pcm_dev_register() local
1038 if (pcm->streams[cidx].substream == NULL || pcm->internal) in snd_pcm_dev_register()
1068 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) in snd_pcm_dev_register()
1069 snd_pcm_timer_init(substream); in snd_pcm_dev_register()
1083 struct snd_pcm_substream *substream; in snd_pcm_dev_disconnect() local
1094 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) { in snd_pcm_dev_disconnect()
1095 snd_pcm_stream_lock_irq(substream); in snd_pcm_dev_disconnect()
1096 if (substream->runtime) { in snd_pcm_dev_disconnect()
1097 substream->runtime->status->state = SNDRV_PCM_STATE_DISCONNECTED; in snd_pcm_dev_disconnect()
1098 wake_up(&substream->runtime->sleep); in snd_pcm_dev_disconnect()
1099 wake_up(&substream->runtime->tsleep); in snd_pcm_dev_disconnect()
1101 snd_pcm_stream_unlock_irq(substream); in snd_pcm_dev_disconnect()
1167 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) in snd_pcm_proc_read()
1170 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) in snd_pcm_proc_read()