summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f600f9c)
raw | patch | inline | side by side (parent: f600f9c)
author | Takashi Iwai <tiwai@suse.de> | |
Wed, 16 Aug 2017 12:18:37 +0000 (14:18 +0200) | ||
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
Fri, 25 Aug 2017 00:02:35 +0000 (17:02 -0700) |
commit 0f174b3525a43bd51f9397394763925e0ebe7bc7 upstream.
C-Media devices (at least some models) mute the playback stream when
volumes are set to the minimum value. But this isn't informed via TLV
and the user-space, typically PulseAudio, gets confused as if it's
still played in a low volume.
This patch adds the new flag, min_mute, to struct usb_mixer_elem_info
for indicating that the mixer element is with the minimum-mute volume.
This flag is set for known C-Media devices in
snd_usb_mixer_fu_apply_quirk() in turn.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196669
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
C-Media devices (at least some models) mute the playback stream when
volumes are set to the minimum value. But this isn't informed via TLV
and the user-space, typically PulseAudio, gets confused as if it's
still played in a low volume.
This patch adds the new flag, min_mute, to struct usb_mixer_elem_info
for indicating that the mixer element is with the minimum-mute volume.
This flag is set for known C-Media devices in
snd_usb_mixer_fu_apply_quirk() in turn.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196669
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/mixer.c | patch | blob | history | |
sound/usb/mixer.h | patch | blob | history | |
sound/usb/mixer_quirks.c | patch | blob | history |
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 499b03c8281de19ac925a0dd06cc6562c46e856b..696de5ac69beb913ea2052a2fdbca83d1ec48473 100644 (file)
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
if (size < sizeof(scale))
return -ENOMEM;
+ if (cval->min_mute)
+ scale[0] = SNDRV_CTL_TLVT_DB_MINMAX_MUTE;
scale[2] = cval->dBmin;
scale[3] = cval->dBmax;
if (copy_to_user(_tlv, scale, sizeof(scale)))
diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h
index 3417ef347e40432482b84de271a3bb98c8724297..2b4b067646ab099653fe7ea79d9af1570e2971f6 100644 (file)
--- a/sound/usb/mixer.h
+++ b/sound/usb/mixer.h
int cached;
int cache_val[MAX_CHANNELS];
u8 initialized;
+ u8 min_mute;
void *private_data;
};
index 04991b00913222f07f4d6dbcb0dc6b955db4f5a5..5d2fc5f58bfe584d8f23949d8aa6675e54b15c1a 100644 (file)
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
if (unitid == 7 && cval->control == UAC_FU_VOLUME)
snd_dragonfly_quirk_db_scale(mixer, cval, kctl);
break;
+ /* lowest playback value is muted on C-Media devices */
+ case USB_ID(0x0d8c, 0x000c):
+ case USB_ID(0x0d8c, 0x0014):
+ if (strstr(kctl->id.name, "Playback"))
+ cval->min_mute = 1;
+ break;
}
}