1. 10 4月, 2014 1 次提交
  2. 26 2月, 2014 1 次提交
    • T
      ALSA: usb-audio: Use standard printk helpers · 0ba41d91
      Takashi Iwai 提交于
      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: NTakashi Iwai <tiwai@suse.de>
      0ba41d91
  3. 07 10月, 2013 3 次提交
  4. 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
  5. 06 8月, 2013 8 次提交
  6. 28 6月, 2013 2 次提交
  7. 29 4月, 2013 1 次提交
  8. 18 4月, 2013 3 次提交
    • D
      ALSA: snd-usb: add support for bit-reversed byte formats · 44dcbbb1
      Daniel Mack 提交于
      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: NDaniel Mack <zonque@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      44dcbbb1
    • 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
    • D
      ALSA: snd-usb: use ep->stride from urb callbacks · 8a2a74d2
      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: NDaniel Mack <zonque@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      8a2a74d2
  9. 13 4月, 2013 1 次提交
    • C
      ALSA: usb: Add quirk for 192KHz recording on E-Mu devices · 1539d4f8
      Calvin Owens 提交于
      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: NCalvin Owens <jcalvinowens@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      1539d4f8
  10. 10 4月, 2013 1 次提交
  11. 04 4月, 2013 2 次提交
  12. 18 3月, 2013 1 次提交
  13. 11 2月, 2013 1 次提交
  14. 26 1月, 2013 1 次提交
    • T
      ALSA: Make snd_printd() and snd_printdd() inline · 86b27237
      Takashi Iwai 提交于
      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: NStratos Karafotis <stratosk@semaphore.gr>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      86b27237
  15. 11 1月, 2013 1 次提交
  16. 24 12月, 2012 1 次提交
  17. 04 12月, 2012 1 次提交
    • E
      ALSA: usb-audio: sync ep init fix for audioformat mismatch · 0d9741c0
      Eldad Zack 提交于
      Commit 947d2996 , "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 <jeff_barish@earthlink.net>
      Cc: Daniel Mack <zonque@gmail.com>
      Signed-off-by: NEldad Zack <eldad@fogrefinery.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      0d9741c0
  18. 29 11月, 2012 2 次提交
  19. 23 11月, 2012 3 次提交
  20. 21 11月, 2012 3 次提交
  21. 08 11月, 2012 1 次提交
  22. 30 10月, 2012 1 次提交