diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-01-08 12:09:57 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:29:47 -0500 |
commit | 31e8960b35975ed235d283d6fb95d0e28dffded0 (patch) | |
tree | f084becc6e5dbec3efa1d79d0961facd68e585f9 /sound/core/pcm_native.c | |
parent | 130755108ba03461f69da990e54e02a254accd23 (diff) |
[ALSA] Remove PCM sleep_min and tick
The 'tick' in PCM is set (again) via sw_params. And, nobody uses
this feature at all except for a command line option of aplay.
(This is literally 'nobody', as I checked alsa-lib API calls in all
programs in major distros.)
Above all, if we need finer wake-ups for the position update, it's
basically an issue that the driver should solve, not tuned by each
application.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/core/pcm_native.c')
-rw-r--r-- | sound/core/pcm_native.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 3c22d78ee8f4..d6b4e6b6108f 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -413,7 +413,6 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream, | |||
413 | runtime->period_size = params_period_size(params); | 413 | runtime->period_size = params_period_size(params); |
414 | runtime->periods = params_periods(params); | 414 | runtime->periods = params_periods(params); |
415 | runtime->buffer_size = params_buffer_size(params); | 415 | runtime->buffer_size = params_buffer_size(params); |
416 | runtime->tick_time = params_tick_time(params); | ||
417 | runtime->info = params->info; | 416 | runtime->info = params->info; |
418 | runtime->rate_num = params->rate_num; | 417 | runtime->rate_num = params->rate_num; |
419 | runtime->rate_den = params->rate_den; | 418 | runtime->rate_den = params->rate_den; |
@@ -433,7 +432,6 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream, | |||
433 | /* Default sw params */ | 432 | /* Default sw params */ |
434 | runtime->tstamp_mode = SNDRV_PCM_TSTAMP_NONE; | 433 | runtime->tstamp_mode = SNDRV_PCM_TSTAMP_NONE; |
435 | runtime->period_step = 1; | 434 | runtime->period_step = 1; |
436 | runtime->sleep_min = 0; | ||
437 | runtime->control->avail_min = runtime->period_size; | 435 | runtime->control->avail_min = runtime->period_size; |
438 | runtime->start_threshold = 1; | 436 | runtime->start_threshold = 1; |
439 | runtime->stop_threshold = runtime->buffer_size; | 437 | runtime->stop_threshold = runtime->buffer_size; |
@@ -542,7 +540,6 @@ static int snd_pcm_sw_params(struct snd_pcm_substream *substream, | |||
542 | } | 540 | } |
543 | snd_pcm_stream_lock_irq(substream); | 541 | snd_pcm_stream_lock_irq(substream); |
544 | runtime->tstamp_mode = params->tstamp_mode; | 542 | runtime->tstamp_mode = params->tstamp_mode; |
545 | runtime->sleep_min = params->sleep_min; | ||
546 | runtime->period_step = params->period_step; | 543 | runtime->period_step = params->period_step; |
547 | runtime->control->avail_min = params->avail_min; | 544 | runtime->control->avail_min = params->avail_min; |
548 | runtime->start_threshold = params->start_threshold; | 545 | runtime->start_threshold = params->start_threshold; |
@@ -551,10 +548,6 @@ static int snd_pcm_sw_params(struct snd_pcm_substream *substream, | |||
551 | runtime->silence_size = params->silence_size; | 548 | runtime->silence_size = params->silence_size; |
552 | params->boundary = runtime->boundary; | 549 | params->boundary = runtime->boundary; |
553 | if (snd_pcm_running(substream)) { | 550 | if (snd_pcm_running(substream)) { |
554 | if (runtime->sleep_min) | ||
555 | snd_pcm_tick_prepare(substream); | ||
556 | else | ||
557 | snd_pcm_tick_set(substream, 0); | ||
558 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && | 551 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && |
559 | runtime->silence_size > 0) | 552 | runtime->silence_size > 0) |
560 | snd_pcm_playback_silence(substream, ULONG_MAX); | 553 | snd_pcm_playback_silence(substream, ULONG_MAX); |
@@ -865,8 +858,6 @@ static void snd_pcm_post_start(struct snd_pcm_substream *substream, int state) | |||
865 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && | 858 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && |
866 | runtime->silence_size > 0) | 859 | runtime->silence_size > 0) |
867 | snd_pcm_playback_silence(substream, ULONG_MAX); | 860 | snd_pcm_playback_silence(substream, ULONG_MAX); |
868 | if (runtime->sleep_min) | ||
869 | snd_pcm_tick_prepare(substream); | ||
870 | if (substream->timer) | 861 | if (substream->timer) |
871 | snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MSTART, | 862 | snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MSTART, |
872 | &runtime->trigger_tstamp); | 863 | &runtime->trigger_tstamp); |
@@ -920,7 +911,6 @@ static void snd_pcm_post_stop(struct snd_pcm_substream *substream, int state) | |||
920 | snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MSTOP, | 911 | snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MSTOP, |
921 | &runtime->trigger_tstamp); | 912 | &runtime->trigger_tstamp); |
922 | runtime->status->state = state; | 913 | runtime->status->state = state; |
923 | snd_pcm_tick_set(substream, 0); | ||
924 | } | 914 | } |
925 | wake_up(&runtime->sleep); | 915 | wake_up(&runtime->sleep); |
926 | } | 916 | } |
@@ -1004,12 +994,9 @@ static void snd_pcm_post_pause(struct snd_pcm_substream *substream, int push) | |||
1004 | snd_timer_notify(substream->timer, | 994 | snd_timer_notify(substream->timer, |
1005 | SNDRV_TIMER_EVENT_MPAUSE, | 995 | SNDRV_TIMER_EVENT_MPAUSE, |
1006 | &runtime->trigger_tstamp); | 996 | &runtime->trigger_tstamp); |
1007 | snd_pcm_tick_set(substream, 0); | ||
1008 | wake_up(&runtime->sleep); | 997 | wake_up(&runtime->sleep); |
1009 | } else { | 998 | } else { |
1010 | runtime->status->state = SNDRV_PCM_STATE_RUNNING; | 999 | runtime->status->state = SNDRV_PCM_STATE_RUNNING; |
1011 | if (runtime->sleep_min) | ||
1012 | snd_pcm_tick_prepare(substream); | ||
1013 | if (substream->timer) | 1000 | if (substream->timer) |
1014 | snd_timer_notify(substream->timer, | 1001 | snd_timer_notify(substream->timer, |
1015 | SNDRV_TIMER_EVENT_MCONTINUE, | 1002 | SNDRV_TIMER_EVENT_MCONTINUE, |
@@ -1064,7 +1051,6 @@ static void snd_pcm_post_suspend(struct snd_pcm_substream *substream, int state) | |||
1064 | &runtime->trigger_tstamp); | 1051 | &runtime->trigger_tstamp); |
1065 | runtime->status->suspended_state = runtime->status->state; | 1052 | runtime->status->suspended_state = runtime->status->state; |
1066 | runtime->status->state = SNDRV_PCM_STATE_SUSPENDED; | 1053 | runtime->status->state = SNDRV_PCM_STATE_SUSPENDED; |
1067 | snd_pcm_tick_set(substream, 0); | ||
1068 | wake_up(&runtime->sleep); | 1054 | wake_up(&runtime->sleep); |
1069 | } | 1055 | } |
1070 | 1056 | ||
@@ -1167,8 +1153,6 @@ static void snd_pcm_post_resume(struct snd_pcm_substream *substream, int state) | |||
1167 | snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MRESUME, | 1153 | snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MRESUME, |
1168 | &runtime->trigger_tstamp); | 1154 | &runtime->trigger_tstamp); |
1169 | runtime->status->state = runtime->status->suspended_state; | 1155 | runtime->status->state = runtime->status->suspended_state; |
1170 | if (runtime->sleep_min) | ||
1171 | snd_pcm_tick_prepare(substream); | ||
1172 | } | 1156 | } |
1173 | 1157 | ||
1174 | static struct action_ops snd_pcm_action_resume = { | 1158 | static struct action_ops snd_pcm_action_resume = { |
@@ -1997,8 +1981,6 @@ int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream) | |||
1997 | } | 1981 | } |
1998 | 1982 | ||
1999 | /* FIXME: this belong to lowlevel */ | 1983 | /* FIXME: this belong to lowlevel */ |
2000 | snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_TICK_TIME, | ||
2001 | 1000000 / HZ, 1000000 / HZ); | ||
2002 | snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIOD_SIZE); | 1984 | snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIOD_SIZE); |
2003 | 1985 | ||
2004 | return 0; | 1986 | return 0; |
@@ -2238,9 +2220,6 @@ static snd_pcm_sframes_t snd_pcm_playback_rewind(struct snd_pcm_substream *subst | |||
2238 | if (appl_ptr < 0) | 2220 | if (appl_ptr < 0) |
2239 | appl_ptr += runtime->boundary; | 2221 | appl_ptr += runtime->boundary; |
2240 | runtime->control->appl_ptr = appl_ptr; | 2222 | runtime->control->appl_ptr = appl_ptr; |
2241 | if (runtime->status->state == SNDRV_PCM_STATE_RUNNING && | ||
2242 | runtime->sleep_min) | ||
2243 | snd_pcm_tick_prepare(substream); | ||
2244 | ret = frames; | 2223 | ret = frames; |
2245 | __end: | 2224 | __end: |
2246 | snd_pcm_stream_unlock_irq(substream); | 2225 | snd_pcm_stream_unlock_irq(substream); |
@@ -2286,9 +2265,6 @@ static snd_pcm_sframes_t snd_pcm_capture_rewind(struct snd_pcm_substream *substr | |||
2286 | if (appl_ptr < 0) | 2265 | if (appl_ptr < 0) |
2287 | appl_ptr += runtime->boundary; | 2266 | appl_ptr += runtime->boundary; |
2288 | runtime->control->appl_ptr = appl_ptr; | 2267 | runtime->control->appl_ptr = appl_ptr; |
2289 | if (runtime->status->state == SNDRV_PCM_STATE_RUNNING && | ||
2290 | runtime->sleep_min) | ||
2291 | snd_pcm_tick_prepare(substream); | ||
2292 | ret = frames; | 2268 | ret = frames; |
2293 | __end: | 2269 | __end: |
2294 | snd_pcm_stream_unlock_irq(substream); | 2270 | snd_pcm_stream_unlock_irq(substream); |
@@ -2335,9 +2311,6 @@ static snd_pcm_sframes_t snd_pcm_playback_forward(struct snd_pcm_substream *subs | |||
2335 | if (appl_ptr >= (snd_pcm_sframes_t)runtime->boundary) | 2311 | if (appl_ptr >= (snd_pcm_sframes_t)runtime->boundary) |
2336 | appl_ptr -= runtime->boundary; | 2312 | appl_ptr -= runtime->boundary; |
2337 | runtime->control->appl_ptr = appl_ptr; | 2313 | runtime->control->appl_ptr = appl_ptr; |
2338 | if (runtime->status->state == SNDRV_PCM_STATE_RUNNING && | ||
2339 | runtime->sleep_min) | ||
2340 | snd_pcm_tick_prepare(substream); | ||
2341 | ret = frames; | 2314 | ret = frames; |
2342 | __end: | 2315 | __end: |
2343 | snd_pcm_stream_unlock_irq(substream); | 2316 | snd_pcm_stream_unlock_irq(substream); |
@@ -2384,9 +2357,6 @@ static snd_pcm_sframes_t snd_pcm_capture_forward(struct snd_pcm_substream *subst | |||
2384 | if (appl_ptr >= (snd_pcm_sframes_t)runtime->boundary) | 2357 | if (appl_ptr >= (snd_pcm_sframes_t)runtime->boundary) |
2385 | appl_ptr -= runtime->boundary; | 2358 | appl_ptr -= runtime->boundary; |
2386 | runtime->control->appl_ptr = appl_ptr; | 2359 | runtime->control->appl_ptr = appl_ptr; |
2387 | if (runtime->status->state == SNDRV_PCM_STATE_RUNNING && | ||
2388 | runtime->sleep_min) | ||
2389 | snd_pcm_tick_prepare(substream); | ||
2390 | ret = frames; | 2360 | ret = frames; |
2391 | __end: | 2361 | __end: |
2392 | snd_pcm_stream_unlock_irq(substream); | 2362 | snd_pcm_stream_unlock_irq(substream); |