summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2009-04-24 15:07:58 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2009-04-24 15:07:58 +0000
commit37580b6acc6c02cb138cec4f6b699e412d4ec852 (patch)
treedb77e13335587b1bcea0b2625b3944a4524356b4 /sys
parentf5e309798cb03dc46e8b5e0d066ffb8ffd8afbf2 (diff)
"selected" connections don't mean much for mixer widgets. all
connections to a mixer widget are enabled and unmuted by default. when finding a default connection through a mixer, check all connections, not just the "selected" connection.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/azalia.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c
index 02b5fc3aa66..1569cb11161 100644
--- a/sys/dev/pci/azalia.c
+++ b/sys/dev/pci/azalia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia.c,v 1.117 2009/04/04 02:59:39 jakemsr Exp $ */
+/* $OpenBSD: azalia.c,v 1.118 2009/04/24 15:07:57 jakemsr Exp $ */
/* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */
/*-
@@ -1353,7 +1353,7 @@ int
azalia_codec_find_defdac(codec_t *this, int index, int depth)
{
const widget_t *w;
- int ret;
+ int i, ret;
w = &this->w[index];
if (w->enable == 0)
@@ -1370,11 +1370,25 @@ azalia_codec_find_defdac(codec_t *this, int index, int depth)
return -1;
if (w->nconnections > 0) {
- index = w->connections[w->selected];
- if (VALID_WIDGET_NID(index, this)) {
- ret = azalia_codec_find_defdac(this, index, depth);
- if (ret >= 0)
- return ret;
+ /* by default, all mixer connections are active */
+ if (w->type == COP_AWTYPE_AUDIO_MIXER) {
+ for (i = 0; i < w->nconnections; i++) {
+ index = w->connections[i];
+ if (!azalia_widget_enabled(this, index))
+ continue;
+ ret = azalia_codec_find_defdac(this, index,
+ depth);
+ if (ret >= 0)
+ return ret;
+ }
+ } else {
+ index = w->connections[w->selected];
+ if (VALID_WIDGET_NID(index, this)) {
+ ret = azalia_codec_find_defdac(this, index,
+ depth);
+ if (ret >= 0)
+ return ret;
+ }
}
}