diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2008-10-12 10:42:39 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2008-10-12 10:42:39 +0000 |
commit | e744a5c2024ba582aaebbcc5896872627e028c14 (patch) | |
tree | 2931df9554b757a55f11e5ffd82eb4d5b7eca3a3 /sys | |
parent | 68a447151376faad772560cc2facdcd56306feab (diff) |
if converters in a group are not needed to satisfy the requirements
of a stream, direct the unneeded converters use HDA link stream #0
from NetBSD via Alexey Suslikov, thanks
tested by several, thanks also
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/azalia.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index 40a3d2fe7f9..8600d3a0f82 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.58 2008/10/12 10:34:18 jakemsr Exp $ */ +/* $OpenBSD: azalia.c,v 1.59 2008/10/12 10:42:38 jakemsr Exp $ */ /* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */ /*- @@ -1530,6 +1530,7 @@ azalia_codec_connect_stream(codec_t *this, int dir, uint16_t fmt, int number) nchan = (fmt & HDA_SD_FMT_CHAN) + 1; startchan = 0; for (i = 0; i < group->nconv; i++) { + uint32_t stream_chan; nid = group->conv[i]; /* surround and c/lfe handling */ @@ -1542,12 +1543,14 @@ azalia_codec_connect_stream(codec_t *this, int dir, uint16_t fmt, int number) err = this->comresp(this, nid, CORB_SET_CONVERTER_FORMAT, fmt, NULL); if (err) goto exit; + stream_chan = (number << 4) | startchan; + if (startchan >= nchan) + stream_chan = 0; /* stream#0 */ err = this->comresp(this, nid, CORB_SET_CONVERTER_STREAM_CHANNEL, - (number << 4) | startchan, NULL); + stream_chan, NULL); if (err) goto exit; - if (nchan > 2) - startchan += WIDGET_CHANNELS(&this->w[nid]); + startchan += WIDGET_CHANNELS(&this->w[nid]); } exit: |