summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorKyle Repinski <repinski23@gmail.com>2015-03-20 14:29:11 -0500
committerZiyan <jaraidaniel@gmail.com>2016-01-15 12:27:24 +0100
commit8f32315cd6df137be596c70952165343e2cd1b68 (patch)
treeb41851416deade991be2791f8bbc3f261dc6e21c /audio
parent99f831a93a267f9c97257bd53e6ca6b757ebbefb (diff)
downloaddevice_samsung_tuna-8f32315cd6df137be596c70952165343e2cd1b68.zip
device_samsung_tuna-8f32315cd6df137be596c70952165343e2cd1b68.tar.gz
device_samsung_tuna-8f32315cd6df137be596c70952165343e2cd1b68.tar.bz2
audio: Fix PLAYBACK_PERIOD_COUNT and OUT_RESAMPLER definition detection.
By moving this block down, the sampling rates are properly defined for this check.
Diffstat (limited to 'audio')
-rw-r--r--audio/audio_hw.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 1776de1..90748e4 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -171,25 +171,6 @@
/* default number of channels for HDMI multichannel output */
#define HDMI_MULTI_DEFAULT_CHANNEL_COUNT 6
-/* Number of pseudo periods for low latency playback.
- * These are called "pseudo" periods in that they are not known as periods by ALSA.
- * Formerly, ALSA was configured in MMAP mode with 2 large periods, and this
- * number was set to 4 (2 didn't work).
- * The short periods size and count were only known by the audio HAL.
- * Now for low latency, we are using non-MMAP mode and can set this to 2.
- */
-#ifdef PLAYBACK_MMAP
-#define PLAYBACK_SHORT_PERIOD_COUNT 4
-/* If sample rate converter is required, then use triple-buffering to
- * help mask the variance in cycle times. Otherwise use double-buffering.
- */
-#elif DEFAULT_OUT_SAMPLING_RATE != MM_FULL_POWER_SAMPLING_RATE
-#define PLAYBACK_SHORT_PERIOD_COUNT 3
-#define OUT_RESAMPLER
-#else
-#define PLAYBACK_SHORT_PERIOD_COUNT 2
-#endif
-
/* write function */
#ifdef PLAYBACK_MMAP
#define PCM_WRITE pcm_mmap_write
@@ -242,6 +223,25 @@
/* sampling rate when using VX port for wide band */
#define VX_WB_SAMPLING_RATE 16000
+/* Number of pseudo periods for low latency playback.
+ * These are called "pseudo" periods in that they are not known as periods by ALSA.
+ * Formerly, ALSA was configured in MMAP mode with 2 large periods, and this
+ * number was set to 4 (2 didn't work).
+ * The short periods size and count were only known by the audio HAL.
+ * Now for low latency, we are using non-MMAP mode and can set this to 2.
+ */
+#ifdef PLAYBACK_MMAP
+#define PLAYBACK_SHORT_PERIOD_COUNT 4
+/* If sample rate converter is required, then use triple-buffering to
+ * help mask the variance in cycle times. Otherwise use double-buffering.
+ */
+#elif DEFAULT_OUT_SAMPLING_RATE != MM_FULL_POWER_SAMPLING_RATE
+#define PLAYBACK_SHORT_PERIOD_COUNT 3
+#define OUT_RESAMPLER
+#else
+#define PLAYBACK_SHORT_PERIOD_COUNT 2
+#endif
+
/* conversions from dB to ABE and codec gains */
#define DB_TO_ABE_GAIN(x) ((x) + MIXER_ABE_GAIN_0DB)
#define DB_TO_CAPTURE_PREAMPLIFIER_VOLUME(x) (((x) + 6) / 6)