diff options
author | KimJeongYeon <jeongyeon.kim@samsung.com> | 2015-10-13 13:44:57 +0900 |
---|---|---|
committer | KimJeongYeon <jeongyeon.kim@samsung.com> | 2015-10-16 08:13:16 +0900 |
commit | bb3ac0f23cf4c5f767e90a793b64e9a89d3213ae (patch) | |
tree | 848445abda8e53c0773f72defde972651caf094c /tizen-audio-util.c | |
parent | b842c760e228a8dfbbebd7ae569a054461e50c47 (diff) | |
download | audio-hal-max98090-bb3ac0f23cf4c5f767e90a793b64e9a89d3213ae.tar.gz audio-hal-max98090-bb3ac0f23cf4c5f767e90a793b64e9a89d3213ae.tar.bz2 audio-hal-max98090-bb3ac0f23cf4c5f767e90a793b64e9a89d3213ae.zip |
audio-hal-max98090: tizenaudio reference sink / sourcesubmit/tizen/20151020.122114submit/tizen/20151016.064158submit/tizen/20151016.062938accepted/tizen/wearable/20151021.013128accepted/tizen/tv/20151021.013105accepted/tizen/mobile/20151021.013057
[Version] 0.2.10
[Profile] Common
[Issue Type] Features
[Dependency module] NA
[Dependency commit] NA
[Comment]
Signed-off-by: KimJeongYeon <jeongyeon.kim@samsung.com>
Change-Id: Ia63619d6b38b1862c90380398159cc21c04a768a
Diffstat (limited to 'tizen-audio-util.c')
-rw-r--r-- | tizen-audio-util.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tizen-audio-util.c b/tizen-audio-util.c index 181746d..83785c0 100644 --- a/tizen-audio-util.c +++ b/tizen-audio-util.c @@ -244,6 +244,15 @@ audio_return_t _audio_mixer_control_get_element(audio_mgr_t *am, const char *ctl return AUDIO_RET_OK; } +#ifdef __USE_TINYALSA__ +/* Convert pcm format from pulse to alsa */ +static const uint32_t g_format_convert_table[] = { + [AUDIO_SAMPLE_U8] = PCM_FORMAT_S8, + [AUDIO_SAMPLE_S16LE] = PCM_FORMAT_S16_LE, + [AUDIO_SAMPLE_S32LE] = PCM_FORMAT_S32_LE, + [AUDIO_SAMPLE_S24_32LE] = PCM_FORMAT_S24_LE +}; +#else /* alsa-lib */ /* Convert pcm format from pulse to alsa */ static const uint32_t g_format_convert_table[] = { [AUDIO_SAMPLE_U8] = SND_PCM_FORMAT_U8, @@ -260,6 +269,7 @@ static const uint32_t g_format_convert_table[] = { [AUDIO_SAMPLE_S24_32LE] = SND_PCM_FORMAT_S24_LE, [AUDIO_SAMPLE_S24_32BE] = SND_PCM_FORMAT_S24_BE }; +#endif uint32_t _convert_format(audio_sample_format_t format) { @@ -399,7 +409,7 @@ audio_return_t _audio_pcm_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_ AUDIO_LOG_WARN("Unable to set stop threshold: %s\n", snd_strerror(err)); goto error; } - if ((err = snd_pcm_sw_params_set_start_threshold(pcm, swparams, (snd_pcm_uframes_t) -1)) < 0) { + if ((err = snd_pcm_sw_params_set_start_threshold(pcm, swparams, (snd_pcm_uframes_t) avail_min)) < 0) { AUDIO_LOG_WARN("Unable to set start threshold: %s\n", snd_strerror(err)); goto error; } |