From alsa-devel-owner@alsa.jcu.cz  Tue May 19 15:06:01 1998
Received: from entry.jcu.cz (perex@entry.jcu.cz [160.217.1.111])
	by marvin.jcu.cz (8.8.8/8.8.8) with SMTP id PAA16151;
	Tue, 19 May 1998 15:03:45 +0200
Date: Tue, 19 May 1998 15:03:45 +0200 (MET DST)
From: Jaroslav Kysela <perex@jcu.cz>
To: LGB of DC <lgb@hal2000.hal.vein.hu>
cc: alsa-devel@alsa.jcu.cz
Subject: Re: alsa does not work with xanim
In-Reply-To: <19980518154103.57817@hal2000.hal.vein.hu>
Message-ID: <Pine.LNX.3.96.980519144259.4582N-100000@entry.jcu.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On Mon, 18 May 1998, LGB of DC wrote:

> Hello !
> 
> Xanim does not play any sound with alsa driver (0.1.1). It is a known
> problem ?

Xanim works for me... Version 2.70.6.4 here... Check volume level - xanim
sets very loud volume by default...

> I've also got problems with mikmod (software mixing based
> xm, s3m, mod player). It simply does not do anything after loading
> the music module.

Checked... Looks like mikmod have very strange bug in OSS code, which
shouldn't be happen with OSS driver which doesn't support 128kB DMA...
Mikmod uses to store fragment size 32-bit integer variable. This is good,
but in internal routines fragment should be max 16-bit. With ALSA driver
and 128kB DMA buffer is fragment size 65536 (2 * 65536 = 128kB) which
means (in 16-bit) zero. Grr... Please, contact author of MikMod's OSS
code or MikMod maintainer to fix this bug...

Here is my patch (or use 64kB DMA size only):

==================================================================
--- drv_vox.c.old       Tue May 19 14:12:48 1998
+++ drv_vox.c   Tue May 19 14:18:15 1998
@@ -44,8 +44,8 @@
 #include <sys/wait.h>
 #include "mikmod.h"

-#define DEFAULT_FRAGSIZE 17
-#define DEFAULT_NUMFRAGS 4
+#define DEFAULT_FRAGSIZE 15
+#define DEFAULT_NUMFRAGS 8

 static int sndfd;
 static int fragmentsize;
@@ -72,7 +72,7 @@
        fragsize=(env=getenv("MM_FRAGSIZE")) ? atoi(env) :
DEFAULT_FRAGSIZE;
        numfrags=(env=getenv("MM_NUMFRAGS")) ? atoi(env) :
DEFAULT_NUMFRAGS;

-       if(fragsize<7 || fragsize>17)  fragsize=DEFAULT_FRAGSIZE;
+       if(fragsize<7 || fragsize>15)  fragsize=DEFAULT_FRAGSIZE;
        if(numfrags<2 || numfrags>255) numfrags=DEFAULT_NUMFRAGS;

        fragmentsize=(numfrags<<16) | fragsize;
===================================================================

> By the way, do you plan to adapt ultrasound projects'
> mod and midi player for alsa ? [will it support both of wavetables sound
> card native directly and dsp-pnly cards ?

Yes, we are planning sequencer interface... It's at this time in design
stage, but (I hope) it should be best sequencer interface for *nix...
I'm planning port wavetable routines from ultra sound driver to ALSA
driver.

And no, I don't plan work on any sound application. I'm very busy with
work on ALSA driver...

						Jaroslav

-----
Jaroslav Kysela <perex@jcu.cz>
Academic Computer Centre, University of South Bohemia
Branisovska 31, C. Budejovice, CZ-370 05 Czech Republic


