35 return snd_pcm_hw_params(
getPCM(), hParams);
44 return snd_pcm_hw_params_current(
getPCM(), hParams);
53 int ret=snd_pcm_hw_params_any(
getPCM(), hParams);
69 snd_pcm_hw_params_malloc(&hParams);
71 assert(
"Couldn't malloc HW params");
76 snd_pcm_hw_params_free(hParams);
84 snd_pcm_hw_params_copy(hParams, hParamsIn);
93 return snd_pcm_hw_params_set_rate_resample(
getPCM(), hParams, state);
107 int ret=snd_pcm_hw_params_set_access(
getPCM(), hParams, access);
117 snd_pcm_access_t access;
118 int ret=snd_pcm_hw_params_get_access(hParams, &access);
184 int ret=snd_pcm_hw_params_set_format(
getPCM(), hParams, format);
196 return snd_pcm_hw_params_get_format(hParams, &format);
204 snd_pcm_format_t format;
207 return snd_pcm_format_physical_width(format);
216 return snd_pcm_hw_params_set_channels(
getPCM(), hParams, cnt);
224 int err=snd_pcm_hw_params_get_channels(hParams, &cnt);
237 int ret=snd_pcm_hw_params_get_channels_max(hParams, &mCh);
250 int ret=snd_pcm_hw_params_set_rate_near(
getPCM(), hParams, &rrate, &dir);
263 int err=snd_pcm_hw_params_get_rate(hParams, &rate, &dir);
276 return snd_pcm_hw_params_get_period_size(hParams, p, dir);
296 return snd_pcm_hw_params_set_period_size_near(
getPCM(), hParams, p, dir);
305 snd_pcm_uframes_t periodSize = bufSize * 2;
307 int err = snd_pcm_hw_params_set_buffer_size_near(
getPCM(), hParams, &periodSize);
309 printf(
"Unable to set buffer size %d %s \n",(
int)(bufSize*2), snd_strerror(err));
314 printf(
"Unable to set period size %d %s \n",(
int)periodSize, snd_strerror(err));
319 return snd_pcm_format_description(format);
327 return snd_pcm_name(
getPCM());
334 return snd_pcm_hw_params_dump(hParams,
log);
int setSampleRate(unsigned int rrate, int dir=0)
void copyFrom(snd_pcm_hw_params_t *hParamsIn)
const char * getDeviceName()
int getPeriodSize(snd_pcm_uframes_t *p, int *dir=NULL)
const char * formatDescription(const snd_pcm_format_t format) const
int setBufSize(snd_pcm_uframes_t bufSize)
#define PCM_NOT_OPEN_CHECK_STRING(pcm)
#define PCM_NOT_OPEN_CHECK_NO_PRINT(pcm, type)
virtual snd_pcm_t * getPCM()
int setPeriodSize(snd_pcm_uframes_t *p, int *dir=0)
int setAccess(snd_pcm_access_t access)
int getFormat(snd_pcm_format_t &format)
virtual int evaluateError(int errorNum)
#define PCM_NOT_OPEN_CHECK(pcm)
snd_pcm_hw_params_t * hParams
PCM params.
int getSampleRate(int dir=0)
int getPeriodSize(int *dir=NULL)
snd_output_t * log
The log stream if enabled.
int getFormatPhysicalWidth()
int rateResample(unsigned int state)
int setFormat(snd_pcm_format_t format)
int setChannels(unsigned int cnt)