* Re: [PATCH] Gallant SC-6000 driver (4th version)
@ 2007-09-06 6:49 Krzysztof Helt
2007-09-06 10:12 ` Rene Herman
0 siblings, 1 reply; 13+ messages in thread
From: Krzysztof Helt @ 2007-09-06 6:49 UTC (permalink / raw)
To: Rene Herman; +Cc: alsa-devel
Rene Herman wrote:
> On 09/05/2007 10:25 PM, Krzysztof Helt wrote:
> > I have left the ISA autodetection. It makes driver usage
simpler for user.
> > The base port, mpu port and mss port can be read from jumper
settings,
> >but irq or dma is not settable. A system may figure out which
one is free
> >and use it.
> The problem is that this "simplification" might actually leave
the non-aware
> user scratching his head for far longer than if he has to spell
things out.
I know it may not work all the time, but you can always fall back
to giving number.
If the simple autodetection works, it helps.
> Even without that problem, we have the problem of IRQs that's
only _appear_
> to be free. IRQ7 for example will usually be assigned to the
first parallel
> port but will only show up as taken if the parport driver is
loaded. Often,
> it'll still actually work, but (again) here for example, it
does not.
Actually, the parport_pc driver is loaded by the udev by default,
so the IRQ7
cannot be requested (I tested - IRQ7 request failed even if I had
not used the printer).
> It's not like people using legacy ISA in this day and age are
not normally
> nerds anyway...
That's the best argument.
> Yes. I am looking at the sound galaxy driver at the moment and
am in fact
> now trying to think of why I want to use the WSS part of the
card and not
> just the SBP part. In DOS, the card is setup in SB Pro mode by
default as
> well, and the CS42xx seems to only be present really for
Windows Sound
> System compatibility for old 16-bit Windows.
IIRC from SB Pro times, the SB Pro specification said it
supported only 16 bit of output (ment either 16-bit mono or 8-bit
stereo). The SB16 supported stereo
16-bit audio.
I don't know what is expected from WSS, but if the SB Pro mode gives
full duplex 16-bit stereo, there is no reason to use WSS mode.
>> (I do not have the CS4231 based card but I should have it next
week -
>> Sound Galaxy Waverider).
> Am testing on that one currently -- will post the driver before
next week.
I'll be happy to test it too.
> Quite sure that 5 works by the way? On a Sound Galaxy, 5 only
works for the
> SB part (and 11 only for the WSS).
It is the IRQ found most times as the first free during card
tests. It worked on all
free IRQs from the range (the 10 or 11 is occupied by USB/PS2 and
I haven't
bothered to make it free).
It seems that ASC-9308 is more capable (in this respect) than SG
chips.
Regards,
Krzysztof
----------------------------------------------------
Pierwsza od piętnastu lat książka
Václava Havla "Tylko krótko proszę" - już w księgarniach!
http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fhavel.html&sid=15
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Gallant SC-6000 driver (4th version)
2007-09-06 6:49 [PATCH] Gallant SC-6000 driver (4th version) Krzysztof Helt
@ 2007-09-06 10:12 ` Rene Herman
2007-09-06 11:20 ` Rene Herman
2007-09-06 21:12 ` [PATCH] Gallant SC-6000 driver (4th version) Krzysztof Helt
0 siblings, 2 replies; 13+ messages in thread
From: Rene Herman @ 2007-09-06 10:12 UTC (permalink / raw)
To: Krzysztof Helt; +Cc: alsa-devel
On 09/06/2007 08:49 AM, Krzysztof Helt wrote:
> Actually, the parport_pc driver is loaded by the udev by default, so the
> IRQ7 cannot be requested (I tested - IRQ7 request failed even if I had
> not used the printer).
Not everybody uses udev. But more importantly, only if the hardware in
question is discoverable. A parallel port will these days normally be
advertised using PnP (BIOS/ACPI) in fact which puts it on the same footing
as ISA-PnP and PCI with respect to this issue, but we are specifically
discussing this in the context of legacy ISA cards.
So imagine you have another piece of legacy ISA hardware sitting on the
resources. Nothing will tell your driver that it is occupying the resources
in question so it goes ahead and grabs them after which both your hardware
and the other one fail, leaving this poor unaware user for whom autoprobing
is supposedly helpful clueless as to why nothing works.
Then there's the bit about this user generally needing to know what resource
is going to be assigned so he can reserve it in the BIOS anyway. Without, an
IRQ may not even be useable from the ISA bus on some systems.
And _then_ there's the bit about the ISA probing being a huge gaping race by
design. There's really no defending that massive junk. All ISA autoprobing
is bad engineering and should be ripped out and shot, period. It's broken
both by design and implementation. The solution to making things nicer is
not autoprobing but not using legacy ISA -- and basically noone is other
than for entertainment purposes.
Any system with ISA slots and running a modern kernel support ISA-PnP or
PnP-BIOS for onboard chips (and not to mention PCI) which solves the problem
nicely through being discoverable. Us entertainment-value users do not feel
there's anything wrong with sticking
options snd-foo port=0x220 irq=5 dma=1
in /etc/modprobe.conf
> I don't know what is expected from WSS, but if the SB Pro mode gives
> full duplex 16-bit stereo, there is no reason to use WSS mode.
Full duplex (simultaneous playback and capture) is something that neither Sb
Pro nor CS4231 does. I do see that SB Pro doesn't natively support S16_LE it
seems...
>> Quite sure that 5 works by the way? On a Sound Galaxy, 5 only works for
>> the SB part (and 11 only for the WSS).
> It is the IRQ found most times as the first free during card tests. It
> worked on all free IRQs from the range (the 10 or 11 is occupied by
> USB/PS2 and I haven't bothered to make it free). It seems that ASC-9308
> is more capable (in this respect) than SG chips.
Okay, so it's at least in some respects really different. That probably
means a seperate driver makes sense.
Rene.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Gallant SC-6000 driver (4th version)
2007-09-06 10:12 ` Rene Herman
@ 2007-09-06 11:20 ` Rene Herman
2007-09-06 14:03 ` Krzysztof Helt
2007-09-06 21:12 ` [PATCH] Gallant SC-6000 driver (4th version) Krzysztof Helt
1 sibling, 1 reply; 13+ messages in thread
From: Rene Herman @ 2007-09-06 11:20 UTC (permalink / raw)
To: Krzysztof Helt; +Cc: alsa-devel
On 09/06/2007 12:12 PM, Rene Herman wrote:
> Full duplex (simultaneous playback and capture) is something that
> neither Sb Pro nor CS4231 does. I do see that SB Pro doesn't natively
> support S16_LE it seems...
Sorry, incorrect -- the cs4231 is full duplex. It's only the cs4248 (ad1848)
which is not. Need to figure out how to do full duplex on a sound galaxy;
old driver didn't do so.
Rene.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Gallant SC-6000 driver (4th version)
2007-09-06 11:20 ` Rene Herman
@ 2007-09-06 14:03 ` Krzysztof Helt
2007-09-06 15:18 ` Rene Herman
0 siblings, 1 reply; 13+ messages in thread
From: Krzysztof Helt @ 2007-09-06 14:03 UTC (permalink / raw)
To: Rene Herman; +Cc: alsa-devel
Dnia 6-09-2007 o godz. 13:20 Rene Herman napisał(a):
> On 09/06/2007 12:12 PM, Rene Herman wrote:
>
> > Full duplex (simultaneous playback and capture) is something
that
> > neither Sb Pro nor CS4231 does. I do see that SB Pro doesn't
natively
> > support S16_LE it seems...
>
> Sorry, incorrect -- the cs4231 is full duplex. It's only the
cs4248 (ad1848)
> which is not. Need to figure out how to do full duplex on a
sound galaxy;
> old driver didn't do so.
>
The SG Waverider is full duplex (at least Win95 driver says so).
Regards,
Krzysztof
----------------------------------------------------
Walka jakiej nie widziałeś! KSW eliminacje,
nie wszyscy przejdą cało!
Zobacz na żywo we Wrocławiu już 15 września.
Więcej -> http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fksweliminacje.html&sid=12
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Gallant SC-6000 driver (4th version)
2007-09-06 14:03 ` Krzysztof Helt
@ 2007-09-06 15:18 ` Rene Herman
2007-09-07 8:34 ` full duplex AD1848 (was SC-6000 driver) Krzysztof Helt
0 siblings, 1 reply; 13+ messages in thread
From: Rene Herman @ 2007-09-06 15:18 UTC (permalink / raw)
To: Krzysztof Helt; +Cc: alsa-devel
On 09/06/2007 04:03 PM, Krzysztof Helt wrote:
> Dnia 6-09-2007 o godz. 13:20 Rene Herman napisał(a):
>> Sorry, incorrect -- the cs4231 is full duplex. It's only the cs4248
>> (ad1848) which is not. Need to figure out how to do full duplex on a
>> sound galaxy; old driver didn't do so.
>>
> The SG Waverider is full duplex (at least Win95 driver says so).
Yup, figured it out -- it's working nicely. Sound Galaxies come with various
codecs; also CS4248 which is half-duplex, so now only need to check that now
_those_ don't crap out...
Rene
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: full duplex AD1848 (was SC-6000 driver)
2007-09-06 15:18 ` Rene Herman
@ 2007-09-07 8:34 ` Krzysztof Helt
2007-09-07 12:00 ` Rene Herman
0 siblings, 1 reply; 13+ messages in thread
From: Krzysztof Helt @ 2007-09-07 8:34 UTC (permalink / raw)
To: Rene Herman; +Cc: alsa-devel
On Thu, 06 Sep 2007 17:18:07 +0200
Rene Herman <rene.herman@gmail.com> wrote:
> On 09/06/2007 04:03 PM, Krzysztof Helt wrote:
>
> > Dnia 6-09-2007 o godz. 13:20 Rene Herman napisał(a):
>
> >> Sorry, incorrect -- the cs4231 is full duplex. It's only the cs4248
> >> (ad1848) which is not. Need to figure out how to do full duplex on a
> >> sound galaxy; old driver didn't do so.
> >>
According to a datasheet, the AD1848K (which was a popular version of AD1848)
is full-duplex (can work in single-dma mode or with two dma channels).
The AD1848 in my SC-6000 is not the K version (at least it is not marked on
the chip) but I saw a photo on the net with SC-6000 and AD1848K (it had no
YMF-262 chip but a different one).
I am looking for the AD1848 datasheet for the pre-K version (or list of
differences between K and earlier versions).
Also, I would like to know how you put your SG card into full-duplex mode.
It seems that hardware of AD1848/CS4231 was not used to its full potential
(SB compatibility was more important).
Regards,
Krzysztof
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: full duplex AD1848 (was SC-6000 driver)
2007-09-07 8:34 ` full duplex AD1848 (was SC-6000 driver) Krzysztof Helt
@ 2007-09-07 12:00 ` Rene Herman
0 siblings, 0 replies; 13+ messages in thread
From: Rene Herman @ 2007-09-07 12:00 UTC (permalink / raw)
To: Krzysztof Helt; +Cc: alsa-devel
On 09/07/2007 10:34 AM, Krzysztof Helt wrote:
> According to a datasheet, the AD1848K (which was a popular version of
> AD1848) is full-duplex (can work in single-dma mode or with two dma
> channels).
Yes, I see...
> The AD1848 in my SC-6000 is not the K version (at least it is not marked
> on the chip) but I saw a photo on the net with SC-6000 and AD1848K (it
> had no YMF-262 chip but a different one).
>
> I am looking for the AD1848 datasheet for the pre-K version (or list of
> differences between K and earlier versions).
Can also only find the K datasheet. Not sure what's up with that -- the
existing ad1848 driver is simplex only.
> Also, I would like to know how you put your SG card into full-duplex
> mode.
That may be the easiest test yes. Try setting bit 2 of mss_config (| 4).
This seems to be the generic way to enable duplex on mss/wss and it works
here. The capture channel is fixed for a fiven playback channel:
P = 0 ==> C = 1
P = 1 ==> C = 0
P = 3 ==> C = 0
By the way -- I'm running into a bug somewhere in cs4231_lib where sometimes
the playback IRQ stops firing when you start a capture. Stopping both the
capture and playback and then re-starting the playback works, after which
things may or may not hang again at re-starting the capture.
Could also be a hardware bug I guess -- will need to test further again
(sigh). But just in case you'd also run into this, don't give up on
ful-duplex if it only sometimes doesn't work right, as there might very well
be a bug lurking in cs4231_lib.
(bug cannot be in my own code, as that's just setup and nowhere to be found
anymore when things are running).
Rene.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Gallant SC-6000 driver (4th version)
2007-09-06 10:12 ` Rene Herman
2007-09-06 11:20 ` Rene Herman
@ 2007-09-06 21:12 ` Krzysztof Helt
2007-09-06 21:16 ` Rene Herman
1 sibling, 1 reply; 13+ messages in thread
From: Krzysztof Helt @ 2007-09-06 21:12 UTC (permalink / raw)
To: Rene Herman; +Cc: Takashi Iwai, alsa-devel
On Thu, 06 Sep 2007 12:12:42 +0200
Rene Herman <rene.herman@gmail.com> wrote:
> On 09/06/2007 08:49 AM, Krzysztof Helt wrote:
>
> > Actually, the parport_pc driver is loaded by the udev by default, so the
> > IRQ7 cannot be requested (I tested - IRQ7 request failed even if I had
> > not used the printer).
>
> Not everybody uses udev. But more importantly, only if the hardware in
> question is discoverable. [...]
>
> And _then_ there's the bit about the ISA probing being a huge gaping race by
> design. There's really no defending that massive junk. All ISA autoprobing
> is bad engineering and should be ripped out and shot, period. It's broken
> both by design and implementation. The solution to making things nicer is
> not autoprobing but not using legacy ISA -- and basically noone is other
> than for entertainment purposes.
>
I am quite sure we won't agree on this one. My reason (to keep autodection)
is sheer laziness of giving two numbers. Even giving them does not make
user free of problems how to avoid irqs and dmas with installed devices
but not visible in the /proc/interrupts file).
I would like to ask Takashi to decide on this issue. I will done as he says.
Will this driver be included? I found a bug in probing - if something is wrong
after the SB region is requested it won't be released. So the next version is
needed to be done anyway (or a small patch later).
Regards,
Krzysztof
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Gallant SC-6000 driver (4th version)
2007-09-06 21:12 ` [PATCH] Gallant SC-6000 driver (4th version) Krzysztof Helt
@ 2007-09-06 21:16 ` Rene Herman
2007-09-07 11:11 ` Takashi Iwai
0 siblings, 1 reply; 13+ messages in thread
From: Rene Herman @ 2007-09-06 21:16 UTC (permalink / raw)
To: Krzysztof Helt; +Cc: Takashi Iwai, alsa-devel
On 09/06/2007 11:12 PM, Krzysztof Helt wrote:
> On Thu, 06 Sep 2007 12:12:42 +0200
> Rene Herman <rene.herman@gmail.com> wrote:
>
>> On 09/06/2007 08:49 AM, Krzysztof Helt wrote:
>>
>>> Actually, the parport_pc driver is loaded by the udev by default, so the
>>> IRQ7 cannot be requested (I tested - IRQ7 request failed even if I had
>>> not used the printer).
>> Not everybody uses udev. But more importantly, only if the hardware in
>> question is discoverable. [...]
>>
>> And _then_ there's the bit about the ISA probing being a huge gaping race by
>> design. There's really no defending that massive junk. All ISA autoprobing
>> is bad engineering and should be ripped out and shot, period. It's broken
>> both by design and implementation. The solution to making things nicer is
>> not autoprobing but not using legacy ISA -- and basically noone is other
>> than for entertainment purposes.
>>
>
> I am quite sure we won't agree on this one. My reason (to keep autodection)
> is sheer laziness of giving two numbers. Even giving them does not make
> user free of problems how to avoid irqs and dmas with installed devices
> but not visible in the /proc/interrupts file).
No, but then at least you aren't hiding the problem by promising the user to
figure it all out automatically. And as said, /etc/modprobe.conf works...
> I would like to ask Takashi to decide on this issue. I will done as he says.
Oh, I've not much doubt he'll not mind it terribly. Still many drivers in
sound/isa that do probing. Doesn't change that it's all counter-productive,
broken junk though!
> Will this driver be included? I found a bug in probing - if something is wrong
> after the SB region is requested it won't be released. So the next version is
> needed to be done anyway (or a small patch later).
Still testing with snd-galaxy here and haven't really looked at integrating
them yet. Will do, but I believe I saw some differences stand out already.
Rene.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Gallant SC-6000 driver (4th version)
2007-09-06 21:16 ` Rene Herman
@ 2007-09-07 11:11 ` Takashi Iwai
2007-09-07 12:11 ` Rene Herman
0 siblings, 1 reply; 13+ messages in thread
From: Takashi Iwai @ 2007-09-07 11:11 UTC (permalink / raw)
To: Rene Herman; +Cc: Krzysztof Helt, alsa-devel
At Thu, 06 Sep 2007 23:16:39 +0200,
Rene Herman wrote:
>
> On 09/06/2007 11:12 PM, Krzysztof Helt wrote:
>
> > On Thu, 06 Sep 2007 12:12:42 +0200
> > Rene Herman <rene.herman@gmail.com> wrote:
> >
> >> On 09/06/2007 08:49 AM, Krzysztof Helt wrote:
> >>
> >>> Actually, the parport_pc driver is loaded by the udev by default, so the
> >>> IRQ7 cannot be requested (I tested - IRQ7 request failed even if I had
> >>> not used the printer).
> >> Not everybody uses udev. But more importantly, only if the hardware in
> >> question is discoverable. [...]
> >>
> >> And _then_ there's the bit about the ISA probing being a huge gaping race by
> >> design. There's really no defending that massive junk. All ISA autoprobing
> >> is bad engineering and should be ripped out and shot, period. It's broken
> >> both by design and implementation. The solution to making things nicer is
> >> not autoprobing but not using legacy ISA -- and basically noone is other
> >> than for entertainment purposes.
> >>
> >
> > I am quite sure we won't agree on this one. My reason (to keep autodection)
> > is sheer laziness of giving two numbers. Even giving them does not make
> > user free of problems how to avoid irqs and dmas with installed devices
> > but not visible in the /proc/interrupts file).
>
> No, but then at least you aren't hiding the problem by promising the user to
> figure it all out automatically. And as said, /etc/modprobe.conf works...
>
> > I would like to ask Takashi to decide on this issue. I will done as he says.
>
> Oh, I've not much doubt he'll not mind it terribly. Still many drivers in
> sound/isa that do probing. Doesn't change that it's all counter-productive,
> broken junk though!
The codes used for this auto-probing is relatively small and easy, so
as Rene expected, I don't mind about it :)
The criterion is only whether it's _really_ useful and works without
hitch. We keep the old code as is just because it was worked, and we
shouldn't break it. The concept is not perfect, but if it practically
works, I have no objection.
> > Will this driver be included? I found a bug in probing - if something is wrong
> > after the SB region is requested it won't be released. So the next version is
> > needed to be done anyway (or a small patch later).
>
> Still testing with snd-galaxy here and haven't really looked at integrating
> them yet. Will do, but I believe I saw some differences stand out already.
I'm for merging it -- at least, if it's confirmed to work on the
latest kernel (and the bug is fixed). Let's put all them in a pot
before 1.0.15 final. We'll cook better after that.
thanks,
Takashi
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Gallant SC-6000 driver (4th version)
2007-09-07 11:11 ` Takashi Iwai
@ 2007-09-07 12:11 ` Rene Herman
0 siblings, 0 replies; 13+ messages in thread
From: Rene Herman @ 2007-09-07 12:11 UTC (permalink / raw)
To: Takashi Iwai; +Cc: Krzysztof Helt, alsa-devel
On 09/07/2007 01:11 PM, Takashi Iwai wrote:
> The codes used for this auto-probing is relatively small and easy, so
> as Rene expected, I don't mind about it :)
>
> The criterion is only whether it's _really_ useful and works without
> hitch.
Exactly. Krysztof snipped most of my objections but we are talking about
legacy ISA hardware here. So imagine you have _another_ piece of legacy ISA
hardware sitting on say IRQ 5. Unless you load your driver after the driver
for the other bit of hardware is loaded, your driver finds IRQ 5 free, grabs
it and configures the card for IRQ 5, after which your nor the other piece
of hardware work anymore.
At this point, you've helped this poor unaware user from the docks into the
harbour as he has no idea what's going on, having not specified anything
himself.
I'll repeat -- there's really no defending that massive junk :-)
> We keep the old code as is just because it was worked, and we shouldn't
> break it. The concept is not perfect, but if it practically works, I
> have no objection.
What practically works is sticking an options line in modprobe.conf...
But hey, I'm aware some people think it helps. As long as you are aware
you're wrong and that it _is_ massive junk, I'm halfway content :-)
Rene.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] Gallant SC-6000 driver (4th version)
@ 2007-09-05 20:25 Krzysztof Helt
2007-09-05 21:53 ` Rene Herman
0 siblings, 1 reply; 13+ messages in thread
From: Krzysztof Helt @ 2007-09-05 20:25 UTC (permalink / raw)
To: Alsa-devel
From: Krzysztof Helt <krzysztof.h1@wp.pl>
This is port of the Gallant SC-6000 driver from the OSS aedsp16 driver.
This card was also sold as AudioExcel DSP 16 and Zoltrix AV302 (Audio Plus True 16).
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
---
This version fixes most of issues pointed by Rene Herman. Thank Clemens,
Takashi and Rene who contributed to this work.
I have left the ISA autodetection. It makes driver usage simpler for user.
The base port, mpu port and mss port can be read from jumper settings,
but irq or dma is not settable. A system may figure out which one is free
and use it.
I post this driver despite my question if it can be integrated into the sgalaxy driver.
I think that I can post it and see if it work for people and maybe contact
someone with SC-6600 model so the driver can be extended to handle this
chip also. It would replace the OSS driver completely then.
I am getting feeling that ad1848 and cs4231 libraries could be merged (or at least
produce some common part like mss_lib). This may allow to merge drivers using
cs4231-lib and ad1848-lib. I'll look into this (I do not have the CS4231 based card
but I should have it next week - Sound Galaxy Waverider).
Regards,
Krzysztof
diff -urpN linux-2.6.22.old/sound/isa/Kconfig linux-2.6.22/sound/isa/Kconfig
--- linux-2.6.22.old/sound/isa/Kconfig 2007-08-28 23:14:08.000000000 +0200
+++ linux-2.6.22/sound/isa/Kconfig 2007-09-01 18:38:41.000000000 +0200
@@ -191,6 +191,19 @@ config SND_ES18XX
To compile this driver as a module, choose M here: the module
will be called snd-es18xx.
+config SND_SC6000
+ tristate "Gallant SC-6000, Audio Excel DSP 16"
+ depends on SND
+ select SND_AD1848_LIB
+ select SND_OPL3_LIB
+ select SND_MPU401_UART
+ help
+ Say Y here to include support for Gallant SC-6000 card and clones:
+ Audio Excel DSP 16 and Zoltrix AV302.
+
+ To compile this driver as a module, choose M here: the module
+ will be called snd-sc6000.
+
config SND_GUS_SYNTH
tristate
diff -urpN linux-2.6.22.old/sound/isa/Makefile linux-2.6.22/sound/isa/Makefile
--- linux-2.6.22.old/sound/isa/Makefile 2007-07-09 01:32:17.000000000 +0200
+++ linux-2.6.22/sound/isa/Makefile 2007-09-03 22:09:58.000000000 +0200
@@ -10,6 +10,7 @@ snd-cmi8330-objs := cmi8330.o
snd-dt019x-objs := dt019x.o
snd-es18xx-objs := es18xx.o
snd-opl3sa2-objs := opl3sa2.o
+snd-sc6000-objs := sc6000.o
snd-sgalaxy-objs := sgalaxy.o
snd-sscape-objs := sscape.o
@@ -21,6 +22,7 @@ obj-$(CONFIG_SND_CMI8330) += snd-cmi8330
obj-$(CONFIG_SND_DT019X) += snd-dt019x.o
obj-$(CONFIG_SND_ES18XX) += snd-es18xx.o
obj-$(CONFIG_SND_OPL3SA2) += snd-opl3sa2.o
+obj-$(CONFIG_SND_SC6000) += snd-sc6000.o
obj-$(CONFIG_SND_SGALAXY) += snd-sgalaxy.o
obj-$(CONFIG_SND_SSCAPE) += snd-sscape.o
diff -urpN linux-2.6.22.old/sound/isa/sc6000.c linux-2.6.22/sound/isa/sc6000.c
--- linux-2.6.22.old/sound/isa/sc6000.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.22/sound/isa/sc6000.c 2007-09-05 21:14:45.000000000 +0200
@@ -0,0 +1,630 @@
+/*
+ * Driver for Gallant SC-6000 soundcard. This card is also known as
+ * Audio Excel DSP 16 or Zoltrix AV302.
+ * These cards use CompuMedia ASC-9308 chip + AD1848 codec.
+ *
+ * Copyright (C) 2007 Krzysztof Helt <krzysztof.h1@wp.pl>
+ *
+ * I don't have documentation for this card. I used the driver
+ * for OSS/Free included in the kernel source as reference.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <sound/driver.h>
+#include <linux/module.h>
+#include <linux/isa.h>
+#include <asm/dma.h>
+#include <sound/core.h>
+#include <sound/ad1848.h>
+#include <sound/opl3.h>
+#include <sound/mpu401.h>
+#include <sound/control.h>
+#define SNDRV_LEGACY_FIND_FREE_IRQ
+#define SNDRV_LEGACY_FIND_FREE_DMA
+#include <sound/initval.h>
+
+MODULE_AUTHOR("Krzysztof Helt");
+MODULE_DESCRIPTION("Gallant SC-6000");
+MODULE_LICENSE("GPL");
+MODULE_SUPPORTED_DEVICE("{{Gallant, SC-6000},"
+ "{AudioExcel, Audio Excel DSP 16},"
+ "{Zoltrix, AV302}}");
+
+static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
+static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
+static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
+static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220, 0x240 */
+static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5, 7, 9, 10, 11 */
+static long mss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x530, 0xe80 */
+static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
+ /* 0x300, 0x310, 0x320, 0x330 */
+static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5, 7, 9, 10, 0 */
+static int dma[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0, 1, 3 */
+
+module_param_array(index, int, NULL, 0444);
+MODULE_PARM_DESC(index, "Index value for sc-6000 based soundcard.");
+module_param_array(id, charp, NULL, 0444);
+MODULE_PARM_DESC(id, "ID string for sc-6000 based soundcard.");
+module_param_array(enable, bool, NULL, 0444);
+MODULE_PARM_DESC(enable, "Enable sc-6000 based soundcard.");
+module_param_array(port, long, NULL, 0444);
+MODULE_PARM_DESC(port, "Port # for sc-6000 driver.");
+module_param_array(mss_port, long, NULL, 0444);
+MODULE_PARM_DESC(mss_port, "MSS Port # for sc-6000 driver.");
+module_param_array(mpu_port, long, NULL, 0444);
+MODULE_PARM_DESC(mpu_port, "MPU-401 port # for sc-6000 driver.");
+module_param_array(irq, int, NULL, 0444);
+MODULE_PARM_DESC(irq, "IRQ # for sc-6000 driver.");
+module_param_array(mpu_irq, int, NULL, 0444);
+MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for sc-6000 driver.");
+module_param_array(dma, int, NULL, 0444);
+MODULE_PARM_DESC(dma, "DMA # for sc-6000 driver.");
+
+/*
+ * Commands of SC6000's DSP (SBPRO+special).
+ * Some of them are COMMAND_xx, in the future they may change.
+ */
+#define WRITE_MDIRQ_CFG 0x50 /* Set M&I&DRQ mask (the real config) */
+#define COMMAND_52 0x52 /* */
+#define READ_HARD_CFG 0x58 /* Read Hardware Config (I/O base etc) */
+#define COMMAND_5C 0x5c /* */
+#define COMMAND_60 0x60 /* */
+#define COMMAND_66 0x66 /* */
+#define COMMAND_6C 0x6c /* */
+#define COMMAND_6E 0x6e /* */
+#define COMMAND_88 0x88 /* Unknown command */
+#define DSP_INIT_MSS 0x8c /* Enable Microsoft Sound System mode */
+#define COMMAND_C5 0xc5 /* */
+#define GET_DSP_VERSION 0xe1 /* Get DSP Version */
+#define GET_DSP_COPYRIGHT 0xe3 /* Get DSP Copyright */
+
+/*
+ * Offsets of SC6000 DSP I/O ports. The offset is added to base I/O port
+ * to have the actual I/O port.
+ * Register permissions are:
+ * (wo) == Write Only
+ * (ro) == Read Only
+ * (w-) == Write
+ * (r-) == Read
+ */
+#define DSP_RESET 0x06 /* offset of DSP RESET (wo) */
+#define DSP_READ 0x0a /* offset of DSP READ (ro) */
+#define DSP_WRITE 0x0c /* offset of DSP WRITE (w-) */
+#define DSP_COMMAND 0x0c /* offset of DSP COMMAND (w-) */
+#define DSP_STATUS 0x0c /* offset of DSP STATUS (r-) */
+#define DSP_DATAVAIL 0x0e /* offset of DSP DATA AVAILABLE (ro) */
+
+#define PFX "sc6000: "
+
+/* hardware dependent functions */
+
+/*
+ * sc6000_irq_to_softcfg - Decode irq number into cfg code.
+ */
+static __devinit unsigned char sc6000_irq_to_softcfg(int irq)
+{
+ unsigned char val = 0;
+
+ switch (irq) {
+ case 5:
+ val = 0x28;
+ break;
+ case 7:
+ val = 0x8;
+ break;
+ case 9:
+ val = 0x10;
+ break;
+ case 10:
+ val = 0x18;
+ break;
+ case 11:
+ val = 0x20;
+ break;
+ default:
+ break;
+ }
+ return val;
+}
+
+/*
+ * sc6000_dma_to_softcfg - Decode dma number into cfg code.
+ */
+static __devinit unsigned char sc6000_dma_to_softcfg(int dma)
+{
+ unsigned char val = 0;
+
+ switch (dma) {
+ case 0:
+ val = 1;
+ break;
+ case 1:
+ val = 2;
+ break;
+ case 3:
+ val = 3;
+ break;
+ default:
+ break;
+ }
+ return val;
+}
+
+/*
+ * sc6000_mpu_irq_to_softcfg - Decode MPU-401 irq number into cfg code.
+ */
+static __devinit unsigned char sc6000_mpu_irq_to_softcfg(int mpu_irq)
+{
+ unsigned char val = 0;
+
+ switch (mpu_irq) {
+ case 5:
+ val = 4;
+ break;
+ case 7:
+ val = 0x44;
+ break;
+ case 9:
+ val = 0x84;
+ break;
+ case 10:
+ val = 0xc4;
+ break;
+ default:
+ break;
+ }
+ return val;
+}
+
+static __devinit int sc6000_wait_data(int port)
+{
+ int loop = 1000;
+ unsigned char val = 0;
+
+ do {
+ val = inb(port + DSP_DATAVAIL);
+ if (val & 0x80)
+ return 0;
+ cpu_relax();
+ } while (loop--);
+
+ return -EAGAIN;
+}
+
+static __devinit int sc6000_read(int port)
+{
+ if (sc6000_wait_data(port))
+ return -EBUSY;
+
+ return inb(port + DSP_READ);
+
+}
+
+static __devinit int sc6000_write(int port, int cmd)
+{
+ unsigned char val;
+ int loop = 500000;
+
+ do {
+ val = inb(port + DSP_STATUS);
+ /*
+ * DSP ready to receive data if bit 7 of val == 0
+ */
+ if (!(val & 0x80)) {
+ outb(cmd, port + DSP_COMMAND);
+ return 0;
+ }
+ cpu_relax();
+ } while (loop--);
+
+ snd_printk(KERN_ERR "DSP Command (0x%x) timeout.\n", cmd);
+
+ return -EAGAIN;
+}
+
+static int __devinit sc6000_dsp_get_answer(int port, int command, char *data,
+ int data_len)
+{
+ int len = 0;
+
+ if (sc6000_write(port, command)) {
+ snd_printk(KERN_ERR "CMD 0x%x: failed!\n", command);
+ return -EFAULT;
+ }
+
+ do {
+ int val = sc6000_read(port);
+
+ if (val < 0)
+ break;
+
+ data[len++] = val;
+
+ } while (len < data_len);
+
+ /*
+ * If no more data available, return to the caller, no error if len>0.
+ * We have no other way to know when the string is finished.
+ */
+ return len ? len : -EIO;
+}
+
+static int __devinit sc6000_dsp_reset(int port)
+{
+ outb(1, port + DSP_RESET);
+ udelay(10);
+ outb(0, port + DSP_RESET);
+ udelay(20);
+ if (sc6000_read(port) == 0xaa)
+ return 0;
+ return -EBUSY;
+}
+
+/* detection and initialization */
+static int __devinit sc6000_cfg_write(int port, unsigned char softcfg)
+{
+
+ if (sc6000_write(port, WRITE_MDIRQ_CFG)) {
+ snd_printk(KERN_ERR "CMD 0x%x: failed!\n", WRITE_MDIRQ_CFG);
+ return -EIO;
+ }
+ if (sc6000_write(port, softcfg)) {
+ snd_printk(KERN_ERR "sc6000_cfg_write: failed!\n");
+ return -EIO;
+ }
+ return 0;
+}
+
+static int __devinit sc6000_setup_board(int port, int config)
+{
+ int loop = 10;
+
+ do {
+ if (sc6000_write(port, COMMAND_88)) {
+ snd_printk(KERN_ERR "CMD 0x%x: failed!\n",
+ COMMAND_88);
+ return -EIO;
+ }
+ } while ((sc6000_wait_data(port) < 0) && loop--);
+
+ if (sc6000_read(port) < 0) {
+ snd_printk(KERN_ERR "sc6000_read after CMD 0x%x: failed\n",
+ COMMAND_88);
+ return -EIO;
+ }
+
+ if (sc6000_cfg_write(port, config))
+ return -EFAULT;
+
+ return 0;
+}
+
+static int __devinit sc6000_init_mss(int port, int config, int mss_port,
+ int mss_config)
+{
+ if (sc6000_write(port, DSP_INIT_MSS)) {
+ snd_printk(KERN_ERR "sc6000_init_mss [0x%x]: failed!\n",
+ DSP_INIT_MSS);
+ return -EIO;
+ }
+
+ msleep(10);
+
+ if (sc6000_cfg_write(port, config))
+ return -EIO;
+
+ outb(mss_config, mss_port);
+
+ return 0;
+}
+
+static int __devinit sc6000_init_board(int port, int irq, int dma,
+ int mss_port, int mpu_irq)
+{
+ char answer[15];
+ char version[2];
+ int mss_config = sc6000_irq_to_softcfg(irq) |
+ sc6000_dma_to_softcfg(dma);
+ int config = mss_config |
+ sc6000_mpu_irq_to_softcfg(mpu_irq);
+
+ if (sc6000_dsp_reset(port)) {
+ snd_printk(KERN_ERR "sc6000_dsp_reset: failed!\n");
+ return -EBUSY;
+ }
+
+ if (sc6000_dsp_get_answer(port, GET_DSP_COPYRIGHT, answer, 15) <= 0) {
+ snd_printk(KERN_ERR "sc6000_dsp_copyright: failed!\n");
+ return -ENODEV;
+ }
+ /*
+ * My SC-6000 card return "SC-6000" in DSPCopyright, so
+ * if we have something different, we have to be warned.
+ * Mine returns SC-6000A - KH
+ */
+ if (strncmp("SC-6000", answer, 7))
+ snd_printk(KERN_WARNING "Warning: non SC-6000 audio card!\n");
+
+ if (sc6000_dsp_get_answer(port, GET_DSP_VERSION, version, 2) < 2) {
+ snd_printk(KERN_ERR "sc6000_dsp_version: failed!\n");
+ return -ENODEV;
+ }
+ printk(KERN_INFO PFX "Detected model: %s, DSP version %d.%d\n",
+ answer, version[0], version[1]);
+
+ /*
+ * 0x0A == (IRQ 7, DMA 1, MIRQ 0)
+ */
+ if (sc6000_cfg_write(port, 0x0a)) {
+ snd_printk(KERN_ERR "sc6000_cfg_write: failed!\n");
+ return -EFAULT;
+ }
+
+ if (sc6000_setup_board(port, config) < 0) {
+ snd_printk(KERN_ERR "sc6000_setup_board: failed!\n");
+ return -ENODEV;
+ }
+
+ if (sc6000_init_mss(port, config, mss_port,
+ mss_config) < 0) {
+ snd_printk(KERN_ERR "Can not initialize"
+ "Microsoft Sound System mode.\n");
+ return -ENODEV;
+ }
+
+ return 0;
+}
+
+static int __devinit snd_sc6000_detect(int dev, int irq, int dma)
+{
+ int err = -ENODEV;
+
+ snd_printd("Initializing BASE[0x%lx] IRQ[%d] DMA[%d] MIRQ[%d]\n",
+ port[dev], irq, dma,
+ mpu_irq[dev] == SND_AUTO_IRQ ? 0 : mpu_irq[dev]);
+
+/*
+ * We must request the port region because these are the I/O
+ * ports to access card's control registers.
+ */
+ if (!request_region(port[dev], 0x10, "sc-6000 (base)")) {
+ snd_printk(KERN_ERR
+ "SC-6000 port I/O port region is already in use.\n");
+ return -EBUSY;
+ }
+
+ err = sc6000_init_board(port[dev], irq, dma,
+ mss_port[dev], mpu_irq[dev]);
+
+ return err;
+}
+
+static int __devinit snd_sc6000_mixer(struct snd_ad1848 *chip)
+{
+ struct snd_card *card = chip->card;
+ struct snd_ctl_elem_id id1, id2;
+ int err;
+
+ memset(&id1, 0, sizeof(id1));
+ memset(&id2, 0, sizeof(id2));
+ id1.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
+ id2.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
+ /* reassign AUX0 to FM */
+ strcpy(id1.name, "Aux Playback Switch");
+ strcpy(id2.name, "FM Playback Switch");
+ err = snd_ctl_rename_id(card, &id1, &id2);
+ if (err < 0)
+ return err;
+ strcpy(id1.name, "Aux Playback Volume");
+ strcpy(id2.name, "FM Playback Volume");
+ err = snd_ctl_rename_id(card, &id1, &id2);
+ if (err < 0)
+ return err;
+ /* reassign AUX1 to CD */
+ strcpy(id1.name, "Aux Playback Switch"); id1.index = 1;
+ strcpy(id2.name, "CD Playback Switch");
+ err = snd_ctl_rename_id(card, &id1, &id2);
+ if (err < 0)
+ return err;
+ strcpy(id1.name, "Aux Playback Volume");
+ strcpy(id2.name, "CD Playback Volume");
+ err = snd_ctl_rename_id(card, &id1, &id2);
+ if (err < 0)
+ return err;
+ return 0;
+}
+
+static int __devinit snd_sc6000_match(struct device *devptr, unsigned int dev)
+{
+ if (!enable[dev])
+ return 0;
+ if (port[dev] == SNDRV_AUTO_PORT) {
+ printk(KERN_ERR PFX "specify IO port\n");
+ return 0;
+ }
+ if (mss_port[dev] == SNDRV_AUTO_PORT) {
+ printk(KERN_ERR PFX "specify MSS port\n");
+ return 0;
+ }
+ if (port[dev] != 0x220 && port[dev] != 0x240) {
+ printk(KERN_ERR PFX "Port must be 0x220 or 0x240\n");
+ return 0;
+ }
+ if (mss_port[dev] != 0x530 && mss_port[dev] != 0xe80) {
+ printk(KERN_ERR PFX "MSS port must be 0x530 or 0xe80\n");
+ return 0;
+ }
+ if (irq[dev] != SNDRV_AUTO_IRQ && !sc6000_irq_to_softcfg(irq[dev])) {
+ printk(KERN_ERR PFX "invalid IRQ %d\n", irq[dev]);
+ return 0;
+ }
+ if (dma[dev] != SNDRV_AUTO_DMA && !sc6000_dma_to_softcfg(dma[dev])) {
+ printk(KERN_ERR PFX "invalid DMA %d\n", dma[dev]);
+ return 0;
+ }
+ if (mpu_port[dev] != SNDRV_AUTO_PORT &&
+ (mpu_port[dev] & ~0x30L) != 0x300) {
+ printk(KERN_ERR PFX "invalid MPU-401 port %lx\n",
+ mpu_port[dev]);
+ return 0;
+ }
+ if (mpu_port[dev] != SNDRV_AUTO_PORT &&
+ mpu_irq[dev] != SNDRV_AUTO_IRQ && mpu_irq[dev] != 0 &&
+ !sc6000_mpu_irq_to_softcfg(mpu_irq[dev])) {
+ printk(KERN_ERR PFX "invalid MPU-401 IRQ %d\n", mpu_irq[dev]);
+ return 0;
+ }
+ return 1;
+}
+
+static int __devinit snd_sc6000_probe(struct device *devptr, unsigned int dev)
+{
+ static int possible_irqs[] = { 5, 7, 9, 10, 11, -1 };
+ static int possible_dmas[] = { 1, 3, 0, -1 };
+ int err;
+ int xirq = irq[dev];
+ int xdma = dma[dev];
+ struct snd_card *card;
+ struct snd_ad1848 *chip;
+ struct snd_opl3 *opl3;
+
+ card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
+ if (!card)
+ return -ENOMEM;
+
+ if (xirq == SNDRV_AUTO_IRQ) {
+ xirq = snd_legacy_find_free_irq(possible_irqs);
+ if (xirq < 0) {
+ snd_printk(KERN_ERR "unable to find a free IRQ\n");
+ err = -EBUSY;
+ goto _err;
+ }
+ }
+
+ if (xdma == SNDRV_AUTO_DMA) {
+ xdma = snd_legacy_find_free_dma(possible_dmas);
+ if (xdma < 0) {
+ snd_printk(KERN_ERR "unable to find a free DMA\n");
+ err = -EBUSY;
+ goto _err;
+ }
+ }
+
+ err = snd_sc6000_detect(dev, xirq, xdma);
+ if (err < 0)
+ goto _err;
+
+ err = snd_ad1848_create(card, mss_port[dev] + 4, xirq, xdma,
+ AD1848_HW_DETECT, &chip);
+ if (err < 0)
+ goto _err;
+ card->private_data = chip;
+
+ err = snd_ad1848_pcm(chip, 0, NULL);
+ if (err < 0) {
+ snd_printk(KERN_ERR
+ "error creating new ad1848 PCM device\n");
+ goto _err;
+ }
+ err = snd_ad1848_mixer(chip);
+ if (err < 0) {
+ snd_printk(KERN_ERR "error creating new ad1848 mixer\n");
+ goto _err;
+ }
+ err = snd_sc6000_mixer(chip);
+ if (err < 0) {
+ snd_printk(KERN_ERR "the mixer rewrite failed\n");
+ goto _err;
+ }
+ if (snd_opl3_create(card,
+ 0x388, 0x388 + 2,
+ OPL3_HW_AUTO, 0, &opl3) < 0) {
+ snd_printk(KERN_ERR "no OPL device at 0x%x-0x%x ?\n",
+ 0x388, 0x388 + 2);
+ } else {
+ err = snd_opl3_timer_new(opl3, 0, 1);
+ if (err < 0)
+ goto _err;
+
+ err = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
+ if (err < 0)
+ goto _err;
+ }
+
+ if (mpu_port[dev] != SNDRV_AUTO_PORT) {
+ if (mpu_irq[dev] == SNDRV_AUTO_IRQ)
+ mpu_irq[dev] = -1;
+ if (snd_mpu401_uart_new(card, 0,
+ MPU401_HW_MPU401,
+ mpu_port[dev], 0,
+ mpu_irq[dev],
+ mpu_irq[dev] >= 0 ? IRQF_DISABLED : 0,
+ NULL) < 0)
+ snd_printk(KERN_ERR "no MPU-401 device at 0x%lx ?\n",
+ mpu_port[dev]);
+ }
+
+ strcpy(card->driver, "Gallant SC-6000");
+ strcpy(card->shortname, "Gallant SC-6000");
+ sprintf(card->longname, "Gallant SC-6000 at 0x%lx, irq %d, dma %d",
+ mss_port[dev], xirq, xdma);
+
+ snd_card_set_dev(card, devptr);
+
+ err = snd_card_register(card);
+ if (err < 0)
+ goto _err;
+
+ dev_set_drvdata(devptr, card);
+ return 0;
+
+ _err:
+ snd_card_free(card);
+ return err;
+}
+
+static int __devexit snd_sc6000_remove(struct device *devptr, unsigned int dev)
+{
+ release_region(port[dev], 0x10);
+
+ snd_card_free(dev_get_drvdata(devptr));
+ dev_set_drvdata(devptr, NULL);
+ return 0;
+}
+
+static struct isa_driver snd_sc6000_driver = {
+ .match = snd_sc6000_match,
+ .probe = snd_sc6000_probe,
+ .remove = __devexit_p(snd_sc6000_remove),
+ /* FIXME: suspend/resume */
+ .driver = {
+ .name = "sc6000",
+ },
+};
+
+
+static int __init alsa_card_sc6000_init(void)
+{
+ return isa_register_driver(&snd_sc6000_driver, SNDRV_CARDS);
+}
+
+static void __exit alsa_card_sc6000_exit(void)
+{
+ isa_unregister_driver(&snd_sc6000_driver);
+}
+
+module_init(alsa_card_sc6000_init)
+module_exit(alsa_card_sc6000_exit)
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH] Gallant SC-6000 driver (4th version)
2007-09-05 20:25 Krzysztof Helt
@ 2007-09-05 21:53 ` Rene Herman
0 siblings, 0 replies; 13+ messages in thread
From: Rene Herman @ 2007-09-05 21:53 UTC (permalink / raw)
To: Krzysztof Helt; +Cc: Alsa-devel
On 09/05/2007 10:25 PM, Krzysztof Helt wrote:
> I have left the ISA autodetection. It makes driver usage simpler for user.
> The base port, mpu port and mss port can be read from jumper settings,
> but irq or dma is not settable. A system may figure out which one is free
> and use it.
The problem is that this "simplification" might actually leave the non-aware
user scratching his head for far longer than if he has to spell things out.
He could for example very well need to go into his BIOS and set the IRQ to
"Legacy ISA" to even have that IRQ available to the ISA bus on some systems
(such as mine, at least for some IRQs -- things tend to fail in the most
mysterious of ways sometimes otherwise).
Even without that problem, we have the problem of IRQs that's only _appear_
to be free. IRQ7 for example will usually be assigned to the first parallel
port but will only show up as taken if the parport driver is loaded. Often,
it'll still actually work, but (again) here for example, it does not.
Non-PnP ISA is an enormous crap bus -- the more you try to make up for it by
trying to be smart in software the bigger the problems the user has when it
doesn't actually work since you hid the details of how it worked by trying
to be nice.
Add in the fact that all this auto-probing is a gigantic race-by-design (the
probe releases the resource again, so someone can come along and grab them
then) and I really violently dislike auto-probing on ISA.
It's not like people using legacy ISA in this day and age are not normally
nerds anyway...
> I post this driver despite my question if it can be integrated into the sgalaxy driver.
> I think that I can post it and see if it work for people and maybe contact
> someone with SC-6600 model so the driver can be extended to handle this
> chip also. It would replace the OSS driver completely then.
Yes. I am looking at the sound galaxy driver at the moment and am in fact
now trying to think of why I want to use the WSS part of the card and not
just the SBP part. In DOS, the card is setup in SB Pro mode by default as
well, and the CS42xx seems to only be present really for Windows Sound
System compatibility for old 16-bit Windows.
I'll keep it all in since loosing the information of _how_ to switch to WSS
mode would be a shame, but I see very little reson in fact for not simply
using the card in SB Pro mode. I guess the same may hold for your card...
> I am getting feeling that ad1848 and cs4231 libraries could be merged (or at least
> produce some common part like mss_lib). This may allow to merge drivers using
> cs4231-lib and ad1848-lib. I'll look into this
They could. An AD1848 (== CS4248) is the basic and original model and a
CS4231 is just a slightly more capable, and pin-compatible, version.
cs4231_lib will actually drive an AD1848, so the "merging" could largely
consist of throwing out ad1848_lib. The latter is sort of nicely minimal
though..
> (I do not have the CS4231 based card but I should have it next week -
> Sound Galaxy Waverider).
Am testing on that one currently -- will post the driver before next week.
> +static __devinit unsigned char sc6000_irq_to_softcfg(int irq)
> +{
> + unsigned char val = 0;
> +
> + switch (irq) {
> + case 5:
> + val = 0x28;
> + break;
> + case 7:
> + val = 0x8;
> + break;
> + case 9:
> + val = 0x10;
> + break;
> + case 10:
> + val = 0x18;
> + break;
> + case 11:
> + val = 0x20;
> + break;
> + default:
> + break;
> + }
> + return val;
> +}
Quite sure that 5 works by the way? On a Sound Galaxy, 5 only works for the
SB part (and 11 only for the WSS).
(remainder only glossed over)
Rene.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2007-09-07 12:17 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-06 6:49 [PATCH] Gallant SC-6000 driver (4th version) Krzysztof Helt
2007-09-06 10:12 ` Rene Herman
2007-09-06 11:20 ` Rene Herman
2007-09-06 14:03 ` Krzysztof Helt
2007-09-06 15:18 ` Rene Herman
2007-09-07 8:34 ` full duplex AD1848 (was SC-6000 driver) Krzysztof Helt
2007-09-07 12:00 ` Rene Herman
2007-09-06 21:12 ` [PATCH] Gallant SC-6000 driver (4th version) Krzysztof Helt
2007-09-06 21:16 ` Rene Herman
2007-09-07 11:11 ` Takashi Iwai
2007-09-07 12:11 ` Rene Herman
-- strict thread matches above, loose matches on Subject: below --
2007-09-05 20:25 Krzysztof Helt
2007-09-05 21:53 ` Rene Herman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.