[nas] nasd SIGFPE

Jon Trulson jon at radscan.com
Sun Jun 20 15:42:01 MDT 2004


On Fri, 7 May 2004, Tobias Diedrich wrote:

> From: Tobias Diedrich <ranma at tdiedrich.de>
> Date: Fri, 7 May 2004 21:36:32 +0200
> Subject: Re: [nas] nasd SIGFPE
> To: Jon Trulson <jon at radscan.com>
> X-Spam-Status: No, hits=-4.7 required=5.0 tests=BAYES_00,RCVD_IN_NJABL,
> 	RCVD_IN_SORBS autolearn=no version=2.60
>
> Jon Trulson wrote:
>
> > 	Sorry it took so long to look at this... It needed some
> > investigation.  Please try the attached patch and see if that helps.  It
> > will ensure that the samplerate is rounded up or down as neccessary to
> > ensure it fits within the parameters of your soundcard config.  I think
> > this is reasonable behavior...
> >
> > 	It's certainly better than crashing :)
>
> It's still crashing... ^^;
> You should be able to use the attached source to reproduce the problem.
> :-)
>

	Your testcase was quite useful :) I also needed to check
elementRate in addition to globalRate for zero values.  See if the
attached patch for server/dia/auprocess.c (for 1.6c) helps any.

	I will now just warn via osLogMsg() and force it to
auSetup.minSampleRate.

-- 
Jon Trulson    mailto:jon at radscan.com
ID: 1A9A2B09, FP: C23F328A721264E7 B6188192EC733962
PGP keys at http://radscan.com/~jon/PGPKeys.txt
#include <std/disclaimer.h>
"I am Nomad." -Nomad
-------------- next part --------------
Index: server/dia/auprocess.c
===================================================================
RCS file: /home/jon/src/repository/nas/server/dia/auprocess.c,v
retrieving revision 1.2
diff -u -r1.2 auprocess.c
--- server/dia/auprocess.c	1999/09/05 02:43:12	1.2
+++ server/dia/auprocess.c	2004/06/20 21:31:55
@@ -1188,6 +1188,7 @@
 {
     AuUint32        elementRate;
     ComponentPtr    c = flowEl->component;
+    extern auConnSetup auSetup;
 
     if (!flowEl->setup)
     {
@@ -1224,6 +1225,14 @@
     else
 	elementRate = c->sampleRate;
 
+    /* sanity - 6/20/2004, for bug report by Tobias Diedrich */
+    if (!elementRate)
+      {
+        osLogMsg("doSetup: elementRate == 0! Forcing to %d\n",
+                 auSetup.minSampleRate);
+        elementRate = auSetup.minSampleRate;
+      }
+
     if (flowEl->raw->type != AuElementTypeImportWaveForm)
 	flowEl->nextSample = isInput ? (elementRate << 16) / globalRate :
 	    (globalRate << 16) / elementRate;
@@ -1269,24 +1278,21 @@
 	writeClient, writeDevice, writeBucket, (AuBool (*) ()) 0,
 	writeMonitor
     };
-
-    if (rate)
-    {
-	if (rate > auSetup.maxSampleRate)
-	    rate = auSetup.maxSampleRate;
-
-	if (rate < auSetup.minSampleRate)
-	    rate = auSetup.minSampleRate;
 
-	if (auCurrentSampleRate != rate)
-	    if (CallbackExists(AuSetSampleRateCB))
-	    {
-		auCurrentSampleRate = rate =
-		    (AuUint32) AuCallback(AuSetSampleRateCB, (rate));
-	    }
-	    else
-		auCurrentSampleRate = rate;
-    }
+    if (rate > auSetup.maxSampleRate)
+      rate = auSetup.maxSampleRate;
+    
+    if (rate < auSetup.minSampleRate)
+      rate = auSetup.minSampleRate;
+    
+    if (auCurrentSampleRate != rate)
+      if (CallbackExists(AuSetSampleRateCB))
+        {
+          auCurrentSampleRate = rate =
+            (AuUint32) AuCallback(AuSetSampleRateCB, (rate));
+        }
+      else
+        auCurrentSampleRate = rate;
 
     for (i = 0; i < fl->numOutputs; i++)
     {


More information about the Nas mailing list