Skip to contentSkip to conversation

Gallant SC-6000 driver (4th version)

PATCH Krzysztof Helt 4 participants 11 messages Sep 6, 2007 – Sep 7, 2007

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines · Rene Herman
Quoted 1 line · Krzysztof Helt

I have left the ISA autodetection. It makes driver usage

simpler for user.

Quoted 1 line
Quoted 1 line

The base port, mpu port and mss port can be read from jumper

settings,

Quoted 1 line
Quoted 1 line

but irq or dma is not settable. A system may figure out which

one is free

Quoted 3 lines
Quoted 1 line

and use it.

The problem is that this "simplification" might actually leave

the non-aware

Quoted 1 line

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.

Quoted 1 line

Even without that problem, we have the problem of IRQs that's

only _appear_

Quoted 1 line

to be free. IRQ7 for example will usually be assigned to the

first parallel

Quoted 1 line

port but will only show up as taken if the parport driver is

loaded. Often,

Quoted 1 line

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).

Quoted 1 line

It's not like people using legacy ISA in this day and age are

not normally

Quoted 1 line

nerds anyway...

That's the best argument.

Quoted 1 line

Yes. I am looking at the sound galaxy driver at the moment and

am in fact

Quoted 1 line

now trying to think of why I want to use the WSS part of the

card and not

Quoted 1 line

just the SBP part. In DOS, the card is setup in SB Pro mode by

default as

Quoted 1 line

well, and the CS42xx seems to only be present really for

Windows Sound

Quoted 1 line

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.

Quoted 1 line
Quoted 1 line

(I do not have the CS4231 based card but I should have it next

week -

Quoted 3 lines
Quoted 1 line

Sound Galaxy Waverider).

Am testing on that one currently -- will post the driver before

next week.

I'll be happy to test it too.

Quoted 1 line

Quite sure that 5 works by the way? On a Sound Galaxy, 5 only

works for the

Quoted 1 line

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

#1 lore raw
Quoted 3 lines · Krzysztof Helt

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

Quoted 2 lines

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...

Quoted 7 lines
Quoted 2 lines

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.

#2 lore raw
Quoted 3 lines · Rene Herman

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.

#3 lore raw
In reply to Rene Herman
Quoted 9 lines · On Thu, 06 Sep 2007 12:12:42 +0200 Rene Herman <[email protected]> wrote:
Quoted 3 lines · Krzysztof Helt

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. [...]

Quoted 7 lines

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

#4 lore raw
Quoted 19 lines · Krzysztof Helt
Quoted 8 lines · On Thu, 06 Sep 2007 12:12:42 +0200 Rene Herman <[email protected]> wrote:
Quoted 3 lines · Krzysztof Helt

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. [...]

Quoted 7 lines

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.

Quoted 4 lines

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...

Quoted 1 line

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!

Quoted 3 lines

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.

#5 lore raw

At Thu, 06 Sep 2007 23:16:39 +0200,

Quoted 27 lines · Rene Herman
Quoted 19 lines · Krzysztof Helt
Quoted 8 lines · On Thu, 06 Sep 2007 12:12:42 +0200 Rene Herman <[email protected]> wrote:
Quoted 3 lines · Krzysztof Helt

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. [...]

Quoted 7 lines

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.

Quoted 4 lines

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).

Quoted 8 lines

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...

Quoted 1 line

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.

Quoted 6 lines
Quoted 3 lines

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

#6 lore raw
Quoted 5 lines · Takashi Iwai

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 :-)

Quoted 3 lines

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.

#7 lore raw
In reply to Krzysztof Helt

Dnia 6-09-2007 o godz. 13:20 Rene Herman napisał(a):

Quoted 3 lines · Rene Herman
Quoted 2 lines

Full duplex (simultaneous playback and capture) is something

that

Quoted 1 line
Quoted 1 line

neither Sb Pro nor CS4231 does. I do see that SB Pro doesn't

natively

Quoted 3 lines
Quoted 1 line

support S16_LE it seems...

Sorry, incorrect -- the cs4231 is full duplex. It's only the

cs4248 (ad1848)

Quoted 1 line

which is not. Need to figure out how to do full duplex on a

sound galaxy;

Quoted 2 lines

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

#8 lore raw
Quoted 7 lines · Krzysztof Helt

Dnia 6-09-2007 o godz. 13:20 Rene Herman napisał(a):

Quoted 4 lines

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
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#9 lore raw

Re: full duplex AD1848 (was SC-6000 driver)

Quoted 8 lines · On Thu, 06 Sep 2007 17:18:07 +0200 Rene Herman <[email protected]> wrote:
Quoted 6 lines · Krzysztof Helt

Dnia 6-09-2007 o godz. 13:20 Rene Herman napisał(a):

Quoted 4 lines

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

#10 lore raw

Re: full duplex AD1848 (was SC-6000 driver)

Quoted 3 lines · Krzysztof Helt

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...

Quoted 6 lines

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.

Quoted 2 lines

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.