diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2019-08-07 17:16:48 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2019-08-08 22:37:30 +0200 |
commit | 5b23c9eb0a97534f0d0fc3aa0c1ad302199eb8dc (patch) | |
tree | 7151fdb71b085b9a43113832c0d478b84bfbbf49 /apps/plugins/mikmod | |
parent | a430e275dddab24059ba15d2621e518562392540 (diff) | |
download | rockbox-5b23c9eb0a97534f0d0fc3aa0c1ad302199eb8dc.tar.gz rockbox-5b23c9eb0a97534f0d0fc3aa0c1ad302199eb8dc.zip |
Introduce HW_SAMPR_MIN_GE_22 macro
Gives us the lowest HW sample rate that's >= 22KHz.
Needed because some targets that don't support 22K support 11K or 8K, so
HW_SAMPR_MIN will give us much lower quality than is acceptable.
Take advantage of this new macro in the SDL, MIDI, and MIKMOD plugins,
and implement a crude "fast enough" test to enable higher sample rates
on more capable targets.
Change-Id: I6ad38026fb3410c62da028e78512e027729bb851
Diffstat (limited to 'apps/plugins/mikmod')
-rw-r--r-- | apps/plugins/mikmod/mikmod_supp.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/apps/plugins/mikmod/mikmod_supp.h b/apps/plugins/mikmod/mikmod_supp.h index 29fa7ebf35..ad8aaafebc 100644 --- a/apps/plugins/mikmod/mikmod_supp.h +++ b/apps/plugins/mikmod/mikmod_supp.h | |||
@@ -63,8 +63,29 @@ int mmsupp_sprintf(char *buf, const char *fmt, ... ); | |||
63 | 63 | ||
64 | extern const struct plugin_api * rb; | 64 | extern const struct plugin_api * rb; |
65 | 65 | ||
66 | #ifdef SIMULATOR | ||
66 | 67 | ||
67 | #define SAMPLE_RATE SAMPR_44 /* 44100 */ | 68 | #define SAMPLE_RATE SAMPR_44 /* Required by Simulator */ |
69 | |||
70 | #elif ((CONFIG_PLATFORM & PLATFORM_HOSTED) || defined(CPU_MIPS)) | ||
71 | |||
72 | #define SAMPLE_RATE SAMPR_44 /* All MIPS and hosted targets are fast */ | ||
73 | |||
74 | #elif defined(CPU_ARM) | ||
75 | |||
76 | /* Treat ARMv5+ as fast */ | ||
77 | #if (ARM_ARCH >= 5) | ||
78 | #define SAMPLE_RATE SAMPR_44 | ||
79 | #else | ||
80 | #define SAMPLE_RATE SAMPR_MIN_GE_22 | ||
81 | #endif | ||
82 | |||
83 | #else /* !CPU_ARM */ | ||
84 | |||
85 | /* Treat everyone else as slow */ | ||
86 | #define SAMPLE_RATE HW_SAMPR_MIN_GE_22 | ||
87 | |||
88 | #endif /* !SIMULATOR */ | ||
68 | 89 | ||
69 | #define BUF_SIZE 4096*8 | 90 | #define BUF_SIZE 4096*8 |
70 | #define NBUF 2 | 91 | #define NBUF 2 |