diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-09-30 18:21:38 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-09-30 21:37:11 -0400 |
commit | 01650b8bc9e400d3b90ebfba403033c7a87bc35e (patch) | |
tree | 573c00d9d652a8bb9da9ac5c3d606d819b676e9a /firmware/export/config_caps.h | |
parent | c2c59457e132c1d296d23363d1fb3757cdbf2080 (diff) | |
download | rockbox-01650b8bc9e400d3b90ebfba403033c7a87bc35e.tar.gz rockbox-01650b8bc9e400d3b90ebfba403033c7a87bc35e.zip |
audio: Add support for 192 and 176KHz playback
* SAMPR_CAPS_ALL -> SAMPR_CAPS_ALL_48/96/192
* All targets claiming SAMPR_CAPS_ALL now get appropriate subset
* No need to explicitly define HAVE_PLAY_FREQ
* Rates that are a multiple of 44 or 48KHz can be used for playback
Inspired by a patch by Roman Stolyarov, but substantially rewritten by myself.
Change-Id: Iaca7363521b1cb9921e047ba1004d3cbe9c9c23e
Diffstat (limited to 'firmware/export/config_caps.h')
-rw-r--r-- | firmware/export/config_caps.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/firmware/export/config_caps.h b/firmware/export/config_caps.h index bc0a42bedf..fe32e4953c 100644 --- a/firmware/export/config_caps.h +++ b/firmware/export/config_caps.h | |||
@@ -122,7 +122,6 @@ | |||
122 | #include "pcm_sampr.h" | 122 | #include "pcm_sampr.h" |
123 | #undef PCM_SAMPR_CONFIG_ONLY | 123 | #undef PCM_SAMPR_CONFIG_ONLY |
124 | 124 | ||
125 | #define PLAY_SAMPR_CAPS (HW_SAMPR_CAPS & (SAMPR_CAP_44 | SAMPR_CAP_48)) | ||
126 | /** | 125 | /** |
127 | * PLAY_SAMPR_MIN: The minimum allowable samplerate for global playback. | 126 | * PLAY_SAMPR_MIN: The minimum allowable samplerate for global playback. |
128 | * Music won't play at a lower rate. | 127 | * Music won't play at a lower rate. |
@@ -133,18 +132,30 @@ | |||
133 | * as the DSP core. DSP never exceeds *MAX to lessen | 132 | * as the DSP core. DSP never exceeds *MAX to lessen |
134 | * buffer allocation demands and overhead. | 133 | * buffer allocation demands and overhead. |
135 | */ | 134 | */ |
136 | #if PLAY_SAMPR_CAPS & (PLAY_SAMPR_CAPS - 1) | 135 | #if (HW_SAMPR_CAPS & SAMPR_CAP_192) |
137 | #define HAVE_PLAY_FREQ | 136 | #define HAVE_PLAY_FREQ 192 |
137 | # define PLAY_SAMPR_MIN SAMPR_44 | ||
138 | # define PLAY_SAMPR_MAX SAMPR_192 | ||
139 | # define PLAY_SAMPR_DEFAULT SAMPR_44 | ||
140 | # define PLAY_SAMPR_HW_MIN HW_SAMPR_MIN | ||
141 | #elif (HW_SAMPR_CAPS & SAMPR_CAP_96) | ||
142 | #define HAVE_PLAY_FREQ 96 | ||
143 | # define PLAY_SAMPR_MIN SAMPR_44 | ||
144 | # define PLAY_SAMPR_MAX SAMPR_96 | ||
145 | # define PLAY_SAMPR_DEFAULT SAMPR_44 | ||
146 | # define PLAY_SAMPR_HW_MIN HW_SAMPR_MIN | ||
147 | #elif ((HW_SAMPR_CAPS & (SAMPR_CAP_48 | SAMPR_CAP_44)) == (SAMPR_CAP_48 | SAMPR_CAP_44)) | ||
148 | #define HAVE_PLAY_FREQ 48 | ||
138 | # define PLAY_SAMPR_MIN SAMPR_44 | 149 | # define PLAY_SAMPR_MIN SAMPR_44 |
139 | # define PLAY_SAMPR_MAX SAMPR_48 | 150 | # define PLAY_SAMPR_MAX SAMPR_48 |
140 | # define PLAY_SAMPR_DEFAULT SAMPR_44 | 151 | # define PLAY_SAMPR_DEFAULT SAMPR_44 |
141 | # define PLAY_SAMPR_HW_MIN HW_SAMPR_MIN | 152 | # define PLAY_SAMPR_HW_MIN HW_SAMPR_MIN |
142 | #elif PLAY_SAMPR_CAPS & SAMPR_CAP_44 | 153 | #elif (HW_SAMPR_CAPS & SAMPR_CAP_44) |
143 | # define PLAY_SAMPR_MIN SAMPR_44 | 154 | # define PLAY_SAMPR_MIN SAMPR_44 |
144 | # define PLAY_SAMPR_MAX SAMPR_44 | 155 | # define PLAY_SAMPR_MAX SAMPR_44 |
145 | # define PLAY_SAMPR_DEFAULT SAMPR_44 | 156 | # define PLAY_SAMPR_DEFAULT SAMPR_44 |
146 | # define PLAY_SAMPR_HW_MIN HW_SAMPR_MIN | 157 | # define PLAY_SAMPR_HW_MIN HW_SAMPR_MIN |
147 | #elif PLAY_SAMPR_CAPS & SAMPR_CAP_48 | 158 | #elif (HW_SAMPR_CAPS & SAMPR_CAP_48) |
148 | # define PLAY_SAMPR_MIN SAMPR_48 | 159 | # define PLAY_SAMPR_MIN SAMPR_48 |
149 | # define PLAY_SAMPR_MAX SAMPR_48 | 160 | # define PLAY_SAMPR_MAX SAMPR_48 |
150 | # define PLAY_SAMPR_DEFAULT SAMPR_48 | 161 | # define PLAY_SAMPR_DEFAULT SAMPR_48 |