diff options
-rw-r--r-- | firmware/drivers/audio/android.c | 26 | ||||
-rw-r--r-- | firmware/drivers/audio/sdl.c | 4 | ||||
-rw-r--r-- | firmware/drivers/audio/tlv320.c | 15 | ||||
-rw-r--r-- | firmware/export/hosted_codec.h | 23 | ||||
-rw-r--r-- | firmware/export/tlv320.h | 13 | ||||
-rw-r--r-- | firmware/export/wm8975.h | 2 | ||||
-rw-r--r-- | uisimulator/common/stubs.c | 5 |
7 files changed, 26 insertions, 62 deletions
diff --git a/firmware/drivers/audio/android.c b/firmware/drivers/audio/android.c index ff36ca21d9..7a5f34ea48 100644 --- a/firmware/drivers/audio/android.c +++ b/firmware/drivers/audio/android.c | |||
@@ -23,32 +23,6 @@ | |||
23 | #include "config.h" | 23 | #include "config.h" |
24 | #include "audiohw.h" | 24 | #include "audiohw.h" |
25 | 25 | ||
26 | const struct sound_settings_info audiohw_settings[] = { | ||
27 | [SOUND_VOLUME] = {"dB", 0, 1, VOLUME_MIN / 10, VOLUME_MAX / 10, -25}, | ||
28 | /* Bass and treble tone controls */ | ||
29 | #ifdef AUDIOHW_HAVE_BASS | ||
30 | [SOUND_BASS] = {"dB", 0, 1, -24, 24, 0}, | ||
31 | #endif | ||
32 | #ifdef AUDIOHW_HAVE_TREBLE | ||
33 | [SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0}, | ||
34 | #endif | ||
35 | [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0}, | ||
36 | [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0}, | ||
37 | [SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100}, | ||
38 | #if defined(HAVE_RECORDING) | ||
39 | [SOUND_LEFT_GAIN] = {"dB", 1, 1,-128, 96, 0}, | ||
40 | [SOUND_RIGHT_GAIN] = {"dB", 1, 1,-128, 96, 0}, | ||
41 | [SOUND_MIC_GAIN] = {"dB", 1, 1,-128, 108, 16}, | ||
42 | #endif | ||
43 | #if defined(AUDIOHW_HAVE_BASS_CUTOFF) | ||
44 | [SOUND_BASS_CUTOFF] = {"", 0, 1, 1, 4, 1}, | ||
45 | #endif | ||
46 | #if defined(AUDIOHW_HAVE_TREBLE_CUTOFF) | ||
47 | [SOUND_TREBLE_CUTOFF] = {"", 0, 1, 1, 4, 1}, | ||
48 | #endif | ||
49 | }; | ||
50 | |||
51 | |||
52 | void audiohw_set_volume(int volume) | 26 | void audiohw_set_volume(int volume) |
53 | { | 27 | { |
54 | extern void pcm_set_mixer_volume(int); | 28 | extern void pcm_set_mixer_volume(int); |
diff --git a/firmware/drivers/audio/sdl.c b/firmware/drivers/audio/sdl.c index eea10ad12c..dfc77378bd 100644 --- a/firmware/drivers/audio/sdl.c +++ b/firmware/drivers/audio/sdl.c | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | #include <SDL_audio.h> | 22 | #include <SDL_audio.h> |
23 | #include "config.h" | 23 | #include "config.h" |
24 | #include "audiohw.h" | 24 | #include "sound.h" |
25 | #include "pcm_sampr.h" | 25 | #include "pcm_sampr.h" |
26 | 26 | ||
27 | /** | 27 | /** |
@@ -85,6 +85,8 @@ void audiohw_set_treble(int value) { (void)value; } | |||
85 | #if CONFIG_CODEC != SWCODEC | 85 | #if CONFIG_CODEC != SWCODEC |
86 | void audiohw_set_channel(int value) { (void)value; } | 86 | void audiohw_set_channel(int value) { (void)value; } |
87 | void audiohw_set_stereo_width(int value){ (void)value; } | 87 | void audiohw_set_stereo_width(int value){ (void)value; } |
88 | void audiohw_set_pitch(int32_t value) { (void)value; } | ||
89 | int32_t audiohw_get_pitch(void) { return PITCH_SPEED_100; } | ||
88 | #endif | 90 | #endif |
89 | #if defined(AUDIOHW_HAVE_BASS_CUTOFF) | 91 | #if defined(AUDIOHW_HAVE_BASS_CUTOFF) |
90 | void audiohw_set_bass_cutoff(int value) { (void)value; } | 92 | void audiohw_set_bass_cutoff(int value) { (void)value; } |
diff --git a/firmware/drivers/audio/tlv320.c b/firmware/drivers/audio/tlv320.c index 23d2fea3a1..6118734d37 100644 --- a/firmware/drivers/audio/tlv320.c +++ b/firmware/drivers/audio/tlv320.c | |||
@@ -31,21 +31,6 @@ | |||
31 | #endif | 31 | #endif |
32 | #include "audiohw.h" | 32 | #include "audiohw.h" |
33 | 33 | ||
34 | const struct sound_settings_info audiohw_settings[] = { | ||
35 | [SOUND_VOLUME] = {"dB", 0, 1, -73, 6, -20}, | ||
36 | /* HAVE_SW_TONE_CONTROLS */ | ||
37 | [SOUND_BASS] = {"dB", 0, 1, -24, 24, 0}, | ||
38 | [SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0}, | ||
39 | [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0}, | ||
40 | [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0}, | ||
41 | [SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100}, | ||
42 | #ifdef HAVE_RECORDING | ||
43 | [SOUND_LEFT_GAIN] = {"dB", 1, 1, 0, 31, 23}, | ||
44 | [SOUND_RIGHT_GAIN] = {"dB", 1, 1, 0, 31, 23}, | ||
45 | [SOUND_MIC_GAIN] = {"dB", 1, 1, 0, 1, 1}, | ||
46 | #endif | ||
47 | }; | ||
48 | |||
49 | /* convert tenth of dB volume (-73..6) to master volume register value */ | 34 | /* convert tenth of dB volume (-73..6) to master volume register value */ |
50 | static int vol_tenthdb2hw(int db) | 35 | static int vol_tenthdb2hw(int db) |
51 | { | 36 | { |
diff --git a/firmware/export/hosted_codec.h b/firmware/export/hosted_codec.h index 50d1281394..62a4d57613 100644 --- a/firmware/export/hosted_codec.h +++ b/firmware/export/hosted_codec.h | |||
@@ -25,6 +25,27 @@ | |||
25 | #define VOLUME_MAX 0 | 25 | #define VOLUME_MAX 0 |
26 | 26 | ||
27 | #define AUDIOHW_CAPS (MONO_VOL_CAP) | 27 | #define AUDIOHW_CAPS (MONO_VOL_CAP) |
28 | AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -100, 0, 0) | 28 | AUDIOHW_SETTING(VOLUME, "dB", 0, 1,-100, 0, 0) |
29 | |||
30 | #if (CONFIG_PLATFORM & PLATFORM_ANDROID) | ||
31 | /* Bass and treble tone controls */ | ||
32 | #ifdef AUDIOHW_HAVE_BASS | ||
33 | AUDIOHW_SETTING(BASS, "dB", 0, 1, -24, 24, 0) | ||
34 | #endif | ||
35 | #ifdef AUDIOHW_HAVE_TREBLE | ||
36 | AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -24, 24, 0) | ||
37 | #endif | ||
38 | #if defined(HAVE_RECORDING) | ||
39 | AUDIOHW_SETTING(LEFT_GAIN, "dB", 1, 1,-128, 96, 0) | ||
40 | AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1,-128, 96, 0) | ||
41 | AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1,-128, 108, 16) | ||
42 | #endif | ||
43 | #if defined(AUDIOHW_HAVE_BASS_CUTOFF) | ||
44 | AUDIOHW_SETTING(BASS_CUTOFF, "", 0, 1, 1, 4, 1) | ||
45 | #endif | ||
46 | #if defined(AUDIOHW_HAVE_TREBLE_CUTOFF) | ||
47 | AUDIOHW_SETTING(TREBLE_CUTOFF, "", 0, 1, 1, 4, 1) | ||
48 | #endif | ||
49 | /* CONFIG_PLATFORM & PLATFORM_ANDROID */ | ||
29 | 50 | ||
30 | #endif /* HOSTED_CODEC_H */ \ No newline at end of file | 51 | #endif /* HOSTED_CODEC_H */ \ No newline at end of file |
diff --git a/firmware/export/tlv320.h b/firmware/export/tlv320.h index 99359f72ce..ea7ccfceb2 100644 --- a/firmware/export/tlv320.h +++ b/firmware/export/tlv320.h | |||
@@ -36,19 +36,6 @@ AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1, 0, 31, 23, (val - 23) * 15) | |||
36 | AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 1, 1, val * 200) | 36 | AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 1, 1, val * 200) |
37 | #endif /* HAVE_RECORDING */ | 37 | #endif /* HAVE_RECORDING */ |
38 | 38 | ||
39 | static inline int _param_2_phys(int setting, int value) | ||
40 | { | ||
41 | switch(setting) | ||
42 | { | ||
43 | default: return value; | ||
44 | #ifdef HAVE_RECORDING | ||
45 | case SOUND_LEFT_GAIN: | ||
46 | case SOUND_RIGHT_GAIN: return (value - 23) * 15; | ||
47 | case SOUND_MIC_GAIN: return value * 200; /* 0 or 20 dB */ | ||
48 | #endif | ||
49 | } | ||
50 | } | ||
51 | |||
52 | /*** definitions ***/ | 39 | /*** definitions ***/ |
53 | #define HEADPHONE_MUTE 0x30 /* 0110000 = -73db */ | 40 | #define HEADPHONE_MUTE 0x30 /* 0110000 = -73db */ |
54 | 41 | ||
diff --git a/firmware/export/wm8975.h b/firmware/export/wm8975.h index f4e0d203a1..bc0d113c4c 100644 --- a/firmware/export/wm8975.h +++ b/firmware/export/wm8975.h | |||
@@ -34,7 +34,7 @@ AUDIOHW_SETTING(BASS, "dB", 0, 1, -6, 9, 0) | |||
34 | AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -6, 9, 0) | 34 | AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -6, 9, 0) |
35 | #ifdef HAVE_RECORDING | 35 | #ifdef HAVE_RECORDING |
36 | AUDIOHW_SETTING(LEFT_GAIN, "dB", 1, 1, 0, 63, 23, ((val - 23) * 15) / 2) | 36 | AUDIOHW_SETTING(LEFT_GAIN, "dB", 1, 1, 0, 63, 23, ((val - 23) * 15) / 2) |
37 | AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1, 0, 63, 23, ((val - 23) * 15) / 2)) | 37 | AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1, 0, 63, 23, ((val - 23) * 15) / 2) |
38 | AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 63, 0, ((val - 23) * 15) / 2 + 200) | 38 | AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 63, 0, ((val - 23) * 15) / 2 + 200) |
39 | #endif /* HAVE_RECORDING */ | 39 | #endif /* HAVE_RECORDING */ |
40 | 40 | ||
diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c index 1404c1e21b..51706ca3d5 100644 --- a/uisimulator/common/stubs.c +++ b/uisimulator/common/stubs.c | |||
@@ -145,11 +145,6 @@ void audiohw_set_superbass(int value) | |||
145 | { | 145 | { |
146 | (void)value; | 146 | (void)value; |
147 | } | 147 | } |
148 | |||
149 | void audiohw_set_pitch(unsigned long value) | ||
150 | { | ||
151 | (void)value; | ||
152 | } | ||
153 | #endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */ | 148 | #endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */ |
154 | #endif /* CODEC != SWCODEC */ | 149 | #endif /* CODEC != SWCODEC */ |
155 | 150 | ||