[alsa-devel] My PC has 6GB memory but the limitation of the alsa-driver is 4GB.

Takashi Iwai tiwai at suse.de
Mon Mar 16 18:37:31 CET 2009


At Tue, 17 Mar 2009 02:29:36 +0900,
Emmanuel Chanel wrote:
> 
> My result of "your original change"
> Attached file: alsa-info-090317-Daniel is the result of alsa-info.sh
> And alsa-driver-090317-Daniel-info.txt is script output.
> I could listen sounds with that modification.

OK, then apparently the DMA buffers have to be in 32bit, too.

There might be a missing register to set 64bit DMA for ATI chipset,
but right now it's safe to set 32bit DMA for them...

The below is the revised patch.  Could you check whether it works?


thanks,

Takashi

---
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 47a5833..8258a46 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2136,7 +2136,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
 				struct azx **rchip)
 {
 	struct azx *chip;
-	int i, err;
+	int i, err, rirb_32bit;
 	unsigned short gcap;
 	static struct snd_device_ops ops = {
 		.dev_free = azx_dev_free,
@@ -2218,12 +2218,26 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
 	pci_set_master(pci);
 	synchronize_irq(chip->irq);
 
+	/* ATI chips seems buggy about 64bit CORB/RIRB addresses */
+	if (chip->driver_type == AZX_DRIVER_ATI)
+		rirb_32bit = 1;
+	else
+		rirb_32bit = 0;
+
 	gcap = azx_readw(chip, GCAP);
 	snd_printdd("chipset global capabilities = 0x%x\n", gcap);
 
 	/* allow 64bit DMA address if supported by H/W */
-	if ((gcap & 0x01) && !pci_set_dma_mask(pci, DMA_64BIT_MASK))
-		pci_set_consistent_dma_mask(pci, DMA_64BIT_MASK);
+	if (rirb_32bit) {
+		if ((gcap & 0x01) && !pci_set_dma_mask(pci, DMA_64BIT_MASK))
+			pci_set_consistent_dma_mask(pci, DMA_64BIT_MASK);
+		else
+			rirb_32bit = 0;
+	}
+	if (!rirb_32bit) {
+		pci_set_dma_mask(pci, DMA_32BIT_MASK);
+		pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK);
+	}
 
 	/* read number of streams from GCAP register instead of using
 	 * hardcoded value


More information about the Alsa-devel mailing list