From: "John L. Utz III" <jutz@dmx.com>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: ALSA Developers <alsa-devel@alsa-project.org>
Subject: CMI8788/AV200/Oxygen Volume Controls in alsamixer (oxygen_mixer.c:dac_volume_get())
Date: Thu, 22 Jan 2009 15:36:52 -0800 [thread overview]
Message-ID: <49790314.10607@dmx.com> (raw)
Hi Clemens and all;
( To those following along at home, kindly open
alsa-driver-1.0.18a/alsa-kernel/pci/oxygen/oxygen_mixer.c and look at
dac_volume_get() and dac_volume_put() )
It appears to me that these functions are attempting to work on all of
the channels at once instead of just choosing Master, Front, Rear,
Surround, or what have you:
static int dac_volume_get(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value)
{
struct oxygen *chip = ctl->private_data;
unsigned int i;
mutex_lock(&chip->mutex);
for (i = 0; i < chip->model.dac_channels; ++i)
value->value.integer.value[i] = chip->dac_volume[i];
mutex_unlock(&chip->mutex);
return 0;
}
This is then surfaced to userland thusly in the controls array:
static const struct snd_kcontrol_new controls[] = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Master Playback Volume",
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
.info = dac_volume_info,
.get = dac_volume_get,
.put = dac_volume_put,
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Master Playback Switch",
.info = snd_ctl_boolean_mono_info,
.get = dac_mute_get,
.put = dac_mute_put,
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Stereo Upmixing",
.info = upmix_info,
.get = upmix_get,
.put = upmix_put,
},
{ blah },
{ blah },
{ blah }
};
this leads to a rather awkward result in alsamixer where there are 5
volume controls called "Master":
< Master > Master Master Master Master
IMHO, it would be more desirable for them to say:
< Master > Front C/LFE Surround Rear Surr
Our app would certainly be much happier :-)
So, i *think* that i can fix this thusly:
static const struct snd_kcontrol_new controls[] = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Master Playback Volume",
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
.info = dac_volume_info,
.get = dac_volume_get,
.put = dac_volume_put,
.private_value = 0
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Master Playback Switch",
.info = snd_ctl_boolean_mono_info,
.get = dac_mute_get,
.put = dac_mute_put,
.private_value = 0
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Front Playback Volume",
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
.info = dac_volume_info,
.get = dac_volume_get,
.put = dac_volume_put,
.private_value = 1
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Front Playback Switch",
.info = snd_ctl_boolean_mono_info,
.get = dac_mute_get,
.put = dac_mute_put,
.private_value = 1
},
and alter dac_volume_*() to not use a for() loop and just work off the
private_value.
anybody have any opinions?
i'll probably have tried this already before anybody responds but it
seemed reasonable to surface the idea.
tnx!
johnu
next reply other threads:[~2009-01-22 23:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-22 23:36 John L. Utz III [this message]
2009-01-23 13:51 ` CMI8788/AV200/Oxygen Volume Controls in alsamixer (oxygen_mixer.c:dac_volume_get()) Clemens Ladisch
2009-01-23 13:56 ` Takashi Iwai
2009-01-23 14:13 ` Clemens Ladisch
2009-01-23 14:18 ` Takashi Iwai
2009-01-23 14:21 ` Takashi Iwai
2009-01-23 19:21 ` John Utz
2009-01-24 10:12 ` Takashi Iwai
2009-01-26 8:51 ` Clemens Ladisch
2009-01-26 23:36 ` John L. Utz III
2009-01-23 19:08 ` John Utz
2009-01-24 10:01 ` Takashi Iwai
2009-01-23 19:07 ` John Utz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49790314.10607@dmx.com \
--to=jutz@dmx.com \
--cc=alsa-devel@alsa-project.org \
--cc=clemens@ladisch.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.