1. 09 12月, 2016 1 次提交
  2. 09 4月, 2016 2 次提交
    • D
      ALSA: usb-audio: allow clock source validity interrupts · 191227d9
      Daniel Mack 提交于
      miniDSP USBStreamer UAC2 devices send clock validity changes with the
      control field set to zero. The current interrupt handler ignores all
      packets if the control field does not match the mixer element's, but
      it really should only do that in case that field is needed to
      distinguish multiple elements with the same ID.
      
      This patch implements a logic that lets notifications packets pass
      if the element ID is unique for a given device.
      Signed-off-by: NDaniel Mack <daniel@zonque.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      191227d9
    • D
      ALSA: usb-audio: add UAC2 clock sources as mixer controls · cddaafb9
      Daniel Mack 提交于
      UAC2 specifies clock sources that optionally have validity controls.
      This patch exposes them as mixer controls, so they can be read (and
      at least in theory even be written) by userspace applications in order
      to make clock selection policy decisions.
      
      This implementation does nothing if the device is not UAC2 compliant,
      or if the clock source does not define said validity control bits.
      
      Tested with a miniDSP USBStreamer (0x2752/0x0016).
      Signed-off-by: NDaniel Mack <daniel@zonque.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      cddaafb9
  3. 14 12月, 2015 1 次提交
    • A
      ALSA: usb-audio: Add a more accurate volume quirk for AudioQuest DragonFly · 42e3121d
      Anssi Hannula 提交于
      AudioQuest DragonFly DAC reports a volume control range of 0..50
      (0x0000..0x0032) which in USB Audio means a range of 0 .. 0.2dB, which
      is obviously incorrect and would cause software using the dB information
      in e.g. volume sliders to have a massive volume difference in 100..102%
      range.
      
      Commit 2d1cb7f6 ("ALSA: usb-audio: add dB range mapping for some
      devices") added a dB range mapping for it with range 0..50 dB.
      
      However, the actual volume mapping seems to be neither linear volume nor
      linear dB scale, but instead quite close to the cubic mapping e.g.
      alsamixer uses, with a range of approx. -53...0 dB.
      
      Replace the previous quirk with a custom dB mapping based on some basic
      output measurements, using a 10-item range TLV (which will still fit in
      alsa-lib MAX_TLV_RANGE_SIZE).
      
      Tested on AudioQuest DragonFly HW v1.2. The quirk is only applied if the
      range is 0..50, so if this gets fixed/changed in later HW revisions it
      will no longer be applied.
      
      v2: incorporated Takashi Iwai's suggestion for the quirk application
      method
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      42e3121d
  4. 28 8月, 2015 1 次提交
  5. 26 8月, 2015 1 次提交
    • T
      ALSA: usb-audio: Avoid nested autoresume calls · 47ab1545
      Takashi Iwai 提交于
      After the recent fix of runtime PM for USB-audio driver, we got a
      lockdep warning like:
      
        =============================================
        [ INFO: possible recursive locking detected ]
        4.2.0-rc8+ #61 Not tainted
        ---------------------------------------------
        pulseaudio/980 is trying to acquire lock:
         (&chip->shutdown_rwsem){.+.+.+}, at: [<ffffffffa0355dac>] snd_usb_autoresume+0x1d/0x52 [snd_usb_audio]
        but task is already holding lock:
         (&chip->shutdown_rwsem){.+.+.+}, at: [<ffffffffa0355dac>] snd_usb_autoresume+0x1d/0x52 [snd_usb_audio]
      
      This comes from snd_usb_autoresume() invoking down_read() and it's
      used in a nested way.  Although it's basically safe, per se (as these
      are read locks), it's better to reduce such spurious warnings.
      
      The read lock is needed to guarantee the execution of "shutdown"
      (cleanup at disconnection) task after all concurrent tasks are
      finished.  This can be implemented in another better way.
      
      Also, the current check of chip->in_pm isn't good enough for
      protecting the racy execution of multiple auto-resumes.
      
      This patch rewrites the logic of snd_usb_autoresume() & co; namely,
      - The recursive call of autopm is avoided by the new refcount,
        chip->active.  The chip->in_pm flag is removed accordingly.
      - Instead of rwsem, another refcount, chip->usage_count, is introduced
        for tracking the period to delay the shutdown procedure.  At
        the last clear of this refcount, wake_up() to the shutdown waiter is
        called.
      - The shutdown flag is replaced with shutdown atomic count; this is
        for reducing the lock.
      - Two new helpers are introduced to simplify the management of these
        refcounts; snd_usb_lock_shutdown() increases the usage_count, checks
        the shutdown state, and does autoresume.  snd_usb_unlock_shutdown()
        does the opposite.  Most of mixer and other codes just need this,
        and simply returns an error if it receives an error from lock.
      
      Fixes: 9003ebb1 ('ALSA: usb-audio: Fix runtime PM unbalance')
      Reported-and-tested-by: NAlexnader Kuleshov <kuleshovmail@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      47ab1545
  6. 20 8月, 2015 1 次提交
  7. 14 8月, 2015 1 次提交
  8. 11 6月, 2015 1 次提交
  9. 03 6月, 2015 1 次提交
  10. 29 5月, 2015 1 次提交
  11. 18 1月, 2015 1 次提交
  12. 21 11月, 2014 2 次提交
    • T
      ALSA: usb-audio: Allow quirks to handle own resume and proc dump · 3360b84b
      Takashi Iwai 提交于
      So far, we blindly assumed that the all usb-audio mixer elements
      follow the standard and apply the standard resume method for the
      registered elements in the id_elems[] list.  However, some quirks
      really need the own resume and it's incomplete for now.
      
      This patch enhances the resume handling in two folds:
      - split some fields in struct usb_mixer_elem_info into a smaller
        header struct (usb_mixer_elem_list) for keeping the minimal
        information in the linked-list; the usb_mixer_elem_info embeds this
        header struct instead
      - add resume and dump callbacks to usb_mixer_elem_list struct to allow
        quirks providing the own methods
      
      For the standard mixer elements, these new callbacks are set to the
      standard ones as default, thus there is no functional change by this
      patch yet.
      
      The dump and resume callbacks are typedef'ed for ease of later patches
      using arrays of such function pointers.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3360b84b
    • T
      ALSA: usb-audio: Refactor ignore_ctl_error checks · 5aeee342
      Takashi Iwai 提交于
      Introduce an internal helper macro for avoiding many open codes.
      
      The only slight behavior change is in a couple of get ballcks where
      the value is reset at error no matter whether ignore_ctl_error is set
      or not.  Actually this is even safer than before.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      5aeee342
  13. 17 11月, 2014 1 次提交
  14. 13 11月, 2014 1 次提交
  15. 04 11月, 2014 1 次提交
  16. 19 10月, 2014 1 次提交
  17. 04 8月, 2014 1 次提交
  18. 25 5月, 2014 2 次提交
  19. 28 4月, 2014 1 次提交
  20. 05 3月, 2014 1 次提交
  21. 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
  22. 14 2月, 2014 1 次提交
  23. 03 2月, 2014 1 次提交
  24. 26 9月, 2013 1 次提交
  25. 12 8月, 2013 1 次提交
  26. 17 6月, 2013 1 次提交
  27. 05 6月, 2013 1 次提交
  28. 20 3月, 2013 3 次提交
  29. 11 2月, 2013 1 次提交
  30. 27 1月, 2013 1 次提交
  31. 29 11月, 2012 4 次提交
  32. 30 10月, 2012 1 次提交