Sergei Vorobyov | 2 Jun 2002 23:12
Picon
Picon

VIA 8233A onboard sound controller

Hi,

sorry for disturbance, but are there any available drivers/modules
or any plans to support the on-board AC97 sound controllers VIA 8233A 
(as found in the new MSI KT3 Ultra or ASUS A7V333 mobos)
in the linux kernel  2.4.19-pre8 or later?

Thanks,
Sergei Vorobyov
Information Technology/
Computing Science Department
Uppsala University
Box 337
S-751 05 Uppsala
Sweden
-
To unsubscribe from this list: send the line "unsubscribe linux-sound" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Gerald Teschl | 3 Jun 2002 14:03
Picon
Picon
Favicon

isapnp problems with opl3sa2

Hi,

first of all, I don't know C and I am no expert, so please apologize if 
some of
my questions/comments are stupid.

I have a yamaha based sound card which works with the opl3sa2 driver. 
However,
the isapnp activation of this card fails (this has been broken ever 
since the 2.4 series).
So I did some investigations and eventually found out that the reason is 
the following
check from isapnp_check_dma(..) in isapnp.c:

-------------
    /* Some machines allow DMA 0, but others don't. In fact on some
       boxes DMA 0 is the memory refresh. Play safe */

    if (dma < 1 || dma == 4 || dma > 7)
        return 1;
--------------

However, the opl3sa2 card insists on dma=0,dma2=1. In particular, if I 
change
"(dma < 1 || dma == 4 || dma > 7)" to "(dma < 0 || dma == 4 || dma > 7)" 
everything
works fine.

Now I am wondering what should be done:

(Continue reading)

Zwane Mwaikambo | 3 Jun 2002 16:23

Re: isapnp problems with opl3sa2

On Mon, 3 Jun 2002, Gerald Teschl wrote:

> the isapnp activation of this card fails (this has been broken ever 
> since the 2.4 series).So I did some investigations and eventually found 
> out that the reason is the following check from isapnp_check_dma(..) in 
> isapnp.c:

You should be able to load it without any parameters with ISAPNP, i have a 
box at home with that card which only requires a modprobe opl3sa2. Could 
you show me how you're loading it as well as dmesg and /proc/isapnp output 
after loading.

> A few further remarks concerning my patch:
> *) The patch also adds a line "opl3sa2_state[card].activated = 1" which 
> is an obvious omission in the original driver.

Thanks, put it right at the end before the return and i'll be happy.

> *) I have to force the driver to use both dma=0 and dma2=1. From what I
> understand dma=0 should be sufficient, but this will not work. Looks like
> a bug in isapnp.c to me. However, this should do no harm since according
> to /proc/isapnp, the card only offers these values anyway.

isapnp.c is fine

> -----------------------------------------------
> --- drivers/sound/opl3sa2.c.orig        Thu May  2 23:36:45 2002
> +++ drivers/sound/opl3sa2.c     Sun Jun  2 15:19:44 2002

When you rediff, can you diff so that the patch can be applied with a 
(Continue reading)

Gerald Teschl | 3 Jun 2002 20:47
Picon
Picon
Favicon

Re: isapnp problems with opl3sa2

Zwane Mwaikambo wrote:

>You should be able to load it without any parameters with ISAPNP, i have a 
>box at home with that card which only requires a modprobe opl3sa2. Could 
>you show me how you're loading it as well as dmesg and /proc/isapnp output 
>after loading.
>
I use redhat-7.3 (kernel-2.4.18-4) and this is an ASUS L7300 laptop.
In /etc/modules.conf I have

alias sound-slot-0 opl3sa2
options sound dmabuf=1
alias synth0 opl3
options opl3 io=0x388
options opl3sa2 ymode=2 isapnp=1

and /proc/isapnp looks like
-------------------------------------------------
Card 1 'YMH0800:YAMAHA OPL3-SAx Audio System' PnP version 1.0
  Logical device 0 'YMH0021:Unknown'
    Device is not active
    Active DMA 0,0
    Resources 0
      Priority preferred
      Port 0x220-0x220, align 0xf, size 0x10, 16-bit address decoding
      Port 0x530-0x530, align 0x7, size 0x8, 16-bit address decoding
      Port 0x388-0x388, align 0x7, size 0x8, 16-bit address decoding
      Port 0x330-0x330, align 0x1, size 0x2, 16-bit address decoding
      Port 0x370-0x370, align 0x1, size 0x2, 16-bit address decoding
      IRQ 5 High-Edge
(Continue reading)

Gerald Teschl | 4 Jun 2002 17:57
Picon
Picon
Favicon

[PATCH] opl3sa2 isapnp activation fix

Hi,

this is the final version of my patch which fixes the isapnp activation 
of opl3sa2 based
cards which require dma=0 as discussed with Zwane Mwaikambo.

Gerald

--- linux-2.4.18-4/drivers/sound/opl3sa2.c.orig    Thu May  2 23:36:45 2002
+++ linux-2.4.18-4/drivers/sound/opl3sa2.c    Tue Jun  4 16:09:50 2002
 <at>  <at>  -57,6 +57,7  <at>  <at> 
  *                         (Jan 7, 2001)
  * Zwane Mwaikambo       Added PM support. (Dec 4 2001)
  * Zwane Mwaikambo       Code, data structure cleanups. (Feb 15 2002)
