summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjakemsr <jakemsr@openbsd.org>2009-01-04 23:42:39 +0000
committerjakemsr <jakemsr@openbsd.org>2009-01-04 23:42:39 +0000
commitf93c14694ba83e14c0918631b23b44f1fd42afd1 (patch)
treed18c791bd19bab30c53b96955cc248d3829551b1
parentsome mixers don't use input amp muting to "select" their sources. (diff)
downloadwireguard-openbsd-f93c14694ba83e14c0918631b23b44f1fd42afd1.tar.xz
wireguard-openbsd-f93c14694ba83e14c0918631b23b44f1fd42afd1.zip
try to get better default outputs.master.slaves by not including
beep generators or mixers and selectors that are more than 2 connections away from a DAC.
-rw-r--r--sys/dev/pci/azalia.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c
index 210c371321e..2a1d667ba84 100644
--- a/sys/dev/pci/azalia.c
+++ b/sys/dev/pci/azalia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia.c,v 1.108 2009/01/03 19:17:45 jakemsr Exp $ */
+/* $OpenBSD: azalia.c,v 1.109 2009/01/04 23:42:39 jakemsr Exp $ */
/* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */
/*-
@@ -1416,12 +1416,22 @@ azalia_codec_init_volgroups(codec_t *this)
for (i = 0; i < this->playvols.nslaves; i++) {
w = &this->w[this->playvols.slaves[i]];
cap = w->outamp_cap;
- dac = azalia_codec_find_defdac(this, w->nid, 0);
+ j = 0;
+ /* azalia_codec_find_defdac only goes 10 connections deep.
+ * Start the connection depth at 8 so it doesn't go more
+ * than 2 connections deep.
+ */
+ if (w->type == COP_AWTYPE_AUDIO_MIXER ||
+ w->type == COP_AWTYPE_AUDIO_SELECTOR)
+ j = 8;
+ dac = azalia_codec_find_defdac(this, w->nid, j);
if (dac != this->dacs.groups[this->dacs.cur].conv[0] &&
dac != this->hp_dac && dac != this->spkr_dac)
continue;
if ((cap & COP_AMPCAP_MUTE) && COP_AMPCAP_NUMSTEPS(cap)) {
- if (w->type == COP_AWTYPE_PIN_COMPLEX) {
+ if (w->type == COP_AWTYPE_BEEP_GENERATOR) {
+ continue;
+ } else if (w->type == COP_AWTYPE_PIN_COMPLEX) {
err = this->comresp(this, w->nid,
CORB_GET_PIN_WIDGET_CONTROL, 0, &result);
if (!err && (result & CORB_PWC_OUTPUT))
@@ -1433,10 +1443,16 @@ azalia_codec_init_volgroups(codec_t *this)
if (this->playvols.cur == 0) {
for (i = 0; i < this->playvols.nslaves; i++) {
w = &this->w[this->playvols.slaves[i]];
- dac = azalia_codec_find_defdac(this, w->nid, 0);
+ j = 0;
+ if (w->type == COP_AWTYPE_AUDIO_MIXER ||
+ w->type == COP_AWTYPE_AUDIO_SELECTOR)
+ j = 8;
+ dac = azalia_codec_find_defdac(this, w->nid, j);
if (dac != this->dacs.groups[this->dacs.cur].conv[0] &&
dac != this->hp_dac && dac != this->spkr_dac)
continue;
+ if (w->type == COP_AWTYPE_BEEP_GENERATOR)
+ continue;
if (w->type == COP_AWTYPE_PIN_COMPLEX) {
err = this->comresp(this, w->nid,
CORB_GET_PIN_WIDGET_CONTROL, 0, &result);