“snd_pcm_set_period_size”将块大小返回为零

时间:2017-11-06 07:31:16

标签: alsa

我正在呼叫"snd_pcm_get_period_size",并将块大小返回为

我的配置是: -

频道数量为2 SamplingRate是48000 InterleaveFlag是1 格式为E_ALSA_PCM_RECORD_FORMAT_S16_LE PeriodSize是2000 BufferSize是4000 SoundCardname是hw:2,1,0。

我的日志如下:

DBG::ALLGO::alsa_pcm_recorder_init::46::++Entered.
DBG::ALLGO::alsa_pcm_recorder_init::47::param1::eFormat=2.
DBG::ALLGO::alsa_pcm_recorder_init::48::param2::uiNumChannels=2.
DBG::ALLGO::alsa_pcm_recorder_init::49::param3::uiSamplingRate=48000.
DBG::ALLGO::alsa_pcm_recorder_init::50::param4::bInterleaveFlag=1.
DBG::ALLGO::alsa_pcm_recorder_init::51::param5::uiPeriodSize=2000.
DBG::ALLGO::alsa_pcm_recorder_init::52::param6::uiBufferSize=4000.
DBG::ALLGO::alsa_pcm_recorder_init::53::param7::acSndCardname=hw:1,1.
DBG::ALLGO::alsa_pcm_recorder_init::148::psCaptureHandle->format = 2
DBG::ALLGO::alsa_pcm_recorder_init::149::psCaptureHandle->channels = 2
DBG::ALLGO::alsa_pcm_recorder_init::150::psCaptureHandle->rate = 48000
DBG::ALLGO::alsa_pcm_recorder_init::151::psCaptureHandle->interleaved 
= 1
DBG::ALLGO::alsa_pcm_recorder_init::160::snd_pcm_open for 
psCapturehandle is done. handle =0x2382f30.
DBG::ALLGO::alsa_pcm_recorder_init::170::snd_pcm_info for 
psaptureHandle is done.
DBG::ALLGO::alsa_pcm_recorder_init::179::psCaptureHandle->audiobuf 
addr 237a9d0
DBG::ALLGO::set_recording_params::36::++Entered.
ERR::ALLGO::set_recording_params::129::
period time=0  period frames=2000
ERR::ALLGO::set_recording_params::146::
buffer time=0  buffer frames=4000
ERR::ALLGO::set_recording_params::160::chunk size=0  return 
value=262144
ERR::ALLGO::set_recording_params::163::buffer size=0 return 
value=524288
ERR::ALLGO::set_recording_params::168::ERROR::Can't use period equal 
to buffer size (0 == 0)
ERR::ALLGO::alsa_pcm_recorder_init::184::ERROR::set_recording_params 
failed.
DBG::ALLGO::alsa_pcm_recorder_uninit::274::++Entered.
DBG::ALLGO::alsa_pcm_recorder_uninit::293::
snd_pcm_drain done.
DBG::ALLGO::alsa_pcm_recorder_uninit::294::
drain returns 0DBG::ALLGO::alsa_pcm_recorder_uninit::296::
snd_pcm_close done.
DBG::ALLGO::alsa_pcm_recorder_uninit::304::--Exiting.
DBG::ALLGO::alsa_pcm_recorder_init::204::--Exiting.
ERR::ALLGO::mls_plat_audio_init::376::alsa_pcm_recorder_init() failed.
DBG::ALLGO::mls_plat_audio_init::405::--Exited

有谁能告诉我为什么会这样?

0 个答案:

没有答案