+ * Gerald Teschl       Fixed ISA PnP activate. (Jun 02 2002)
  *
  */

 <at>  <at>  -869,10 +870,24  <at>  <at> 
     }
     else {
         if(dev->activate(dev) < 0) {
-            printk(KERN_WARNING PFX "ISA PnP activate failed\n");
-            opl3sa2_state[card].activated = 0;
-            return -ENODEV;
+            /*
+             * isapnp.c disallows dma=0 but some opl3sa2 cards need it.
+             * So we set dma by hand and try again
+             */
+            if (dma < 0 || dma > 7)
(Continue reading)

Zwane Mwaikambo | 4 Jun 2002 17:42

Re: [PATCH] opl3sa2 isapnp activation fix

On Tue, 4 Jun 2002, Gerald Teschl wrote:

> --- linux-2.4.18-4/drivers/sound/opl3sa2.c.orig    Thu May  2 23:36:45 2002
> +++ linux-2.4.18-4/drivers/sound/opl3sa2.c    Tue Jun  4 16:09:50 2002
>  <at>  <at>  -57,6 +57,7  <at>  <at> 
>   *                         (Jan 7, 2001)
>   * Zwane Mwaikambo       Added PM support. (Dec 4 2001)
>   * Zwane Mwaikambo       Code, data structure cleanups. (Feb 15 2002)
> + * Gerald Teschl       Fixed ISA PnP activate. (Jun 02 2002)
>   *
>   */
>  
>  <at>  <at>  -869,10 +870,24  <at>  <at> 
>      }
>      else {
>          if(dev->activate(dev) < 0) {
> -            printk(KERN_WARNING PFX "ISA PnP activate failed\n");
> -            opl3sa2_state[card].activated = 0;
> -            return -ENODEV;
> +            /*
> +             * isapnp.c disallows dma=0 but some opl3sa2 cards need it.
> +             * So we set dma by hand and try again
> +             */
> +            if (dma < 0 || dma > 7)
> +                dma= 0;
> +            if (dma2 < 0 || dma2 >7)
> +                dma2= 1;

Oops, that won't work on isapnp since dma = dma2 = -1 at this stage, how 
about;
(Continue reading)

Zwane Mwaikambo | 4 Jun 2002 17:48

Re: [PATCH] opl3sa2 isapnp activation fix

Hi Gerald,

I forgot to mention, Marcelo is the more likely target for this one, but 
since he's going for -rc you can either wait for 2.4.20-pre or you can 
send it to Alan (who probably has the latest version). 2.5 needs a merge 
from 2.4-ac which i'll send later on.

Cheers,
	Zwane

--

-- 
http://function.linuxpower.ca
		

-
To unsubscribe from this list: send the line "unsubscribe linux-sound" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Gerald Teschl | 4 Jun 2002 19:34
Picon
Picon
Favicon

Re: [PATCH] opl3sa2 isapnp activation fix

Zwane Mwaikambo wrote:

>On Tue, 4 Jun 2002, Zwane Mwaikambo wrote:
>
>  
>
>>>         if(dev->activate(dev) < 0) {
>>>-            printk(KERN_WARNING PFX "ISA PnP activate failed\n");
>>>-            opl3sa2_state[card].activated = 0;
>>>-            return -ENODEV;
>>>+            /*
>>>+             * isapnp.c disallows dma=0 but some opl3sa2 cards need it.
>>>+             * So we set dma by hand and try again
>>>+             */
>>>+            if (dma < 0 || dma > 7)
>>>+                dma= 0;
>>>+            if (dma2 < 0 || dma2 >7)
>>>+                dma2= 1;
>>>      
>>>
>>Oops, that won't work on isapnp since dma = dma2 = -1 at this stage, how 
>>about;
>>
>>if ((dma != -1) && (dma2 != -1)) frob();
>>
I don't get what you mean? I tested this, if I do "modprobe opl3sa2 
dma=1 dma2=3" it will activate
the card with dma 1,3 (according to /proc/isapnp). However, my card will 
not work with these values.

(Continue reading)

Zwane Mwaikambo | 4 Jun 2002 19:33

Re: [PATCH] opl3sa2 isapnp activation fix

On Tue, 4 Jun 2002, Gerald Teschl wrote:

> >>Oops, that won't work on isapnp since dma = dma2 = -1 at this stage, how 
> >>about;
> >>
> >>if ((dma != -1) && (dma2 != -1)) frob();
> >>
> I don't get what you mean? I tested this, if I do "modprobe opl3sa2 
> dma=1 dma2=3" it will activate
> the card with dma 1,3 (according to /proc/isapnp). However, my card will 
> not work with these values.

How about this, you check if the resource register reads 0 for the DMA 
value and you reassign it using the resource registers, that way you skip 
on using magic values.

Cheers,
	Zwane

--

-- 
http://function.linuxpower.ca
		

-
To unsubscribe from this list: send the line "unsubscribe linux-sound" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Gerald Teschl | 5 Jun 2002 17:05
Picon
Picon
Favicon

Re: [PATCH] opl3sa2 isapnp activation fix

Zwane Mwaikambo wrote:

>Isn't 0 listed in a BAR register anyway? Can't you read it after a 
>prepare? 
>
I don't know what you mean by a BAR register. As far as I can tell, 
prepare does nothing than
setting all values in the dev struct to zero and the flags to AUTO. So 
after the prepare call

dev->dma_resource[i].start = dev->dma_resource[i].end = 0

for i=0,1. So I don't think this can be used for a test.

The current version tests ALL dma resources which the card lists as 
acceptable for the first dma.
If there is no acceptable configuration other than dma=0, then I give it 
dma=0 (see also below).

>My only objection to your patch is the hardcoded 0 and 1, get rid 
>of that and you'll get rid of my nagging ;) 
>
What is the differnece between your suggestion

if (a == 0)
    b = a;

and my

if (a == 0)
(Continue reading)


Gmane