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

Commit 2febd458 authored by Surendar Karka's avatar Surendar Karka
Browse files

Merge commit 'd34f05cb' into audio-hal.lnx.5.1

Change-Id: I4656a1a78c2b1d4b4834b2fd538699f96e2aa90e
parents 1512cf1b d34f05cb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -140,6 +140,7 @@ 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])
AM_CONDITIONAL([INSTANCE_ID], [test x$AUDIO_FEATURE_ENABLED_INSTANCE_ID = xtrue])
AM_CONDITIONAL([LL_AS_PRIMARY_OUTPUT], [test x$AUDIO_USE_LL_AS_PRIMARY_OUTPUT = xtrue])

AC_CONFIG_FILES([ \
        Makefile \
+5 −0
Original line number Diff line number Diff line
@@ -187,6 +187,7 @@ endif

if AUDIO_HW_LOOPBACK
AM_CFLAGS += -DAUDIO_HW_LOOPBACK_ENABLED
AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED
c_sources += audio_extn/hw_loopback.c
endif

@@ -208,6 +209,10 @@ if INSTANCE_ID
AM_CFLAGS += -DINSTANCE_ID_ENABLED
endif

if LL_AS_PRIMARY_OUTPUT
AM_CFLAGS += -DUSE_LL_AS_PRIMARY_OUTPUT
endif

h_sources = audio_extn/audio_defs.h \
            audio_extn/audio_extn.h \
            audio_hw.h \
+806 −283

File changed.

Preview size limit exceeded, changes collapsed.

+14 −6
Original line number Diff line number Diff line
@@ -293,10 +293,14 @@ void audio_extn_usb_set_reconfig(bool is_required);
#define audio_extn_a2dp_set_parameters(parms)            (0)
#define audio_extn_a2dp_is_force_device_switch()         (0)
#define audio_extn_a2dp_set_handoff_mode(is_on)          (0)
#define audio_extn_a2dp_get_sample_rate(sample_rate)     (0)
#define audio_extn_a2dp_get_enc_sample_rate(sample_rate) (0)
#define audio_extn_a2dp_get_dec_sample_rate(sample_rate) (0)
#define audio_extn_a2dp_get_encoder_latency()            (0)
#define audio_extn_a2dp_is_ready()                       (0)
#define audio_extn_a2dp_is_suspended()                   (0)
#define audio_extn_a2dp_sink_is_ready()                  (0)
#define audio_extn_a2dp_source_is_ready()                (0)
#define audio_extn_a2dp_source_is_suspended()            (0)
#define audio_extn_a2dp_start_capture()                  (0)
#define audio_extn_a2dp_stop_capture()                   (0)
#else
void audio_extn_a2dp_init(void *adev);
int audio_extn_a2dp_start_playback();
@@ -304,10 +308,14 @@ int audio_extn_a2dp_stop_playback();
void audio_extn_a2dp_set_parameters(struct str_parms *parms);
bool audio_extn_a2dp_is_force_device_switch();
void audio_extn_a2dp_set_handoff_mode(bool is_on);
void audio_extn_a2dp_get_sample_rate(int *sample_rate);
void audio_extn_a2dp_get_enc_sample_rate(int *sample_rate);
void audio_extn_a2dp_get_dec_sample_rate(int *sample_rate);
uint32_t audio_extn_a2dp_get_encoder_latency();
bool audio_extn_a2dp_is_ready();
bool audio_extn_a2dp_is_suspended();
bool audio_extn_a2dp_sink_is_ready();
bool audio_extn_a2dp_source_is_ready();
bool audio_extn_a2dp_source_is_suspended();
int audio_extn_a2dp_start_capture();
int audio_extn_a2dp_stop_capture();
#endif

#ifndef SSR_ENABLED
+12 −7
Original line number Diff line number Diff line
@@ -77,9 +77,9 @@ typedef enum patch_state {
typedef struct loopback_patch {
    audio_patch_handle_t patch_handle_id;            /* patch unique ID */
    struct audio_port_config loopback_source;        /* Source port config */
    struct audio_port_config loopback_sink;          /* Source port config */
    struct audio_port_config loopback_sink;          /* Sink port config */
    struct compress *source_stream;                  /* Source stream */
    struct compress *sink_stream;                    /* Source stream */
    struct compress *sink_stream;                    /* Sink stream */
    struct stream_inout patch_stream;                /* InOut type stream */
    patch_state_t patch_state;                       /* Patch operation state */
} loopback_patch_t;
@@ -196,7 +196,9 @@ audio_patch_handle_t get_loopback_patch_type(loopback_patch_t* loopback_patch)
            case AUDIO_PORT_TYPE_DEVICE :
                if ((loopback_patch->loopback_source.config_mask & AUDIO_PORT_CONFIG_FORMAT)) {
                    if ((loopback_patch->loopback_source.ext.device.type & AUDIO_DEVICE_IN_HDMI) ||
                        (loopback_patch->loopback_source.ext.device.type & AUDIO_DEVICE_IN_SPDIF)) {
                        (loopback_patch->loopback_source.ext.device.type & AUDIO_DEVICE_IN_SPDIF) ||
                        (loopback_patch->loopback_source.ext.device.type & AUDIO_DEVICE_IN_BLUETOOTH_A2DP)) {

                       switch (loopback_patch->loopback_source.format) {
                           case AUDIO_FORMAT_PCM:
                           case AUDIO_FORMAT_PCM_16_BIT:
@@ -205,6 +207,10 @@ audio_patch_handle_t get_loopback_patch_type(loopback_patch_t* loopback_patch)
                           case AUDIO_FORMAT_IEC61937:
                           case AUDIO_FORMAT_AC3:
                           case AUDIO_FORMAT_E_AC3:
                           case AUDIO_FORMAT_AAC_LATM_LC:
                           case AUDIO_FORMAT_AAC_LATM_HE_V1:
                           case AUDIO_FORMAT_AAC_LATM_HE_V2:
                           case AUDIO_FORMAT_SBC:
                              is_source_supported = true;
                           break;
                       }
@@ -214,8 +220,8 @@ audio_patch_handle_t get_loopback_patch_type(loopback_patch_t* loopback_patch)
                }
            break;
            default :
            break;
                //Unsupported as of now, need to extend for other source types
                break;
        }
    }

@@ -241,14 +247,13 @@ audio_patch_handle_t get_loopback_patch_type(loopback_patch_t* loopback_patch)
            }
            break;
        default :
            break;
            //Unsupported as of now, need to extend for other sink types
            break;
        }
    }
    if (is_source_supported && is_sink_supported) {
        return source_device | sink_device;
    }

    ALOGE("%s, Unsupported source or sink port config", __func__);
    return loopback_patch->patch_handle_id;
}
Loading