diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-10-01 02:27:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-01 03:39:19 -0400 |
commit | 9442e691e4aec85eba43ac60a3e77c77fd2e73a4 (patch) | |
tree | 51314e5fcf6c023788df67a130cb6e692e5df496 /include | |
parent | 5c87579e65ee4f419b2369407f82326d38b5d2d8 (diff) |
[PATCH] maximum latency tracking: ALSA support
Add maximum latency tracking to the ALSA subsystem for PCM playback. In
ALSA, the playback application controls the buffer size and thus indirectly
the period of latency that it can deal with. This patch uses 75% of the
total available latency as threshold to announce to the latency subsystem;
While 75% is a crude heuristic it's a quite reasonable one; the remaining
25% can be used for all driver processing for the next samples which is
also proportional to the size of the buffer.
With ogg123 a latency setting of about 4msec was seen (at 44Khz), while
with the "play" command a much longer maximum tolerable latency was seen.
Other, more multimedia oriented players as well as games, will have a lot
smaller buffers to allow better synchronization and those will actually get
into the latency domains where there is impact on the power management
rules.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/sound/pcm.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 60d40b34efc0..afaf3e88e086 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -347,6 +347,7 @@ struct snd_pcm_substream { | |||
347 | int number; | 347 | int number; |
348 | char name[32]; /* substream name */ | 348 | char name[32]; /* substream name */ |
349 | int stream; /* stream (direction) */ | 349 | int stream; /* stream (direction) */ |
350 | char latency_id[20]; /* latency identifier */ | ||
350 | size_t buffer_bytes_max; /* limit ring buffer size */ | 351 | size_t buffer_bytes_max; /* limit ring buffer size */ |
351 | struct snd_dma_buffer dma_buffer; | 352 | struct snd_dma_buffer dma_buffer; |
352 | unsigned int dma_buf_id; | 353 | unsigned int dma_buf_id; |