[alsa-devel] snd_pcm_lib_read1 timeout

Harsha, Priya priya.harsha at intel.com
Sat Jun 27 09:43:49 CEST 2009


I found another clue to this but can anyone please explain what could be going wrong?

The execution enters into the following function 

>static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream >*substream)
>{
>	....
>	new_hw_ptr = hw_base + pos;
this gets updated correctly
>	...
>	hdelta = new_hw_ptr - old_hw_ptr;
>	jdelta = jiffies - runtime->hw_ptr_jiffies;
as far as I don't get into the following loop, am good...the moment I get into this loop my new_hw_ptr gets modified and it does not progress in capture. Any clues?
>	if (((hdelta * HZ) / runtime->rate) > jdelta + HZ/100) {
>		delta = jdelta /
>			(((runtime->period_size * HZ) / runtime->rate)
>								+ HZ/100);
>		hw_ptr_error(substream,
>			     "hw_ptr skipping! [Q] "
>			     "(pos=%ld, delta=%ld, period=%ld, "
>			     "jdelta=%lu/%lu/%lu)\n",
>			     (long)pos, (long)hdelta,
>			     (long)runtime->period_size, jdelta,
>			     ((hdelta * HZ) / runtime->rate), delta);
>		hw_ptr_interrupt = runtime->hw_ptr_interrupt +
>				   runtime->period_size * delta;
>		if (hw_ptr_interrupt >= runtime->boundary)
>			hw_ptr_interrupt -= runtime->boundary;
>		/* rebase to interrupt position */
>		hw_base = new_hw_ptr = hw_ptr_interrupt;
>		/* align hw_base to buffer_size */
>		hw_base -= hw_base % runtime->buffer_size;
>		delta = 0;
>	}
>      ...
>}

Thanks,
Harsha

______________________________________
From: Harsha, Priya 
Sent: Saturday, June 27, 2009 9:18 AM
To: alsa-devel at alsa-project.org
Subject: snd_pcm_lib_read1 timeout

Hi,

I have a basic question;

There is a schedule_timeout() in snd_pcm_lib_read1 -> wait_for_avail_min. When and where does this timeout get signaled? What would be the reason that this timeout happens?


Thanks,
Harsha



More information about the Alsa-devel mailing list