Re: [PATCH] sparc dbri: recording is back

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Thu, 24 Aug 2006 08:09:26 +0200,
Krzysztof Helt wrote:
> 
> 
> 
> Dnia 23-08-2006 o godz. 20:16 Takashi Iwai napisał(a):
> > At Wed, 23 Aug 2006 20:10:35 +0200,
> > Krzysztof Helt wrote:
> > > 
> > > @@ -2159,7 +2139,7 @@ static snd_pcm_uframes_t snd_dbri_pointe
> > >  	snd_pcm_uframes_t ret;
> > >  
> > >  	ret = bytes_to_frames(substream->runtime, info->offset)
> > > -		% substream->runtime->buffer_size;
> >  >+		% (substream->runtime->buffer_size + 1);
> > >  	dprintk(D_USR, "I/O pointer: %ld frames of %ld.\n",
> > >  		ret, substream->runtime->buffer_size);
> > >  	return ret;
> > 
> > What is the reason of this change?  The original code looks OK
> to me.
> > The pointer callback must return a value between 0 and
> > (buffer_size-1).
> > 
> > 
> 
> I will recheck if recording works without this change. The last
> returned pointer value is equal to buffer_size. Your email
> implies that 0 means "I have full buffer filled with data".

No, pointer callback returns the current processing DMA position in
the ring buffer (called hw_ptr).  It doesn't mean how many samples
remain.

The amount of remaining sample is calculated in PCM core layer.
The PCM layer remembers how many samples are put in the buffer
(= appl_ptr), then can easily calculate the remaining samples by 
(appl_ptr - hw_ptr). 


Takashi

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux