summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2010-06-26 21:06:53 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2010-06-26 21:06:53 +0000
commit8f9b810a0b3b1ea79d49397a5a9fdde46750a1ca (patch)
treec3ecb5ba4dcdecd658392bc557779b553a36c0c6
parentbcb06d1f951abe5fc916e2e1965c4b12436c6592 (diff)
make sure widgets are connected to usable widgets by default.
for example: outputs.sel7_source= -> outputs.sel7_source=adc-0:1 on the HP HDX 18
-rw-r--r--sys/dev/pci/azalia_codec.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/dev/pci/azalia_codec.c b/sys/dev/pci/azalia_codec.c
index 78453329c59..315c76412b4 100644
--- a/sys/dev/pci/azalia_codec.c
+++ b/sys/dev/pci/azalia_codec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia_codec.c,v 1.143 2010/03/21 15:04:35 jakemsr Exp $ */
+/* $OpenBSD: azalia_codec.c,v 1.144 2010/06/26 21:06:52 jakemsr Exp $ */
/* $NetBSD: azalia_codec.c,v 1.8 2006/05/10 11:17:27 kent Exp $ */
/*-
@@ -1331,6 +1331,26 @@ azalia_mixer_default(codec_t *this)
azalia_mixer_set(this, m->nid, m->target, &mc);
}
+ /* make sure default connection is valid */
+ for (i = 0; i < this->nmixers; i++) {
+ m = &this->mixers[i];
+ if (m->target != MI_TARGET_CONNLIST)
+ continue;
+
+ azalia_mixer_get(this, m->nid, m->target, &mc);
+ for (j = 0; j < m->devinfo.un.e.num_mem; j++) {
+ if (mc.un.ord == m->devinfo.un.e.member[j].ord)
+ break;
+ }
+ if (j >= m->devinfo.un.e.num_mem) {
+ bzero(&mc, sizeof(mc));
+ mc.dev = i;
+ mc.type = AUDIO_MIXER_ENUM;
+ mc.un.ord = m->devinfo.un.e.member[0].ord;
+ }
+ azalia_mixer_set(this, m->nid, m->target, &mc);
+ }
+
/* get default value for play group master */
for (i = 0; i < this->playvols.nslaves; i++) {
if (!(this->playvols.cur & (1 << i)))