[alsa-devel] HDA: Sound mutes when combination is below -48 dB

Takashi Iwai tiwai at suse.de
Fri Dec 3 12:59:21 CET 2010


At Fri, 03 Dec 2010 12:30:02 +0100,
David Henningsson wrote:
> 
> I'm trying to nail down a strange behaviour. I have one "Master" and one 
> "Speaker" (or "Headphone") volume control, each ranging from -48 dB to 0 
> dB. Whenever the sum of "Master" and "Speaker" is below -48 dB, the 
> output mutes. Codec is attached.
> 
> "Master" is a "Virtual master" control, and both "Master" and "Speaker" 
> control amp-out on nid 0x13. Nid 0x13 does not have amp-out caps, but 
> the AFG specifies a range of -96 dB to 0 dB in 0.75 dB steps.
> 
> There is some strange things here. First, in 
> patch_sigmatel:create_controls_idx, there is this comment:
> 
> 		/* if dB scale is over -64dB, and finer enough,
> 		 * let's reduce it to half
> 		 */
> Hmm? Removing half of the volume slider?
> 
> Second, assuming we actually buy this decision, wouldn't it make sense 
> for people to be able to combine Master and Speaker to get the full -96 
> to 0 dB range? Instead, "Master" is just working over the range defined 
> by "Speaker".

Well, the problem was fairly old.  You must think of the world before
anything dB evaluation was introduced in the mixer apps.  They just
took a percentage value, so we got to cut it off to give some "usable"
interface for them.

The biggest problem right now is that you can't take it back so easily
"just for PA".  The PCM softvol is also the same.  There is no perfect
solution, and PA isn't by 100% people here.  However, we must not give
a regression in 100% manner.

OK, let's back to the bug point...

> Third, there is an interesting condition in hda_codec.c:update_amp_value:
> 
> 	if (val > 0)
> 		val += ofs;
> 
> Now this is in practice turning all volume controls which have ofs (e g 
> those being "reduced to half") to a minimum-is-mute error: I can set the 
> amp value to either 0 (-96 dB) or the 65 - 127 range (~ -48 dB - 0 dB). 
> So it isn't really mute, it's -96 dB signal, but I can't hear that anyway.

OK, this looks really like a bug that the driver gives min-mute flag.
The min-mute flag should be given only for the STAC codecs with lower
resolution, such as STAC9200.  It seems that STAC925x (and STAC9202)
are also in this category, while STAC9205 and other IDT codecs have
higher resolutions.

Since both STAC9200 and STAC925x have own Master definition, the
simplest solution is to remove TLV_DB_SCALE_MUTE for vmaster like
below...


thanks,

Takashi

---
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index efa4225..1780890 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1150,8 +1150,6 @@ static int stac92xx_build_controls(struct hda_codec *codec)
 					HDA_OUTPUT, vmaster_tlv);
 		/* correct volume offset */
 		vmaster_tlv[2] += vmaster_tlv[3] * spec->volume_offset;
-		/* minimum value is actually mute */
-		vmaster_tlv[3] |= TLV_DB_SCALE_MUTE;
 		err = snd_hda_add_vmaster(codec, "Master Playback Volume",
 					  vmaster_tlv, slave_vols);
 		if (err < 0)



More information about the Alsa-devel mailing list