This is a small diff to enable mavb(4) 24-bit native format. To
test it, first check that audio works without the diff. Then, apply
the diff, kill sndiod, and run it as:

        sndiod -dd -e s24be4lsb

then play any audio file; sndiod should log something like:

snd0: 48000Hz, s24be4lsb, play 0:1, rec 0:1, 9 blocks of 960 frames

does it? if so, does it sound right?

Thanks!

-- Alexandre

Index: mavb.c
===================================================================
RCS file: /cvs/src/sys/arch/sgi/dev/mavb.c,v
retrieving revision 1.15
diff -u -p -r1.15 mavb.c
--- mavb.c      15 May 2013 08:29:23 -0000      1.15
+++ mavb.c      15 Jun 2013 11:29:10 -0000
@@ -522,7 +522,10 @@ mavb_set_params(void *hdl, int setmode, 
                                        return (EINVAL);
                                }
                        } else {
-                               return (EINVAL);
+                               play->factor = 1;
+                               play->sw_code = NULL;
+                               play->channels = 2;
+                               play->precision = 24;
                        }
                        break;
                default:
@@ -538,7 +541,7 @@ mavb_set_params(void *hdl, int setmode, 
                        return (error);
 
                play->bps = AUDIO_BPS(play->precision);
-               play->msb = 1;
+               play->msb = 0;
        }
 
        if (setmode & AUMODE_RECORD) {
@@ -556,7 +559,11 @@ mavb_set_params(void *hdl, int setmode, 
                                rec->factor = 2;
                                rec->sw_code = linear24_to_linear16_be;
                        } else {
-                               return (EINVAL);
+                               rec->factor = 1;
+                               rec->sw_code = NULL;
+                               rec->channels = 2;
+                               rec->precision = 24;
+                               break;
                        }
                        break;
                default:
@@ -575,7 +582,7 @@ mavb_set_params(void *hdl, int setmode, 
                        return (error);
 
                rec->bps = AUDIO_BPS(rec->precision);
-               rec->msb = 1;
+               rec->msb = 0;
        }
 
        return (0);

Reply via email to