Re: [alsa-devel] HCTL element callback
On Fri, 2010-09-03 at 09:16 +0200, Jaroslav Kysela wrote:
On Fri, 3 Sep 2010, Camilo Polymeris wrote:
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.
Reboot your machine at first to ensure that you have loaded new ALSA kernel modules.
Jaroslav
Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
Very nice. That worked. Thanks! By the way, I have noticed two small errors (I think) with element names: * Pads are labeled 14dB, but they are actually ~12dB (intended as -10dBV/+4dBu) * Enum items (inputs) are labeled 0202 SPDIF Left/Right, but the connector is on the 1010 card. The outputs are ok. Are you keeping those for backwards-compatibility?
Again, thanks. Camilo
On Fri, 3 Sep 2010, Camilo Polymeris wrote:
On Fri, 2010-09-03 at 09:16 +0200, Jaroslav Kysela wrote:
On Fri, 3 Sep 2010, Camilo Polymeris wrote:
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.
Reboot your machine at first to ensure that you have loaded new ALSA kernel modules.
Jaroslav
Very nice. That worked. Thanks! By the way, I have noticed two small errors (I think) with element names:
- Pads are labeled 14dB, but they are actually ~12dB (intended as
-10dBV/+4dBu)
- Enum items (inputs) are labeled 0202 SPDIF Left/Right, but the
connector is on the 1010 card. The outputs are ok. Are you keeping those for backwards-compatibility?
The whole emu card support code is from James. So these questions should go to him.
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
participants (2)
-
Camilo Polymeris
-
Jaroslav Kysela