* Copy call back for capture substream
@ 2011-04-28 9:04 kshemanth.vasireddi
2011-04-28 9:29 ` Clemens Ladisch
0 siblings, 1 reply; 7+ messages in thread
From: kshemanth.vasireddi @ 2011-04-28 9:04 UTC (permalink / raw)
To: alsa-devel
Hi,
I am new to ALSA, I am trying to write an ALSA driver for voice channels
of and ADC.
I had create a sound card with a PCM instance with 2 capture sub
streams. I want to copy data manually by copy call back. I had
registered a copy call back.
I am trying to test my driver with arecord -c 1 -f s16_LE -t wav
test.wav. In log 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.
Thanks and regards,
Kshemanth
Please do not print this email unless it is absolutely necessary.
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.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Copy call back for capture substream
2011-04-28 9:04 Copy call back for capture substream kshemanth.vasireddi
@ 2011-04-28 9:29 ` Clemens Ladisch
2011-04-29 10:51 ` kshemanth.vasireddi
0 siblings, 1 reply; 7+ messages in thread
From: Clemens Ladisch @ 2011-04-28 9:29 UTC (permalink / raw)
To: kshemanth.vasireddi; +Cc: alsa-devel
kshemanth.vasireddi@wipro.com 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.
Regards,
Clemens
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Copy call back for capture substream
2011-04-28 9:29 ` Clemens Ladisch
@ 2011-04-29 10:51 ` kshemanth.vasireddi
2011-04-29 15:22 ` Clemens Ladisch
0 siblings, 1 reply; 7+ messages in thread
From: kshemanth.vasireddi @ 2011-04-29 10:51 UTC (permalink / raw)
To: clemens; +Cc: alsa-devel
Hi,
Yes, I am not clear on what should be returned in pointer call back.
>From my understanding we have return available frames in buffer.
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 = number of channels * sample_bytes ( 2 * 2 = 4)
Let's say period size is 1024 frames ( 4096 bytes)
Buffer_size is 2 periods ( 8192 bytes)
Accordingly I configured
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP_VALID ),
.formats = SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_48000,
.rate_min = 48000,
.rate_max = 48000,
.channels_min = 2,
.channels_max = 2,
.buffer_bytes_max = 8192,
.period_bytes_min = 4096,
.period_bytes_max = 4096,
.periods_min = 1,
.periods_max = 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
invoked.
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,
Kshemanth
-----Original Message-----
From: Clemens Ladisch [mailto:clemens@ladisch.de]
Sent: Thursday, April 28, 2011 3:00 PM
To: Kshemanth Vasireddi (WT01 - Manufacturing & Hi Tech)
Cc: alsa-devel@alsa-project.org
Subject: Re: [alsa-devel] Copy call back for capture substream
kshemanth.vasireddi@wipro.com 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.
Regards,
Clemens
Please do not print this email unless it is absolutely necessary.
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.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Copy call back for capture substream
2011-04-29 10:51 ` kshemanth.vasireddi
@ 2011-04-29 15:22 ` Clemens Ladisch
2011-05-02 11:17 ` kshemanth.vasireddi
0 siblings, 1 reply; 7+ messages in thread
From: Clemens Ladisch @ 2011-04-29 15:22 UTC (permalink / raw)
To: kshemanth.vasireddi; +Cc: alsa-devel
kshemanth.vasireddi@wipro.com wrote:
> Yes, I am not clear on what should be returned in pointer call back.
> From my understanding we have return available frames in buffer.
No, it has to return the position in the buffer after the most recently
captured sample.
> My ADC doesn't have buffer so, I maintain a ring buffer of 2 periods.
> ...
> .periods_min = 1,
> .periods_max = 2,
You need periods_min = 2.
> 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.
Regards,
Clemens
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Copy call back for capture substream
2011-04-29 15:22 ` Clemens Ladisch
@ 2011-05-02 11:17 ` kshemanth.vasireddi
2011-05-02 12:42 ` Clemens Ladisch
0 siblings, 1 reply; 7+ messages in thread
From: kshemanth.vasireddi @ 2011-05-02 11:17 UTC (permalink / raw)
To: clemens; +Cc: alsa-devel
Hi,
Copy call is working, Thanks for inputs.
When I tried to record using arecord "arecord -d 10 -c 2 -f s16_LE -r
48000 -t wav test.wav" sterio mode of recording works.
If I want to record both channels in separate files, what command should
be given to arecord, I am not clear on -I option. Do I require to change
my driver.
Thanks and regards,
Kshemanth
-----Original Message-----
From: Clemens Ladisch [mailto:clemens@ladisch.de]
Sent: Friday, April 29, 2011 8:52 PM
To: Kshemanth Vasireddi (WT01 - Manufacturing & Hi Tech)
Cc: alsa-devel@alsa-project.org
Subject: Re: [alsa-devel] Copy call back for capture substream
kshemanth.vasireddi@wipro.com wrote:
> Yes, I am not clear on what should be returned in pointer call back.
> From my understanding we have return available frames in buffer.
No, it has to return the position in the buffer after the most recently
captured sample.
> My ADC doesn't have buffer so, I maintain a ring buffer of 2 periods.
> ...
> .periods_min = 1,
> .periods_max = 2,
You need periods_min = 2.
> 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.
Regards,
Clemens
Please do not print this email unless it is absolutely necessary.
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.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Copy call back for capture substream
2011-05-02 11:17 ` kshemanth.vasireddi
@ 2011-05-02 12:42 ` Clemens Ladisch
2011-05-03 6:03 ` kshemanth.vasireddi
0 siblings, 1 reply; 7+ messages in thread
From: Clemens Ladisch @ 2011-05-02 12:42 UTC (permalink / raw)
To: kshemanth.vasireddi; +Cc: alsa-devel
kshemanth.vasireddi@wipro.com wrote:
> If I want to record both channels in separate files, what command should
> be given to arecord, I am not clear on -I option.
Just give two file names. Please note that this always results
in raw files.
> 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.
Regards,
Clemens
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Copy call back for capture substream
2011-05-02 12:42 ` Clemens Ladisch
@ 2011-05-03 6:03 ` kshemanth.vasireddi
0 siblings, 0 replies; 7+ messages in thread
From: kshemanth.vasireddi @ 2011-05-03 6:03 UTC (permalink / raw)
To: clemens; +Cc: alsa-devel
Hi,
Copy call back is getting invoked for sterio mode with below command
arecord -c 2 -f s16_LE -r 48000 -t wav test.wav
But when I tried to create separate files for both the channels using
below command, copy call is not getting invoked.
arecord -c 2 -f s16_LE -r 48000 -I test1 test2
Please help me out. I want to create separate raw files for both
channels.
Thanks and regards,
Kshemanth
-----Original Message-----
From: Clemens Ladisch [mailto:clemens@ladisch.de]
Sent: Monday, May 02, 2011 6:13 PM
To: Kshemanth Vasireddi (WT01 - Manufacturing & Hi Tech)
Cc: alsa-devel@alsa-project.org
Subject: Re: [alsa-devel] Copy call back for capture substream
kshemanth.vasireddi@wipro.com wrote:
> If I want to record both channels in separate files, what command
should
> be given to arecord, I am not clear on -I option.
Just give two file names. Please note that this always results
in raw files.
> 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.
Regards,
Clemens
Please do not print this email unless it is absolutely necessary.
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.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-05-03 6:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-28 9:04 Copy call back for capture substream kshemanth.vasireddi
2011-04-28 9:29 ` Clemens Ladisch
2011-04-29 10:51 ` kshemanth.vasireddi
2011-04-29 15:22 ` Clemens Ladisch
2011-05-02 11:17 ` kshemanth.vasireddi
2011-05-02 12:42 ` Clemens Ladisch
2011-05-03 6:03 ` kshemanth.vasireddi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.