mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-10 05:32:40 -05:00
hm60x/hm801: Fix balance by enabling sw volume control.
Change-Id: I8760b58d5b801409f35370d812d72f8d578d2889
This commit is contained in:
parent
2dd1f37a10
commit
6be8097651
4 changed files with 19 additions and 2 deletions
|
|
@ -23,9 +23,11 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "audio.h"
|
#include "audio.h"
|
||||||
#include "audiohw.h"
|
#include "audiohw.h"
|
||||||
|
#include "system.h"
|
||||||
|
#include "pcm_sw_volume.h"
|
||||||
|
|
||||||
const struct sound_settings_info audiohw_settings[] = {
|
const struct sound_settings_info audiohw_settings[] = {
|
||||||
[SOUND_VOLUME] = {"dB", 0, 1, -1, 0, 0},
|
[SOUND_VOLUME] = {"dB", 0, 1, VOLUME_MIN/10, VOLUME_MAX/10, 0},
|
||||||
/* HAVE_SW_TONE_CONTROLS */
|
/* HAVE_SW_TONE_CONTROLS */
|
||||||
[SOUND_BASS] = {"dB", 0, 1, -24, 24, 0},
|
[SOUND_BASS] = {"dB", 0, 1, -24, 24, 0},
|
||||||
[SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0},
|
[SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0},
|
||||||
|
|
@ -44,3 +46,13 @@ void audiohw_set_frequency(int fsel)
|
||||||
{
|
{
|
||||||
(void)fsel;
|
(void)fsel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_SW_VOLUME_CONTROL
|
||||||
|
void audiohw_set_master_vol(int vol_l, int vol_r)
|
||||||
|
{
|
||||||
|
/* SW volume for <= 1.0 gain, HW at unity, < VOLUME_MIN == MUTE */
|
||||||
|
int sw_volume_l = vol_l < VOLUME_MIN ? PCM_MUTE_LEVEL : MIN(vol_l, 0);
|
||||||
|
int sw_volume_r = vol_r < VOLUME_MIN ? PCM_MUTE_LEVEL : MIN(vol_r, 0);
|
||||||
|
pcm_set_master_volume(sw_volume_l, sw_volume_r);
|
||||||
|
}
|
||||||
|
#endif /* HAVE_SW_VOLUME_CONTROL */
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,8 @@
|
||||||
#define CONFIG_NAND NAND_RK27XX
|
#define CONFIG_NAND NAND_RK27XX
|
||||||
#define HAVE_SW_TONE_CONTROLS
|
#define HAVE_SW_TONE_CONTROLS
|
||||||
|
|
||||||
|
#define HAVE_SW_VOLUME_CONTROL
|
||||||
|
|
||||||
/* commented for now */
|
/* commented for now */
|
||||||
/* #define HAVE_HOTSWAP */
|
/* #define HAVE_HOTSWAP */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,8 @@
|
||||||
#define CONFIG_NAND NAND_RK27XX
|
#define CONFIG_NAND NAND_RK27XX
|
||||||
#define HAVE_SW_TONE_CONTROLS
|
#define HAVE_SW_TONE_CONTROLS
|
||||||
|
|
||||||
|
#define HAVE_SW_VOLUME_CONTROL
|
||||||
|
|
||||||
/* commented for now */
|
/* commented for now */
|
||||||
/* #define HAVE_HOTSWAP */
|
/* #define HAVE_HOTSWAP */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,9 @@
|
||||||
#ifndef __DUMMY_CODEC_H_
|
#ifndef __DUMMY_CODEC_H_
|
||||||
#define __DUMMY_CODEC_H_
|
#define __DUMMY_CODEC_H_
|
||||||
|
|
||||||
#define VOLUME_MIN -1
|
#define VOLUME_MIN -730
|
||||||
#define VOLUME_MAX 0
|
#define VOLUME_MAX 0
|
||||||
|
|
||||||
|
void audiohw_set_master_vol(int vol_l, int vol_r);
|
||||||
|
|
||||||
#endif /* __DUMMY_CODEC_H_ */
|
#endif /* __DUMMY_CODEC_H_ */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue