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

Commit 474de5a7 authored by Ravi Kumar Alamanda's avatar Ravi Kumar Alamanda
Browse files

hal: add support for ull audio playback

Add a new use case and mixer paths to support ultra
low latency audio playback. This use case exercises the
ULL mode in the DSP.

CRs-Fixed: 892056
Change-Id: I6685dd0f346072029ca51e4ce92856a13e74ee76
parent ac2d7511
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -165,6 +165,7 @@ struct pcm_config pcm_config_afe_proxy_record = {
const char * const use_case_table[AUDIO_USECASE_MAX] = {
    [USECASE_AUDIO_PLAYBACK_DEEP_BUFFER] = "deep-buffer-playback",
    [USECASE_AUDIO_PLAYBACK_LOW_LATENCY] = "low-latency-playback",
    [USECASE_AUDIO_PLAYBACK_ULL]         = "audio-ull-playback",
    [USECASE_AUDIO_PLAYBACK_MULTI_CH]    = "multi-channel-playback",
    [USECASE_AUDIO_PLAYBACK_OFFLOAD] = "compress-offload-playback",
#ifdef MULTIPLE_OFFLOAD_ENABLED
@@ -3050,6 +3051,10 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
        out->usecase = USECASE_AUDIO_PLAYBACK_AFE_PROXY;
        out->config = pcm_config_afe_proxy_playback;
        adev->voice_tx_output = out;
    } else if (out->flags & AUDIO_OUTPUT_FLAG_RAW) {
        out->usecase = USECASE_AUDIO_PLAYBACK_ULL;
        out->config = pcm_config_low_latency;
        out->sample_rate = out->config.rate;
    } else if (out->flags & AUDIO_OUTPUT_FLAG_FAST) {
        format = AUDIO_FORMAT_PCM_16_BIT;
        out->usecase = USECASE_AUDIO_PLAYBACK_LOW_LATENCY;
@@ -3675,6 +3680,7 @@ static int period_size_is_plausible_for_low_latency(int period_size)
{
    switch (period_size) {
    case 160:
    case 192:
    case 240:
    case 320:
    case 480:
+1 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ enum {
    USECASE_AUDIO_PLAYBACK_OFFLOAD8,
    USECASE_AUDIO_PLAYBACK_OFFLOAD9,
#endif
    USECASE_AUDIO_PLAYBACK_ULL,

    USECASE_AUDIO_DIRECT_PCM_OFFLOAD,

+4 −1
Original line number Diff line number Diff line
@@ -233,6 +233,8 @@ static int pcm_device_table[AUDIO_USECASE_MAX][2] = {
                                            DEEP_BUFFER_PCM_DEVICE},
    [USECASE_AUDIO_PLAYBACK_LOW_LATENCY] = {LOWLATENCY_PCM_DEVICE,
                                           LOWLATENCY_PCM_DEVICE},
    [USECASE_AUDIO_PLAYBACK_ULL]         = {MULTIMEDIA3_PCM_DEVICE,
                                            MULTIMEDIA3_PCM_DEVICE},
    [USECASE_AUDIO_PLAYBACK_MULTI_CH] = {MULTIMEDIA2_PCM_DEVICE,
                                         MULTIMEDIA2_PCM_DEVICE},
    [USECASE_AUDIO_PLAYBACK_OFFLOAD] =
@@ -598,6 +600,7 @@ static char * backend_table[SND_DEVICE_MAX] = {0};
static struct name_to_index usecase_name_index[AUDIO_USECASE_MAX] = {
    {TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_DEEP_BUFFER)},
    {TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_LOW_LATENCY)},
    {TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_ULL)},
    {TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_MULTI_CH)},
    {TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_OFFLOAD)},
#ifdef MULTIPLE_OFFLOAD_ENABLED
+1 −0
Original line number Diff line number Diff line
@@ -217,6 +217,7 @@ enum {
#define DEEP_BUFFER_PCM_DEVICE 0
#define AUDIO_RECORD_PCM_DEVICE 0
#define MULTIMEDIA2_PCM_DEVICE 1
#define MULTIMEDIA3_PCM_DEVICE 4
#define FM_PLAYBACK_PCM_DEVICE 5
#define FM_CAPTURE_PCM_DEVICE  6
#define HFP_PCM_RX 5