From alsa-user-owner@alsa.jcu.cz  Wed Jul  8 04:07:03 1998
Received: from pump2.york.ac.uk (pump2.york.ac.uk [144.32.128.12])
	by marvin.jcu.cz (8.8.8/8.8.8) with ESMTP id EAA02811
	for <alsa-user@alsa.jcu.cz>; Wed, 8 Jul 1998 04:07:00 +0200
Received: from tower.york.ac.uk (so101@tower.york.ac.uk [144.32.128.6])
	by pump2.york.ac.uk (8.8.7/8.8.7) with SMTP id DAA02592
	for <alsa-user@alsa.jcu.cz>; Wed, 8 Jul 1998 03:07:00 +0100 (BST)
Date: Wed, 8 Jul 1998 03:06:59 +0100 (BST)
From: Stephen Oxley <so101@york.ac.uk>
To: alsa-user@alsa.jcu.cz
Subject: SB16 ViBRA16X PnP partial solution.
Message-ID: <Pine.SGI.3.95L.980708022453.11686B-100000@tower.york.ac.uk>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-user@alsa.jcu.cz
Sender: alsa-user-owner@alsa.jcu.cz
Precedence: list

Quick recap:(see earlier emails for more info)

ViBRA16X cards have two low dma channels (0,1,3)
ALSA needs the 16 bit channel to be 5 or above.
Only workable solution I or others could find resulted in a shared 8 bit
dma channel created for playing sound OR recording sound. 

cd quality sound played through this channel is turned into 8 bit audio
and has a bad hiss and blips in. Also since it is a SHARED 8 bit channel
this means half duplex.

This partial solution doesn't result in full duplex sound but it does turn
the shared 8 bit channel into a shared 16 bit channel, giving cd quality
recording and playback - hurrah.

I'm not really sure how much detail I should go into here, so I shall try
and keep it brief.

Change source code to allow low dma values for 16bit dma:
in file cards/sb16.c:

<   static int possible_dmas16[] = { 5, 6, 7, -1 };
>   static int possible_dmas16[] = { 0, 1, 3, 5, 6, 7, -1 };

<   if ( (snd_dma16[ dev ] >= 4 && snd_dma16[ dev ] <= 7) || snd_dma16[
dev ] == SND_AUTO_DMA ) {
>   if ( (snd_dma16[ dev ] >= 0 && snd_dma16[ dev ] <= 7) || snd_dma16[
dev ] == SND_AUTO_DMA ) {

in file lowlevel/sb/sb.c:
<if ( codec -> dma16num != SND_DMA_DISABLE ) {
<    switch ( codec -> dma16 ) {
<      case 5: dmareg |= 0x20; break;
<      case 6: dmareg |= 0x40; break;
<      case 7: dmareg |= 0x80; break;
>  if ( codec -> dma16num != SND_DMA_DISABLE ) {
>    switch ( codec -> dma16 ) {
>      case 0: dmareg |= 0x01; break;
>      case 1: dmareg |= 0x02; break;
>      case 3: dmareg |= 0x08; break;
>      case 5: dmareg |= 0x20; break;
>      case 6: dmareg |= 0x40; break;
>      case 7: dmareg |= 0x80; break;

(recompile and reinstall)

/etc/isapnp.conf:

(READPORT 0x0203)
(ISOLATE)
(IDENTIFY *)
(CONFIGURE CTL00f0/-1 (LD 0
 (INT 0 (IRQ 7 (MODE +E)))
 (DMA 0 (CHANNEL 0))
 (DMA 1 (CHANNEL 1))
 (IO 0 (BASE 0x0220))
 (IO 1 (BASE 0x0330))
 (IO 2 (BASE 0x0388))
 (ACT Y)
))
(CONFIGURE CTL00f0/-1 (LD 1
))
(WAITFORKEY)

(all #'s deleted to save space)

I'm not saying to change your file to exactly this, but I would recommend
changing the dma 0 and dma 1 line to be this.

/etc/conf.modules
options snd-sb16 snd_port=0x220 snd_mpu_port=0x330 snd_irq=7 snd_dma8=9 
snd_dma16=0

the snd_dma8=9 is a red herring, it just means not to use the 8 bit dma.
IF all goes well you should get a shared 16 bit port. I haven't been able
to have the 8 bit port working at the same time though, so no full duplex
sound.

I have a theory to as why not, but it is incomprehensible so i just
deleted it. If anyone is interested though.... 

Is anyone working on proper support for the vibra16x?  I'm getting fed up
of changing to oss-linux everytime I want a full duplex fix...

steve.

ps. should this have been posted to developer?


