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

Commit f15123fa authored by Quinn Male's avatar Quinn Male Committed by Gerrit - the friendly Code Review server
Browse files

hal: Add support to send playback events to sound trigger hal

Send events to sound trigger hal based on usecase.  Also add
playback offload2 to the list of usecases that need an event.

Change-Id: I4953c8bddbe839479e5ece16223097b989838908
parent 653aaefa
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4764,6 +4764,7 @@ bool platform_sound_trigger_usecase_needs_event(audio_usecase_t uc_id)
    case USECASE_AUDIO_PLAYBACK_DEEP_BUFFER:
    case USECASE_AUDIO_PLAYBACK_MULTI_CH:
    case USECASE_AUDIO_PLAYBACK_OFFLOAD:
    case USECASE_AUDIO_PLAYBACK_OFFLOAD2:
        needs_event = true;
        break;
    /* concurrent playback in low latency allowed */
+48 −2
Original line number Diff line number Diff line
@@ -4697,9 +4697,55 @@ bool platform_sound_trigger_device_needs_event(snd_device_t snd_device)
    return needs_event;
}

bool platform_sound_trigger_usecase_needs_event(audio_usecase_t uc_id __unused)
bool platform_sound_trigger_usecase_needs_event(audio_usecase_t uc_id)
{
    return false;
    bool needs_event = false;

    switch(uc_id){
    /* concurrent playback usecases needs event */
    case USECASE_AUDIO_PLAYBACK_DEEP_BUFFER:
    case USECASE_AUDIO_PLAYBACK_MULTI_CH:
    case USECASE_AUDIO_PLAYBACK_OFFLOAD:
    case USECASE_AUDIO_PLAYBACK_OFFLOAD2:
        needs_event = true;
        break;
    /* concurrent playback in low latency allowed */
    case USECASE_AUDIO_PLAYBACK_LOW_LATENCY:
        break;
    /* concurrent playback FM needs event */
    case USECASE_AUDIO_PLAYBACK_FM:
        needs_event = true;
        break;

    /* concurrent capture usecases, no event, capture handled by device
    *  USECASE_AUDIO_RECORD:
    *  USECASE_AUDIO_RECORD_COMPRESS:
    *  USECASE_AUDIO_RECORD_LOW_LATENCY:

    *  USECASE_VOICE_CALL:
    *  USECASE_VOICE2_CALL:
    *  USECASE_VOLTE_CALL:
    *  USECASE_QCHAT_CALL:
    *  USECASE_VOWLAN_CALL:
    *  USECASE_VOICEMMODE1_CALL:
    *  USECASE_VOICEMMODE2_CALL:
    *  USECASE_COMPRESS_VOIP_CALL:
    *  USECASE_AUDIO_RECORD_FM_VIRTUAL:
    *  USECASE_INCALL_REC_UPLINK:
    *  USECASE_INCALL_REC_DOWNLINK:
    *  USECASE_INCALL_REC_UPLINK_AND_DOWNLINK:
    *  USECASE_INCALL_REC_UPLINK_COMPRESS:
    *  USECASE_INCALL_REC_DOWNLINK_COMPRESS:
    *  USECASE_INCALL_REC_UPLINK_AND_DOWNLINK_COMPRESS:
    *  USECASE_INCALL_MUSIC_UPLINK:
    *  USECASE_INCALL_MUSIC_UPLINK2:
    *  USECASE_AUDIO_SPKR_CALIB_RX:
    *  USECASE_AUDIO_SPKR_CALIB_TX:
    */
    default:
        ALOGV("%s:usecase_id[%d] no need to raise event.", __func__, uc_id);
    }
    return needs_event;
}

/* Read  offload buffer size from a property.