Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 35e70651 authored by BeYkeRYkt's avatar BeYkeRYkt Committed by Michael Bestas
Browse files

hal: msm8974: Use stereo recording depending on camera orientation

* The 4b084132 commit ("select camcorder snd device according to camera
  orientation") adds the ability to configure microphones depending on
  camera orientation. Use this option to select the desired device for stereo
  video recording depending on the orientation of the camera.
* Use SND_DEVICE_IN_SPEAKER_DMIC_STEREO for CAMERA_BACK_LANDSCAPE as a
  standard device, since in this camera position it is more advantageous
  to connect the 'speaker-mic' first to avoid inverted audio channels.
* For full-fledged work, you need to set "ro.audio.monitorRotation=true"
  to listen to the orientation of the device or manually send parameters
  via AudioManager.

Change-Id: Ieb217c47d48771970a800b93eefafeb20493fee4
parent b4ba737e
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -7405,7 +7405,22 @@ snd_device_t platform_get_input_snd_device(void *platform,
                if ((my_data->fluence_type & FLUENCE_DUAL_MIC) &&
                    (my_data->source_mic_type & SOURCE_DUAL_MIC) &&
                    (channel_count == 2))
                    switch (adev->camera_orientation) {
                        case CAMERA_BACK_LANDSCAPE:
                        case CAMERA_FRONT_INVERT_LANDSCAPE:
                            snd_device = SND_DEVICE_IN_SPEAKER_DMIC_STEREO;
                            break;
                        case CAMERA_BACK_INVERT_LANDSCAPE:
                        case CAMERA_BACK_PORTRAIT:
                        case CAMERA_FRONT_LANDSCAPE:
                        case CAMERA_FRONT_PORTRAIT:
                            snd_device = SND_DEVICE_IN_HANDSET_DMIC_STEREO;
                            break;
                        default:
                            ALOGW("%s: invalid camera orientation %08x", __func__, adev->camera_orientation);
                            snd_device = SND_DEVICE_IN_HANDSET_DMIC_STEREO;
                            break;
                    }
                else
                    switch (adev->camera_orientation) {
                        case CAMERA_BACK_LANDSCAPE: