From fc5a515f9b0f9a9c471edea3ad29bdf90e7fd37a Mon Sep 17 00:00:00 2001 From: Kyle Repinski Date: Mon, 13 Oct 2014 04:40:11 -0500 Subject: tuna: Proper 48kHz audio support. This fixes a bunch of annoying junk in the logcat about fast path being denied to UI sounds due to them having a 48000Hz sample rate. Also allows playback of 96kHz audio, as Android refuses to resample to anything lower than a divide by two. --- audio/audio_hw.c | 2 +- audio/audio_policy.conf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/audio/audio_hw.c b/audio/audio_hw.c index c4c4b76..ba8a81d 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -216,7 +216,7 @@ /* minimum sleep time in out_write() when write threshold is not reached */ #define MIN_WRITE_SLEEP_US 5000 -#define DEFAULT_OUT_SAMPLING_RATE 44100 // 48000 is possible but interacts poorly with HDMI +#define DEFAULT_OUT_SAMPLING_RATE 48000 // TODO: Check with HDMI. /* sampling rate when using MM low power port */ #define MM_LOW_POWER_SAMPLING_RATE 44100 diff --git a/audio/audio_policy.conf b/audio/audio_policy.conf index a782448..3131fa7 100644 --- a/audio/audio_policy.conf +++ b/audio/audio_policy.conf @@ -23,14 +23,14 @@ audio_hw_modules { primary { outputs { primary { - sampling_rates 44100 + sampling_rates 44100|48000 channel_masks AUDIO_CHANNEL_OUT_STEREO formats AUDIO_FORMAT_PCM_16_BIT devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET flags AUDIO_OUTPUT_FLAG_PRIMARY } deep_buffer { - sampling_rates 44100 + sampling_rates 44100|48000 channel_masks AUDIO_CHANNEL_OUT_STEREO formats AUDIO_FORMAT_PCM_16_BIT devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE -- cgit v1.1