• Takashi Iwai's avatar
    ALSA: usb-audio: Initialize every feature unit once at probe time · b96681bd
    Takashi Iwai authored
    So far we used to read the current value of the mixer element
    dynamically at the first access, and the error from a GET_CUR message
    is treated as a fatal error (unless QUIRK_IGNORE_CTL_ERROR is set).
    It's rather inconvenient, as most of GET_CUR errors are no fatal, and
    we can continue operation with assumption of some fixed value.
    
    This patch makes the USB-audio driver to change the behavior at probe
    time; now it tries to initialize the current value of each mixer
    element that is built from a feature unit (those for typically for
    mixer volumes and switches).  When a read failure happens, it tries to
    set the known minimum value.  After that point, a cached value is used
    always, hence we won't hit GET_CUR message error any longer.
    
    The error from GET_CUR message is still shown as a warning normally,
    but only once at the probe time, and it'll keep operating.  If the
    message is confirmed to be harmless, it can be shut up by
    QUIRK_IGNORE_CTL_ERROR quirk flag, too.
    Tested-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Link: https://lore.kernel.org/r/20211014130636.17860-4-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    b96681bd
mixer.c 97.8 KB