From 01650b8bc9e400d3b90ebfba403033c7a87bc35e Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 30 Sep 2020 18:21:38 -0400 Subject: 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 --- firmware/export/config_caps.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'firmware/export/config_caps.h') 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 @@ #include "pcm_sampr.h" #undef PCM_SAMPR_CONFIG_ONLY -#define PLAY_SAMPR_CAPS (HW_SAMPR_CAPS & (SAMPR_CAP_44 | SAMPR_CAP_48)) /** * PLAY_SAMPR_MIN: The minimum allowable samplerate for global playback. * Music won't play at a lower rate. @@ -133,18 +132,30 @@ * as the DSP core. DSP never exceeds *MAX to lessen * buffer allocation demands and overhead. */ -#if PLAY_SAMPR_CAPS & (PLAY_SAMPR_CAPS - 1) -#define HAVE_PLAY_FREQ +#if (HW_SAMPR_CAPS & SAMPR_CAP_192) +#define HAVE_PLAY_FREQ 192 +# define PLAY_SAMPR_MIN SAMPR_44 +# define PLAY_SAMPR_MAX SAMPR_192 +# define PLAY_SAMPR_DEFAULT SAMPR_44 +# define PLAY_SAMPR_HW_MIN HW_SAMPR_MIN +#elif (HW_SAMPR_CAPS & SAMPR_CAP_96) +#define HAVE_PLAY_FREQ 96 +# define PLAY_SAMPR_MIN SAMPR_44 +# define PLAY_SAMPR_MAX SAMPR_96 +# define PLAY_SAMPR_DEFAULT SAMPR_44 +# define PLAY_SAMPR_HW_MIN HW_SAMPR_MIN +#elif ((HW_SAMPR_CAPS & (SAMPR_CAP_48 | SAMPR_CAP_44)) == (SAMPR_CAP_48 | SAMPR_CAP_44)) +#define HAVE_PLAY_FREQ 48 # define PLAY_SAMPR_MIN SAMPR_44 # define PLAY_SAMPR_MAX SAMPR_48 # define PLAY_SAMPR_DEFAULT SAMPR_44 # define PLAY_SAMPR_HW_MIN HW_SAMPR_MIN -#elif PLAY_SAMPR_CAPS & SAMPR_CAP_44 +#elif (HW_SAMPR_CAPS & SAMPR_CAP_44) # define PLAY_SAMPR_MIN SAMPR_44 # define PLAY_SAMPR_MAX SAMPR_44 # define PLAY_SAMPR_DEFAULT SAMPR_44 # define PLAY_SAMPR_HW_MIN HW_SAMPR_MIN -#elif PLAY_SAMPR_CAPS & SAMPR_CAP_48 +#elif (HW_SAMPR_CAPS & SAMPR_CAP_48) # define PLAY_SAMPR_MIN SAMPR_48 # define PLAY_SAMPR_MAX SAMPR_48 # define PLAY_SAMPR_DEFAULT SAMPR_48 -- cgit v1.2.3