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

Commit 0b1488e0 authored by Dhanalakshmi Siddani's avatar Dhanalakshmi Siddani
Browse files

hal: Add proxy support for BT playback

Changes to read decoded pcm data from DSP via proxy port.

CRs-Fixed: 1081411
Change-Id: Ia60e284de5e30b162dbde1705e263f17f4c5e187
parent 99b0e5d0
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -67,15 +67,7 @@ struct audio_extn_module {
    bool hifi_audio_enabled;
};

static struct audio_extn_module aextnmod = {
    .anc_enabled = 0,
    .aanc_enabled = 0,
    .custom_stereo_enabled = 0,
    .proxy_channel_num = 2,
    .hpx_enabled = 0,
    .vbat_enabled = 0,
    .hifi_audio_enabled = 0,
};
static struct audio_extn_module aextnmod;

#define AUDIO_PARAMETER_KEY_ANC        "anc_enabled"
#define AUDIO_PARAMETER_KEY_WFD        "wfd_channel_cap"
@@ -752,6 +744,17 @@ static int get_active_offload_usecases(const struct audio_device *adev,
    return ret;
}

void audio_extn_init(void)
{
    aextnmod.anc_enabled = 0;
    aextnmod.aanc_enabled = 0;
    aextnmod.custom_stereo_enabled = 0;
    aextnmod.proxy_channel_num = 2;
    aextnmod.hpx_enabled = 0;
    aextnmod.vbat_enabled = 0;
    aextnmod.hifi_audio_enabled = 0;
}

void audio_extn_set_parameters(struct audio_device *adev,
                               struct str_parms *parms)
{
+5 −0
Original line number Diff line number Diff line
@@ -44,6 +44,10 @@
#define AUDIO_DEVICE_OUT_PROXY 0x40000
#endif

#ifndef AUDIO_DEVICE_IN_PROXY
#define AUDIO_DEVICE_IN_PROXY (AUDIO_DEVICE_BIT_IN | 0x1000000)
#endif

#ifndef INCALL_MUSIC_ENABLED
#define AUDIO_OUTPUT_FLAG_INCALL_MUSIC 0x8000
#endif
@@ -501,6 +505,7 @@ int audio_extn_pm_vote (void);
void audio_extn_pm_unvote(void);
#endif

void audio_extn_init(void);
void audio_extn_utils_update_streams_cfg_lists(void *platform,
                                  struct mixer *mixer,
                                  struct listnode *streams_output_cfg_list,
+9 −0
Original line number Diff line number Diff line
@@ -4717,6 +4717,14 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
            ret = -EINVAL;
            goto err_open;
        }
    if ((in->device == AUDIO_DEVICE_IN_TELEPHONY_RX) &&
          (adev->mode != AUDIO_MODE_IN_CALL)) {
        ret = -EINVAL;
        goto err_open;
    }

    if ((in->device == AUDIO_DEVICE_IN_TELEPHONY_RX) ||
             (in->device == AUDIO_DEVICE_IN_PROXY)) {
        if (config->sample_rate == 0)
            config->sample_rate = AFE_PROXY_SAMPLING_RATE;
        if (config->sample_rate != 48000 && config->sample_rate != 16000 &&
@@ -5015,6 +5023,7 @@ static int adev_open(const hw_module_t *module, const char *name,
                                                        "visualizer_hal_stop_output");
        }
    }
    audio_extn_init();
    audio_extn_listen_init(adev, adev->snd_card);
    audio_extn_sound_trigger_init(adev);
    audio_extn_gef_init(adev);