Re: New sound driver version available

Nikita Schmidt (cetus@snowball.ucd.ie)
Fri, 7 Feb 1997 18:06:15 +0000 (GMT)


A bug in ossfree-3.8-beta4 makes full duplex inaccessible in AD1848
based cards (ad1848_init no longer calls ad1848_detect so that audio
flags are left unset). The quick workaround is to put ad1848_detect
back (see patch 1 below) - this causes one extra detection, though.
Probably Hannu can invent a better solution.
There are also two small full-duplex related bugs in SNDCTL_DSP_SETDUPLEX
and SNDCTL_DSP_GETCAPS ioctls (see patch 1 for fixes).

The driver included in 2.0.28 also prevents ad1848 family from utilizing
full duplex capabilities: when output starts it stops the input (see
patch 2).

One suggestion: the MSS-compatible device used in AlphaStations (called
msb) is full-duplex capable; however, Linux MSS driver cannot be configured
for full duplex (although it can run in full duplex mode if patch 1 or 2
is applied). Maybe it's worth to add this feature? (See patch 3.)

Kit.

========================== Patch 1 (2.1.x kernels) ==========================
diff -u -r sound.orig/ad1848.c sound/ad1848.c
--- sound.orig/ad1848.c Fri Feb 7 15:56:24 1997
+++ sound/ad1848.c Fri Feb 7 15:55:33 1997
@@ -2327,6 +2327,9 @@
int dma = hw_config->dma;
int dma2 = hw_config->dma2;

+ if (!ad1848_detect (hw_config->io_base + 4, &ad_flags, hw_config->osp))
+ return;
+
if (hw_config->card_subtype == 1) /* Has no IRQ/DMA registers */
{
ad1848_init ("MS Sound System", hw_config->io_base + 4,
diff -u -r sound.orig/audio.c sound/audio.c
--- sound.orig/audio.c Fri Feb 7 15:32:23 1997
+++ sound/audio.c Fri Feb 7 15:35:50 1997
@@ -461,7 +461,7 @@
int info = 1; /* Revision level of this ioctl() */

if (audio_devs[dev]->flags & DMA_DUPLEX &&
- audio_mode[dev] == OPEN_READWRITE)
+ audio_devs[dev]->open_mode == OPEN_READWRITE)
info |= DSP_CAP_DUPLEX;

if (audio_devs[dev]->coproc)
@@ -516,7 +516,7 @@
return (*(int *) arg = audio_devs[dev]->d->set_bits (dev, 0));

case SNDCTL_DSP_SETDUPLEX:
- if (audio_mode[dev] != OPEN_READWRITE)
+ if (audio_devs[dev]->open_mode != OPEN_READWRITE)
return -EPERM;
if (audio_devs[dev]->flags & DMA_DUPLEX)
return 0;
============================== End of patch 1 ===============================

========================== Patch 2 (2.0.x kernels) ==========================
diff -u -r orig/ad1848.c ./ad1848.c
--- orig/ad1848.c Wed Aug 21 07:18:09 1996
+++ ./ad1848.c Sun Feb 2 13:41:36 1997
@@ -828,8 +829,8 @@
save_flags (flags);
cli ();

- /* ad_write (devc, 9, ad_read (devc, 9) & ~ 0x01); / * Playback disable */
- ad1848_halt (dev);
+ ad_write (devc, 9, ad_read (devc, 9) & ~ 0x01); /* Playback disable */
+ /* ad1848_halt (dev); */
DMAbuf_start_dma (dev, buf, count, DMA_MODE_WRITE);

ad_write (devc, 15, (unsigned char) (cnt & 0xff));
============================== End of patch 2 ===============================

======================== Patch 3 (all 2.x.x kernels) ========================
diff -u orig/configure.c ./configure.c
--- orig/configure.c Wed Sep 25 19:35:30 1996
+++ ./configure.c Wed Dec 4 23:42:39 1996
@@ -945,6 +945,12 @@
3,
"0, 1 or 3");

+ ask_int_choice (B (OPT_MSS), "MSS_DMA2",
+ "MSS/WSS second DMA (if any)",
+ FMT_INT,
+ -1,
+ "0, 1 or 3");
+
ask_int_choice (B (OPT_SSCAPE), "SSCAPE_BASE",
"SoundScape MIDI I/O base",
FMT_HEX,
diff -u orig/dev_table.h ./dev_table.h
--- orig/dev_table.h Fri Sep 20 15:00:35 1996
+++ ./dev_table.h Wed Dec 4 23:43:26 1996
@@ -416,9 +416,13 @@

#ifdef CONFIG_MSS
# ifdef DESKPROXL
- {SNDCARD_DESKPROXL, {MSS_BASE, MSS_IRQ, MSS_DMA, -1}, SND_DEFAULT_ENABLE},
+ {SNDCARD_DESKPROXL, {MSS_BASE, MSS_IRQ, MSS_DMA, MSS_DMA2}, SND_DEFAULT_ENABLE},
# else
- {SNDCARD_MSS, {MSS_BASE, MSS_IRQ, MSS_DMA, -1}, SND_DEFAULT_ENABLE},
+ {SNDCARD_MSS, {MSS_BASE, MSS_IRQ, MSS_DMA, MSS_DMA2}, SND_DEFAULT_ENABLE},
# endif
# ifdef MSS2_BASE
{SNDCARD_MSS, {MSS2_BASE, MSS2_IRQ, MSS2_DMA, -1}, SND_DEFAULT_ENABLE},
============================== End of patch 3 ===============================