[alsa-devel] Unable to set ALSA buffer size
Hello All,
I am trying to set my alsa buffer size as 1024*8. But my playback device is not able to set to requested ALSA buffer size.
snd_pcm_hw_params_set_periods(handle, params, 8, 0); snd_pcm_hw_params_set_period_size(handle, params, 1024, 0); snd_pcm_uframes_t frames1; frames1=1024*8; retVal=snd_pcm_hw_params_set_buffer_size_near(handle, params, &frames1);
snd_pcm_hw_params_get_buffer_size(params, (snd_pcm_uframes_t *) &val);
/*Expected Output*/ ==============>>>>>>> buffer size = 8192 frames
/*Output*/ ==============>>>>>>> buffer size = 1325 frames
Return value for above APIs is coming as zero. but still i am unable to get expected result. Is there any other forcible way to do the above.
Regards,
SASKEN BUSINESS DISCLAIMER: This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. Read Disclaimer at http://www.sasken.com/extras/mail_disclaimer.html
Irfan Shaikh wrote:
I am trying to set my alsa buffer size as 1024*8. But my playback device is not able to set to requested ALSA buffer size.
Is there any other forcible way to do the above.
No; you cannot use buffer/period size that are not supported by your hardware. If your program isn't designed to run with some specific device, it must be able to cope with any buffer size.
SASKEN BUSINESS DISCLAIMER: This message may contain bla bla bla ...
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
participants (2)
-
Clemens Ladisch
-
Irfan Shaikh