26 Sep, 2013

1 commit

  • Convert 0 to false and 1 to true when assigning values to bool
    variables. Inspired by commit 3db1cd5c05f35fb43eb134df6f321de4e63141f2.

    The simplified semantic patch that find this problem is as
    follows (http://coccinelle.lip6.fr/):

    @@
    bool b;
    @@
    (
    -b = 0
    +b = false
    |
    -b = 1
    +b = true
    )

    Signed-off-by: Peter Senna Tschudin
    Signed-off-by: Takashi Iwai

    Peter Senna Tschudin
     

12 Aug, 2013

1 commit


17 Jun, 2013

1 commit


05 Jun, 2013

1 commit

  • USB audio driver spews an error message when probing Logitech HD
    webcam c270:
    ALSA mixer.c:1300 usb_audio: Warning! Unlikely big volume range (=6144), cval->res is probably wrong.
    ALSA mixer.c:1304 usb_audio: [5] FU [Mic Capture Volume] ch = 1, val = 1536/7680/1

    Obviously the device needs a fixed volume resolution (cval->res = 384)
    like other Logitech devices.

    Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=821735

    Reported-and-tested-by: Cristian Rodríguez
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

20 Mar, 2013

3 commits

  • Creation of individual mixer controls may fail, but that shouldn't cause
    the entire mixer creation to fail. Even worse, if the mixer creation
    fails, that will error out the entire device probing.

    All the functions called by parse_audio_unit() should return -EINVAL if
    they find descriptors that are unsupported or believed to be malformed,
    so we can safely handle this error code as a non-fatal condition in
    snd_usb_mixer_controls().

    That fixes a long standing bug which is commonly worked around by
    adding quirks which make the driver ignore entire interfaces. Some of
    them might now be unnecessary.

    Signed-off-by: Daniel Mack
    Reported-and-tested-by: Rodolfo Thomazelli
    Cc:
    Signed-off-by: Takashi Iwai

    Daniel Mack
     
  • In check_input_term() and parse_audio_feature_unit(), propagate the
    error value that has been returned by a failing function instead of
    -EINVAL. That helps cleaning up the error pathes in the mixer.

    Signed-off-by: Daniel Mack
    Cc:
    Signed-off-by: Takashi Iwai

    Daniel Mack
     
  • UAC2_EXTENSION_UNIT_V2 differs from UAC1_EXTENSION_UNIT, but can be handled in
    the same way when parsing the unit. Otherwise parse_audio_unit() fails when it
    sees an extension unit on a UAC2 device.

    UAC2_EXTENSION_UNIT_V2 is outside the range allocated by UAC1.

    Signed-off-by: Torstein Hegge
    Acked-by: Daniel Mack
    Cc:
    Signed-off-by: Takashi Iwai

    Torstein Hegge
     

11 Feb, 2013

1 commit

  • Adds quirks and mixer support for the M-Audio Fast Track C600 USB
    audio interface. This device is very similar to the C400 - the C600
    simply has some more inputs and outputs, so the existing C400 support
    is extended to support this device as well.

    Signed-off-by: Matt Gruskin
    Signed-off-by: Takashi Iwai

    Matt Gruskin
     

27 Jan, 2013

1 commit

  • Commit 23caaf19b11e (ALSA: usb-mixer: Add support for Audio Class v2.0)
    forgot to adjust the length check for UAC 2.0 feature unit descriptors.
    This would make the code abort on encountering a feature unit without
    per-channel controls, and thus prevented the driver to work with any
    device having such a unit, such as the RME Babyface or Fireface UCX.

    Reported-by: Florian Hanisch
    Tested-by: Matthew Robbetts
    Tested-by: Michael Beer
    Cc: Daniel Mack
    Cc: 2.6.35+
    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     

29 Nov, 2012

4 commits

  • A lot of headsets/headphones have a "Speaker" mixer control. This confuses
    PulseAudio to think it is a speaker instead of a headphone/headset.
    Therfore, we rename it to "Headphone".

    We determine if something is a headphone similar to how udev determines
    form factor (see 78-sound-card.rules).

    BugLink: https://bugs.launchpad.net/bugs/1082357
    Signed-off-by: David Henningsson
    Signed-off-by: Takashi Iwai

    David Henningsson
     
  • Add ranges for various Fast Track C400 controls, as observed
    while using the vendor's mixer control software (res values
    are an estimation).

    Signed-off-by: Eldad Zack
    Signed-off-by: Takashi Iwai

    Eldad Zack
     
  • Current code mishandles the case where the device is a UAC2
    and the bDescriptorSubtype is a UAC2 Effect Unit (0x07).
    It tries to parse it as a Processing Unit (which is similar to two
    other UAC1 units with overlapping subtypes), but since the structure
    is different (See: 4.7.2.10, 4.7.2.11 in UAC2 standard), the parsing
    is done incorrectly and prevents the device from initializing.
    For now, just ignore the unit.

    Signed-off-by: Eldad Zack
    Signed-off-by: Takashi Iwai

    Eldad Zack
     
  • Currently, channel IDs exceeding 31 (0x1f) cannot be used.
    The channel ID is derived from the cmask. Extending cmask
    to a 64-bit type would only allow it to go up to 63 (0x3f).
    Some devices have channel IDs exceeding that as well.
    To address that, add an offset to the mixer element which
    is then accounted for in the UAC set/get functions.

    Signed-off-by: Eldad Zack
    Signed-off-by: Takashi Iwai

    Eldad Zack
     

