diff options
author | James Courtier-Dutton <James@superbug.co.uk> | 2005-04-09 18:00:24 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-05-29 03:58:52 -0400 |
commit | 310bacd29230abf5f2a230159e48e983171e0f26 (patch) | |
tree | 16ae5d0cf14660de40db4435ebca0a64b1fcaf20 /sound/pci | |
parent | 001f758990d685e7023008763795f1970ef56614 (diff) |
[ALSA] Improve playback startup. Increase buffer size, and reduce xruns.
EMU10K1/EMU10K2 driver
Signed-off-by: James Courtier-Dutton <James@superbug.co.uk>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/emu10k1/p16v.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c index 8dd87838fb22..776761fe5577 100644 --- a/sound/pci/emu10k1/p16v.c +++ b/sound/pci/emu10k1/p16v.c | |||
@@ -124,9 +124,9 @@ static snd_pcm_hardware_t snd_p16v_playback_hw = { | |||
124 | .rate_max = 192000, | 124 | .rate_max = 192000, |
125 | .channels_min = 8, | 125 | .channels_min = 8, |
126 | .channels_max = 8, | 126 | .channels_max = 8, |
127 | .buffer_bytes_max = (32*1024), | 127 | .buffer_bytes_max = ((65536 - 64) * 8), |
128 | .period_bytes_min = 64, | 128 | .period_bytes_min = 64, |
129 | .period_bytes_max = (16*1024), | 129 | .period_bytes_max = (65536 - 64), |
130 | .periods_min = 2, | 130 | .periods_min = 2, |
131 | .periods_max = 8, | 131 | .periods_max = 8, |
132 | .fifo_size = 0, | 132 | .fifo_size = 0, |
@@ -347,7 +347,8 @@ static int snd_p16v_pcm_prepare_playback(snd_pcm_substream_t *substream) | |||
347 | snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_SIZE, channel, (runtime->periods - 1) << 19); | 347 | snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_SIZE, channel, (runtime->periods - 1) << 19); |
348 | snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_PTR, channel, 0); | 348 | snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_PTR, channel, 0); |
349 | snd_emu10k1_ptr20_write(emu, PLAYBACK_DMA_ADDR, channel, runtime->dma_addr); | 349 | snd_emu10k1_ptr20_write(emu, PLAYBACK_DMA_ADDR, channel, runtime->dma_addr); |
350 | snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, frames_to_bytes(runtime, runtime->period_size)<<16); // buffer size in bytes | 350 | //snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, frames_to_bytes(runtime, runtime->period_size)<<16); // buffer size in bytes |
351 | snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, 0); // buffer size in bytes | ||
351 | snd_emu10k1_ptr20_write(emu, PLAYBACK_POINTER, channel, 0); | 352 | snd_emu10k1_ptr20_write(emu, PLAYBACK_POINTER, channel, 0); |
352 | snd_emu10k1_ptr20_write(emu, 0x07, channel, 0x0); | 353 | snd_emu10k1_ptr20_write(emu, 0x07, channel, 0x0); |
353 | snd_emu10k1_ptr20_write(emu, 0x08, channel, 0); | 354 | snd_emu10k1_ptr20_write(emu, 0x08, channel, 0); |
@@ -602,7 +603,7 @@ int snd_p16v_pcm(emu10k1_t *emu, int device, snd_pcm_t **rpcm) | |||
602 | if ((err = snd_pcm_lib_preallocate_pages(substream, | 603 | if ((err = snd_pcm_lib_preallocate_pages(substream, |
603 | SNDRV_DMA_TYPE_DEV, | 604 | SNDRV_DMA_TYPE_DEV, |
604 | snd_dma_pci_data(emu->pci), | 605 | snd_dma_pci_data(emu->pci), |
605 | 64*1024, 64*1024)) < 0) /* FIXME: 32*1024 for sound buffer, between 32and64 for Periods table. */ | 606 | ((65536 - 64) * 8), ((65536 - 64) * 8))) < 0) |
606 | return err; | 607 | return err; |
607 | //snd_printk("preallocate playback substream: err=%d\n", err); | 608 | //snd_printk("preallocate playback substream: err=%d\n", err); |
608 | } | 609 | } |