1. 19 9月, 2012 2 次提交
  2. 06 9月, 2012 1 次提交
    • T
      ALSA: usb-audio: Fix bogus error messages for delay accounting · 1213a205
      Takashi Iwai 提交于
      The recent fix for the missing fine delayed time adjustment gives
      strange error messages at each start of the playback stream, such as
        delay: estimated 0, actual 352
        delay: estimated 353, actual 705
      
      These come from the sanity check in retire_playback_urb().  Before the
      stream is activated via start_endpoints(), a few silent packets have
      been already sent.  And at this point the delay account is still in
      the state as if the new packets are just queued, so the driver gets
      confused and spews the bogus error messages.
      
      For fixing the issue, we just need to check whether the received
      packet is valid, whether it's zero sized or not.
      Reported-by: NMarkus Trippelsdorf <markus@trippelsdorf.de>
      Cc: <stable@vger.kernel.org> [v3.5+]
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      1213a205
  3. 01 9月, 2012 3 次提交
    • D
      ALSA: snd-usb: fix cross-interface streaming devices · 2e4a263c
      Daniel Mack 提交于
      Commit 68e67f40 ("ALSA: snd-usb: move calls to usb_set_interface")
      saved us some unnecessary calls to snd_usb_set_interface() but ignored
      the fact that there is at least one device out there which operates on
      two endpoint in different interfaces simultaniously.
      
      Take care for this by catching the case where data and sync endpoints
      are located on different interfaces and calling snd_usb_set_interface()
      between the start of the two endpoints.
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Reported-by: NRobert M. Albrecht <linux@romal.de>
      Cc: stable@kernel.org [v3.5+]
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2e4a263c
    • 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
    • D
      ALSA: snd-usb: restore delay information · fbcfbf5f
      Daniel Mack 提交于
      Parts of commit 294c4fb8 ("ALSA: usb: refine delay information with USB
      frame counter") were unfortunately lost during the refactoring of the
      snd-usb driver in 3.5.
      
      This patch adds them back, restoring the correct delay information
      behaviour.
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Cc: stable@kernel.org [3.5+]
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      fbcfbf5f
  4. 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
  5. 16 8月, 2012 1 次提交
  6. 13 7月, 2012 1 次提交
  7. 06 7月, 2012 1 次提交
    • T
      ALSA: usb-audio: Fix the first PCM interface assignment · 9e9b5946
      Takashi Iwai 提交于
      In the new PCM streaming logic, the interface number is assigned to
      usb stream instance (subs->interface) after the format and rate setups
      are succeeded, but some codes are still passing subs->interface as the
      reference to helper functions.  This leads to initializing with an
      invalid iface number (-1).
      
      This patch replaces the wrong references with the ones from the target
      fmt correctly.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      9e9b5946
  8. 18 6月, 2012 2 次提交
  9. 31 5月, 2012 1 次提交
  10. 21 5月, 2012 1 次提交
  11. 13 4月, 2012 2 次提交
  12. 15 3月, 2012 1 次提交
  13. 27 9月, 2011 1 次提交
  14. 14 9月, 2011 1 次提交
  15. 12 9月, 2011 1 次提交
    • P
      ALSA: usb: refine delay information with USB frame counter · 294c4fb8
      Pierre-Louis Bossart 提交于
      Existing code only updates the audio delay when URBs were
      submitted/retired. This can introduce an uncertainty of 8ms
      on the number of samples played out with the default settings,
      and a lot more when URBs convey more packets to reduce the
      interrupt rate and power consumption.
      
      This patch relies on the USB frame counter to reduce the
      uncertainty to less than 2ms worst-case. The delay information
      essentially becomes independent of the URB size and number of
      packets. This should help applications like PulseAudio which
      require accurate audio timing. Clemens Ladisch reported
      a decrease of mplayer's A-V difference from nrpacks down to at
      most 1ms.
      
      Thanks to Clemens for also pointing out that the implementation
      of frame counters varies between different HCDs. Only the
      8 lowest-bits are used to estimate the delay.
      Signed-off-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      [clemens: changed debug code]
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      294c4fb8
  16. 11 3月, 2011 1 次提交
  17. 23 2月, 2011 1 次提交
    • T
      ALSA: usb-audio: fix oops due to cleanup race when disconnecting · 382225e6
      Takashi Iwai 提交于
      When a USB audio device is disconnected, snd_usb_audio_disconnect()
      kills all audio URBs.  At the same time, the application, after being
      notified of the disconnection, might close the device, in which case
      ALSA calls the .hw_free callback, which should free the URBs too.
      
      Commit de1b8b93 "[ALSA] Fix hang-up at disconnection of usb-audio"
      prevented snd_usb_hw_free() from freeing the URBs to avoid a hang that
      resulted from this race, but this introduced another race because the
      URB callbacks could now be executed after snd_usb_hw_free() has
      returned, and try to access already freed data.
      
      Fix the first race by introducing a mutex to serialize the disconnect
      callback and all PCM callbacks that manage URBs (hw_free and hw_params).
      Reported-and-tested-by: NPierre-Louis Bossart <pierre-louis.bossart@intel.com>
      Cc: <stable@kernel.org>
      [CL: also serialize hw_params callback]
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      382225e6
  18. 01 11月, 2010 1 次提交
  19. 27 10月, 2010 1 次提交
    • C
      ALSA: usb-audio: automatically detect feedback format · 89e1e66d
      Clemens Ladisch 提交于
      There are two USB Audio Class specifications (v1 and v2), but neither of
      them clearly defines the feedback format for high-speed UAC v1 devices.
      Add to this whatever the Creative and M-Audio firmware writers have been
      smoking, and it becomes impossible to predict the exact feedback format
      used by a particular device.
      
      Therefore, automatically detect the feedback format by looking at the
      magnitude of the first received feedback value.
      
      Also, this allows us to get rid of some special cases for E-Mu devices.
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      89e1e66d
  20. 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
  21. 14 8月, 2010 1 次提交
    • P
      ALSA: usb: USB3 SuperSpeed sound support · 4f4e8f69
      Paul Zimmerman 提交于
      This is V2 of the patch, after feedback from Clemens and Daniel.
      
      This patch adds SuperSpeed support to the USB drivers under sound/. It adds
      tests for USB_SPEED_SUPER to the appropriate places that check for the USB
      speed.
      
      This patch has been tested with our SS USB3 device emulating a set of Yamaha
      speakers and a Logitech microphone, but with the descriptors modified to add
      USB3 support. It has also been tested with the real speakers and microphone,
      to make sure that USB2 devices still work.
      Signed-off-by: NPaul Zimmerman <paulz@synopsys.com>
      Cc: Clemens Ladisch <clemens@ladisch.de>
      Cc: Daniel Mack <daniel@caiaq.de>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4f4e8f69
  22. 13 7月, 2010 1 次提交
  23. 01 6月, 2010 1 次提交
    • D
      ALSA: usb-audio: parse clock topology of UAC2 devices · 79f920fb
      Daniel Mack 提交于
      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: NDaniel Mack <daniel@caiaq.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      79f920fb
  24. 27 5月, 2010 1 次提交
  25. 29 3月, 2010 1 次提交
  26. 12 3月, 2010 1 次提交
  27. 05 3月, 2010 4 次提交