Re: [PATCH] opti931: additional check for OPL3 device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/17/2007 12:39 PM, Clemens Ladisch wrote:

Rene Herman wrote:

At least 16 won't do -- the OPTi chip provides a 12-byte range. More
than 8 would work, but just +8 is fine. I have all OPTi ISA-PnP chips
(924, 925, 931, 933) and more aren't going to be produced. The 0x380
base is what it calls the OPL4Base and ALBase (AdLib) is at 0x388.

Are there chips that have both OPL4Base and ALBase?

Not as seperate PnP resources no. Here are pnpdumps for the 4 PnP chips:

http://members.home.nl/rene.herman/opti/

(yes, OPTi 933 is OPT0931 same as OPTi 931)

The chip can defer to external FM it seems, but even if there are
OPTi/OPL4 combo's out there in the wild (I sort of doubt it)

Why?

Because an OPL4 is fairly rarely seen as is and all OPTi (PnP) chips I have ever seen are on dirt cheap mass-market soundcards. It does not make a lot of sense from a business standpoint to put a cheap chip with integrated OPL3 on a card and then wire up an expensive OPL4 to it. Admittedly, some of early OPTi chips may have been somewhat less junky -- 931/3 are worst in that respect.

the driver's just doing opl3 anyway. ie, still needs just the +8.

Only the 93x driver; the 92x driver has OPL4 support.

You're right, somehow managed to miss that. According to the code, there's overlap with PnP at the 924 which is unfortunate since it means we can't just add 8 (unconditionally, nor when the area is larger than 8) to the PnP resource -- an OPL4 would be probed for at the wrong address.

How about this? This adds 8 to fm_port only if we're checking for an OPL3 at a 16-byte aligned address (such as the 0x380-0x3f0 from the PnP chips). Is still second guessing the user if (s)he supplied the value, but what can you do. Ack?

Rene.

diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index 60c120f..1f5af7b 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -1890,12 +1890,15 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card)
 			}
 		}
 #endif	/* !OPTi93X */
-		if (!opl3 && snd_opl3_create(card,
-					     chip->fm_port,
-					     chip->fm_port + 2,
-					     OPL3_HW_AUTO, 0, &opl3) < 0) {
-			snd_printk(KERN_WARNING "no OPL device at 0x%lx-0x%lx\n",
-				   chip->fm_port, chip->fm_port + 4 - 1);
+		if (!opl3) {
+			if ((chip->fm_port & 15) == 0)
+				chip->fm_port += 8;
+			error = snd_opl3_create(card, chip->fm_port,
+						chip->fm_port + 2,
+						OPL3_HW_AUTO, 0, &opl3);
+			if (error < 0)
+				snd_printk(KERN_WARNING "no OPL device at 0x%lx-0x%lx\n",
+					   chip->fm_port, chip->fm_port + 4 - 1);
 		}
 		if (opl3) {
 #ifdef CS4231
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux