diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2010-10-15 04:32:50 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-10-17 04:45:30 -0400 |
commit | de8c85f7840e5e29629de95f5af24297fb325e0b (patch) | |
tree | 79f9a1cff3ff4b5baec72186f5d0709803b9125e /sound/pci/hda/hda_local.h | |
parent | c3d226ab8b44fe31e5e6d5739eb353597cea4029 (diff) |
ALSA: HDA: Sigmatel: work around incorrect master muting
The HDA specification does not allow for a codec to mute itself just
because the volume is reduced, so _of course_ somebody had to go and do
it. This wouldn'\''t hurt too much when the volume is adjusted by hand,
but programs like PA that try to set the volume automatically could
inadvertently mute the output.
To work around this, change the TLV dB information for the Master volume
on all Sigmatel HDA codecs to indicate the the minimal volume setting
actually mutes.
Reported-by: Colin Guthrie <gmane@colin.guthr.ie>
Reported-by: "Alexander E. Patrakov" <patrakov@gmail.com>
Tested-by: Colin Guthrie <cguthrie@mandriva.org>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_local.h')
-rw-r--r-- | sound/pci/hda/hda_local.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index d7dfa547e2d..46bbefe2e4a 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -38,10 +38,11 @@ | |||
38 | */ | 38 | */ |
39 | #define HDA_COMPOSE_AMP_VAL_OFS(nid,chs,idx,dir,ofs) \ | 39 | #define HDA_COMPOSE_AMP_VAL_OFS(nid,chs,idx,dir,ofs) \ |
40 | ((nid) | ((chs)<<16) | ((dir)<<18) | ((idx)<<19) | ((ofs)<<23)) | 40 | ((nid) | ((chs)<<16) | ((dir)<<18) | ((idx)<<19) | ((ofs)<<23)) |
41 | #define HDA_AMP_VAL_MIN_MUTE (1<<29) | ||
41 | #define HDA_COMPOSE_AMP_VAL(nid,chs,idx,dir) \ | 42 | #define HDA_COMPOSE_AMP_VAL(nid,chs,idx,dir) \ |
42 | HDA_COMPOSE_AMP_VAL_OFS(nid, chs, idx, dir, 0) | 43 | HDA_COMPOSE_AMP_VAL_OFS(nid, chs, idx, dir, 0) |
43 | /* mono volume with index (index=0,1,...) (channel=1,2) */ | 44 | /* mono volume with index (index=0,1,...) (channel=1,2) */ |
44 | #define HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \ | 45 | #define HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, channel, xindex, dir, flags) \ |
45 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ | 46 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ |
46 | .subdevice = HDA_SUBDEV_AMP_FLAG, \ | 47 | .subdevice = HDA_SUBDEV_AMP_FLAG, \ |
47 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \ | 48 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \ |
@@ -51,16 +52,20 @@ | |||
51 | .get = snd_hda_mixer_amp_volume_get, \ | 52 | .get = snd_hda_mixer_amp_volume_get, \ |
52 | .put = snd_hda_mixer_amp_volume_put, \ | 53 | .put = snd_hda_mixer_amp_volume_put, \ |
53 | .tlv = { .c = snd_hda_mixer_amp_tlv }, \ | 54 | .tlv = { .c = snd_hda_mixer_amp_tlv }, \ |
54 | .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, xindex, direction) } | 55 | .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, xindex, dir) | flags } |
55 | /* stereo volume with index */ | 56 | /* stereo volume with index */ |
56 | #define HDA_CODEC_VOLUME_IDX(xname, xcidx, nid, xindex, direction) \ | 57 | #define HDA_CODEC_VOLUME_IDX(xname, xcidx, nid, xindex, direction) \ |
57 | HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, 3, xindex, direction) | 58 | HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, 3, xindex, direction, 0) |
58 | /* mono volume */ | 59 | /* mono volume */ |
59 | #define HDA_CODEC_VOLUME_MONO(xname, nid, channel, xindex, direction) \ | 60 | #define HDA_CODEC_VOLUME_MONO(xname, nid, channel, xindex, direction) \ |
60 | HDA_CODEC_VOLUME_MONO_IDX(xname, 0, nid, channel, xindex, direction) | 61 | HDA_CODEC_VOLUME_MONO_IDX(xname, 0, nid, channel, xindex, direction, 0) |
61 | /* stereo volume */ | 62 | /* stereo volume */ |
62 | #define HDA_CODEC_VOLUME(xname, nid, xindex, direction) \ | 63 | #define HDA_CODEC_VOLUME(xname, nid, xindex, direction) \ |
63 | HDA_CODEC_VOLUME_MONO(xname, nid, 3, xindex, direction) | 64 | HDA_CODEC_VOLUME_MONO(xname, nid, 3, xindex, direction) |
65 | /* stereo volume with min=mute */ | ||
66 | #define HDA_CODEC_VOLUME_MIN_MUTE(xname, nid, xindex, direction) \ | ||
67 | HDA_CODEC_VOLUME_MONO_IDX(xname, 0, nid, 3, xindex, direction, \ | ||
68 | HDA_AMP_VAL_MIN_MUTE) | ||
64 | /* mono mute switch with index (index=0,1,...) (channel=1,2) */ | 69 | /* mono mute switch with index (index=0,1,...) (channel=1,2) */ |
65 | #define HDA_CODEC_MUTE_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \ | 70 | #define HDA_CODEC_MUTE_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \ |
66 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ | 71 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \ |
@@ -581,6 +586,7 @@ int snd_hda_check_amp_list_power(struct hda_codec *codec, | |||
581 | #define get_amp_direction(kc) (((kc)->private_value >> 18) & 0x1) | 586 | #define get_amp_direction(kc) (((kc)->private_value >> 18) & 0x1) |
582 | #define get_amp_index(kc) (((kc)->private_value >> 19) & 0xf) | 587 | #define get_amp_index(kc) (((kc)->private_value >> 19) & 0xf) |
583 | #define get_amp_offset(kc) (((kc)->private_value >> 23) & 0x3f) | 588 | #define get_amp_offset(kc) (((kc)->private_value >> 23) & 0x3f) |
589 | #define get_amp_min_mute(kc) (((kc)->private_value >> 29) & 0x1) | ||
584 | 590 | ||
585 | /* | 591 | /* |
586 | * CEA Short Audio Descriptor data | 592 | * CEA Short Audio Descriptor data |