diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/azalia_codec.c | 22 |
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))) |