1. 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
  2. 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
  3. 13 4月, 2012 3 次提交
    • D
      ALSA: snd-usb: remove old streaming logic · d399ff95
      Daniel Mack 提交于
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d399ff95
    • D
      ALSA: snd-usb: switch over to new endpoint streaming logic · edcd3633
      Daniel Mack 提交于
      With the previous commit that added the new streaming model, all
      endpoint and streaming related code is now in endpoint.c, and pcm.c
      only acts as a wrapper for handling the packet's payload.
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      edcd3633
    • D
      ALSA: snd-usb: implement new endpoint streaming model · 8fdff6a3
      Daniel Mack 提交于
      This patch adds a new generic streaming logic for audio over USB.
      
      It defines a model (snd_usb_endpoint) that handles everything that
      is related to an USB endpoint and its streaming. There are functions to
      activate and deactivate an endpoint (which call usb_set_interface()),
      and to start and stop its URBs. It also has function pointers to be
      called when data was received or is about to be sent, and pointer to
      a sync slave (another snd_usb_endpoint) that is informed when data has
      been received.
      
      A snd_usb_endpoint knows about its state and implements a refcounting,
      so only the first user will actually start the URBs and only the last
      one to stop it will tear them down again.
      
      With this sort of abstraction, the actual streaming is decoupled from
      the pcm handling, which makes the "implicit feedback" mechanisms easy to
      implement.
      
      In order to split changes properly, this patch only adds the new
      implementation but leaves the old one around, so the the driver doesn't
      change its behaviour. The switch to actually use the new code is
      submitted separately.
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      8fdff6a3
  4. 14 9月, 2011 2 次提交
  5. 05 3月, 2010 1 次提交
    • D
      ALSA: usb-audio: refactor code · e5779998
      Daniel Mack 提交于
      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: NDaniel Mack <daniel@caiaq.de>
      Cc: Clemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      e5779998