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

Commit 79a8a08f authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "audioserver: Improve logging / dumping for encoded formats" into main...

Merge "audioserver: Improve logging / dumping for encoded formats" into main am: a649ebba am: 6accdbea

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2660458



Change-Id: I9d851383436b939e03d8a4d94d31660c014bc9b0
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 39989c4d 6accdbea
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -125,6 +125,15 @@ void DeviceDescriptorBase::dump(std::string *dst, int spaces,
    dst->append(base::StringPrintf(
                    "%*sEncapsulation modes: %u, metadata types: %u\n", spaces, "",
                    mEncapsulationModes, mEncapsulationMetadataTypes));
    if (!mEncodedFormats.empty()) {
        std::string s;
        for (const auto& format : mEncodedFormats) {
            if (!s.empty()) s.append(", ");
            s.append(audio_format_to_string(format));
        }
        dst->append(base::StringPrintf(
                        "%*sEncoded formats: %s\n", spaces, "", s.c_str()));
    }

    std::string portStr;
    AudioPort::dump(&portStr, spaces, nullptr, verbose);
+10 −4
Original line number Diff line number Diff line
@@ -383,8 +383,8 @@ sp<DeviceDescriptor> HwModuleCollection::getDeviceDescriptor(const audio_devices
        }
    }
    if (!allowToCreate) {
        ALOGV("%s: could not find HW module for device %s %04x address %s", __FUNCTION__,
              name, deviceType, address);
        ALOGW("%s: could not find HW module for device %s (%s, %08x) address %s", __FUNCTION__,
                name, audio_device_to_string(deviceType), deviceType, address);
        return nullptr;
    }
    return createDevice(deviceType, address, name, encodedFormat);
@@ -398,8 +398,14 @@ sp<DeviceDescriptor> HwModuleCollection::createDevice(const audio_devices_t type
    std::string tagName = {};
    sp<HwModule> hwModule = getModuleForDeviceType(type, encodedFormat, &tagName);
    if (hwModule == 0) {
        ALOGE("%s: could not find HW module for device %04x address %s", __FUNCTION__, type,
              address);
        if (encodedFormat == AUDIO_FORMAT_DEFAULT) {
            ALOGE("%s: could not find HW module for device type '%s' (%08x)",
                    __FUNCTION__, audio_device_to_string(type), type);
        } else {
            ALOGE("%s: could not find HW module for device type '%s' (%08x), "
                    "encoded format '%s'", __FUNCTION__, audio_device_to_string(type), type,
                    audio_format_to_string(encodedFormat));
        }
        return nullptr;
    }