[alsa-devel] HCTL element callback
Hello. I am writing this mixer app: http://emutrix.googlecode.com
I have trouble with callbacks. So far I have implemented callbacks for the master volume fader and clock rate selection (integer and enum, resp.) But "pad" callbacks (boolean) won't work. In fact, I have noticed that alsamixer 1.0.22 also doesn't react to pad changes from the application. But the driver reacts to both as expected, so we're dealing with the same element.
I set callbacks with this: snd_hctl_elem_set_callback(el, cb);
And periodically poll them with: if (snd_hctl_wait(hctl, 10)) snd_hctl_handle_events(hctl);
As I said, integers and enums I have tried so far, work.
Thanks for any help, Camilo
On Thu, 2 Sep 2010, Camilo Polymeris wrote:
Hello. I am writing this mixer app: http://emutrix.googlecode.com
I have trouble with callbacks. So far I have implemented callbacks for the master volume fader and clock rate selection (integer and enum, resp.) But "pad" callbacks (boolean) won't work. In fact, I have noticed that alsamixer 1.0.22 also doesn't react to pad changes from the application. But the driver reacts to both as expected, so we're dealing with the same element.
It seems like a bug in the emu driver. The elem put callbacks does not check for changes (they should return 1).
Does this patch help?
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c index 05afe06..7bd1c1a 100644 --- a/sound/pci/emu10k1/emumixer.c +++ b/sound/pci/emu10k1/emumixer.c @@ -622,6 +622,7 @@ static int snd_emu1010_adc_pads_put(struct snd_kcontrol *kcontrol, struct snd_ct if (cache != emu->emu1010.adc_pads) { snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, cache ); emu->emu1010.adc_pads = cache; + return 1; }
return 0; @@ -670,6 +671,7 @@ static int snd_emu1010_dac_pads_put(struct snd_kcontrol *kcontrol, struct snd_ct if (cache != emu->emu1010.dac_pads) { snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, cache ); emu->emu1010.dac_pads = cache; + return 1; }
return 0;
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
On Fri, 2010-09-03 at 08:35 +0200, Jaroslav Kysela wrote:
On Thu, 2 Sep 2010, Camilo Polymeris wrote:
Hello. I am writing this mixer app: http://emutrix.googlecode.com
I have trouble with callbacks. So far I have implemented callbacks for the master volume fader and clock rate selection (integer and enum, resp.) But "pad" callbacks (boolean) won't work. In fact, I have noticed that alsamixer 1.0.22 also doesn't react to pad changes from the application. But the driver reacts to both as expected, so we're dealing with the same element.
It seems like a bug in the emu driver. The elem put callbacks does not check for changes (they should return 1).
Does this patch help?
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c index 05afe06..7bd1c1a 100644 --- a/sound/pci/emu10k1/emumixer.c +++ b/sound/pci/emu10k1/emumixer.c @@ -622,6 +622,7 @@ static int snd_emu1010_adc_pads_put(struct snd_kcontrol *kcontrol, struct snd_ct if (cache != emu->emu1010.adc_pads) { snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, cache ); emu->emu1010.adc_pads = cache;
return 1;
}
return 0;
@@ -670,6 +671,7 @@ static int snd_emu1010_dac_pads_put(struct snd_kcontrol *kcontrol, struct snd_ct if (cache != emu->emu1010.dac_pads) { snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, cache ); emu->emu1010.dac_pads = cache;
return 1;
}
return 0;
Jaroslav
Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
Hello. I think it doesn't help. I applied the patch, built the sources, installed them (with 'make install') and reloaded alsa (with 'alsa reload'). That should have installed the new module, right? If so, the patch didn't help. I am not very experienced with kernel stuff, so if I did something wrong, please tell me and I'll try again.
Camilo
participants (2)
-
Camilo Polymeris
-
Jaroslav Kysela