On Sat, Mar 27, 2010 at 01:02:44PM +0000, Jacob Meuser wrote:

> unfortunately, fixing this is not exactly trivial.  I have an idea,
> but I really would need a machine (I have the cards, just nothing that
> can use them) to work it out.

not exactly elegant (I don't think there is an elegant way to handle it
without bigger changes) but it should work (only compile tested).

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org

Index: sbdsp.c
===================================================================
RCS file: /cvs/src/sys/dev/isa/sbdsp.c,v
retrieving revision 1.29
diff -u -p sbdsp.c
--- sbdsp.c     31 Jul 2009 22:53:04 -0000      1.29
+++ sbdsp.c     27 Mar 2010 15:03:58 -0000
@@ -562,6 +562,57 @@ sbdsp_set_params(addr, setmode, usemode, play, rec)
                        continue;
 
                p = mode == AUMODE_PLAY ? play : rec;
+
+               switch (model) {
+               case SB_1:
+               case SB_20:
+                       if (mode == AUMODE_PLAY) {
+                               if (p->sample_rate < 4000)
+                                       p->sample_rate = 4000;
+                               else if (p->sample_rate > 22727)
+                                       p->sample_rate = 22727; /* 22050 ? */
+                       } else {
+                               if (p->sample_rate < 4000)
+                                       p->sample_rate = 4000;
+                               else if (p->sample_rate > 12987)
+                                       p->sample_rate = 12987; /* 12000 ? */
+                       }
+                       break;
+               case SB_2x:
+                       if (mode == AUMODE_PLAY) {
+                               if (p->sample_rate < 4000)
+                                       p->sample_rate = 4000;
+                               else if (p->sample_rate > 45454)
+                                       p->sample_rate = 45454; /* 44100 ? */
+                       } else {
+                               if (p->sample_rate < 4000)
+                                       p->sample_rate = 4000;
+                               else if (p->sample_rate > 14925)
+                                       p->sample_rate = 14925; /* ??? */
+                       }
+                       break;
+               case SB_PRO:
+               case SB_JAZZ:
+                       if (p->channels == 2) {
+                               if (p->sample_rate < 11025)
+                                       p->sample_rate = 11025;
+                               else if (p->sample_rate > 22727)
+                                       p->sample_rate = 22727; /* 22050 ? */
+                       } else {
+                               if (p->sample_rate < 4000)
+                                       p->sample_rate = 4000;
+                               else if (p->sample_rate > 45454)
+                                       p->sample_rate = 45454; /* 44100 ? */
+                       }
+                       break;
+               case SB_16:
+                       if (p->sample_rate < 5000)
+                               p->sample_rate = 5000;
+                       else if (p->sample_rate > 45000)
+                               p->sample_rate = 45000; /* 44100 ? */
+                       break;
+               }
+
                /* Locate proper commands */
                for(m = mode == AUMODE_PLAY ? sbpmodes : sbrmodes;
                    m->model != -1; m++) {

Reply via email to