1. 07 10月, 2013 2 次提交
  2. 26 9月, 2013 1 次提交
    • A
      ALSA: improve buffer size computations for USB PCM audio · 976b6c06
      Alan Stern 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      CC: Clemens Ladisch <clemens@ladisch.de>
      Tested-by: NDaniel Mack <zonque@gmail.com>
      Tested-by: NEldad Zack <eldad@fogrefinery.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      976b6c06
  3. 08 8月, 2013 1 次提交
  4. 06 8月, 2013 1 次提交
  5. 29 4月, 2013 1 次提交
  6. 18 4月, 2013 1 次提交
    • D
      ALSA: snd-usb: add support for DSD DOP stream transport · d24f5061
      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: NDaniel Mack <zonque@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d24f5061
  7. 04 4月, 2013 2 次提交
  8. 29 11月, 2012 1 次提交
    • E
      ALSA: usb-audio: use sender stride for implicit feedback · 28acb120
      Eldad Zack 提交于
      For implicit feedback endpoints, the number of bytes for each packet
      is matched by the corresponding synchronizing endpoint.
      The size is calculated by taking the actual size and dividing it by
      the stride - currently by the endpoint's stride, but we should use the
      synchronization source's stride.
      This is evident when the number of channels differ between the
      synchronization source and the implicitly fed-back endpoint, as with
      M-Audio Fast Track C400 - the synchronization source (capture)
      has 4 channels, while the implicit feedback mode endpoint has 6.
      Signed-off-by: NEldad Zack <eldad@fogrefinery.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      28acb120
  9. 21 11月, 2012 4 次提交
  10. 17 11月, 2012 1 次提交
  11. 08 11月, 2012 1 次提交
  12. 28 9月, 2012 1 次提交
  13. 19 9月, 2012 1 次提交
  14. 04 9月, 2012 1 次提交
    • D
      ALSA: snd-usb: Add quirks for Playback Designs devices · 2b58fd5b
      Daniel Mack 提交于
      Playback Designs' USB devices have some hardware limitations on their
      USB interface. In particular:
      
       - They need a 20ms delay after each class compliant request as the
         hardware ACKs the USB packets before the device is actually ready
         for the next command. Sending data immediately will result in buffer
         overflows in the hardware.
       - The devices send bogus feedback data at the start of each stream
         which confuse the feedback format auto-detection.
      
      This patch introduces a new quirks hook that is called after each
      control packet and which adds a delay for all devices that match
      Playback Designs' USB VID for now.
      
      In addition, it adds a counter to snd_usb_endpoint to drop received
      packets on the floor. Another new quirks function that is called once
      an endpoint is started initializes that counter for these devices on
      their sync endpoint.
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Reported-and-tested-by: NAndreas Koch <andreas@akdesigninc.com>
      Supported-by: NDemian Martin <demianm_1@yahoo.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2b58fd5b
  15. 01 9月, 2012 1 次提交
    • D
      ALSA: snd-usb: fix calls to next_packet_size · 245baf98
      Daniel Mack 提交于
      In order to support devices with implicit feedback streaming models,
      packet sizes are now stored with each individual urb, and the PCM
      handling code which fills the buffers purely relies on the size fields
      now.
      
      However, calling snd_usb_audio_next_packet_size() for all possible
      packets in an URB at once, prior to letting the PCM code do its job
      does in fact not lead to the same behaviour than what the old code did:
      The PCM code will break its loop once a period boundary is reached,
      consequently using up less packets that it really could.
      
      As snd_usb_audio_next_packet_size() implements a feedback mechanism to
      the endpoints phase accumulator, the number of calls to that function
      matters, and when called too often, the data rate runs out of bounds.
      
      Fix this by making the next_packet function public, and call it from the
      PCM code as before if the packet data sizes are not defined.
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Cc: stable@kernel.org [v3.5+]
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      245baf98
  16. 30 8月, 2012 1 次提交
    • D
      ALSA: snd-usb: Fix URB cancellation at stream start · 015618b9
      Daniel Mack 提交于
      Commit e9ba389c ("ALSA: usb-audio: Fix scheduling-while-atomic bug in
      PCM capture stream") fixed a scheduling-while-atomic bug that happened
      when snd_usb_endpoint_start was called from the trigger callback, which
      is an atmic context. However, the patch breaks the idea of the endpoints
      reference counting, which is the reason why the driver has been
      refactored lately.
      
      Revert that commit and let snd_usb_endpoint_start() take care of the URB
      cancellation again. As this function is called from both atomic and
      non-atomic context, add a flag to denote whether the function may sleep.
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Cc: stable@kernel.org [3.5+]
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      015618b9
  17. 16 8月, 2012 1 次提交
  18. 13 7月, 2012 1 次提交
  19. 25 4月, 2012 1 次提交
  20. 24 4月, 2012 1 次提交
  21. 13 4月, 2012 6 次提交
  22. 09 1月, 2012 1 次提交
  23. 14 9月, 2011 2 次提交
  24. 04 8月, 2011 1 次提交
  25. 13 7月, 2011 1 次提交
  26. 04 9月, 2010 1 次提交
    • C
      ALSA: usb-audio: fix detection of vendor-specific device protocol settings · a2acad82
      Clemens Ladisch 提交于
      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: NClemens Ladisch <clemens@ladisch.de>
      Cc: Daniel Mack <daniel@caiaq.de>
      Cc: <stable@kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a2acad82
  27. 02 9月, 2010 1 次提交
  28. 23 6月, 2010 2 次提交