[alsa-devel] Set multiple mixer channel values at once
Hi,
does the ALSA library provide a method to set multiple channel values of a multi-channel mixer element at once? There are the snd_mixer_selem_set_XXXXX_all() methods, which set all channels to the same value. I would like to write a different value to each channel, is there such a method?
My motivation is the following. I have a HW with DSP/equaliser function, which uses a 5-channel mixer element (volume type element) to store biquad coefficients. To avoid invalid values in the transfer function the coefficients have to be sent to the HW over I2C all together in one transfer. Though the low level driver does that, the snd_mixer_selem_set_playback_volume() API method I'm using sets only one coef at a time. This results in partial updates of the biquad coefficients and temporary errors in the transfer function.
Thanks Petr
On Mon, 08 Jan 2018 12:01:34 +0100, Petr Kulhavy wrote:
Hi,
does the ALSA library provide a method to set multiple channel values of a multi-channel mixer element at once?
It depends. If the multi-channel is implemented in a single control element, you can set the whole update and write it in a single shot. But maybe not via alsa-lib mixer functions but with raw snd_ctl_*() stuff.
Takashi
There are the snd_mixer_selem_set_XXXXX_all() methods, which set all channels to the same value. I would like to write a different value to each channel, is there such a method?
My motivation is the following. I have a HW with DSP/equaliser function, which uses a 5-channel mixer element (volume type element) to store biquad coefficients. To avoid invalid values in the transfer function the coefficients have to be sent to the HW over I2C all together in one transfer. Though the low level driver does that, the snd_mixer_selem_set_playback_volume() API method I'm using sets only one coef at a time. This results in partial updates of the biquad coefficients and temporary errors in the transfer function.
Thanks Petr
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Hi Takashi,
thank you for the hint, I will try that.
Indeed the multichannel is a single control element. Do you mean to call multiple snd_ctl_elem_value_set_integer() followed by a single snd_hctl_elem_write() ? Similar to what is described here https://alsa.opensrc.org/HowTo_access_a_mixer_control ?
Thanks Petr
On 09/01/18 09:29, Takashi Iwai wrote:
On Mon, 08 Jan 2018 12:01:34 +0100, Petr Kulhavy wrote:
Hi,
does the ALSA library provide a method to set multiple channel values of a multi-channel mixer element at once?
It depends. If the multi-channel is implemented in a single control element, you can set the whole update and write it in a single shot. But maybe not via alsa-lib mixer functions but with raw snd_ctl_*() stuff.
Takashi
On Tue, 09 Jan 2018 17:37:49 +0100, Petr Kulhavy wrote:
Hi Takashi,
thank you for the hint, I will try that.
Indeed the multichannel is a single control element. Do you mean to call multiple snd_ctl_elem_value_set_integer() followed by a single snd_hctl_elem_write() ? Similar to what is described here https://alsa.opensrc.org/HowTo_access_a_mixer_control ?
Yes, something like that.
Takashi
Thanks Petr
On 09/01/18 09:29, Takashi Iwai wrote:
On Mon, 08 Jan 2018 12:01:34 +0100, Petr Kulhavy wrote:
Hi,
does the ALSA library provide a method to set multiple channel values of a multi-channel mixer element at once?
It depends. If the multi-channel is implemented in a single control element, you can set the whole update and write it in a single shot. But maybe not via alsa-lib mixer functions but with raw snd_ctl_*() stuff.
Takashi
participants (2)
-
Petr Kulhavy
-
Takashi Iwai