This project is mirrored from Pull mirroring updated .
  1. 20 Feb, 2015 1 commit
  2. 28 Jan, 2015 1 commit
  3. 30 Dec, 2014 2 commits
    • Lars-Peter Clausen's avatar
      ALSA: Add support for wildcard msbits constraints · 8ef9df55
      Lars-Peter Clausen authored
      Currently the msbits constraints requires to specify a specific sample
      format width for which the constraint should be applied. But often the
      number of most significant bits is not sample format specific, but rather a
      absolute limit. E.g. the PCM interface might accept 32-bit and 24-bit
      samples, but the DAC has a 16-bit resolution and throws away the LSBs. In
      this case for both 32-bit and 24-bit format msbits should be set to 16. This
      patch extends snd_pcm_hw_constraint_msbits() so that a wildcard constraint
      can be setup that is applied for all formats with a sample width larger than
      the specified msbits. Choosing the wildcard constraint is done by setting
      the sample width parameter of the function to 0.
      Signed-off-by: default avatarLars-Peter Clausen <>
      Signed-off-by: default avatarTakashi Iwai <>
    • Lars-Peter Clausen's avatar
      ALSA: Fix handling of multiple msbits constraints on the same runtime · 19f52fae
      Lars-Peter Clausen authored
      If the sound card is made up of discrete components, each with their own
      driver (e.g. like in the ASoC case), we might end up with multiple msbits
      constraint rules installed. Currently this will result in msbits being set
      to whatever the last rule set it to.
      This patch updates the behavior of the rule to choose the minimum (other
      than zero) of all the installed rules.
      Signed-off-by: default avatarLars-Peter Clausen <>
      Signed-off-by: default avatarTakashi Iwai <>
  4. 04 Nov, 2014 2 commits
    • Takashi Iwai's avatar
      ALSA: pcm: Replace PCM hwptr tracking with tracepoints · f5914908
      Takashi Iwai authored
      ALSA PCM core has a mechanism tracking the PCM hwptr updates for
      analyzing XRUNs.  But its log is limited (up to 10) and its log output
      is a kernel message, which is hard to handle.
      In this patch, the hwptr logging is moved to the tracing
      infrastructure instead of its own.  Not only the hwptr updates but
      also XRUN and hwptr errors are recorded on the trace log, so that user
      can see such events at the exact timing.
      The new "snd_pcm" entry will appear in the tracing events:
        # ls -F /sys/kernel/debug/tracing/events/snd_pcm
        enable  filter  hw_ptr_error/  hwptr/  xrun/
      The hwptr is for the regular hwptr update events.  An event trace
      looks like:
        aplay-26187 [004] d..3  4012.834761: hwptr: pcmC0D0p/sub0: POS: pos=488, old=0, base=0, period=1024, buf=16384
      "POS" shows the hwptr update by the explicit position update call and
      "IRQ" means the hwptr update by the interrupt,
      i.e. snd_pcm_period_elapsed() call.  The "pos" is the passed
      ring-buffer offset by the caller, "old" is the previous hwptr, "base"
      is the hwptr base position, "period" and "buf" are period- and
      buffer-size of the target PCM substream.
      (Note that the hwptr position displayed here isn't the ring-buffer
       offset.  It increments up to the PCM position boundary.)
      The XRUN event appears similarly, but without "pos" field.
      The hwptr error events appear with the PCM identifier and its reason
      string, such as "Lost interrupt?".
      The XRUN and hwptr error reports on kernel message are still left, can
      be turned on/off via xrun_debug proc like before.  But the bit 3, 4, 5
      and 6 bits of xrun_debug proc are dropped by this patch.  Also, along
      with the change, the message strings have been reformatted to be a bit
      more consistent.
      Last but not least, the hwptr reporting is enabled only when
      Signed-off-by: default avatarTakashi Iwai <>
    • Takashi Iwai's avatar
      ALSA: pcm: Correct PCM BUG error message · d507941b
      Takashi Iwai authored
      While converting to dev_*(), the message showing the invalid PCM
      position was wrongly tagged as if an XRUN although it's actually a
      BUG.  This patch corrects the message again.
      Signed-off-by: default avatarTakashi Iwai <>
  5. 22 Sep, 2014 1 commit
  6. 08 Sep, 2014 2 commits
  7. 16 Apr, 2014 1 commit
  8. 20 Feb, 2014 1 commit
  9. 14 Feb, 2014 1 commit
  10. 17 Dec, 2013 1 commit
  11. 19 Aug, 2013 1 commit
    • Tim Gardner's avatar
      ALSA: pcm: Use snd_printd_ratelimit() · 74d779ab
      Tim Gardner authored
      The use of snd_printd_ratelimit() supresses superfluous output from
      printk_ratelimit() when CONFIG_SND_DEBUG is not defined. For example,
      [   43.753692] snd_pcm_update_hw_ptr0: 26 callbacks suppressed
      [   48.822131] snd_pcm_update_hw_ptr0: 25 callbacks suppressed
      [   53.894953] snd_pcm_update_hw_ptr0: 25 callbacks suppressed
      [   58.997761] snd_pcm_update_hw_ptr0: 25 callbacks suppressed
      [   64.100952] snd_pcm_update_hw_ptr0: 25 callbacks suppressed
      fills the log even when no debug output is actually produced.
      Cc: Jaroslav Kysela <>
      Cc: Takashi Iwai <>
      Cc: Pierre-Louis Bossart <>
      Cc: Lars-Peter Clausen <>
      Cc: Yacine Belkadi <>
      Signed-off-by: default avatarTim Gardner <>
      Signed-off-by: default avatarTakashi Iwai <>
  12. 24 May, 2013 1 commit
  13. 12 Mar, 2013 1 commit
  14. 23 Oct, 2012 2 commits
  15. 13 Sep, 2012 1 commit
  16. 11 Sep, 2012 1 commit
  17. 06 Sep, 2012 2 commits
    • Takashi Iwai's avatar
      ALSA: Remove VOLATILE flag from chmap ctls · 6e67683d
      Takashi Iwai authored
      The VOLATILE flag was added to control elements by
      snd_pcm_add_chmap_ctls() just because I didn't want to have a
      side-effect of "alsactl restore".  But now the set operation doesn't
      allow to change the value unless the PCM stream is in PREAPRED state,
      there is no reason to keep this flag.  Let's rip it off.
      Signed-off-by: default avatarTakashi Iwai <>
    • Takashi Iwai's avatar
      ALSA: PCM: channel mapping API implementation · 2d3391ec
      Takashi Iwai authored
      This patch implements the basic data types for the standard channel
      mapping API handling.
      - The definitions of the channel positions and the new TLV types are
        added in sound/asound.h and sound/tlv.h, so that they can be
        referred from user-space.
      - Introduced a new helper function snd_pcm_add_chmap_ctls() to create
        control elements representing the channel maps for each PCM
      - Some standard pre-defined channel maps are provided for
      Signed-off-by: default avatarTakashi Iwai <>
  18. 05 Jul, 2012 1 commit
  19. 22 May, 2012 1 commit
  20. 11 May, 2012 1 commit
    • Takashi Iwai's avatar
      ALSA: pcm - Optimize the call of snd_pcm_update_hw_ptr() in read/write loop · 0910c216
      Takashi Iwai authored
      In the PCM read/write loop, the driver calls snd_pcm_update_hw_ptr()
      at each time at the beginning of the loop.  Russell King reported that
      this hogs CPU significantly.
      The current code assumes that the pointer callback is very fast and
      cheap, also not too much fine grained.  It's not true in all cases.
      When the pointer advances short samples while the read/write copy has
      been performed, the driver updates the hw_ptr and gets avail > 0
      again.  Then it tries to read/write these small chunks.  This repeats
      until the avail really gets to zero.
      For avoiding this situation, a simple workaround is to call
      snd_pcm_update_hw_ptr() only once at starting the loop, assuming that
      the read/write copy is performed fast enough.  If the available count
      becomes short, it goes to snd_pcm_wait_avail() anyway, and this
      processes right.
      Tested-by: default avatarRussell King <>
      Signed-off-by: default avatarTakashi Iwai <>
  21. 15 Mar, 2012 1 commit
  22. 31 Oct, 2011 1 commit
  23. 20 Sep, 2011 1 commit
  24. 15 Sep, 2011 1 commit
    • Arjan van de Ven's avatar
      ALSA: pcm - fix race condition in wait_for_avail() · 763437a9
      Arjan van de Ven authored
      wait_for_avail() in pcm_lib.c has a race in it (observed in practice by an
      Intel validation group).
      The function is supposed to return once space in the buffer has become
      available, or if some timeout happens.  The entity that creates space (irq
      handler of sound driver and some such) will do a wake up on a waitqueue
      that this function registers for.
      However there are two races in the existing code
      1) If space became available between the caller noticing there was no
         space and this function actually sleeping, the wakeup is missed and the
         timeout condition will happen instead
      2) If a wakeup happened but not sufficient space became available, the
         code will loop again and wait for more space.  However, if the second
         wake comes in prior to hitting the schedule_timeout_interruptible(), it
         will be missed, and potentially you'll wait out until the timeout
      The fix consists of using more careful setting of the current state (so
      that if a wakeup happens in the main loop window, the schedule_timeout()
      falls through) and by checking for available space prior to going into the
      schedule_timeout() loop, but after being on the waitqueue and having the
      state set to interruptible.
      [tiwai: the following changes have been added to Arjan's original patch:
       - merged akpm's fix for waitqueue adding order into a single patch
       - reduction of duplicated code of avail check
      Signed-off-by: default avatarArjan van de Ven <>
      Signed-off-by: default avatarAndrew Morton <>
      Cc: <>
      Signed-off-by: default avatarTakashi Iwai <>
  25. 24 Jul, 2011 1 commit
  26. 26 May, 2011 1 commit
  27. 19 May, 2011 1 commit
  28. 18 May, 2011 1 commit
    • Ben Gardiner's avatar
      ALSA: sound, core, pcm_lib: xrun_log: log also in_interrupt · ec08b144
      Ben Gardiner authored
      When debugging pcm drivers I found the "period" or "hw" prefix printed
      respectively to be very useful is observing the interplay between
      interrupt-context updates and syscall-context updates.
      Similarly, when debugging overruns with XRUN_DEBUG_LOG it is useful to
      see the context of the last 10 positions.
      Add an in_interrupt member to hwptr_log_entry which stores the value of
      the in_interrupt parameter of snd_pcm_update_hw_ptr0 when the log entry
      is created. Print a "[Q]" prefix when dumping the log entries if
      in_interrupt was true.
      Signed-off-by: default avatarBen Gardiner <>
      Signed-off-by: default avatarTakashi Iwai <>
  29. 01 Apr, 2011 1 commit
  30. 21 Dec, 2010 1 commit
  31. 22 Nov, 2010 4 commits
  32. 19 Aug, 2010 1 commit