9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Axel Belinfante <Axel.Belinfante@cs.utwente.nl>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] sb16(?) problem: audio timeout / mpg123: problem: division-by-zero
Date: Fri,  5 Apr 2002 16:30:55 +0200	[thread overview]
Message-ID: <200204051430.g35EUtf12512@copernicus.cs.utwente.nl> (raw)
In-Reply-To: Your message of "Thu, 04 Apr 2002 13:19:17 -0500." <fa34ddaa2087d8c2fccd36b58ab0d98c@plan9.bell-labs.com>

Thanks to those who reacted; I solved the problems.

I got the sb working by simply trying more irq/dma
configurations in plan9.ini (in my case: irq=5 dma=1 works).

W.r.t. mpg123 it looks like my hack-around works.
For the archives:
version: mpg123-0.59r
problem: division-by-zero
hack-around:

--- layer3.c	Wed Apr 21 17:25:18 1999
+++ /tmp/layer3.c	Fri Apr  5 16:23:52 2002
@@ -169,10 +169,14 @@

   for(i=0;i<16;i++) {
     double t = tan( (double) i * M_PI / 12.0 );
-    tan1_1[i] = t / (1.0+t);
-    tan2_1[i] = 1.0 / (1.0 + t);
-    tan1_2[i] = M_SQRT2 * t / (1.0+t);
-    tan2_2[i] = M_SQRT2 / (1.0 + t);
+    double tt = (1.0+t);
+    if (tt == 0.0)
+	tt = 0.00001;
+    /* fprintf(stderr, "tt=%f\n", tt); */
+    tan1_1[i] = t / tt;
+    tan2_1[i] = 1.0 / tt;
+    tan1_2[i] = M_SQRT2 * t / tt;
+    tan2_2[i] = M_SQRT2 / tt;

     for(j=0;j<2;j++) {
       double base = pow(2.0,-0.25*(j+1.0));

Regards,
Axel.



  reply	other threads:[~2002-04-05 14:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-04 18:19 Russ Cox
2002-04-05 14:30 ` Axel Belinfante [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-04-04 18:01 Axel Belinfante

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200204051430.g35EUtf12512@copernicus.cs.utwente.nl \
    --to=axel.belinfante@cs.utwente.nl \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).