[alsa-devel] [PATCH 1/3] ALSA: pcm - introduce device_buffer

Vinod Koul vinod.koul at linux.intel.com
Fri Aug 31 17:02:25 CEST 2012


On Fri, 2012-08-31 at 12:48 +0200, Jaroslav Kysela wrote:
> Date 31.8.2012 03:14, Vinod Koul wrote:
> > -		if (avail >= runtime->stop_threshold) {
> > +		snd_pcm_uframes_t actual_avail;
> > +		if (avail < runtime->device_buffer)
> > +			actual_avail = avail;
> > +		else
> > +			actual_avail = avail - runtime->device_buffer;
> > +		if (actual_avail  >= runtime->stop_threshold) {
> 
> Perhaps this may be simplified to:
> 	if (avail >= runtime->stop_threshold + runtime->device_buffer)
I see no reason why this wouldnt work, and dont know why i didnt take
this more intuitive approach. Let me grab some coffee for my jet lagged
mind and rethink :)
> 
> > +			snd_printd(KERN_ERR  "avail > stop_threshold!!\n");
> > +			snd_printd(KERN_ERR  "actual_avail %ld, avail %ld, device_buffer %ld!!\n",
> > +					actual_avail, avail,  runtime->device_buffer);
> 
> I would propose to enhance xrun_log() to show something about
> device_buffer and remove these printd calls from this location.
Yup
> 
> 					Jaroslav
> 


-- 
~Vinod



More information about the Alsa-devel mailing list