Source
snd_pcm_indirect2_increase_min_periods(struct snd_pcm_substream *substream,
/*
* Helper functions for indirect PCM data transfer to a simple FIFO in
* hardware (small, no possibility to read "hardware io position",
* updating position done by interrupt, ...)
*
* Copyright (c) by 2007 Joachim Foerster <JOFT@gmx.de>
*
* Based on "pcm-indirect.h" (alsa-driver-1.0.13) by
*
* Copyright (c) by Takashi Iwai <tiwai@suse.de>
* Jaroslav Kysela <perex@suse.cz>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* snd_printk/d() */
/* struct snd_pcm_substream, struct snd_pcm_runtime, snd_pcm_uframes_t
* snd_pcm_period_elapsed() */
/* jiffies */
void snd_pcm_indirect2_stat(struct snd_pcm_substream *substream,
struct snd_pcm_indirect2 *rec)
{
struct snd_pcm_runtime *runtime = substream->runtime;
int i;
int j;
int k;
int seconds = (rec->lastbytetime - rec->firstbytetime) / HZ;
snd_printk(KERN_DEBUG "STAT: mul_elapsed: %u, mul_elapsed_real: %d, "
"irq_occurred: %d\n",
rec->mul_elapsed, rec->mul_elapsed_real, rec->irq_occured);
snd_printk(KERN_DEBUG "STAT: min_multiple: %d (irqs/period)\n",
rec->min_multiple);
snd_printk(KERN_DEBUG "STAT: firstbytetime: %lu, lastbytetime: %lu, "
"firstzerotime: %lu\n",
rec->firstbytetime, rec->lastbytetime, rec->firstzerotime);
snd_printk(KERN_DEBUG "STAT: bytes2hw: %u Bytes => (by runtime->rate) "
"length: %d s\n",
rec->bytes2hw, rec->bytes2hw / 2 / 2 / runtime->rate);
snd_printk(KERN_DEBUG "STAT: (by measurement) length: %d => "
"rate: %d Bytes/s = %d Frames/s|Hz\n",
seconds, rec->bytes2hw / seconds,
rec->bytes2hw / 2 / 2 / seconds);