1. 13 Jun, 2018 1 commit
  2. 21 Mar, 2018 1 commit
    • Ruslan Bilovol's avatar
      ALSA: usb: initial USB Audio Device Class 3.0 support · 9a2fe9b8
      Ruslan Bilovol authored
      Recently released USB Audio Class 3.0 specification
      introduces many significant changes comparing to
      previous versions, like
       - new Power Domains, support for LPM/L1
       - new Cluster descriptor
       - changed layout of all class-specific descriptors
       - new High Capability descriptors
       - New class-specific String descriptors
       - new and removed units
       - additional sources for interrupts
       - removed Type II Audio Data Formats
       - ... and many other things (check spec)
      It also provides backward compatibility through
      multiple configurations, as well as requires
      mandatory support for BADD (Basic Audio Device
      Definition) on each ADC3.0 compliant device
      This patch adds initial support of UAC3 specification
      that is enough for Generic I/O Profile (BAOF, BAIF)
      device support from BADD document.
      Signed-off-by: default avatarRuslan Bilovol <ruslan.bilovol@gmail.com>
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  3. 02 Nov, 2017 1 commit
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      How this work was done:
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
      All documentation files were explicitly excluded.
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
         For non */uapi/* files that summary was:
         SPDX license identifier                            # files
         GPL-2.0                                              11139
         and resulted in the first patch in this series.
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
         SPDX license identifier                            # files
         GPL-2.0 WITH Linux-syscall-note                        930
         and resulted in the second patch in this series.
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
         SPDX license identifier                            # files
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
         and that resulted in the third patch in this series.
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: default avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
  4. 22 Aug, 2016 1 commit
  5. 31 Mar, 2016 1 commit
  6. 03 Mar, 2016 1 commit
  7. 19 Oct, 2015 1 commit
    • Ricard Wanderlof's avatar
      ALSA: USB-audio: Add quirk for Zoom R16/24 playback · e0570446
      Ricard Wanderlof authored
      The Zoom R16/24 have a nonstandard playback format where each isochronous
      packet contains a length descriptor in the first four bytes. (Curiously,
      capture data does not contain this and requires no quirk.)
      The quirk involves adding the extra length descriptor whenever outgoing
      isochronous packets are generated, both in pcm.c (outgoing audio) and
      endpoint.c (silent data).
      In order to make the quirk as unintrusive as possible, for
      pcm.c:prepare_playback_urb(), the isochronous packet descriptors are
      initially set up in the same way no matter if the quirk is enabled or not.
      Once it is time to actually copy the data into the outgoing packet buffer
      (together with the added length descriptors) the isochronous descriptors
      are adjusted in order take the increased payload length into account.
      For endpoint.c:prepare_silent_urb() it makes more sense to modify the
      actual function, partly because the function is less complex to start with
      and partly because it is not as time-critical as prepare_playback_urb()
      (whose bulk is run with interrupts disabled), so the (minute) additional
      time spent in the non-quirk case is motivated by the simplicity of having
      a single function for all cases.
      The quirk is controlled by the new tx_length_quirk member in struct
      snd_usb_substream and struct snd_usb_audio, which is conveyed to pcm.c
      and endpoint.c from quirks.c in a similar manner to the txfr_quirk member
      in the same structs.
      In contrast to txfr_quirk however, the quirk is enabled directly in
      quirks.c:create_standard_audio_quirk() by checking the USB ID in that
      function. Another option would be to introduce a new
      QUIRK_AUDIO_ZOOM_INTERFACE or somesuch, which would have made the quirk
      very plain to see in the quirk table, but it was felt that the additional
      code needed to implement it this way would just make the implementation
      more complex with no real gain.
      Tested with a Zoom R16, both by doing capture and playback separately
      using arecord and aplay (8 channel capture and 2 channel playback,
      respectively), as well as capture and playback together using Ardour, as
      well as Audacity and Qtractor together with jackd.
      The R24 is reportedly compatible with the R16 when used as an audio
      interface. Both devices share the same USB ID and have the same number of
      inputs (8) and outputs (2). Therefore "R16/24" is mentioned throughout the
      Regression tested using an Edirol UA-5 in both class compliant (16-bit)
      and "advanced" (24 bit, forces the use of quirks) modes.
      Signed-off-by: default avatarRicard Wanderlof <ricardw@axis.com>
      Tested-by: default avatarPanu Matilainen <pmatilai@laiskiainen.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  8. 09 Feb, 2015 1 commit
  9. 02 May, 2014 1 commit
  10. 07 Oct, 2013 1 commit
    • Eldad Zack's avatar
      ALSA: usb-audio: rename alt_idx to altsetting · df23a246
      Eldad Zack authored
      As Clemens Ladisch kindly explained:
       "Please note that there are two methods to identify alternate settings:
        the number, which is the value in bAlternateSetting, and the index,
        which is the index in the descriptor array.  There might be some wording
        in the USB spec that these two values must be the same, but in reality,
        [insert standard rant about firmware writers], bAlternateSetting
        must be treated as a random ID value."
      This patch changes the name to express the correct usage semantics.
      No functional change.
      Signed-off-by: default avatarEldad Zack <eldad@fogrefinery.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  11. 26 Sep, 2013 1 commit
    • Alan Stern's avatar
      ALSA: improve buffer size computations for USB PCM audio · 976b6c06
      Alan Stern authored
      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
      	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: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: Clemens Ladisch <clemens@ladisch.de>
      Tested-by: default avatarDaniel Mack <zonque@gmail.com>
      Tested-by: default avatarEldad Zack <eldad@fogrefinery.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  12. 27 Jun, 2013 1 commit
  13. 18 Apr, 2013 2 commits
    • Daniel Mack's avatar
      ALSA: snd-usb: add support for bit-reversed byte formats · 44dcbbb1
      Daniel Mack authored
      There is quite some confusion around the bit-ordering in DSD samples,
      and no general agreement that defines whether hardware is supposed to
      expect the oldest sample in the MSB or the LSB of a byte.
      ALSA will hence set the rule that on the software API layer, bytes
      always carry the oldest bit in the most significant bit of a byte, and
      the driver has to translate that at runtime in order to match the
      hardware layout.
      This patch adds support for this by adding a boolean flag to the
      audio format struct.
      Signed-off-by: default avatarDaniel Mack <zonque@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    • Daniel Mack's avatar
      ALSA: snd-usb: add support for DSD DOP stream transport · d24f5061
      Daniel Mack authored
      In order to provide a compatibility way for pushing DSD
      samples through ordinary PCM channels, the "DoP open Standard" was
      invented. See http://www.dsd-guide.com
       for the official document.
      The host is required to stuff DSD marker bytes (0x05, 0xfa,
      alternating) in the MSB of 24 bit wide samples on the bus, in addition
      to the 16 bits of actual DSD sample payload.
      To support this, the hardware and software stride logic in the driver
      has to be tweaked a bit, as we make the userspace believe we're
      operating on 16 bit samples, while we in fact push one more byte per
      channel down to the hardware.
      The DOP runtime information is stored in struct snd_usb_substream, so
      we can keep track of our state across multiple calls to
      Signed-off-by: default avatarDaniel Mack <zonque@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  14. 13 Apr, 2013 1 commit
    • Calvin Owens's avatar
      ALSA: usb: Add quirk for 192KHz recording on E-Mu devices · 1539d4f8
      Calvin Owens authored
      When recording at 176.2KHz or 192Khz, the device adds a 32-bit length
      header to the capture packets, which obviously needs to be ignored for
      recording to work properly.
      Userspace expected:  L0 L1 L2 R0 R1 R2
      ...but actually got: R2 L0 L1 L2 R0 R1
      Also, the last byte of the length header being interpreted as L0 of
      the first sample caused spikes every 0.5ms, resulting in a loud 16KHz
      tone (about the highest 'B' on a piano) being present throughout
      Tested at all sample rates on an E-Mu 0404USB, and tested for
      regressions on a generic USB headset.
      Signed-off-by: default avatarCalvin Owens <jcalvinowens@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  15. 26 Nov, 2012 1 commit
    • Takashi Iwai's avatar
      ALSA: usb-audio: add channel map support · 04324ccc
      Takashi Iwai authored
      Add the support for channel maps of the PCM streams on USB audio
      devices.  The channel map information is already found in
      ChannelConfig descriptor entries, which haven't been referred until
      Each chmap entry is added to audioformat list entry and copied to TLV
      dynamically instead of creating a whole chmap array.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  16. 30 Oct, 2012 1 commit
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix races at disconnection · 978520b7
      Takashi Iwai authored
      Close some races at disconnection of a USB audio device by adding the
      chip->shutdown_mutex and chip->shutdown check at appropriate places.
      The spots to put bandaids are:
      - PCM prepare, hw_params and hw_free
      - where the usb device is accessed for communication or get speed, in
       mixer.c and others; the device speed is now cached in subs->speed
       instead of accessing to chip->dev
      The accesses in PCM open and close don't need the mutex protection
      because these are already handled in the core PCM disconnection code.
      The autosuspend/autoresume codes are still uncovered by this patch
      because of possible mutex deadlocks.  They'll be covered by the
      upcoming change to rwsem.
      Also the mixer codes are untouched, too.  These will be fixed in
      another patch, too.
      Reported-by: default avatarMatthieu CASTET <matthieu.castet@parrot.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  17. 19 Sep, 2012 2 commits
    • Takashi Iwai's avatar
      ALSA: usb-audio: Avoid unnecessary EP setups in prepare · 384dc085
      Takashi Iwai authored
      The recent fix for USB suspend breakage moved the code to set up EP
      from hw_params to prepare, but it means also the EP setup might be
      called multiple times unnecessarily because the prepare callback can
      be called multiple times without starting the stream (e.g. OSS
      This patch adds a new flag to struct snd_usb_substream indicating
      whether the setup of EP is required, and do it only when necessary,
      i.e. right after hw_params or suspend.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    • Dylan Reid's avatar
      ALSA: usb-audio: Move configuration to prepare. · 61a70950
      Dylan Reid authored
      Move interface and endpoint configuration from hw_params to prepare
      callback.  During system suspend/resume when the USB device power isn't
      cycled the interface and endpoint configuration need to be set before
      audio playback can continue.  Resume involves another call to prepare
      but not to hw_params, moving it here allows a playing stream to continue
      after resume.
      Signed-off-by: default avatarDylan Reid <dgreid@chromium.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  18. 04 Sep, 2012 1 commit
    • Daniel Mack's avatar
      ALSA: snd-usb: Add quirks for Playback Designs devices · 2b58fd5b
      Daniel Mack authored
      Playback Designs' USB devices have some hardware limitations on their
      USB interface. In particular:
       - They need a 20ms delay after each class compliant request as the
         hardware ACKs the USB packets before the device is actually ready
         for the next command. Sending data immediately will result in buffer
         overflows in the hardware.
       - The devices send bogus feedback data at the start of each stream
         which confuse the feedback format auto-detection.
      This patch introduces a new quirks hook that is called after each
      control packet and which adds a delay for all devices that match
      Playback Designs' USB VID for now.
      In addition, it adds a counter to snd_usb_endpoint to drop received
      packets on the floor. Another new quirks function that is called once
      an endpoint is started initializes that counter for these devices on
      their sync endpoint.
      Signed-off-by: default avatarDaniel Mack <zonque@gmail.com>
      Reported-and-tested-by: default avatarAndreas Koch <andreas@akdesigninc.com>
      Supported-by: default avatarDemian Martin <demianm_1@yahoo.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  19. 28 Aug, 2012 1 commit
  20. 08 Jun, 2012 1 commit
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix substream assignments · 8260ef07
      Takashi Iwai authored
      In 3.5 kernel, the endpoint is assigned dynamically for the
      substreams, but the PCM assignment still checks the presence of the
      endpoint pointer.  This ended up in duplicated PCM substream creations
      at probing time, resulting in kernel warnings like:
      WARNING: at fs/proc/generic.c:586 proc_register+0x169/0x1a6()
      Pid: 1152, comm: modprobe Not tainted 3.5.0-rc1-00110-g71fae7e7
      Call Trace:
       [<ffffffff8102a400>] warn_slowpath_common+0x83/0x9c
       [<ffffffff8102a4bc>] warn_slowpath_fmt+0x46/0x48
       [<ffffffff813829ad>] ? add_preempt_count+0x39/0x3b
       [<ffffffff811292f0>] proc_register+0x169/0x1a6
       [<ffffffff8112962e>] create_proc_entry+0x74/0x8c
       [<ffffffffa018eb63>] snd_info_register+0x3e/0xc3 [snd]
       [<ffffffffa01fde2e>] snd_pcm_new_stream+0xb1/0x404 [snd_pcm]
       [<ffffffffa024861f>] snd_usb_add_audio_stream+0xd2/0x230 [snd_usb_audio]
       [<ffffffffa0241d33>] ? snd_usb_parse_audio_format+0x252/0x34f [snd_usb_audio]
       [<ffffffff810d6b17>] ? kmem_cache_alloc_trace+0xab/0xbb
       [<ffffffffa0248c29>] snd_usb_parse_audio_interface+0x4ac/0x567 [snd_usb_audio]
       [<ffffffffa023f0ff>] snd_usb_create_stream+0xe9/0x125 [snd_usb_audio]
       [<ffffffffa023f9b1>] usb_audio_probe+0x62a/0x72c [snd_usb_audio]
      This patch fixes the regression by checking the fixed endpoint number
      for each substream instead of the endpoint pointer.
      Reported-and-tested-by: default avatarJamie Heilman <jamie@audible.transient.net>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  21. 21 Apr, 2012 1 commit
  22. 13 Apr, 2012 3 commits
    • Takashi Iwai's avatar
      ALSA: usb: Remove obsoleted fields from struct snd_usb_substream · 22026c1a
      Takashi Iwai authored
      Many fields have been moved to struct snd_usb_endpoint.
      Also fix the proc output to correspond to the new structure.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    • Daniel Mack's avatar
      ALSA: snd-usb: switch over to new endpoint streaming logic · edcd3633
      Daniel Mack authored
      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: default avatarDaniel Mack <zonque@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    • Daniel Mack's avatar
      ALSA: snd-usb: implement new endpoint streaming model · 8fdff6a3
      Daniel Mack authored
      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
      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: default avatarDaniel Mack <zonque@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  23. 15 Feb, 2012 1 commit
  24. 12 Sep, 2011 1 commit
    • Pierre-Louis Bossart's avatar
      ALSA: usb: refine delay information with USB frame counter · 294c4fb8
      Pierre-Louis Bossart authored
      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: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      [clemens: changed debug code]
      Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  25. 27 Oct, 2010 1 commit
    • Clemens Ladisch's avatar
      ALSA: usb-audio: automatically detect feedback format · 89e1e66d
      Clemens Ladisch authored
      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: default avatarClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  26. 31 May, 2010 1 commit
    • Daniel Mack's avatar
      ALSA: usb-audio: parse clock topology of UAC2 devices · 79f920fb
      Daniel Mack authored
      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: default avatarDaniel Mack <daniel@caiaq.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
  27. 05 Mar, 2010 3 commits