On Mon, 2003-03-03 at 00:43, Thomas Charbonnel wrote:
> The correct offsets can be found in the attached patch.
> 
Err... this wasn't the case.
The attached patch replaces the previous one and enhances it with line
outs metering.

The line outs peak registers were not accessible with the current
driver, so I added code to map them to ctls. The option I took is
mapping all the registers, even the unused ones (i.e. from 19 to 26 on
the Multiface), as those registers are always present, regardless of the
attached box. This approach also avoided ctl index discontinuity. (Due
to the way clts map registers, the ctls mapping the line out registers
(Output Peak) had to have indexes 27 and 29). 
As a side effect this transfers the task of electing relevant registers
to user space applications. (In this perspective I think the 9652
shouldn't look as a digiface from user space, as it has no line outs. It
should have an entry of its own in HDSP_type).

Paul, the meter section of the HDSPMixer is now functional. It helped me
a lot understand how wrong the registers offsets were. I can send you a
copy if you think it can help you implementing 9652 support.

Thomas

--- hdsp.c.orig 2003-03-03 00:30:46.000000000 +0100
+++ hdsp.c      2003-03-03 15:06:38.000000000 +0100
@@ -3,6 +3,7 @@
  *
  *      Copyright (c) 2002  Paul Davis
  *                          Marcus Andersson
+ *                          Thomas Charbonnel
  *
  *   This program is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
@@ -123,9 +124,9 @@
 
 #define HDSP_playbackPeakLevel  4096  /* 26 * 32 bit values */
 #define HDSP_inputPeakLevel     4224  /* 26 * 32 bit values */
-#define HDSP_outputPeakLevel    4100  /* 26 * 32 bit values */
+#define HDSP_outputPeakLevel    4352  /* 28 * 32 bit values (26 + 2 line outs) */
 #define HDSP_playbackRmsLevel   4612  /* 26 * 64 bit values */
-#define HDSP_inputRmsLevel      4884  /* 26 * 64 bit values */
+#define HDSP_inputRmsLevel      4868  /* 26 * 64 bit values */
 
 #define HDSP_IO_EXTENT     5192
 
@@ -1864,14 +1865,12 @@
                if ((err = snd_ctl_add (card, kctl = 
snd_ctl_new1(&snd_hdsp_playback_mixer, hdsp)))) {
                        return err;
                }
+       }
+       for (idx = 0; idx < HDSP_MAX_CHANNELS; ++idx) {
                snd_hdsp_input_peak.index = idx+1;
                if ((err = snd_ctl_add (card, kctl = 
snd_ctl_new1(&snd_hdsp_input_peak, hdsp)))) {
                        return err;
                }
-               snd_hdsp_output_peak.index = idx+1;
-               if ((err = snd_ctl_add (card, kctl = 
snd_ctl_new1(&snd_hdsp_output_peak, hdsp)))) {
-                       return err;
-               }
                snd_hdsp_playback_peak.index = idx+1;
                if ((err = snd_ctl_add (card, kctl = 
snd_ctl_new1(&snd_hdsp_playback_peak, hdsp)))) {
                        return err;
@@ -1885,7 +1884,12 @@
                        return err;
                }
        }
-
+       for (idx = 0; idx < HDSP_MAX_CHANNELS + 2 ; ++idx) {
+               snd_hdsp_output_peak.index = idx+1;
+               if ((err = snd_ctl_add (card, kctl = 
snd_ctl_new1(&snd_hdsp_output_peak, hdsp)))) {
+                       return err;
+               }
+       }
        return 0;
 }
 

Reply via email to