[alsa-devel] [alsa-cvslog] alsa-kernel: Official ALSA project GIT repository for Linux 2.6 branch, master now at v2.6.31-rc8-407-gfc9e4a3

Takashi Iwai tiwai at suse.de
Tue Oct 6 09:03:25 CEST 2009


At Tue,  6 Oct 2009 08:36:04 +0200 (CEST),
noreply-git at alsa-project.org wrote:
> commit fc9e4a3811567f8d1d4c263a89e27b52c90d6098
> Author:     Clemens Ladisch <clemens at ladisch.de>
> AuthorDate: Tue Oct 6 08:21:04 2009 +0200
> Commit:     Clemens Ladisch <clemens at ladisch.de>
> CommitDate: Tue Oct 6 08:21:04 2009 +0200
> 
>     sound: via82xx: move DXS volume controls to PCM interface
>     
>     The "VIA DXS" controls are actually volume controls that apply to the
>     four PCM substreams, so we better indicate this connection by moving the
>     controls to the PCM interface.
>     
>     Commit b452e08e73c0e3dbb0be82130217be4b7084299e in 2.6.30 broke the
>     restoring of these volumes by "amixer restore" that most distributions
>     use; the renaming in this patch cures that regression by preventing
>     amixer from applying the old, wrong volume levels to the new controls.
>     http://bugzilla.kernel.org/show_bug.cgi?id=14151
>     http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532613
>     
>     Signed-off-by: Clemens Ladisch <clemens at ladisch.de>
>     Cc: <stable at kernel.org>

Well, this control was once removed, and then revived due to complains 
by users who have used it in mixer.  Moving this to PCM iface does
almost the same thing, disabling an easy way to access it.
I'm afraid that this patch might be regarded as another "regression".

For such an old driver, the compatibility is the most important item.
If any, we must provide a way to back to the old behavior.


thanks,

Takashi

> 
> -----------------------------------------------------------------------
> 
> Diffstat:
>  sound/pci/via82xx.c |   27 ++++++++++++++++++---------
>  1 files changed, 18 insertions(+), 9 deletions(-)
> 
> 
> Patch -------------- (max 1500 lines)
> diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
> index acfa476..91683a3 100644
> --- a/sound/pci/via82xx.c
> +++ b/sound/pci/via82xx.c
> @@ -1626,7 +1626,7 @@ static int snd_via8233_dxs_volume_get(struct snd_kcontrol *kcontrol,
>  				      struct snd_ctl_elem_value *ucontrol)
>  {
>  	struct via82xx *chip = snd_kcontrol_chip(kcontrol);
> -	unsigned int idx = snd_ctl_get_ioff(kcontrol, &ucontrol->id);
> +	unsigned int idx = kcontrol->id.subdevice;
>  
>  	ucontrol->value.integer.value[0] = VIA_DXS_MAX_VOLUME - chip->playback_volume[idx][0];
>  	ucontrol->value.integer.value[1] = VIA_DXS_MAX_VOLUME - chip->playback_volume[idx][1];
> @@ -1646,7 +1646,7 @@ static int snd_via8233_dxs_volume_put(struct snd_kcontrol *kcontrol,
>  				      struct snd_ctl_elem_value *ucontrol)
>  {
>  	struct via82xx *chip = snd_kcontrol_chip(kcontrol);
> -	unsigned int idx = snd_ctl_get_ioff(kcontrol, &ucontrol->id);
> +	unsigned int idx = kcontrol->id.subdevice;
>  	unsigned long port = chip->port + 0x10 * idx;
>  	unsigned char val;
>  	int i, change = 0;
> @@ -1705,11 +1705,12 @@ static struct snd_kcontrol_new snd_via8233_pcmdxs_volume_control __devinitdata =
>  };
>  
>  static struct snd_kcontrol_new snd_via8233_dxs_volume_control __devinitdata = {
> -	.name = "VIA DXS Playback Volume",
> -	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
> +	.iface = SNDRV_CTL_ELEM_IFACE_PCM,
> +	.device = 0,
> +	/* .subdevice set later */
> +	.name = "PCM Playback Volume",
>  	.access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
>  		   SNDRV_CTL_ELEM_ACCESS_TLV_READ),
> -	.count = 4,
>  	.info = snd_via8233_dxs_volume_info,
>  	.get = snd_via8233_dxs_volume_get,
>  	.put = snd_via8233_dxs_volume_put,
> @@ -1936,10 +1937,18 @@ static int __devinit snd_via8233_init_misc(struct via82xx *chip)
>  		}
>  		else /* Using DXS when PCM emulation is enabled is really weird */
>  		{
> -			/* Standalone DXS controls */
> -			err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_via8233_dxs_volume_control, chip));
> -			if (err < 0)
> -				return err;
> +			for (i = 0; i < 4; ++i) {
> +				struct snd_kcontrol *kctl;
> +
> +				kctl = snd_ctl_new1(
> +					&snd_via8233_dxs_volume_control, chip);
> +				if (!kctl)
> +					return -ENOMEM;
> +				kctl->id.subdevice = i;
> +				err = snd_ctl_add(chip->card, kctl);
> +				if (err < 0)
> +					return err;
> +			}
>  		}
>  	}
>  	/* select spdif data slot 10/11 */
> ------- End of patch
> 
> hooks/update
> ---
> Git Source Code Management System
> hooks/update refs/heads/master \
>   62f08ef9739c5cb5fff5b5bdec3bc02d522b9a12 \
>   fc9e4a3811567f8d1d4c263a89e27b52c90d6098
> 
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Alsa-cvslog mailing list
> Alsa-cvslog at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-cvslog
> 


More information about the Alsa-devel mailing list