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

Commit f911152d authored by Ben Romberger's avatar Ben Romberger Committed by Gerrit - the friendly Code Review server
Browse files

hal: Add property to set TrueHD buffer size

Add the property audio.truehd.buffer.size.kb to
allow users to set the TrueHD buffer size to
a value other than the default of 2kb. TrueHD
is supported only for compress pass-through
and can be set as IEC format audio.

Change-Id: I97698eb84c7f6fe94219771650654204c203be55
parent 28718c54
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -6327,9 +6327,18 @@ uint32_t platform_get_compress_passthrough_buffer_size(
                                          audio_offload_info_t* info)
{
    uint32_t fragment_size = MIN_COMPRESS_PASSTHROUGH_FRAGMENT_SIZE;
    char value[PROPERTY_VALUE_MAX] = {0};

    if (((info->format == AUDIO_FORMAT_DOLBY_TRUEHD) ||
            (info->format == AUDIO_FORMAT_IEC61937)) &&
            property_get("audio.truehd.buffer.size.kb", value, "") &&
            atoi(value)) {
        fragment_size = atoi(value) * 1024;
        goto done;
    }
    if (!info->has_video)
        fragment_size = MIN_COMPRESS_PASSTHROUGH_FRAGMENT_SIZE;

done:
    return fragment_size;
}

+10 −1
Original line number Diff line number Diff line
@@ -5996,9 +5996,18 @@ uint32_t platform_get_compress_passthrough_buffer_size(
                                          audio_offload_info_t* info)
{
    uint32_t fragment_size = MIN_COMPRESS_PASSTHROUGH_FRAGMENT_SIZE;
    char value[PROPERTY_VALUE_MAX] = {0};

    if (((info->format == AUDIO_FORMAT_DOLBY_TRUEHD) ||
            (info->format == AUDIO_FORMAT_IEC61937)) &&
            property_get("audio.truehd.buffer.size.kb", value, "") &&
            atoi(value)) {
        fragment_size = atoi(value) * 1024;
        goto done;
    }
    if (!info->has_video)
        fragment_size = MIN_COMPRESS_PASSTHROUGH_FRAGMENT_SIZE;

done:
    return fragment_size;
}