| 1 |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
|
| 2 |
index c8d9178..7d3bb15 100644
|
| 3 |
--- a/sound/pci/hda/hda_intel.c
|
| 4 |
+++ b/sound/pci/hda/hda_intel.c
|
| 5 |
@@ -1774,6 +1774,7 @@ azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
|
| 6 |
struct azx_pcm *apcm;
|
| 7 |
int pcm_dev = cpcm->device;
|
| 8 |
int s, err;
|
| 9 |
+ size_t prealloc_min = 64*1024; /* 64KB */
|
| 10 |
|
| 11 |
if (pcm_dev >= AZX_MAX_PCMS) {
|
| 12 |
snd_printk(KERN_ERR SFX "Invalid PCM device number %d\n",
|
| 13 |
@@ -1807,10 +1808,21 @@ azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
|
| 14 |
if (cpcm->stream[s].substreams)
|
| 15 |
snd_pcm_set_ops(pcm, s, &azx_pcm_ops);
|
| 16 |
}
|
| 17 |
+
|
| 18 |
/* buffer pre-allocation */
|
| 19 |
+
|
| 20 |
+ /* subtle, don't allocate a big buffer for modems...
|
| 21 |
+ * also, don't just test 32BIT_MASK, since azx supports
|
| 22 |
+ * 64-bit DMA in some cases.
|
| 23 |
+ */
|
| 24 |
+ /* lennart wants a 2.2MB buffer for 2sec of 48khz */
|
| 25 |
+ if (pcm->dev_class == SNDRV_PCM_CLASS_GENERIC &&
|
| 26 |
+ chip->pci->dma_mask >= DMA_32BIT_MASK)
|
| 27 |
+ prealloc_min = 4 * 1024 * 1024; /* 4MB */
|
| 28 |
+
|
| 29 |
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
|
| 30 |
snd_dma_pci_data(chip->pci),
|
| 31 |
- 1024 * 64, 32 * 1024 * 1024);
|
| 32 |
+ prealloc_min, 32 * 1024 * 1024);
|
| 33 |
return 0;
|
| 34 |
}
|
| 35 |
|