On Thu, May 14, 2009 at 09:50:12PM +0000, Jacob Meuser wrote: > On Wed, May 13, 2009 at 11:24:29PM +0200, Peter Hessler wrote: > > On some systems, when I have muted the sound, and then adjust it up and > > down using the hardware keys, it unmutes it for me. I'm not 100% sure I > > want this, but it may be the "expected" behaviour. > > gain and mute are always set in the same command. that's per Intel's > HDA specs. apparently there are some codecs that have the "feature" > where increasing the gain and muting in the same command results in > increasing the gain and *un*muting. either that or the codecs are > broken, or maybe the driver needs a DELAY() after setting gain/mute > on each channel, I really don't know. I'm only aware of this happening > with Conexant codecs, and Conexant doesn't have publicly available > datasheets for their HDA codecs. > > however, the way outputs.master (which is also controlled by both > keyboard volume keys and "extra" hardware volume buttons) currently works > on azalia is probably adding to the problem. > > usually outputs.master.slaves will contain both headphone and speaker > gain controls, so increasing outputs.master increases the gain on both the > headphones and the speaker. > > and if jack-sense-spaker-muting is active (should be in most codes by > default, at least in -current) plugging in the headphones/line-out should > cause the speaker to mute. > > now if you plug in and the speaker mutes, then you adjust the volume > with outputs.master (either directly or with the keys/buttons), it > could unmute the speaker on codecs with the above mentioned "feature". > this surely is not desired. the obvious fix is to make outputs.master > not change the gain on it's slaves that are muted. I'll try to cook > up a patch for that soonish.
can you see if this helps? -- jake...@sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org Index: azalia_codec.c =================================================================== RCS file: /cvs/src/sys/dev/pci/azalia_codec.c,v retrieving revision 1.124 diff -u -p -r1.124 azalia_codec.c --- azalia_codec.c 17 May 2009 02:28:26 -0000 1.124 +++ azalia_codec.c 17 May 2009 03:05:05 -0000 @@ -2049,6 +2049,15 @@ azalia_generic_mixer_set(codec_t *this, w = &this->w[this->playvols.slaves[i]]; if (!(COP_AMPCAP_NUMSTEPS(w->outamp_cap))) continue; + + /* don't change volume if muted */ + if (w->outamp_cap & COP_AMPCAP_MUTE) { + mc2.type = AUDIO_MIXER_ENUM; + azalia_generic_mixer_get(this, w->nid, + MI_TARGET_OUTAMP, &mc2); + if (mc2.un.ord) + continue; + } mc2.type = AUDIO_MIXER_VALUE; mc2.un.value.num_channels = WIDGET_CHANNELS(w); mc2.un.value.level[0] = this->playvols.vol_l;