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

Commit 939c563a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: start keep alive session to feed EC with silence data"

parents 1df3378f 59c51075
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@ AM_CONDITIONAL([DTSHD_PARSER], [test x$AUDIO_FEATURE_ENABLED_DTSHD_PARSER = xtru
AM_CONDITIONAL([QAP], [test x$AUDIO_FEATURE_ENABLED_QAP = xtrue])
AM_CONDITIONAL([AUDIO_HW_FFV], [test x$AUDIO_FEATURE_ENABLED_FFV = xtrue])
AM_CONDITIONAL([CUSTOM_STEREO], [test x$AUDIO_FEATURE_ENABLED_CUSTOM_STEREO = xtrue])
AM_CONDITIONAL([RUN_KEEP_ALIVE_IN_ARM_FFV], [test x$AUDIO_FEATURE_ENABLED_KEEP_ALIVE_ARM_FFV = xtrue])

AC_CONFIG_FILES([ \
        Makefile \
+4 −0
Original line number Diff line number Diff line
@@ -189,6 +189,10 @@ AM_CFLAGS += -DAUDIO_HW_LOOPBACK_ENABLED
c_sources += audio_extn/hw_loopback.c
endif

if RUN_KEEP_ALIVE_IN_ARM_FFV
AM_CFLAGS += -DRUN_KEEP_ALIVE_IN_ARM_FFV
endif

if AUDIO_HW_FFV
AM_CFLAGS += -DFFV_ENABLED \
             -I $(PKG_CONFIG_SYSROOT_DIR)/usr/include/ffv/
+8 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
@@ -47,6 +47,7 @@
#include <sys/resource.h>

#include "audio_hw.h"
#include "audio_extn.h"
#include "platform.h"
#include "platform_api.h"

@@ -497,7 +498,9 @@ int32_t audio_extn_ffv_stream_init(struct stream_in *in)
    }

    ffvmod.in = in;

#ifdef RUN_KEEP_ALIVE_IN_ARM_FFV
    audio_extn_keep_alive_start(KEEP_ALIVE_OUT_PRIMARY);
#endif
#ifdef FFV_PCM_DUMP
    if (!ffvmod.fp_input) {
        ALOGD("%s: Opening input dump file \n", __func__);
@@ -547,7 +550,9 @@ int32_t audio_extn_ffv_stream_deinit()

    if (ffvmod.buffers_allocated)
        deallocate_buffers();

#ifdef RUN_KEEP_ALIVE_IN_ARM_FFV
    audio_extn_keep_alive_stop(KEEP_ALIVE_OUT_PRIMARY);
#endif
    ffvmod.handle = NULL;
    ffvmod.in = NULL;
    ALOGV("%s: exit", __func__);
+17 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2014, 2016-2017 The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2014, 2016-2018 The Linux Foundation. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
@@ -135,6 +135,13 @@ int audio_hw_call_back(sound_trigger_event_type_t event,
        list_add_tail(&st_dev->st_ses_list, &st_ses_info->list);
        break;

    case ST_EVENT_START_KEEP_ALIVE:
        pthread_mutex_unlock(&st_dev->lock);
        pthread_mutex_lock(&st_dev->adev->lock);
        audio_extn_keep_alive_start(KEEP_ALIVE_OUT_PRIMARY);
        pthread_mutex_unlock(&st_dev->adev->lock);
        goto done;

    case ST_EVENT_SESSION_DEREGISTER:
        if (!config) {
            ALOGE("%s: NULL config", __func__);
@@ -152,11 +159,20 @@ int audio_hw_call_back(sound_trigger_event_type_t event,
        list_remove(&st_ses_info->list);
        free(st_ses_info);
        break;

    case ST_EVENT_STOP_KEEP_ALIVE:
        pthread_mutex_unlock(&st_dev->lock);
        pthread_mutex_lock(&st_dev->adev->lock);
        audio_extn_keep_alive_stop(KEEP_ALIVE_OUT_PRIMARY);
        pthread_mutex_unlock(&st_dev->adev->lock);
        goto done;

    default:
        ALOGW("%s: Unknown event %d", __func__, event);
        break;
    }
    pthread_mutex_unlock(&st_dev->lock);
done:
    return status;
}