10 Apr, 2014

1 commit

  • BugLink: http://bugs.launchpad.net/bugs/1305133

    Malfunctioning or slow devices can cause a flood of dmesg SPAM.

    I've ignored checkpatch.pl complaints about the use of printk_ratelimit() in favour
    of prior art in sound/usb/pcm.c.

    WARNING: Prefer printk_ratelimited or pr__ratelimited to printk_ratelimit
    + if (printk_ratelimit() &&

    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Cc: Eldad Zack
    Cc: Daniel Mack
    Cc: Clemens Ladisch
    Signed-off-by: Tim Gardner
    Signed-off-by: Takashi Iwai

    Tim Gardner
     

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
     

07 Oct, 2013

3 commits

  • As Clemens Ladisch kindly explained:
    "Please note that there are two methods to identify alternate settings:
    the number, which is the value in bAlternateSetting, and the index,
    which is the index in the descriptor array. There might be some wording
    in the USB spec that these two values must be the same, but in reality,
    [insert standard rant about firmware writers], bAlternateSetting
    must be treated as a random ID value."

    This patch changes the name to express the correct usage semantics.
    No functional change.

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

    Eldad Zack
     
  • If setting the interface fails, the SUBSTREAM_FLAG_SYNC_EP_STARTED
    should be cleared.

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

    Eldad Zack
     
  • The only call site for deactivate_endpoints() at snd_usb_hw_free().
    The return value is not checked there, as it is irrelevant if it
    fails on hw_free.
    This patch moves the deactivation of the endpoints directly into
    snd_usb_hw_free().

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

    Eldad Zack
     

26 Sep, 2013

1 commit

  • This patch changes the way URBs are allocated and their sizes are
    determined for PCM playback in the snd-usb-audio driver. Currently
    the driver allocates too few URBs for endpoints that don't use
    implicit sync, making underruns more likely to occur. This may be a
    holdover from before I/O delays could be measured accurately; in any
    case, it is no longer necessary.

    The patch allocates as many URBs as possible, subject to four
    limitations:

    The total number of URBs for the endpoint is not allowed to
    exceed MAX_URBS (which the patch increases from 8 to 12).

    The total number of packets per URB is not allowed to exceed
    MAX_PACKS (or MAX_PACKS_HS for high-speed devices), which is
    decreased from 20 to 6.

    The total duration of queued data is not allowed to exceed
    MAX_QUEUE, which is decreased from 24 ms to 18 ms.

    The total number of ALSA frames in the output queue is not
    allowed to exceed the ALSA buffer size.

    The last requirement is the hardest to implement. Currently the
    number of URBs needed to fill a buffer cannot be determined in
    advance, because a buffer contains a fixed number of frames whereas
    the number of frames in an URB varies to match shifts in the device's
    clock rate. To solve this problem, the patch changes the logic for
    deciding how many packets an URB should contain. Rather than using as
    many as possible without exceeding an ALSA period boundary, now the
    driver uses only as many packets as needed to transfer a predetermined
    number of frames. As a result, unless the device's clock has an
    exceedingly variable rate, the number of URBs making up each period
    (and hence each buffer) will remain constant.

    The overall effect of the patch is that playback works better in
    low-latency settings. The user can still specify values for
    frames/period and periods/buffer that exceed the capabilities of the
    hardware, of course. But for values that are within those
    capabilities, the performance will be improved. For example, testing
    shows that a high-speed device can handle 32 frames/period and 3
    periods/buffer at 48 KHz, whereas the current driver starts to get
    glitchy at 64 frames/period and 2 periods/buffer.

    A side effect of these changes is that the "nrpacks" module parameter
    is no longer used. The patch removes it.

    Signed-off-by: Alan Stern
    CC: Clemens Ladisch
    Tested-by: Daniel Mack
    Tested-by: Eldad Zack
    Signed-off-by: Takashi Iwai

    Alan Stern
     

06 Aug, 2013

8 commits


28 Jun, 2013

2 commits

  • All the Roland/Edirol/BOSS USB audio devices that need implicit feedback
    show this unambiguously in their descriptors, so it might be a good idea
    to let the driver detect this.

    This should make playback work correctly (at least with Jack) with the
    following devices:
    - BOSS GT-100
    - BOSS JS-8 Jam Station
    - Edirol M-16DX
    - Roland GAIA SH-01

    Signed-off-by: Clemens Ladisch

    Clemens Ladisch
     
  • Instead of reading bInterfaceProtocol from the descriptor whenever it's
    needed, store this value in the audioformat structure. Besides
    simplifying some code, this will allow us to correctly handle vendor-
    specific devices where the descriptors are marked with other values.

    Signed-off-by: Clemens Ladisch

    Clemens Ladisch
     

29 Apr, 2013

1 commit


18 Apr, 2013

3 commits

  • There is quite some confusion around the bit-ordering in DSD samples,
    and no general agreement that defines whether hardware is supposed to
    expect the oldest sample in the MSB or the LSB of a byte.

    ALSA will hence set the rule that on the software API layer, bytes
    always carry the oldest bit in the most significant bit of a byte, and
    the driver has to translate that at runtime in order to match the
    hardware layout.

    This patch adds support for this by adding a boolean flag to the
    audio format struct.

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

    Daniel Mack
     
  • In order to provide a compatibility way for pushing DSD
    samples through ordinary PCM channels, the "DoP open Standard" was
    invented. See http://www.dsd-guide.com for the official document.

    The host is required to stuff DSD marker bytes (0x05, 0xfa,
    alternating) in the MSB of 24 bit wide samples on the bus, in addition
    to the 16 bits of actual DSD sample payload.

    To support this, the hardware and software stride logic in the driver
    has to be tweaked a bit, as we make the userspace believe we're
    operating on 16 bit samples, while we in fact push one more byte per
    channel down to the hardware.

    The DOP runtime information is stored in struct snd_usb_substream, so
    we can keep track of our state across multiple calls to
    prepare_playback_urb_dsd_dop().

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

    Daniel Mack
     
  • For normal PCM transfer, this change has no effect, as the endpoint's
    stride is always frame_bits/8. For DSD DOP streams, however, which is
    added later, the hardware stride differs from the software stride, and
    the endpoint has the correct information in these cases.

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

    Daniel Mack
     

13 Apr, 2013

1 commit

  • When recording at 176.2KHz or 192Khz, the device adds a 32-bit length
    header to the capture packets, which obviously needs to be ignored for
    recording to work properly.

    Userspace expected: L0 L1 L2 R0 R1 R2
    ...but actually got: R2 L0 L1 L2 R0 R1

    Also, the last byte of the length header being interpreted as L0 of
    the first sample caused spikes every 0.5ms, resulting in a loud 16KHz
    tone (about the highest 'B' on a piano) being present throughout
    captures.

    Tested at all sample rates on an E-Mu 0404USB, and tested for
    regressions on a generic USB headset.

    Signed-off-by: Calvin Owens
    Cc:
    Signed-off-by: Takashi Iwai

    Calvin Owens
     

10 Apr, 2013

1 commit


04 Apr, 2013

2 commits


18 Mar, 2013

1 commit


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
     

26 Jan, 2013

1 commit

  • Because currently snd_printd() and snd_printdd() macros are expanded
    to empty when CONFIG_SND_DEBUG=n, a compile warning like below
    appears sometimes, and we had to covert it by ugly ifdefs:
    sound/pci/hda/patch_sigmatel.c: In function ‘stac92hd71bxx_fixup_hp’:
    sound/pci/hda/patch_sigmatel.c:2434:24: warning: unused variable ‘spec’ [-Wunused-variable]

    For "fixing" these issues better, this patch replaces snd_printd() and
    snd_printdd() definitions with empty inline functions instead of
    macros. This should have the same effect but shut up warnings like
    above.

    But since we had already put ifdefs, changing to inline functions
    would trigger compile errors. So, such ifdefs is removed in this
    patch.

    In addition, snd_pci_quirk name field is defined only when
    CONFIG_SND_DEBUG_VERBOSE is set, and the reference to it in
    snd_printdd() argument triggers the build errors, too. For avoiding
    these errors, introduce a new macro snd_pci_quirk_name() that is
    defined no matter how the debug option is set.

    Reported-by: Stratos Karafotis
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

23 Jan, 2013

1 commit


11 Jan, 2013

1 commit

  • The commit [0d9741c0: ALSA: usb-audio: sync ep init fix for
    audioformat mismatch] introduced the correction of parameters to be
    set for sync EP. But since the new code assumes that the sync EP is
    always paired with the data EP of another direction, it triggers Oops
    when a device only with a single direction is used.

    This patch adds a proper check of sync EP type and the presence of the
    paired substream for avoiding the crash.

    Reported-and-tested-by: Jens Axboe
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

24 Dec, 2012

1 commit


04 Dec, 2012

1 commit

  • Commit 947d299686aa9cc8aecf749d54e8475c6e498956 , "ALSA: snd-usb:
    properly initialize the sync endpoint", while correcting the
    initialization of the sync endpoint when opening just the data
    endpoint, prevents devices that has a sync endpoint, with a channel
    number different than that of the data endpoint, from functioning.
    Due to a different channel and period bytes count, attempting to
    initialize the sync endpoint will fail at the usb host driver.
    For example, when using xhci:

    cannot submit urb 0, error -90: internal error

    With this patch, if a sync endpoint has multiple audioformats, a
    matching audioformat is preferred. An audioformat must be found
    with at least one channel and support the requested sample rate
    and PCM format, otherwise the stream will not be opened.

    If the number of channels differ between the selected audioformat
    and the requested format, adjust the period bytes count accordingly.
    It is safe to perform the calculation on the basis of the channel
    count, since the requested PCM audio format and the rate must be
    supported by the selected audioformat.

    Cc: Jeffrey Barish
    Cc: Daniel Mack
    Signed-off-by: Eldad Zack
    Signed-off-by: Takashi Iwai

    Eldad Zack
     

29 Nov, 2012

2 commits


23 Nov, 2012

4 commits


21 Nov, 2012

3 commits