[AD] another tiny alsa fix |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Since switching to the plug:dmix device, the mixer init complains about
an unknown mixing device. I don't think it's possible to derive the
mixer device used for plug:dmix (or even "default", probably it was just
conincidence it worked, when both were named "default"), so I introduced
another config var instead. (just in case. it shouldn't normally get
used, because set_volume no longer changes the HW volume anyway, so the
HW mixer is useless anyway, which is a very good thing.)
--
Elias Pschernig <elias@xxxxxxxxxx>
Index: src/unix/alsa9.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/unix/alsa9.c,v
retrieving revision 1.7
diff -u -r1.7 alsa9.c
--- src/unix/alsa9.c 17 May 2004 18:55:49 -0000 1.7
+++ src/unix/alsa9.c 17 May 2004 21:22:14 -0000
@@ -62,6 +62,7 @@
static char const *alsa_device = "default";
+static char const *alsa_mixer_device = "default";
static snd_pcm_hw_params_t *hwparams = NULL;
static snd_pcm_sw_params_t *swparams = NULL;
static snd_pcm_channel_area_t *areas = NULL;
@@ -299,6 +300,10 @@
uconvert_ascii("alsa_device", tmp2),
alsa_device);
+ alsa_mixer_device = get_config_string(uconvert_ascii("sound", tmp1),
+ uconvert_ascii("alsa_mixer_device", tmp2),
+ alsa_mixer_device);
+
fragsize = get_config_int(uconvert_ascii("sound", tmp1),
uconvert_ascii("alsa_fragsize", tmp2), -1);
@@ -315,7 +320,7 @@
snd_mixer_open(&alsa_mixer, 0);
if (alsa_mixer
- && snd_mixer_attach(alsa_mixer, alsa_device) >= 0
+ && snd_mixer_attach(alsa_mixer, alsa_mixer_device) >= 0
&& snd_mixer_selem_register (alsa_mixer, NULL, NULL) >= 0
&& snd_mixer_load(alsa_mixer) >= 0) {
const char *alsa_mixer_elem_name = get_config_string(uconvert_ascii("sound", tmp1),