[alsa-devel] snd_dummy on Centos - Redhat

Takashi Iwai tiwai at suse.de
Fri Sep 4 08:58:49 CEST 2009


At Fri, 4 Sep 2009 00:43:09 +0200,
Giovanni Maruzzelli wrote:
> 
> On Fri, Sep 4, 2009 at 12:03 AM, Giovanni
> Maruzzelli<gmaruzz.lists at gmail.com> wrote:
> > I'll test it and report back here.
> 
> Still we have big problems....

OK, then upgrade your alsa driver stack to 1.0.21.  There have been
some changes in PCM core.  Then, get dummy.c again from the latest
alsa-driver-unstable tarball.  It already contains my latest fix.

If 1.0.21+dummy.c doesn't work, apply the patch below to get position
logs.  If this still causes the invalid backward jump to position 0,
you should check xrun debug, e.g.
	# echo 9 > /proc/asound/card0/pcm0p/xrun_debug

(assuming snd-dummy is card0).


Takashi

---
diff --git a/dummy.c b/dummy.c
index e8e29bf..f7c21d5 100644
--- a/dummy.c
+++ b/dummy.c
@@ -239,6 +239,10 @@ static void dummy_systimer_update(struct dummy_systimer_pcm *dpcm)
 		dpcm->frac_period_rest += dpcm->frac_period_size;
 	}
 	dpcm->frac_period_rest -= delta;
+	printk(KERN_DEBUG "xxx delta=%ld, pos=%d(%d), rest=%d(%d)\n",
+	       delta / dpcm->rate,
+	       dpcm->frac_pos, dpcm->frac_pos / HZ,
+	       dpcm->frac_period_rest, dpcm->frac_period_rest / HZ);
 }
 
 static int dummy_systimer_start(struct snd_pcm_substream *substream)
@@ -248,6 +252,10 @@ static int dummy_systimer_start(struct snd_pcm_substream *substream)
 	dpcm->base_time = jiffies;
 	dummy_systimer_rearm(dpcm);
 	spin_unlock(&dpcm->lock);
+	printk(KERN_DEBUG "*** START: buffer=%d, period=%d, rate=%d\n",
+	       (int)substream->runtime->buffer_size,
+	       (int)substream->runtime->period_size,
+	       substream->runtime->rate);
 	return 0;
 }
 
@@ -257,6 +265,7 @@ static int dummy_systimer_stop(struct snd_pcm_substream *substream)
 	spin_lock(&dpcm->lock);
 	del_timer(&dpcm->timer);
 	spin_unlock(&dpcm->lock);
+	printk(KERN_DEBUG "*** STOP\n");
 	return 0;
 }
 


More information about the Alsa-devel mailing list