From dc15cec22a74aaa1a3bcd58534d5b2310a4250d7 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 30 Jan 2017 22:36:25 +0100 Subject: [PATCH] audio: Make speaker swap on screen rotation optional Change-Id: I73623629c4418bff8178793d856d8da98b694283 --- audio/audio_hw.c | 2 ++ audio/include/samsung_audio.h | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 7d6a1935..cd47e146 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -3767,6 +3767,7 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) adev->bluetooth_nrec = false; } +#if SWAP_SPEAKER_ON_SCREEN_ROTATION ret = str_parms_get_int(parms, "rotation", &val); if (ret >= 0) { bool reverse_speakers = false; @@ -3800,6 +3801,7 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) } pthread_mutex_unlock(&adev->lock); } +#endif /* SWAP_SPEAKER_ON_SCREEN_ROTATION */ str_parms_destroy(parms); diff --git a/audio/include/samsung_audio.h b/audio/include/samsung_audio.h index 6aaf4dff..46fe9898 100644 --- a/audio/include/samsung_audio.h +++ b/audio/include/samsung_audio.h @@ -44,5 +44,11 @@ #define SOUND_CAPTURE_HOTWORD_DEVICE 0 */ +/* + * If the device has stereo speakers and the speakers are arranged on + * different sides of the device you can activate this feature by + * setting it to 1. + */ +#define SWAP_SPEAKER_ON_SCREEN_ROTATION 0 #endif // SAMSUNG_AUDIO_H