View | Details | Raw Unified | Return to bug 140453 | Differences between
and this patch

Collapse All | Expand All

(-)sys/dev/sound/pcm/ac97.c (-2 / +21 lines)
Lines 715-722 ac97_initmixer(struct ac97_info *codec) Link Here
715
				 * (ac97 2.3).
715
				 * (ac97 2.3).
716
				 */
716
				 */
717
				bit = codec->mix[i].bits;
717
				bit = codec->mix[i].bits;
718
				if (bit == 5)
718
				if (bit == 5) {
719
					bit++;
719
					/*
720
					 * Test for possible 6bit control by
721
					 * turning on 5th (or 13th) and detect
722
					 * possible clamped values on the lower
723
					 * bits, which might be possible for
724
					 * 5bit control.
725
					 *
726
					 * XXX Emulators (QEMU, Virtualbox,
727
					 *     etc..) does not reset the
728
					 *     high bit, making it looks like
729
					 *     a 6bit control. Consider that
730
					 *     as "buggy codec".
731
					 */
732
					j = 1 << (5 + codec->mix[i].ofs);
733
					ac97_wrcd(codec, reg, j);
734
					k = ac97_rdcd(codec, reg);
735
					k >>= codec->mix[i].ofs;
736
					if ((k & 0x1f) != 0x1f)
737
						bit++;
738
				}
720
				j = ((1 << bit) - 1) << codec->mix[i].ofs;
739
				j = ((1 << bit) - 1) << codec->mix[i].ofs;
721
				ac97_wrcd(codec, reg,
740
				ac97_wrcd(codec, reg,
722
					j | (codec->mix[i].mute ? 0x8000 : 0));
741
					j | (codec->mix[i].mute ? 0x8000 : 0));

Return to bug 140453