1. 01 4月, 2016 1 次提交
  2. 20 3月, 2016 1 次提交
  3. 16 3月, 2016 3 次提交
  4. 04 3月, 2016 2 次提交
  5. 01 3月, 2016 1 次提交
  6. 13 2月, 2016 1 次提交
  7. 30 1月, 2016 1 次提交
  8. 29 1月, 2016 4 次提交
    • J
      ALSA: usb-audio: Add native DSD support for PS Audio NuWave DAC · ad678b4c
      Jurgen Kramer 提交于
      This patch adds native DSD support for the PS Audio NuWave DAC.
      Signed-off-by: NJurgen Kramer <gtmkramer@xs4all.nl>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      ad678b4c
    • J
      ALSA: usb-audio: Fix OPPO HA-1 vendor ID · 5327d6ba
      Jurgen Kramer 提交于
      In my patch adding native DSD support for the Oppo HA-1, the wrong vendor ID got
      through. This patch fixes the vendor ID and aligns the comment.
      
      Fixes: a4eae3a5 ('ALSA: usb: Add native DSD support for Oppo HA-1')
      Signed-off-by: NJurgen Kramer <gtmkramer@xs4all.nl>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      5327d6ba
    • T
      ALSA: usb-audio: Add quirk_alias option · e2703363
      Takashi Iwai 提交于
      This patch adds a new option "quirk_alias" to snd-usb-audio driver for
      allowing user to pass the quirk alias list.  A quirk alias consists of
      a string form like 0123abcd:5678beef, which makes to apply a quirk to
      a device with USB ID 0123:abcd treated as if it were 5678:beef.
      This feature is useful to test an existing quirk, typically for a
      newer model of the same vendor, without patching / rebuilding the
      kernel driver.
      
      The current implementation is fairly simplistic: since there is no API
      for matching a usb_device_id to the given ID pair, it has an open code
      to loop over the id table and matches only with vendor:product pair.
      So far, this is OK, as all existing entries are with vendor:product
      pairs, indeed.  Once when we have another matching entry, however,
      we'd need to update get_alias_quirk() as well.
      
      Note that this option is provided only for testing / development.  If
      you want to have a proper support, contact to upstream for adding the
      matching quirk in the driver code statically.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      e2703363
    • T
      ALSA: usb-audio: Refer to chip->usb_id for quirks and MIDI creation · 79289e24
      Takashi Iwai 提交于
      This is a preliminary patch for the later change to allow a better
      quirk ID management.  In the current USB-audio code, there are a few
      places looking at usb_device idVendor and idProduct fields directly
      even though we have already a static member in snd_usb_audio.usb_id.
      This patch modifies such codes to refer to the latter field.
      
      For achieving this, two slightly intensive changes have been done:
      - The snd_usb_audio object is set/reset via dev_getdrv() for the given
        USB device; it's needed for minimizing the changes for some existing
        quirks that take only usb_device object.
      
      - __snd_usbmidi_create() is introduced to receive the pre-given usb_id
        argument.  The exported snd_usbmidi_create() is unchanged by calling
        this new function internally.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      79289e24
  9. 26 1月, 2016 1 次提交
  10. 13 1月, 2016 1 次提交
  11. 12 1月, 2016 1 次提交
    • T
      ALSA: usb-audio: Avoid calling usb_autopm_put_interface() at disconnect · 5c06d68b
      Takashi Iwai 提交于
      ALSA PCM may still have a leftover instance after disconnection and
      it delays its release.  The problem is that the PCM close code path of
      USB-audio driver has a call of snd_usb_autosuspend().  This involves
      with the call of usb_autopm_put_interface() and it may lead to a
      kernel Oops due to the NULL object like:
      
       BUG: unable to handle kernel NULL pointer dereference at 0000000000000190
       IP: [<ffffffff815ae7ef>] usb_autopm_put_interface+0xf/0x30 PGD 0
       Call Trace:
        [<ffffffff8173bd94>] snd_usb_autosuspend+0x14/0x20
        [<ffffffff817461bc>] snd_usb_pcm_close.isra.14+0x5c/0x90
        [<ffffffff8174621f>] snd_usb_playback_close+0xf/0x20
        [<ffffffff816ef58a>] snd_pcm_release_substream.part.36+0x3a/0x90
        [<ffffffff816ef6b3>] snd_pcm_release+0xa3/0xb0
        [<ffffffff816debb0>] snd_disconnect_release+0xd0/0xe0
        [<ffffffff8114d417>] __fput+0x97/0x1d0
        [<ffffffff8114d589>] ____fput+0x9/0x10
        [<ffffffff8109e452>] task_work_run+0x72/0x90
        [<ffffffff81088510>] do_exit+0x280/0xa80
        [<ffffffff8108996a>] do_group_exit+0x3a/0xa0
        [<ffffffff8109261f>] get_signal+0x1df/0x540
        [<ffffffff81040903>] do_signal+0x23/0x620
        [<ffffffff8114c128>] ? do_readv_writev+0x128/0x200
        [<ffffffff810012e1>] prepare_exit_to_usermode+0x91/0xd0
        [<ffffffff810013ba>] syscall_return_slowpath+0x9a/0x120
        [<ffffffff817587cd>] ? __sys_recvmsg+0x5d/0x70
        [<ffffffff810d2765>] ? ktime_get_ts64+0x45/0xe0
        [<ffffffff8115dea0>] ? SyS_poll+0x60/0xf0
        [<ffffffff818d2327>] int_ret_from_sys_call+0x25/0x8f
      
      We have already a check of disconnection in snd_usb_autoresume(), but
      the check is missing its counterpart.  The fix is just to put the same
      check in snd_usb_autosuspend(), too.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=109431
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      5c06d68b
  12. 11 1月, 2016 1 次提交
  13. 22 12月, 2015 1 次提交
  14. 14 12月, 2015 2 次提交
    • A
      ALSA: usb-audio: Add sample rate inquiry quirk for AudioQuest DragonFly · 12a6116e
      Anssi Hannula 提交于
      Avoid getting sample rate on AudioQuest DragonFly as it is unsupported
      and causes noisy "cannot get freq at ep 0x1" messages when playback
      starts.
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      12a6116e
    • 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
  15. 11 12月, 2015 1 次提交
  16. 08 12月, 2015 1 次提交
  17. 03 12月, 2015 1 次提交
  18. 22 11月, 2015 1 次提交
  19. 16 11月, 2015 4 次提交
    • C
      ALSA: ua101: replace le16_to_cpu() with usb_endpoint_maxp() · 3c7a0935
      Cheah Kok Cheong 提交于
      Commit 939f325f ("usb: add usb_endpoint_maxp() macro") and commit
      29cc8897 ("USB: use usb_endpoint_maxp() instead of le16_to_cpu()")
      introduced a new helper macro.  This trivial patch convert remaining
      users found in ua101 driver.
      Signed-off-by: NCheah Kok Cheong <thrust73@gmail.com>
      Acked-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3c7a0935
    • C
      ALSA: usb-audio: work around CH345 input SysEx corruption · a91e627e
      Clemens Ladisch 提交于
      One of the many faults of the QinHeng CH345 USB MIDI interface chip is
      that it does not handle received SysEx messages correctly -- every second
      event packet has a wrong code index number, which is the one from the last
      seen message, instead of 4.  For example, the two messages "FE F0 01 02 03
      04 05 06 07 08 09 0A 0B 0C 0D 0E F7" result in the following event
      packets:
      
      correct:       CH345:
      0F FE 00 00    0F FE 00 00
      04 F0 01 02    04 F0 01 02
      04 03 04 05    0F 03 04 05
      04 06 07 08    04 06 07 08
      04 09 0A 0B    0F 09 0A 0B
      04 0C 0D 0E    04 0C 0D 0E
      05 F7 00 00    05 F7 00 00
      
      A class-compliant driver must interpret an event packet with CIN 15 as
      having a single data byte, so the other two bytes would be ignored.  The
      message received by the host would then be missing two bytes out of six;
      in this example, "F0 01 02 03 06 07 08 09 0C 0D 0E F7".
      
      These corrupted SysEx event packages contain only data bytes, while the
      CH345 uses event packets with a correct CIN value only for messages with
      a status byte, so it is possible to distinguish between these two cases by
      checking for the presence of this status byte.
      
      (Other bugs in the CH345's input handling, such as the corruption resulting
      from running status, cannot be worked around.)
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a91e627e
    • C
      ALSA: usb-audio: prevent CH345 multiport output SysEx corruption · 1ca8b201
      Clemens Ladisch 提交于
      The CH345 USB MIDI chip has two output ports.  However, they are
      multiplexed through one pin, and the number of ports cannot be reduced
      even for hardware that implements only one connector, so for those
      devices, data sent to either port ends up on the same hardware output.
      This becomes a problem when both ports are used at the same time, as
      longer MIDI commands (such as SysEx messages) are likely to be
      interrupted by messages from the other port, and thus to get lost.
      
      It would not be possible for the driver to detect how many ports the
      device actually has, except that in practice, _all_ devices built with
      the CH345 have only one port.  So we can just ignore the device's
      descriptors, and hardcode one output port.
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      1ca8b201
    • C
      ALSA: usb-audio: add packet size quirk for the Medeli DD305 · 98d362be
      Clemens Ladisch 提交于
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      98d362be
  20. 09 11月, 2015 1 次提交
  21. 19 10月, 2015 7 次提交
  22. 16 10月, 2015 1 次提交
  23. 13 10月, 2015 1 次提交
    • R
      ALSA: usb-audio: Fix max packet size calculation for USB audio · ab30965d
      Ricard Wanderlof 提交于
      Rounding must take place before multiplication with the frame size, since
      each packet contains a whole number of frames.
      
      We must also properly consider the data interval, as a larger data
      interval will result in larger packets, which, depending on the sampling
      frequency, can result in packet sizes that are less than integral
      multiples of the packet size for a lower data interval.
      
      Detailed explanation and rationale:
      
      The code before this commit had the following expression on line 613 to
      calculate the maximum isochronous packet size:
      
      	maxsize = ((ep->freqmax + 0xffff) * (frame_bits >> 3))
      			>> (16 - ep->datainterval);
      
      Here, ep->freqmax is the maximum assumed sample frequency, calculated from the
      nominal sample frequency plus 25%. It is ultimately derived from ep->freqn,
      which is in the units of frames per packet, from get_usb_full_speed_rate()
      or usb_high_speed_rate(), as applicable, in Q16.16 format.
      
      The expression essentially adds the Q16.16 equivalent of 0.999... (i.e.
      the largest number less than one) to the sample rate, in order to get a
      rate whose integer part is rounded up from the fractional value. The
      multiplication with (frame_bits >> 3) yields the number of bytes in a
      packet, and the (16 >> ep->datainterval) then converts it from Q16.16 back
      to an integer, taking into consideration the bDataInterval field of the
      endpoint descriptor (which describes how often isochronous packets are
      transmitted relative to the (micro)frame rate (125us or 1ms, for USB high
      speed and full speed, respectively)). For this discussion we will initially
      assume a bDataInterval of 0, so the second line of the expression just
      converts the Q16.16 value to an integer.
      
      In order to illustrate the problem, we will set frame_bits 64, which
      corresponds to a frame size of 8 bytes.
      
      The problem here is twofold. First, the rounding operation consists
      of the addition of 0x0.ffff and subsequent conversion to integer, but as the
      expression stands, the conversion to integer is done after multiplication
      with the frame size, rather than before. This results in the resulting
      maxsize becoming too large.
      
      Let's take an example. We have a sample rate of 96 kHz, so our ep->freqn is
      0xc0000 (see usb_high_speed_rate()). Add 25% (line 612) and we get 0xf0000.
      The calculated maxsize is then ((0xf0000 + 0x0ffff) * 8) >> 16 = 127 .
      However, if we do the number of bytes calculation in a less obscure way it's
      more apparent what the true corresponding packet size is: we get
      ceil(96000 * 1.25 / 8000) * 8 = 120, where 1.25 is the 25% from line 612,
      and the 8000 is the number of isochronous packets per second on a high
      speed USB connection (125 us microframe interval).
      
      This is fixed by performing the complete rounding operation prior to
      multiplication with the frame rate.
      
      The second problem is that when considering the ep->datainterval, this
      must be done before rounding, in order to take the advantage of the fact
      that if the number of bytes per packet is not an integer, the resulting
      rounded-up integer is not necessarily a factor of two when the data
      interval is increased by the same factor.
      
      For instance, assuming a freqency of 41 kHz, the resulting
      bytes-per-packet value for USB high speed is 41 kHz / 8000 = 5.125, or
      0x52000 in Q16.16 format. With a data interval of 1 (ep->datainterval = 0),
      this means that 6 frames per packet are needed, whereas with a data
      interval of 2 we need 10.25, i.e. 11 frames needed.
      
      Rephrasing the maxsize expression to:
      
      	maxsize = (((ep->freqmax << ep->datainterval) + 0xffff) >> 16) *
      			 (frame_bits >> 3);
      
      for the above 96 kHz example we instead get
      ((0xf0000 + 0xffff) >> 16) * 8 = 120 which is the correct value.
      
      We can also do the calculation with a non-integer sample rate which is when
      rounding comes into effect: say we have 44.1 kHz (resulting ep->freqn =
      0x58333, and resulting ep->freqmax 0x58333 * 1.25 = 0x6e3ff (rounded down)):
      
      Original maxsize = ((0x6e3ff + 0xffff) * 8) << 16 = 63 (63.124.. rounded down)
      True maxsize = ceil(44100 * 1.25 / 8000) * 8 = 7 * 8 = 56
      New maxsize = ((0x6e3ff + 0xffff) >> 16) * 8 = 7 * 8 = 56
      
      This is also corroborated by the wMaxPacketSize check on line 616. Assume
      that wMaxPacketSize = 104, with ep->maxpacksize then having the same value.
      As 104 < 127, we get maxsize = 104. ep->freqmax is then recalculated to
      (104 / 8) << 16 = 0xd0000 . Putting that rate into the original maxsize
      calculation yields a maxsize of ((0xd0000 + 0xffff) * 8) >> 16 = 111
      (with decimals 111.99988). Clearly, we should get back the 104 here,
      which we would with the new expression: ((0xd0000 + 0xffff) >> 16) * 8 = 104 .
      
      (The error has not been a problem because it only results in maxsize being
      a bit too big which just wastes a couple of bytes, either as a result of
      the first maxsize calculation, or because the resulting calculation will
      hit the wMaxPacketSize value before the packet is too big, resulting in
      fixing the size to wMaxPacketSize even though the packet is actually not
      too long.)
      
      Tested with an Edirol UA-5 both at 44.1 kHz and 96 kHz.
      Signed-off-by: NRicard Wanderlof <ricardw@axis.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      ab30965d
  24. 12 10月, 2015 1 次提交