Skip to content

Commit c53898e

Browse files
committed
Revert "ALSA: usb-audio: Name feature ctl using output if input is PCM"
This reverts commit 1601cd5. This fix is applied globally to all devices, and it may change the existing control names. When the devices are managed with the fixed configuration like UCM, such control name mismatch may lead to significant regressions. For avoiding that kind of regression, we would need to apply such changes conditionally, but it'd take time to settle down. While the original fix is a good thing in general, in order to address the regression, let's revert the change for now. Link: https://bugzilla.kernel.org/show_bug.cgi?id=218605 Reported-and-tested-by: Niklāvs Koļesņikovs <[email protected]> Message-ID: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 587d67f commit c53898e

File tree

1 file changed

+14
-35
lines changed

1 file changed

+14
-35
lines changed

sound/usb/mixer.c

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,34 +1652,6 @@ static const struct usb_feature_control_info *get_feature_control_info(int contr
16521652
return NULL;
16531653
}
16541654

1655-
static int feature_unit_mutevol_ctl_name(struct usb_mixer_interface *mixer,
1656-
struct snd_kcontrol *kctl,
1657-
struct usb_audio_term *iterm,
1658-
struct usb_audio_term *oterm)
1659-
{
1660-
struct usb_audio_term *aterm, *bterm;
1661-
bool output_first;
1662-
int len = 0;
1663-
1664-
/*
1665-
* If the input terminal is USB Streaming, we try getting the name of
1666-
* the output terminal first in hopes of getting something more
1667-
* descriptive than "PCM".
1668-
*/
1669-
output_first = iterm && !(iterm->type >> 16) && (iterm->type & 0xff00) == 0x0100;
1670-
1671-
aterm = output_first ? oterm : iterm;
1672-
bterm = output_first ? iterm : oterm;
1673-
1674-
if (aterm)
1675-
len = get_term_name(mixer->chip, aterm, kctl->id.name,
1676-
sizeof(kctl->id.name), 1);
1677-
if (!len && bterm)
1678-
len = get_term_name(mixer->chip, bterm, kctl->id.name,
1679-
sizeof(kctl->id.name), 1);
1680-
return len;
1681-
}
1682-
16831655
static void __build_feature_ctl(struct usb_mixer_interface *mixer,
16841656
const struct usbmix_name_map *imap,
16851657
unsigned int ctl_mask, int control,
@@ -1761,15 +1733,22 @@ static void __build_feature_ctl(struct usb_mixer_interface *mixer,
17611733
case UAC_FU_MUTE:
17621734
case UAC_FU_VOLUME:
17631735
/*
1764-
* Determine the control name:
1765-
* - If a name id is given in descriptor, use it.
1766-
* - If input and output terminals are present, try to derive
1767-
* the name from either of these.
1768-
* - Otherwise, make up a name using the feature unit ID.
1736+
* determine the control name. the rule is:
1737+
* - if a name id is given in descriptor, use it.
1738+
* - if the connected input can be determined, then use the name
1739+
* of terminal type.
1740+
* - if the connected output can be determined, use it.
1741+
* - otherwise, anonymous name.
17691742
*/
17701743
if (!len) {
1771-
len = feature_unit_mutevol_ctl_name(mixer, kctl, iterm,
1772-
oterm);
1744+
if (iterm)
1745+
len = get_term_name(mixer->chip, iterm,
1746+
kctl->id.name,
1747+
sizeof(kctl->id.name), 1);
1748+
if (!len && oterm)
1749+
len = get_term_name(mixer->chip, oterm,
1750+
kctl->id.name,
1751+
sizeof(kctl->id.name), 1);
17731752
if (!len)
17741753
snprintf(kctl->id.name, sizeof(kctl->id.name),
17751754
"Feature %d", unitid);

0 commit comments

Comments
 (0)