30 Oct, 2012

2 commits

  • Replace mutex with rwsem for codec->shutdown protection so that
    concurrent accesses are allowed.

    Also add the protection to snd_usb_autosuspend() and
    snd_usb_autoresume(), too.

    Reported-by: Matthieu CASTET
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • Close some races at disconnection of a USB audio device by adding the
    chip->shutdown_mutex and chip->shutdown check at appropriate places.

    The spots to put bandaids are:
    - PCM prepare, hw_params and hw_free
    - where the usb device is accessed for communication or get speed, in
    mixer.c and others; the device speed is now cached in subs->speed
    instead of accessing to chip->dev

    The accesses in PCM open and close don't need the mutex protection
    because these are already handled in the core PCM disconnection code.

    The autosuspend/autoresume codes are still uncovered by this patch
    because of possible mutex deadlocks. They'll be covered by the
    upcoming change to rwsem.

    Also the mixer codes are untouched, too. These will be fixed in
    another patch, too.

    Reported-by: Matthieu CASTET
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

20 Sep, 2012

1 commit

  • While going through Ubuntu bugs, I discovered this patch being
    posted and a confirmation that the patch works as expected.

    Finding out how the hw volume really works would be preferrable
    to just disabling the broken one, but this would be better than
    nothing.

    Credit: sndfnsdfin (qawsnews)
    BugLink: https://bugs.launchpad.net/bugs/559939
    Signed-off-by: David Henningsson
    Signed-off-by: Takashi Iwai

    David Henningsson
     

15 May, 2012

1 commit


24 Apr, 2012

2 commits


15 Apr, 2012

1 commit


09 Nov, 2011

2 commits

  • Logitech HD Webcam c510 provide wrong mixer resolution.
    Add it to "res = 384" quirk.

    Signed-off-by: Alexey Fisher
    Signed-off-by: Takashi Iwai

    Alexey Fisher
     
  • In the recent usb-audio driver, the initialization of volume ranges
    may be delayed when the device doesn't respond well at the probing time.
    But the volume quirks for certain devices are applied only in
    mixer_ctl_feature_info() thus only at the very first probe and will be
    missing when the volume range is initialized later.

    This patch moves the volume quirk code to be always called from the
    volume-range extraction (get_min_max()), so that the quirks are properly
    applied in the later init time.

    Reported-and-tested-by: Alexey Fisher
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

13 Oct, 2011

1 commit

  • The audio_feature_info[] array should contain all entries for UAC2_FU_*,
    but currently a few last entries are missing. Even though, the driver
    tries to probe these entries in parse_audio_feature_unit() and may
    access the range over the array. This patch fixes the bug by limiting
    the loop size properly using ARRAY_SIZE() instead of a hard-coded
    magic number.

    Reported-by: Dan Carpenter
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

27 Sep, 2011

1 commit

  • There are certain devices that are reportedly so slow that they need
    more than 100 ms to handle control transfers. Therefore, increase the
    timeout in mixer(_quirks).c to 1000 ms.

    The timeout parameter of snd_usb_ctl_msg() is now constant, so we can
    drop it.

    Reported-by: Felipe Balbi
    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     

19 Aug, 2011

2 commits

  • When the initial check of dB-range failed due to the read error, try to
    check again at the later read, too. When an invalid dB range is found,
    remove TLV flags and notify the mixer info change.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The recent fix for testing dB range at the mixer creation time seems
    to cause regressions in some devices. In such devices, reading the dB
    info at probing time gives an error, thus both dBmin and dBmax are still
    zero, and TLV flag isn't set although the later read of dB info succeeds.

    This patch adds a workaround for such a case by assuming that the later
    read will succeed. In future, a similar test should be performed in a
    case where a wrong dB range is seen even in the later read.

    Signed-off-by: Takashi Iwai
    Cc:

    Takashi Iwai
     

04 Aug, 2011

2 commits


25 May, 2011

2 commits

  • In order to allow quirks functions to hook up to the standard feature
    unit op tables, this patch exports a pointer to the struct that is used
    internally.

    That way, all the code handling the control can be kept private, and
    external code can reference the symbol to re-use it.

    Signed-off-by: Daniel Mack
    Signed-off-by: Takashi Iwai

    Daniel Mack
     
  • This patch renames add_control_to_empty() to snd_usb_mixer_add_control()
    and exports it, so the quirks functions can make use of it.

    Also, as "struct mixer_build" is private to mixer.c, rewrite the
    function to take an argument of type "struct usb_mixer_interface"
    instead.

    Signed-off-by: Daniel Mack
    Signed-off-by: Takashi Iwai

    Daniel Mack
     

22 May, 2011

1 commit


28 Apr, 2011

1 commit

  • Some crappy USB-audio devices give broken dB ranges, e.g. both min and max
    are 0dB. This confuses the volume control that prefers dB expression such
    as alsactl or PulseAudio. In such a case, it's much better not to expose
    the broken dB information.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

31 Mar, 2011

1 commit


11 Mar, 2011

3 commits


10 Mar, 2011

2 commits


08 Feb, 2011

1 commit


10 Jan, 2011

1 commit