aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/pcm.c')
-rw-r--r--sound/core/pcm.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index c69c60b2a48a..0d428d0896db 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -435,6 +435,7 @@ static void snd_pcm_substream_proc_status_read(struct snd_info_entry *entry,
435 return; 435 return;
436 } 436 }
437 snd_iprintf(buffer, "state: %s\n", snd_pcm_state_name(status.state)); 437 snd_iprintf(buffer, "state: %s\n", snd_pcm_state_name(status.state));
438 snd_iprintf(buffer, "owner_pid : %d\n", pid_vnr(substream->pid));
438 snd_iprintf(buffer, "trigger_time: %ld.%09ld\n", 439 snd_iprintf(buffer, "trigger_time: %ld.%09ld\n",
439 status.trigger_tstamp.tv_sec, status.trigger_tstamp.tv_nsec); 440 status.trigger_tstamp.tv_sec, status.trigger_tstamp.tv_nsec);
440 snd_iprintf(buffer, "tstamp : %ld.%09ld\n", 441 snd_iprintf(buffer, "tstamp : %ld.%09ld\n",
@@ -809,7 +810,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
809 card = pcm->card; 810 card = pcm->card;
810 read_lock(&card->ctl_files_rwlock); 811 read_lock(&card->ctl_files_rwlock);
811 list_for_each_entry(kctl, &card->ctl_files, list) { 812 list_for_each_entry(kctl, &card->ctl_files, list) {
812 if (kctl->pid == current->pid) { 813 if (kctl->pid == task_pid(current)) {
813 prefer_subdevice = kctl->prefer_pcm_subdevice; 814 prefer_subdevice = kctl->prefer_pcm_subdevice;
814 if (prefer_subdevice != -1) 815 if (prefer_subdevice != -1)
815 break; 816 break;
@@ -893,6 +894,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
893 memset((void*)runtime->control, 0, size); 894 memset((void*)runtime->control, 0, size);
894 895
895 init_waitqueue_head(&runtime->sleep); 896 init_waitqueue_head(&runtime->sleep);
897 init_waitqueue_head(&runtime->tsleep);
896 898
897 runtime->status->state = SNDRV_PCM_STATE_OPEN; 899 runtime->status->state = SNDRV_PCM_STATE_OPEN;
898 900
@@ -900,6 +902,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
900 substream->private_data = pcm->private_data; 902 substream->private_data = pcm->private_data;
901 substream->ref_count = 1; 903 substream->ref_count = 1;
902 substream->f_flags = file->f_flags; 904 substream->f_flags = file->f_flags;
905 substream->pid = get_pid(task_pid(current));
903 pstr->substream_opened++; 906 pstr->substream_opened++;
904 *rsubstream = substream; 907 *rsubstream = substream;
905 return 0; 908 return 0;
@@ -919,8 +922,14 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream)
919 snd_free_pages((void*)runtime->control, 922 snd_free_pages((void*)runtime->control,
920 PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control))); 923 PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control)));
921 kfree(runtime->hw_constraints.rules); 924 kfree(runtime->hw_constraints.rules);
925#ifdef CONFIG_SND_PCM_XRUN_DEBUG
926 if (runtime->hwptr_log)
927 kfree(runtime->hwptr_log);
928#endif
922 kfree(runtime); 929 kfree(runtime);
923 substream->runtime = NULL; 930 substream->runtime = NULL;
931 put_pid(substream->pid);
932 substream->pid = NULL;
924 substream->pstr->substream_opened--; 933 substream->pstr->substream_opened--;
925} 934}
926 935