Update of /cvsroot/alsa/alsa-kernel/pci
In directory sc8-pr-cvs1:/tmp/cvs-serv16337

Modified Files:
        rme96.c 
Log Message:
Anders Torger <[EMAIL PROTECTED]>
fixed bug introduced in previous patch - analog input now works again


Index: rme96.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/rme96.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- rme96.c     7 Jan 2003 10:36:30 -0000       1.21
+++ rme96.c     29 Jan 2003 20:45:07 -0000      1.22
@@ -311,6 +311,9 @@
 snd_rme96_create_switches(snd_card_t *card,
                          rme96_t *rme96);
 
+static int
+snd_rme96_getinputtype(rme96_t *rme96);
+
 static inline unsigned int
 snd_rme96_playback_ptr(rme96_t *rme96)
 {
@@ -679,6 +682,7 @@
        int rate, dummy;
 
        if (!(rme96->wcreg & RME96_WCR_MASTER) &&
+            snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG &&
            (rate = snd_rme96_capture_getrate(rme96, &dummy)) > 0)
        {
                /* slave clock */
@@ -992,6 +996,7 @@
                return err;
        spin_lock_irqsave(&rme96->lock, flags);
        if (!(rme96->wcreg & RME96_WCR_MASTER) &&
+            snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG &&
            (rate = snd_rme96_capture_getrate(rme96, &dummy)) > 0)
        {
                 /* slave clock */
@@ -1059,15 +1064,6 @@
                        spin_unlock_irqrestore(&rme96->lock, flags);
                        return err;
                }
-       }
-       snd_rme96_setframelog(rme96, params_channels(params), 0);
-       if (rme96->playback_periodsize != 0) {
-               if (params_period_size(params) << rme96->capture_frlog !=
-                   rme96->playback_periodsize)
-               {
-                       spin_unlock_irqrestore(&rme96->lock, flags);
-                       return -EBUSY;
-               }
        } else if ((rate = snd_rme96_capture_getrate(rme96, &isadat)) > 0) {
                 if (params_rate(params) != rate) {
                        spin_unlock_irqrestore(&rme96->lock, flags);
@@ -1080,6 +1076,15 @@
                        return -EIO;
                 }
         }
+       snd_rme96_setframelog(rme96, params_channels(params), 0);
+       if (rme96->playback_periodsize != 0) {
+               if (params_period_size(params) << rme96->capture_frlog !=
+                   rme96->playback_periodsize)
+               {
+                       spin_unlock_irqrestore(&rme96->lock, flags);
+                       return -EBUSY;
+               }
+       }
        rme96->capture_periodsize =
                params_period_size(params) << rme96->capture_frlog;
        snd_rme96_set_period_properties(rme96, rme96->capture_periodsize);
@@ -1209,6 +1214,7 @@
 
        runtime->hw = snd_rme96_playback_spdif_info;
        if (!(rme96->wcreg & RME96_WCR_MASTER) &&
+            snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG &&
            (rate = snd_rme96_capture_getrate(rme96, &dummy)) > 0)
        {
                 /* slave clock */
@@ -1237,7 +1243,9 @@
        snd_pcm_set_sync(substream);
 
        runtime->hw = snd_rme96_capture_spdif_info;
-        if ((rate = snd_rme96_capture_getrate(rme96, &isadat)) > 0) {
+        if (snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG &&
+            (rate = snd_rme96_capture_getrate(rme96, &isadat)) > 0)
+        {
                 if (isadat) {
                         return -EIO;
                 }
@@ -1285,6 +1293,7 @@
        
        runtime->hw = snd_rme96_playback_adat_info;
        if (!(rme96->wcreg & RME96_WCR_MASTER) &&
+            snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG &&
            (rate = snd_rme96_capture_getrate(rme96, &dummy)) > 0)
        {
                 /* slave clock */
@@ -1308,6 +1317,11 @@
        snd_pcm_set_sync(substream);
 
        runtime->hw = snd_rme96_capture_adat_info;
+        if (snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG) {
+                /* makes no sense to use analog input. Note that analog
+                   expension cards AEB4/8-I are RME96_INPUT_INTERNAL */
+                return -EIO;
+        }
         if ((rate = snd_rme96_capture_getrate(rme96, &isadat)) > 0) {
                 if (!isadat) {
                         return -EIO;
@@ -1850,6 +1864,10 @@
                snd_iprintf(buffer, "  clock mode: word clock\n");
        } else if (rme96->wcreg & RME96_WCR_MASTER) {
                snd_iprintf(buffer, "  clock mode: master\n");
+       } else if (snd_rme96_getinputtype(rme96) == RME96_INPUT_ANALOG) {
+               snd_iprintf(buffer, "  clock mode: slave (master anyway due to analog 
+input setting)\n");
+       } else if (snd_rme96_capture_getrate(rme96, &n) < 0) {
+               snd_iprintf(buffer, "  clock mode: slave (master anyway due to no 
+valid signal)\n");
        } else {
                snd_iprintf(buffer, "  clock mode: slave\n");
        }



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to