22 Aug, 2016

1 commit


21 Apr, 2015

1 commit

  • Roland SC-D70 reports its device class as vendor specific class and
    the quirk QUIRK_AUDIO_FIXED_ENDPOINT was used for audio output.

    In the quirks table the sampling rate was hard-coded to 44100 Hz
    and therefore not worked when the sound module was in 48000 Hz mode.

    In this change the quirk is changed to QUIRK_AUDIO_STANDARD_INTERFACE
    but as the sound module reports incorrect bSubframeSize in its
    descriptors, additional change is made in format.c to detect it and
    to override it (which uses the existing code for Edirol SD-90).

    Tested both when the sound module was in 44100 Hz mode and 48000 Hz
    mode and both audio input and output. MIDI related part of the driver
    is not touched.

    Signed-off-by: Takamichi Horikawa
    Signed-off-by: Takashi Iwai

    Takamichi Horikawa
     

26 Feb, 2014

1 commit

  • Convert with dev_err() and co from snd_printk(), etc.
    As there are too deep indirections (e.g. ep->chip->dev->dev),
    a few new local macros, usb_audio_err() & co, are introduced.

    Also, the device numbers in some messages are dropped, as they are
    shown in the prefix automatically.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

14 Jan, 2014

1 commit


28 Jun, 2013

1 commit


29 Apr, 2013

1 commit


18 Apr, 2013

1 commit

  • Unfortunately, none of the UAC standards provides a way to identify DSD
    (Direct Stream Digital) formats. Hence, this patch adds a quirks
    handler to identify USB interfaces that are capable of handling DSD.

    That quirks handler can augment the already parsed formats bit-field,
    by any of the new SNDRV_PCM_FMTBIT_DSD_{U8_U16} and setting the dsd_dop
    flag in the audio format, if the driver should take care for the DOP
    byte stuffing.

    The only devices that are known to work with this are the ones with
    a 'Playback Designs' vendor id.

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

    Daniel Mack
     

04 Apr, 2013

1 commit

  • Move the check that parse_audio_format_rates_v2() do after
    receiving the clock source entity ID directly into the find
    function and add a validation flag to the function.

    This patch does not introduce any logic flow change.

    It is provided to allow introducing automatic clock switching
    easier later. By moving this uac_clock_source_is_valid callsite,
    2 additional callsites can be avoided.

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

    Eldad Zack
     

18 Mar, 2013

2 commits


21 Nov, 2012

1 commit


15 Feb, 2012

1 commit

  • A malicious USB device could feed in a large nr_rates value. This would
    cause the subsequent call to kmemdup() to allocate a smaller buffer than
    expected, leading to out-of-bounds access.

    This patch validates the nr_rates value and reuses the limit introduced
    in commit 4fa0e81b ("ALSA: usb-audio: fix possible hang and overflow
    in parse_uac2_sample_rate_range()").

    Signed-off-by: Xi Wang
    Signed-off-by: Takashi Iwai

    Xi Wang
     

08 Jan, 2012

1 commit

  • A malicious USB device may feed in carefully crafted min/max/res values,
    so that the inner loop in parse_uac2_sample_rate_range() could run for
    a long time or even never terminate, e.g., given max = INT_MAX.

    Also nr_rates could be a large integer, which causes an integer overflow
    in the subsequent call to kmalloc() in parse_audio_format_rates_v2().
    Thus, kmalloc() would allocate a smaller buffer than expected, leading
    to a memory corruption.

    To exploit the two vulnerabilities, an attacker needs physical access
    to the machine to plug in a malicious USB device.

    This patch makes two changes.

    1) The type of "rate" is changed to unsigned int, so that the loop could
    stop once "rate" is larger than INT_MAX.

    2) Limit nr_rates to 1024.

    Suggested-by: Takashi Iwai
    Signed-off-by: Xi Wang
    Signed-off-by: Takashi Iwai

    Xi Wang
     

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
     

22 May, 2011

1 commit


18 May, 2011

1 commit


29 Apr, 2011

1 commit


10 Jan, 2011

1 commit


04 Sep, 2010

1 commit

  • The Audio Class v2 support code in 2.6.35 added checks for the
    bInterfaceProtocol field. However, there are devices (usually those
    detected by vendor-specific quirks) that do not have one of the
    predefined values in this field, which made the driver reject them.

    To fix this regression, restore the old behaviour, i.e., assume that
    a device with an unknown bInterfaceProtocol field (other than
    UAC_VERSION_2) has more or less UAC-v1-compatible descriptors.

    [compile warning fixes by tiwai]

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

    Clemens Ladisch
     

15 Aug, 2010

1 commit

  • Gcc complains that ret might be used uninitialized:

    sound/usb/format.c: In function ‘snd_usb_parse_audio_format’:
    sound/usb/format.c:354: warning: ‘ret’ may be used uninitialized in this function
    sound/usb/format.c:354: note: ‘ret’ was declared here
    sound/usb/format.c:414: warning: ‘ret’ may be used uninitialized in this function
    sound/usb/format.c:414: note: ‘ret’ was declared here

    I suppose it could be uninitialized if there is ever a UAC_VERSION_3
    released. Anyway this patch is worthwhile if only to silence the gcc
    warning.

    Signed-off-by: Dan Carpenter
    Acked-by: Daniel Mack
    Signed-off-by: Takashi Iwai

    Dan Carpenter
     

23 Jun, 2010

1 commit


12 Jun, 2010

3 commits


01 Jun, 2010

1 commit

  • Audio devices which comply to the UAC2 standard can export complex clock
    topologies in its descriptors and set up links between them.

    The entities that are defined are

    - clock sources, which define the end-leafs.
    - clock selectors, which act as switch to select one out of many
    possible clocks sources.
    - clock multipliers, which have an input clock source, and act as clock
    source again. They can be used to derive one clock from another.

    All sample rate changes, clock validity queries and the like must go to
    clock source elements, while clock selectors and multipliers can be used
    as terminal clock source.

    The following patch adds a parser for these elements and functions to
    iterate over the tree and find the leaf nodes (clock sources).

    The samplerate set functions were moved to the new clock.c file.

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

    Daniel Mack
     

27 May, 2010

2 commits


29 Mar, 2010

1 commit


12 Mar, 2010

2 commits


05 Mar, 2010

3 commits

  • Change the parser to correctly handle v2 descriptors with multiple
    format bits set.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     
  • In preparation for USB audio 2.0 support, change the audioformat
    structure so that it uses a bitmask to specify possible formats.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     
  • Clean up the usb audio driver by factoring out a lot of functions to
    separate files. Code for procfs, quirks, urbs, format parsers etc all
    got a new home now.

    Moved almost all special quirk handling to quirks.c and introduced new
    generic functions to handle them, so the exceptions do not pollute the
    whole driver.

    Renamed usbaudio.c to card.c because this is what it actually does now.
    Renamed usbmidi.c to midi.c for namespace clarity.
    Removed more things from usbaudio.h.

    The non-standard drivers were adopted accordingly.

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

    Daniel Mack