]> Pileus Git - ~andy/linux/blobdiff - sound/drivers/pcm-indirect2.c
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[~andy/linux] / sound / drivers / pcm-indirect2.c
index 6a829cd03dde4033cdad586f9144cdb4611d4df7..e73fafd761b35c829c90e3443388e5dcf17e06df 100644 (file)
@@ -25,8 +25,6 @@
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-/* #dependency of sound/core.h# */
-#include <sound/driver.h>
 /* snd_printk/d() */
 #include <sound/core.h>
 /* struct snd_pcm_substream, struct snd_pcm_runtime, snd_pcm_uframes_t
@@ -266,7 +264,7 @@ snd_pcm_indirect2_playback_transfer(struct snd_pcm_substream *substream,
                if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2))
                        diff += runtime->boundary;
                /* number of bytes "added" by ALSA increases the number of
-                * bytes which are ready to "be transfered to HW"/"played"
+                * bytes which are ready to "be transferred to HW"/"played"
                 * Then, set rec->appl_ptr to not count bytes twice next time.
                 */
                rec->sw_ready += (int)frames_to_bytes(runtime, diff);
@@ -332,7 +330,7 @@ snd_pcm_indirect2_playback_transfer(struct snd_pcm_substream *substream,
                /* copy bytes from intermediate buffer position sw_data to the
                 * HW and return number of bytes actually written
                 * Furthermore, set hw_ready to 0, if the fifo isn't empty
-                * now => more could be transfered to fifo
+                * now => more could be transferred to fifo
                 */
                bytes = copy(substream, rec, bytes);
                rec->bytes2hw += bytes;
@@ -403,7 +401,7 @@ snd_pcm_indirect2_playback_interrupt(struct snd_pcm_substream *substream,
                                          rec->min_multiple);
                rec->mul_elapsed++;
 #endif
-               rec->min_periods = 0;
+               rec->min_periods = (rec->min_periods % rec->min_multiple);
                snd_pcm_period_elapsed(substream);
        }
 }
@@ -568,24 +566,8 @@ snd_pcm_indirect2_capture_interrupt(struct snd_pcm_substream *substream,
                rec->mul_elapsed_real += (rec->min_periods /
                                          rec->min_multiple);
                rec->mul_elapsed++;
-
-               if (!(rec->mul_elapsed % 4)) {
-                       struct snd_pcm_runtime *runtime = substream->runtime;
-                       unsigned int appl_ptr =
-                           frames_to_bytes(runtime,
-                                           (unsigned int)runtime->control->
-                                           appl_ptr) % rec->sw_buffer_size;
-                       int diff = rec->sw_data - appl_ptr;
-                       if (diff < 0)
-                               diff += rec->sw_buffer_size;
-                       snd_printk(KERN_DEBUG
-                                  "STAT: mul_elapsed: %d, sw_data: %u, "
-                                  "appl_ptr (bytes): %u, diff: %d\n",
-                                  rec->mul_elapsed, rec->sw_data, appl_ptr,
-                                  diff);
-               }
 #endif
-               rec->min_periods = 0;
+               rec->min_periods = (rec->min_periods % rec->min_multiple);
                snd_pcm_period_elapsed(substream);
        }
 }