1. 03 5月, 2014 1 次提交
    • T
      ALSA: usb-audio: Fix deadlocks at resuming · 1ee23fe0
      Takashi Iwai 提交于
      The recent addition of the USB audio mixer suspend/resume may lead to
      deadlocks when the driver tries to call usb_autopm_get_interface()
      recursively, since the function tries to sync with the finish of the
      other calls.  For avoiding it, introduce a flag indicating the resume
      operation and avoids the recursive usb_autopm_get_interface() calls
      during the resume.
      Reported-and-tested-by: NBryan Quigley <gquigs@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      1ee23fe0
  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. 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
  4. 28 6月, 2013 1 次提交
    • C
      ALSA: usb-audio: add support for many Roland/Yamaha devices · aafe77cc
      Clemens Ladisch 提交于
      Add quirks to detect the various vendor-specific descriptors used by
      Roland and Yamaha in most of their recent USB audio and MIDI devices.
      
      Together with the previous patch, this should add audio/MIDI support for
      the following USB devices:
      - Edirol motion dive .tokyo performance package
      - Roland MC-808 Synthesizer
      - Roland BK-7m Synthesizer
      - Roland VIMA JM-5/8 Synthesizer
      - Roland SP-555 Sequencer
      - Roland V-Synth GT Synthesizer
      - Roland Music Atelier AT-75/100/300/350C/500/800/900/900C Organ
      - Edirol V-Mixer M-200i/300/380/400/480/R-1000
      - BOSS GT-10B Effects Processor
      - Roland Fantom G6/G7/G8 Keyboard
      - Cakewalk Sonar V-Studio 20/100/700 Audio Interface
      - Roland GW-8 Keyboard
      - Roland AX-Synth Keyboard
      - Roland JUNO-Di/STAGE/Gi Keyboard
      - Roland VB-99 Effects Processor
      - Cakewalk UM-2G MIDI Interface
      - Roland A-500S Keyboard
      - Roland SD-50 Synthesizer
      - Roland OCTAPAD SPD-30 Controller
      - Roland Lucina AX-09 Synthesizer
      - BOSS BR-800 Digital Recorder
      - Roland DUO/TRI-CAPTURE (EX) Audio Interface
      - BOSS RC-300 Loop Station
      - Roland JUPITER-50/80 Keyboard
      - Roland R-26 Recorder
      - Roland SPD-SX Controller
      - BOSS JS-10 Audio Player
      - Roland TD-11/15/30 Drum Module
      - Roland A-49/88 Keyboard
      - Roland INTEGRA-7 Synthesizer
      - Roland R-88 Recorder
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      aafe77cc
  5. 04 4月, 2013 1 次提交
  6. 04 1月, 2013 1 次提交
  7. 19 12月, 2012 1 次提交
    • D
      ALSA: usb-audio: Support for Digidesign Mbox 2 USB sound card: · cb99864d
      Damien Zammit 提交于
      This patch is the result of a lot of trial and error, since there are no specs
      available for the device.
      
      Full duplex support is provided, i.e. playback and recording in stereo.
      The format is hardcoded at 48000Hz @ 24 bit, which is the maximum that the
      device supports.  Also, MIDI in and MIDI out both work.
      
      Users will notice that the S/PDIF light also flashes when playback or recording
      is active.  I believe this means that S/PDIF input/output is simultaneously
      activated with the analogue i/o during use.
      But this particular functionality remains untested.
      
      Note that this particular version of the patch is so far untested on the
      physical hardware because I have not compiled a full kernel with the changes.
      However, extensive testing has been done by many users of the hardware
      who believe other versions of my patch have worked since circa 2009.
      
      [Modified to make a function static by tiwai]
      Signed-off-by: NDamien Zammit <damien@zamaudio.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      cb99864d
  8. 21 11月, 2012 1 次提交
  9. 30 10月, 2012 1 次提交
  10. 13 4月, 2012 2 次提交
    • 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
    • D
      ALSA: snd-usb: add snd_usb_audio-wide mutex · 596580d0
      Daniel Mack 提交于
      This is needed for new card-wide list operations.
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      596580d0
  11. 26 8月, 2011 1 次提交
  12. 25 5月, 2011 1 次提交
  13. 11 3月, 2011 1 次提交
  14. 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
  15. 23 10月, 2010 1 次提交
  16. 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
  17. 21 5月, 2010 1 次提交
  18. 05 3月, 2010 2 次提交
    • 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
    • D
      ALSA: usb-audio: header file cleanups · 3e1aebef
      Daniel Mack 提交于
      Rename snd-usb-lib to snd-usbmidi-lib as MIDI functions are the only
      thing it actually contains. Introduce a new header file to only declare
      these functions.
      
      Introduced usbmixer.h for all functions exported by usbmixer.c.
      Signed-off-by: NDaniel Mack <daniel@caiaq.de>
      Cc: Clemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3e1aebef
  19. 02 3月, 2010 1 次提交
  20. 23 2月, 2010 3 次提交
    • D
      ALSA: usbaudio: consolidate header files · de48c7bc
      Daniel Mack 提交于
      Use the definitions from linux/usb/audio.h all over the ALSA USB audio
      driver and add some missing definitions there as well.
      
      Use the endpoint attribute macros from linux/usb/ch9 and remove the own
      things from sound/usb/usbaudio.h.
      
      Now things are also nicely prefixed which makes understanding the code
      easier.
      Signed-off-by: NDaniel Mack <daniel@caiaq.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      de48c7bc
    • D
      ALSA: usbaudio: implement basic set of class v2.0 parser · 53ee98fe
      Daniel Mack 提交于
      This adds a number of parsers for audio class v2.0. In particular, the
      following internals are different and now handled by the code:
      
      * the number of streaming interfaces is now reported by an interface
        association descriptor. The old approach using a proprietary
        descriptor is deprecated.
      
      * The number of channels per interface is now stored in the AS_GENERAL
        descriptor (used to be part of the FORMAT_TYPE descriptor).
      
      * The list of supported sample rates is no longer stored in a variable
        length appendix of the format_type descriptor but is retrieved from
        the device using a class specific GET_RANGE command.
      
      * Supported sample formats are now reported as 32bit bitmap rather than
        a fixed value. For now, this is worked around by choosing just one of
        them.
      
      * A devices needs to have at least one CLOCK_SOURCE descriptor which
        denotes a clockID that is needed im the class request command.
      
      * Many descriptors (format_type, ...) have changed their layout. Handle
        this by casting the descriptors to the appropriate structs.
      Signed-off-by: NDaniel Mack <daniel@caiaq.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      53ee98fe
    • D
      ALSA: usbaudio: introduce new types for audio class v2 · 8fee4aff
      Daniel Mack 提交于
      This patch adds some definitions for audio class v2.
      
      Unfortunately, the UNIT types PROCESSING_UNIT and EXTENSION_UNIT have
      different numerical representations in both standards, so there is need
      for a _V1 add-on now. usbmixer.c is changed accordingly.
      Signed-off-by: NDaniel Mack <daniel@caiaq.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      8fee4aff
  21. 28 12月, 2009 3 次提交
  22. 15 12月, 2009 1 次提交
  23. 24 11月, 2009 1 次提交
  24. 07 11月, 2009 1 次提交
    • J
      ALSA: usb-audio: fix combine_word problem · f4950882
      Julian Anastasov 提交于
      Fix combine_word problem where first octet is not
      read properly. The only affected place seems to be the
      INPUT_TERMINAL type. Before now, sound controls can be created
      with the output terminal's name which is a fallback mechanism
      used only for unknown input terminal types. For example,
      Line can wrongly appear as Speaker. After the change it
      should appear as Line.
      
      	The side effect of this change can be that users
      can expect the wrong control name in their scripts or
      programs while now we return the correct one.
      
      	Probably, these defines should use get_unaligned_le16 and
      friends.
      Signed-off-by: NJulian Anastasov <ja@ssi.bg>
      Cc: <stable@kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      f4950882
  25. 27 5月, 2009 1 次提交
  26. 10 10月, 2008 1 次提交
  27. 15 8月, 2008 1 次提交
  28. 01 8月, 2008 1 次提交
  29. 01 2月, 2008 1 次提交
  30. 09 2月, 2007 1 次提交
    • B
      [ALSA] usbaudio - Add support for Edirol UA-101 · d0b0fac1
      Bjoern Fay 提交于
      Added support for the Edirol UA-101 (only in high-speed mode) by taking
      the quirks for the UA-1000 and change them accordingly. Changes were
      made in 'usbaudio.c', 'usbaudio.h', and 'usbquirks.h'
      MIDI and recording seem to work perfectly (with JACK), but playback
      gives some few glitches. I think that's the mentioned
      synchronizing-problem in the UA-1000 quirk ('FIXME: playback must be
      synchronized to capture'), so I didn't change that.
      ToDo: Adding Mixer-Support for the built-in
      control-panel/patch-bay/router.
      Signed-off-by: NBjoern Fay <mail@bfay.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NJaroslav Kysela <perex@suse.cz>
      d0b0fac1
  31. 23 6月, 2006 1 次提交
  32. 22 3月, 2006 1 次提交
  33. 03 1月, 2006 1 次提交
  34. 04 11月, 2005 1 次提交