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

Commit 8f715d94 authored by Ravi Kumar Alamanda's avatar Ravi Kumar Alamanda
Browse files

hal: Use deep buffer output as primary

- The audio content in video clips, YouTube content, etc
  are being rendered through low latency path as it was
  set as default output profile. This results more power
  consumption for video playback.
- Fix this using deep buffer path as default one and use
  low latency path only for those audio tracks that
  request with AUDIO_OUTPUT_FLAG_FAST.

Change-Id: I52fafa0ec2a312bc4383c813497830e6ded071bc
CRs-Fixed: 570389
parent 50f87768
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1873,10 +1873,6 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
        out->config.rate = config->sample_rate;
        out->config.channels = popcount(out->channel_mask);
        out->config.period_size = HDMI_MULTI_PERIOD_BYTES / (out->config.channels * 2);
    } else if (out->flags & AUDIO_OUTPUT_FLAG_DEEP_BUFFER) {
        out->usecase = USECASE_AUDIO_PLAYBACK_DEEP_BUFFER;
        out->config = pcm_config_deep_buffer;
        out->sample_rate = out->config.rate;
    } else if (out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) {
        if (config->offload_info.version != AUDIO_INFO_INITIALIZER.version ||
            config->offload_info.size != AUDIO_INFO_INITIALIZER.size) {
@@ -1934,10 +1930,14 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
                  __func__, ret);
            goto error_open;
        }
    } else {
    } else if (out->flags & AUDIO_OUTPUT_FLAG_FAST) {
        out->usecase = USECASE_AUDIO_PLAYBACK_LOW_LATENCY;
        out->config = pcm_config_low_latency;
        out->sample_rate = out->config.rate;
    } else {
        out->usecase = USECASE_AUDIO_PLAYBACK_DEEP_BUFFER;
        out->config = pcm_config_deep_buffer;
        out->sample_rate = out->config.rate;
    }

    if (flags & AUDIO_OUTPUT_FLAG_PRIMARY) {