Fix f5a5b94 errors. Employ SW volume for select targets on SIM.

Onda VX747 sim was missing a limits #define; #include limits.h in
pcm_sw_volume.h.

Simply use the software volume control for the SIM volume control
rather than the SDL volume control when the target would have it
natively.

Change-Id: I8e924a2ff1b410f602452d2ea9b691efb82c931e
This commit is contained in:
Michael Sevakis 2013-04-11 18:57:06 -04:00
parent f5a5b94686
commit 2dd1f37a10
4 changed files with 27 additions and 3 deletions

View file

@ -29,6 +29,14 @@
* SDL. if we used DSP we would run code that doesn't actually run on the target
**/
#ifdef HAVE_SW_VOLUME_CONTROL
#include "pcm_sw_volume.h"
void audiohw_set_master_vol(int vol_l, int vol_r)
{
pcm_set_master_volume(vol_l, vol_r);
}
#else /* ndef HAVE_SW_VOLUME_CONTROL */
extern void pcm_set_mixer_volume(int);
void audiohw_set_volume(int volume)
@ -44,6 +52,7 @@ void audiohw_set_volume(int volume)
(void)volume;
#endif /* CONFIG_CODEC == SWCODEC */
}
#endif /* HAVE_SW_VOLUME_CONTROL */
const struct sound_settings_info audiohw_settings[] = {
[SOUND_VOLUME] = {"dB", 0, 1, VOLUME_MIN / 10, VOLUME_MAX / 10, -25},
@ -129,7 +138,13 @@ const struct sound_settings_info audiohw_settings[] = {
**/
#if defined(AUDIOHW_HAVE_PRESCALER)
void audiohw_set_prescaler(int value) { (void)value; }
void audiohw_set_prescaler(int value)
{
#ifdef HAVE_SW_VOLUME_CONTROL
pcm_set_prescaler(value);
#endif
(void)value;
}
#endif
#if defined(AUDIOHW_HAVE_BALANCE)
void audiohw_set_balance(int value) { (void)value; }

View file

@ -24,6 +24,7 @@
#ifdef HAVE_SW_VOLUME_CONTROL
#include <audiohw.h>
#include <limits.h>
#define PCM_MUTE_LEVEL INT_MIN

View file

@ -235,8 +235,10 @@ static void set_prescaled_volume(void)
}
/* ypr0 with sdl has separate volume controls */
#if !defined(HAVE_SDL_AUDIO) || defined(SAMSUNG_YPR0)
#if defined(HAVE_SW_VOLUME_CONTROL) || defined(HAVE_JZ4740_CODEC)
#if defined(HAVE_SW_VOLUME_CONTROL)
audiohw_set_master_vol(l, r);
#elif !defined(HAVE_SDL_AUDIO) || defined(SAMSUNG_YPR0)
#if defined(HAVE_JZ4740_CODEC)
audiohw_set_master_vol(l, r);
#elif CONFIG_CODEC == MAS3507D
dac_volume(tenthdb2reg(l), tenthdb2reg(r), false);

View file

@ -51,7 +51,11 @@
extern bool debug_audio;
#endif
#ifdef HAVE_SW_VOLUME_CONTROL
static int sim_volume = SDL_MIX_MAXVOLUME;
#else
static int sim_volume = 0;
#endif
#if CONFIG_CODEC == SWCODEC
static int cvt_status = -1;
@ -414,9 +418,11 @@ void pcm_play_dma_postinit(void)
{
}
#ifndef HAVE_SW_VOLUME_CONTROL
void pcm_set_mixer_volume(int volume)
{
sim_volume = volume;
}
#endif /* HAVE_SW_VOLUME_CONTROL */
#endif /* CONFIG_CODEC == SWCODEC */