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

Modified Files:
        hdsp.c 
Log Message:
fix by Thomas Charbonnel <[EMAIL PROTECTED]>:

The attach patch fixes problems with speed modes for H9632 cards (many
thanks to Pentti Ala-Vannesluoma for testing the driver and helping
finding bugs), and the AutoSync mode issue (for all cards) reported by
Anders Torger at the end of september.


Index: hdsp.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/rme9652/hdsp.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- hdsp.c      7 Nov 2003 18:42:59 -0000       1.48
+++ hdsp.c      24 Nov 2003 11:39:16 -0000      1.49
@@ -1109,16 +1109,17 @@
                rate_bits = HDSP_Frequency176_4KHz;
                break;
        case 192000:
-               if (current_rate != 192000) {
+               if (current_rate < 128000) {
                        reject_if_open = 1;
                }
                rate_bits = HDSP_Frequency192KHz;
+               break;
        default:
                return -EINVAL;
        }
 
        if (reject_if_open && (hdsp->capture_pid >= 0 || hdsp->playback_pid >= 0)) {
-               snd_printk ("cannot change between single- and double-speed mode 
(capture PID = %d, playback PID = %d)\n",
+               snd_printk ("cannot change speed mode (capture PID = %d, playback PID 
= %d)\n",
                            hdsp->capture_pid,
                            hdsp->playback_pid);
                return -EBUSY;
@@ -2102,9 +2103,11 @@
        switch (mode) {
        case HDSP_CLOCK_SOURCE_AUTOSYNC:
                if (hdsp_external_sample_rate(hdsp) != 0) {
-                   hdsp->control_register &= ~HDSP_ClockModeMaster;            
-                   hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
-                   return 0;
+                   if (!hdsp_set_rate(hdsp, hdsp_external_sample_rate(hdsp), 1)) {
+                       hdsp->control_register &= ~HDSP_ClockModeMaster;               
 
+                       hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
+                       return 0;
+                   }
                }
                return -1;
        case HDSP_CLOCK_SOURCE_INTERNAL_32KHZ:
@@ -4189,30 +4192,37 @@
 static int snd_hdsp_hw_rule_in_channels(snd_pcm_hw_params_t *params,
                                        snd_pcm_hw_rule_t *rule)
 {
-       unsigned int list[2];
        hdsp_t *hdsp = rule->private;
        snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
        if (hdsp->io_type == H9632) {
+               unsigned int list[3];
                list[0] = hdsp->qs_in_channels;
+               list[1] = hdsp->ds_in_channels;
+               list[2] = hdsp->ss_in_channels;
+               return snd_interval_list(c, 3, list, 0);
        } else {
+               unsigned int list[2];
                list[0] = hdsp->ds_in_channels;
+               list[1] = hdsp->ss_in_channels;
+               return snd_interval_list(c, 2, list, 0);
        }
-       list[1] = hdsp->ss_in_channels;
-       return snd_interval_list(c, 2, list, 0);
 }
 
 static int snd_hdsp_hw_rule_out_channels(snd_pcm_hw_params_t *params,
                                        snd_pcm_hw_rule_t *rule)
 {
-       unsigned int list[2];
+       unsigned int list[3];
        hdsp_t *hdsp = rule->private;
        snd_interval_t *c = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
        if (hdsp->io_type == H9632) {
                list[0] = hdsp->qs_out_channels;
+               list[1] = hdsp->ds_out_channels;
+               list[2] = hdsp->ss_out_channels;
+               return snd_interval_list(c, 3, list, 0);
        } else {
                list[0] = hdsp->ds_out_channels;
+               list[1] = hdsp->ss_out_channels;
        }
-       list[1] = hdsp->ss_out_channels;
        return snd_interval_list(c, 2, list, 0);
 }
 
@@ -4229,7 +4239,7 @@
                        .integer = 1,
                };
                return snd_interval_refine(c, &t);      
-       } else if (r->min > 48000) {
+       } else if (r->min > 48000 && r->max <= 96000) {
                snd_interval_t t = {
                        .min = hdsp->ds_in_channels,
                        .max = hdsp->ds_in_channels,
@@ -4260,7 +4270,7 @@
                        .integer = 1,
                };
                return snd_interval_refine(c, &t);      
-       } else if (r->min > 48000) {
+       } else if (r->min > 48000 && r->max <= 96000) {
                snd_interval_t t = {
                        .min = hdsp->ds_out_channels,
                        .max = hdsp->ds_out_channels,



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to