staticintset_hwparams(snd_pcm_t*handle,snd_pcm_hw_params_t*params,snd_pcm_access_taccess){interr, dir;/* choose all parameters */err = snd_pcm_hw_params_any(handle,params);if(err <0) {printf("Access type not available for playback: %s\n", snd_strerror(err));returnerr; }/* ...
snd_pcm_hw_params_set_channels(handle, params,2);unsignedrate =44100;intdir; snd_pcm_hw_params_set_rate_near(handle, params, &rate, &dir);snd_pcm_uframes_tperiod = (int)rate; snd_pcm_hw_params_set_period_size_near(handle, params, &period, &dir); sample_size = rate;if(snd_pcm_...
err = open_func(pcmp, name, pcm_root, pcm_conf, stream, mode);...登录后复制snd_pcm_open_conf 调用snd_dlobj_cache_get在动态库中libasound_module_pcm_hw.so获取函数指针_snd_pcm_hw_open_snd_pcm_hw_open通过调用snd_pcm_hw_open来创建hw_pcm设备。snd_pcm_hw_open函数原型如下int snd_pcm_hw...
There is a problem with the ALSA sink which causes a runtime error when we reconfigure the flow graph. This is the case when we change mode and bandwidth. The error message is: audio_alsa_sink[hw:0,0]: snd_pcm_hw_params failed: File desc...
I guess the runtime of jackd received failure by call of ioctl with SNDRV_PCM_IOCTL_HW_PARAMS request. Typically, the error code is -ETIMEDOUT. Would I ask you to test jackd with strace(1) command and gather logs? The command line should be: $ strace -tt -f jackd -v -P25 -dalsa...
{snd_pcm_hw_params_free(hw_params);return-1; }snd_pcm_hw_params_free(hw_params);#endifreturn0; } 开发者ID:BackupTheBerlios,项目名称:quh,代码行数:76,代码来源:alsa.c 示例2: detect_pcm ▲点赞 5▼ void*capture_thread(void*data){ ...
(&pcm->pcm, desc->name, stm, SND_PCM_NONBLOCK);if(err) PERROR_GOTO(snd_strerror(err), on_error_0); err = snd_pcm_hw_params_malloc(&pcm->hw_params);if(err) PERROR_GOTO(snd_strerror(err), on_error_1); err = snd_pcm_hw_params_any(pcm->pcm, pcm->hw_params);if(err) PERR...
{snd_pcm_drain(handle); prepareDevice(); } } 开发者ID:vsicurella,项目名称:CS490_Final,代码行数:29,代码来源:audio.cpp 示例3: stop ▲点赞 4▼ staticvoidstop(void){if(alsa_handle) {snd_pcm_drain(alsa_handle); snd_pcm_close(alsa_handle); ...
示例1: omap_pcm_open ▲点赞 9▼ staticintomap_pcm_open(struct snd_pcm_substream *substream){structsnd_pcm_runtime*runtime=substream->runtime;structomap_runtime_data*prtd;intret; snd_soc_set_runtime_hwparams(substream, &omap_pcm_hardware);/* Ensure that buffer size is a multiple of...
SND_PCM_ACCESS_RW_INTERLEAVED);if(err <0)gotoerror; ad->writei = snd_pcm_writei; } err = alsa_output_setup_format(ad->pcm, hwparams, audio_format);if(err <0) { g_set_error(error, alsa_output_quark(), err,"ALSA device \"%s\" does not support format %s: %s", ...