[alsa-devel] Copy call back for capture substream
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
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
Hi,
Yes, I am not clear on what should be returned in pointer call back.
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
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
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
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
participants (2)
-
Clemens Ladisch
-
kshemanth.vasireddi@wipro.com