diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-10-10 05:49:49 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-11-04 07:17:47 -0500 |
commit | 07799e756c76ecd52cb01a812ba48b7d8ac67633 (patch) | |
tree | 5b6a006d90e631e6b70264aba355314a7cedbbe5 /sound | |
parent | 7c22f1aaa23370bf9ba2dd3abbccbed70dced216 (diff) |
[ALSA] Use getnstimeofday()
Modules: Documentation,PCM Midlevel,Timer Midlevel,ALSA Core
Use the standard getnstimeofday() function instead of ALSA's own one.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/pcm_lib.c | 2 | ||||
-rw-r--r-- | sound/core/pcm_native.c | 14 | ||||
-rw-r--r-- | sound/core/timer.c | 6 |
3 files changed, 8 insertions, 14 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index dfc5f45f2748..3dbf9bf2ac16 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -152,7 +152,7 @@ static inline snd_pcm_uframes_t snd_pcm_update_hw_ptr_pos(snd_pcm_substream_t *s | |||
152 | if (pos == SNDRV_PCM_POS_XRUN) | 152 | if (pos == SNDRV_PCM_POS_XRUN) |
153 | return pos; /* XRUN */ | 153 | return pos; /* XRUN */ |
154 | if (runtime->tstamp_mode & SNDRV_PCM_TSTAMP_MMAP) | 154 | if (runtime->tstamp_mode & SNDRV_PCM_TSTAMP_MMAP) |
155 | snd_timestamp_now((snd_timestamp_t*)&runtime->status->tstamp, runtime->tstamp_timespec); | 155 | getnstimeofday((struct timespec *)&runtime->status->tstamp); |
156 | #ifdef CONFIG_SND_DEBUG | 156 | #ifdef CONFIG_SND_DEBUG |
157 | if (pos >= runtime->buffer_size) { | 157 | if (pos >= runtime->buffer_size) { |
158 | snd_printk(KERN_ERR "BUG: stream = %i, pos = 0x%lx, buffer size = 0x%lx, period size = 0x%lx\n", substream->stream, pos, runtime->buffer_size, runtime->period_size); | 158 | snd_printk(KERN_ERR "BUG: stream = %i, pos = 0x%lx, buffer size = 0x%lx, period size = 0x%lx\n", substream->stream, pos, runtime->buffer_size, runtime->period_size); |
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index e6e2b70314c0..a1924f12d8fc 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -565,9 +565,9 @@ int snd_pcm_status(snd_pcm_substream_t *substream, | |||
565 | if (runtime->tstamp_mode & SNDRV_PCM_TSTAMP_MMAP) | 565 | if (runtime->tstamp_mode & SNDRV_PCM_TSTAMP_MMAP) |
566 | status->tstamp = runtime->status->tstamp; | 566 | status->tstamp = runtime->status->tstamp; |
567 | else | 567 | else |
568 | snd_timestamp_now(&status->tstamp, runtime->tstamp_timespec); | 568 | getnstimeofday(&status->tstamp); |
569 | } else | 569 | } else |
570 | snd_timestamp_now(&status->tstamp, runtime->tstamp_timespec); | 570 | getnstimeofday(&status->tstamp); |
571 | status->appl_ptr = runtime->control->appl_ptr; | 571 | status->appl_ptr = runtime->control->appl_ptr; |
572 | status->hw_ptr = runtime->status->hw_ptr; | 572 | status->hw_ptr = runtime->status->hw_ptr; |
573 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 573 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
@@ -652,7 +652,7 @@ static void snd_pcm_trigger_tstamp(snd_pcm_substream_t *substream) | |||
652 | if (runtime->trigger_master == NULL) | 652 | if (runtime->trigger_master == NULL) |
653 | return; | 653 | return; |
654 | if (runtime->trigger_master == substream) { | 654 | if (runtime->trigger_master == substream) { |
655 | snd_timestamp_now(&runtime->trigger_tstamp, runtime->tstamp_timespec); | 655 | getnstimeofday(&runtime->trigger_tstamp); |
656 | } else { | 656 | } else { |
657 | snd_pcm_trigger_tstamp(runtime->trigger_master); | 657 | snd_pcm_trigger_tstamp(runtime->trigger_master); |
658 | runtime->trigger_tstamp = runtime->trigger_master->runtime->trigger_tstamp; | 658 | runtime->trigger_tstamp = runtime->trigger_master->runtime->trigger_tstamp; |
@@ -2446,14 +2446,8 @@ static int snd_pcm_common_ioctl1(snd_pcm_substream_t *substream, | |||
2446 | return put_user(SNDRV_PCM_VERSION, (int __user *)arg) ? -EFAULT : 0; | 2446 | return put_user(SNDRV_PCM_VERSION, (int __user *)arg) ? -EFAULT : 0; |
2447 | case SNDRV_PCM_IOCTL_INFO: | 2447 | case SNDRV_PCM_IOCTL_INFO: |
2448 | return snd_pcm_info_user(substream, arg); | 2448 | return snd_pcm_info_user(substream, arg); |
2449 | case SNDRV_PCM_IOCTL_TSTAMP: | 2449 | case SNDRV_PCM_IOCTL_TSTAMP: /* just for compatibility */ |
2450 | { | ||
2451 | int xarg; | ||
2452 | if (get_user(xarg, (int __user *)arg)) | ||
2453 | return -EFAULT; | ||
2454 | substream->runtime->tstamp_timespec = xarg ? 1 : 0; | ||
2455 | return 0; | 2450 | return 0; |
2456 | } | ||
2457 | case SNDRV_PCM_IOCTL_HW_REFINE: | 2451 | case SNDRV_PCM_IOCTL_HW_REFINE: |
2458 | return snd_pcm_hw_refine_user(substream, arg); | 2452 | return snd_pcm_hw_refine_user(substream, arg); |
2459 | case SNDRV_PCM_IOCTL_HW_PARAMS: | 2453 | case SNDRV_PCM_IOCTL_HW_PARAMS: |
diff --git a/sound/core/timer.c b/sound/core/timer.c index 128916c66085..8ecec9134acd 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c | |||
@@ -385,7 +385,7 @@ static void snd_timer_notify1(snd_timer_instance_t *ti, enum sndrv_timer_event e | |||
385 | struct list_head *n; | 385 | struct list_head *n; |
386 | struct timespec tstamp; | 386 | struct timespec tstamp; |
387 | 387 | ||
388 | snd_timestamp_now(&tstamp, 1); | 388 | getnstimeofday(&tstamp); |
389 | snd_assert(event >= SNDRV_TIMER_EVENT_START && event <= SNDRV_TIMER_EVENT_PAUSE, return); | 389 | snd_assert(event >= SNDRV_TIMER_EVENT_START && event <= SNDRV_TIMER_EVENT_PAUSE, return); |
390 | if (event == SNDRV_TIMER_EVENT_START || event == SNDRV_TIMER_EVENT_CONTINUE) | 390 | if (event == SNDRV_TIMER_EVENT_START || event == SNDRV_TIMER_EVENT_CONTINUE) |
391 | resolution = snd_timer_resolution(ti); | 391 | resolution = snd_timer_resolution(ti); |
@@ -1156,14 +1156,14 @@ static void snd_timer_user_tinterrupt(snd_timer_instance_t *timeri, | |||
1156 | struct timespec tstamp; | 1156 | struct timespec tstamp; |
1157 | int prev, append = 0; | 1157 | int prev, append = 0; |
1158 | 1158 | ||
1159 | snd_timestamp_zero(&tstamp); | 1159 | memset(&tstamp, 0, sizeof(tstamp)); |
1160 | spin_lock(&tu->qlock); | 1160 | spin_lock(&tu->qlock); |
1161 | if ((tu->filter & ((1 << SNDRV_TIMER_EVENT_RESOLUTION)|(1 << SNDRV_TIMER_EVENT_TICK))) == 0) { | 1161 | if ((tu->filter & ((1 << SNDRV_TIMER_EVENT_RESOLUTION)|(1 << SNDRV_TIMER_EVENT_TICK))) == 0) { |
1162 | spin_unlock(&tu->qlock); | 1162 | spin_unlock(&tu->qlock); |
1163 | return; | 1163 | return; |
1164 | } | 1164 | } |
1165 | if (tu->last_resolution != resolution || ticks > 0) | 1165 | if (tu->last_resolution != resolution || ticks > 0) |
1166 | snd_timestamp_now(&tstamp, 1); | 1166 | getnstimeofday(&tstamp); |
1167 | if ((tu->filter & (1 << SNDRV_TIMER_EVENT_RESOLUTION)) && tu->last_resolution != resolution) { | 1167 | if ((tu->filter & (1 << SNDRV_TIMER_EVENT_RESOLUTION)) && tu->last_resolution != resolution) { |
1168 | r1.event = SNDRV_TIMER_EVENT_RESOLUTION; | 1168 | r1.event = SNDRV_TIMER_EVENT_RESOLUTION; |
1169 | r1.tstamp = tstamp; | 1169 | r1.tstamp = tstamp; |