No subject

Fri Jul 31 19:24:53 CEST 2009

My ADC doesn't have buffer so, I maintain a ring buffer of 2 periods.

I have 2 capture channels with 1 sample width 2 bytes sampling rate is
48khz. Based on this

1 Frame =3D number of channels * sample_bytes  ( 2 * 2 =3D 4)

Let's say period size is 1024 frames ( 4096 bytes)

Buffer_size is 2 periods  ( 8192 bytes)

Accordingly I configured 
	.info =3D		(SNDRV_PCM_INFO_MMAP |
	.formats =3D		SNDRV_PCM_FMTBIT_S16_LE,
	.rates =3D		SNDRV_PCM_RATE_48000,
	.rate_min =3D		48000,
	.rate_max =3D		48000,
	.channels_min =3D		2,
	.channels_max =3D		2,
	.buffer_bytes_max =3D	8192,
	.period_bytes_min =3D	4096,
	.period_bytes_max =3D	4096,
	.periods_min =3D		1,
	.periods_max =3D		2,

In pointer call back for first time if I return 1024, copy call back is
invoked. In second pointer call if I return again 1024 it copy is not

In second pointer call if I return 2048 copy is called. Later copy was
never called.

Can someone please help me out, what is correct value that I should
return in pointer call back so that copy is invoked.

Thanks and regards,

-----Original Message-----
From: Clemens Ladisch [mailto:clemens at] 
Sent: Thursday, April 28, 2011 3:00 PM
To: Kshemanth Vasireddi (WT01 - Manufacturing & Hi Tech)
Cc: alsa-devel at
Subject: Re: [alsa-devel] Copy call back for capture substream

kshemanth.vasireddi at wrote:
> I had registered a copy call back.
> all call backs are invoked, but copy call back is not
> getting invoked. Can you please let me know when will copy call  back
> shall be invoked, is there any condition for it.

It's right there in the source code.

The copy callback is called exactly when in the same circumstances when
the data of a 'normal' driver would be copied out of the device's
buffer, i.e., when some data is available.

I'd guess that your pointer callback does not return the correct values.

> The information contained in this electronic message ...

This e-mail contains public information intended for any subscriber of
this mailing list and for anybody else who bothers to read it; it will
be copied, disclosed and distributed to the public.  If you think you
are not the intended recipient, please commit suicide immediately.
These terms apply also to any e-mails quoted in, referenced from, or
answering this e-mail, and supersede any confidentiality notices in
those e-mails.  Additionally, confidentiality notices in those e-mails
will incur legal processing fees of $42 per line; you have agreed to
this by reading this confidentiality notice.


Please do not print this email unless it is absolutely necessary. =0A=
The information contained in this electronic message and any attachments to=
 this message are intended for the exclusive use of the addressee(s) and may=
 contain proprietary, confidential or privileged information. If you are not=
 the intended recipient, you should not disseminate, distribute or copy this=
 e-mail. Please notify the sender immediately and destroy all copies of this=
 message and any attachments. =0A=
WARNING: Computer viruses can be transmitted via email. The recipient should=
 check this email and any attachments for the presence of viruses. The compa=
ny accepts no liability for any damage caused by any virus transmitted by th=
is email. =0A=

More information about the Alsa-devel mailing list