]> git.alsa-project.org Git - alsa-lib.git/commitdiff
More EMU10K1 fixes.
authorJaroslav Kysela <perex@perex.cz>
Mon, 14 May 2001 15:50:09 +0000 (15:50 +0000)
committerJaroslav Kysela <perex@perex.cz>
Mon, 14 May 2001 15:50:09 +0000 (15:50 +0000)
src/pcm/pcm_surr.c
src/pcm/surround.conf

index 94a0736050f007f41787e76e86316504cb006eb0..327b4ea7ed39b553b012757591c0a1ff1a996082 100644 (file)
@@ -859,7 +859,44 @@ int load_surround_config(snd_ctl_t *ctl, snd_pcm_surround_t *surr,
                        err = -ENODEV;
                        goto __error;
                }
-               if (snd_config_search(n, "open_control", &n1) >= 0) {
+               if (stype == SND_PCM_SURROUND_40 && snd_config_search(n, "open_control_four", &n1) >= 0) {
+                       snd_sctl_replace_t replace[3];
+                       char values[2][10] = { "123", "123" };
+                       snd_pcm_info_t *info;
+                       int ridx = 0;
+                       
+                       snd_pcm_info_alloca(&info);
+                       if ((err = snd_pcm_info(surr->pcm[0], info)) < 0) {
+                               SNDERR("snd_pcm_info failed", snd_strerror(err));
+                               goto __error;
+                       }
+                       sprintf(values[0], "%i", snd_pcm_info_get_subdevice(info));
+                       replace[ridx].key = "index";
+                       replace[ridx].old_value = "subdevice0";
+                       replace[ridx].new_value = values[0];
+                       ridx++;
+                       
+                       if (surr->pcm[1]) {
+                               if ((err = snd_pcm_info(surr->pcm[1], info)) < 0) {
+                                       SNDERR("snd_pcm_info failed", snd_strerror(err));
+                                       goto __error;
+                               }
+                               sprintf(values[1], "%i", snd_pcm_info_get_subdevice(info));
+                               replace[ridx].key = "index";
+                               replace[ridx].old_value = "subdevice1";
+                               replace[ridx].new_value = values[1];
+                               ridx++;
+                       }
+                       replace[ridx].key = NULL;
+                       replace[ridx].old_value = NULL;
+                       replace[ridx].new_value = NULL;
+                       if ((err = snd_sctl_build(ctl, &surr->store, n1, replace)) < 0) {
+                               SNDERR("snd_sctl_build : %s\n", snd_strerror(err));
+                               goto __error;
+                       }
+               }
+               if ((stype == SND_PCM_SURROUND_51 && snd_config_search(n, "open_control_six", &n1) >= 0) ||
+                   snd_config_search(n, "open_control", &n1) >= 0) {
                        snd_sctl_replace_t replace[4];
                        char values[3][10] = { "123", "123", "123" };
                        snd_pcm_info_t *info;
index a3c61eeb16d9d2110150b0fca7fccd6345dd665d..5a41539adc7ffce20d26298ff2296e518aaae01b 100644 (file)
@@ -148,7 +148,7 @@ surround_plugin.EMU10K1 {
                device.2 = 0;
                subdevice.2 = -1;
        }
-       open_control.0 {
+       open_control_four.0 {
                iface = MIXER;
                name = 'Wave Surround Playback Volume';
                index = 0;
@@ -158,7 +158,31 @@ surround_plugin.EMU10K1 {
                value.1 = 0;
        }
        # change send volume from front to rear
-       open_control.1 {
+       open_control_four.1 {
+               iface = MIXER;
+               name = 'EMU10K1 PCM Send Volume';
+               index = subdevice1;
+               lock = true;
+               value.4 = 0;
+               value.5 = 0;
+               value.6 = 255;
+               value.7 = 0;
+               value.8 = 0;
+               value.9 = 0;
+               value.10 = 0;
+               value.11 = 255;
+       }
+       open_control_six.0 {
+               iface = MIXER;
+               name = 'Wave Surround Playback Volume';
+               index = 0;
+               lock = true;
+               preserve = true;
+               value.0 = 0;
+               value.1 = 0;
+       }
+       # change send volume from front to rear
+       open_control_six.1 {
                iface = MIXER;
                name = 'EMU10K1 PCM Send Volume';
                index = subdevice1;
@@ -173,7 +197,7 @@ surround_plugin.EMU10K1 {
                value.11 = 255;
        }
        # send routing must be changed to 6 (center) and 7 (LFE)
-       open_control.2 {
+       open_control_six.2 {
                iface = MIXER;
                name = 'EMU10K1 PCM Send Routing';
                index = subdevice2;