1. 28 10月, 2015 1 次提交
  2. 22 10月, 2015 1 次提交
  3. 16 10月, 2015 1 次提交
  4. 19 5月, 2015 1 次提交
    • K
      ALSA: pcm: Modify double acknowledged interrupts check condition · 13a98839
      Koro Chen 提交于
      Currently in snd_pcm_update_hw_ptr0 during interrupt,
      we consider there were double acknowledged interrupts when:
      1. HW reported pointer is smaller than expected, and
      2. Time from last update time (hdelta) is over half a buffer time.
      
      However, when HW reported pointer is only a few bytes smaller than
      expected, and when hdelta is just a little larger than half a buffer time
      (e.g. ping-pong buffer), it wrongly treats this IRQ as double acknowledged.
      
      The condition #2 uses jiffies, but jiffies is not high resolution
      since it is integer. We should consider jiffies inaccuracy.
      Signed-off-by: NKoro Chen <koro.chen@mediatek.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      13a98839
  5. 21 2月, 2015 1 次提交
  6. 29 1月, 2015 1 次提交
  7. 30 12月, 2014 2 次提交
    • L
      ALSA: Add support for wildcard msbits constraints · 8ef9df55
      Lars-Peter Clausen 提交于
      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: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      8ef9df55
    • L
      ALSA: Fix handling of multiple msbits constraints on the same runtime · 19f52fae
      Lars-Peter Clausen 提交于
      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: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      19f52fae
  8. 04 11月, 2014 2 次提交
    • T
      ALSA: pcm: Replace PCM hwptr tracking with tracepoints · f5914908
      Takashi Iwai 提交于
      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
      CONFIG_SND_PCM_XRUN_DEBUG is set.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      f5914908
    • T
      ALSA: pcm: Correct PCM BUG error message · d507941b
      Takashi Iwai 提交于
      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: NTakashi Iwai <tiwai@suse.de>
      d507941b
  9. 22 9月, 2014 1 次提交
  10. 08 9月, 2014 2 次提交
  11. 16 4月, 2014 1 次提交
  12. 20 2月, 2014 1 次提交
  13. 14 2月, 2014 1 次提交
  14. 17 12月, 2013 1 次提交
  15. 19 8月, 2013 1 次提交
    • T
      ALSA: pcm: Use snd_printd_ratelimit() · 74d779ab
      Tim Gardner 提交于
      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 <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Cc: Lars-Peter Clausen <lars@metafoo.de>
      Cc: Yacine Belkadi <yacine.belkadi.1@gmail.com>
      Signed-off-by: NTim Gardner <tim.gardner@canonical.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      74d779ab
  16. 24 5月, 2013 1 次提交
  17. 12 3月, 2013 1 次提交
  18. 23 10月, 2012 2 次提交
  19. 13 9月, 2012 1 次提交
  20. 11 9月, 2012 1 次提交
  21. 07 9月, 2012 2 次提交
    • T
      ALSA: Remove VOLATILE flag from chmap ctls · 6e67683d
      Takashi Iwai 提交于
      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: NTakashi Iwai <tiwai@suse.de>
      6e67683d
    • T
      ALSA: PCM: channel mapping API implementation · 2d3391ec
      Takashi Iwai 提交于
      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
        (sub)stream.
      
      - Some standard pre-defined channel maps are provided for
        convenience.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2d3391ec
  22. 05 7月, 2012 1 次提交
  23. 23 5月, 2012 1 次提交
  24. 12 5月, 2012 1 次提交
    • T
      ALSA: pcm - Optimize the call of snd_pcm_update_hw_ptr() in read/write loop · 0910c216
      Takashi Iwai 提交于
      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: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      0910c216
  25. 15 3月, 2012 1 次提交
  26. 01 11月, 2011 1 次提交
  27. 20 9月, 2011 1 次提交
  28. 15 9月, 2011 1 次提交
    • A
      ALSA: pcm - fix race condition in wait_for_avail() · 763437a9
      Arjan van de Ven 提交于
      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
         happens.
      
      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: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: <stable@kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      763437a9
  29. 24 7月, 2011 1 次提交
  30. 26 5月, 2011 1 次提交
  31. 19 5月, 2011 1 次提交
  32. 18 5月, 2011 1 次提交
    • B
      ALSA: sound, core, pcm_lib: xrun_log: log also in_interrupt · ec08b144
      Ben Gardiner 提交于
      When debugging pcm drivers I found the "period" or "hw" prefix printed
      by either XRUN_DEBUG_PERIODUPDATE or XRUN_DEBUG_PERIODUPDATE events,
      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: NBen Gardiner <bengardiner@nanometrics.ca>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      ec08b144
  33. 02 4月, 2011 1 次提交
  34. 21 12月, 2010 1 次提交
  35. 22 11月, 2010 1 次提交