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

Commit 1707ec47 authored by Lucas Gates's avatar Lucas Gates
Browse files

Tuner Default HAL change dvr buffer size for CF

The default HAL currently uses a single shared memory
buffer to store the data within MediaEvents. This buffer
would cause sudden crashes when running on
cf_x86_tv-userdebug due to being de-allocated by the
memory management system. This CL decreases the size of
the buffer so our SampleTunerTIS can once again run
successfully on Cuttlefish.

Bug: 236847284
Test: Running sampletunertvinput manually on cuttlefish
Change-Id: I8e6042da422a9ed93cd9dbd18fe954c71098534d
parent de362e00
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -432,12 +432,12 @@ Filter::~Filter() {

    if (mSharedAvMemHandle != nullptr) {
        *out_avMemory = ::android::dupToAidl(mSharedAvMemHandle);
        *_aidl_return = BUFFER_SIZE_16M;
        *_aidl_return = BUFFER_SIZE;
        mUsingSharedAvMem = true;
        return ::ndk::ScopedAStatus::ok();
    }

    int av_fd = createAvIonFd(BUFFER_SIZE_16M);
    int av_fd = createAvIonFd(BUFFER_SIZE);
    if (av_fd < 0) {
        return ::ndk::ScopedAStatus::fromServiceSpecificError(
                static_cast<int32_t>(Result::OUT_OF_MEMORY));
@@ -454,7 +454,7 @@ Filter::~Filter() {
    mUsingSharedAvMem = true;

    *out_avMemory = ::android::dupToAidl(mSharedAvMemHandle);
    *_aidl_return = BUFFER_SIZE_16M;
    *_aidl_return = BUFFER_SIZE;
    return ::ndk::ScopedAStatus::ok();
}

@@ -1168,7 +1168,7 @@ void Filter::createMediaEvent(vector<DemuxFilterEvent>& events) {
    mediaEvent.isPesPrivateData = true;
    mediaEvent.extraMetaData.set<DemuxFilterMediaEventExtraMetaData::Tag::audio>(audio);

    int av_fd = createAvIonFd(BUFFER_SIZE_16M);
    int av_fd = createAvIonFd(BUFFER_SIZE);
    if (av_fd == -1) {
        return;
    }
+3 −1
Original line number Diff line number Diff line
@@ -50,7 +50,9 @@ using ::android::AidlMessageQueue;
using ::android::hardware::EventFlag;

using FilterMQ = AidlMessageQueue<int8_t, SynchronizedReadWrite>;
const uint32_t BUFFER_SIZE_16M = 0x1000000;
// Large buffer size can lead to sudden crashes due to being de-allocated
// by the memory management system. Change the buffer size when needed.
const uint32_t BUFFER_SIZE = 0x800000;  // 8 MB

class Demux;
class Dvr;