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

Commit d9d72acd authored by Mikhail Naganov's avatar Mikhail Naganov Committed by Android (Google) Code Review
Browse files

Merge "audiohal: Fix volume changes handling"

parents 6bfee7cc f4f2ff39
Loading
Loading
Loading
Loading
+20 −10
Original line number Diff line number Diff line
@@ -83,26 +83,36 @@ interface IEffect {

    /*
     * Set and get volume. Used by audio framework to delegate volume control to
     * effect engine.  The effect implementation must set EFFECT_FLAG_VOLUME_IND
     * or EFFECT_FLAG_VOLUME_CTRL flag in its descriptor to receive this command
     * before every call to 'process' function If EFFECT_FLAG_VOLUME_CTRL flag
     * is set in the effect descriptor, the effect engine must return the volume
     * that should be applied before the effect is processed. The overall volume
     * (the volume actually applied by the effect engine multiplied by the
     * returned value) should match the value indicated in the command.
     * effect engine. The effect implementation must set EFFECT_FLAG_VOLUME_CTRL
     * flag in its descriptor to receive this command. The effect engine must
     * return the volume that should be applied before the effect is
     * processed. The overall volume (the volume actually applied by the effect
     * engine multiplied by the returned value) should match the value indicated
     * in the command.
     *
     * @param volumes vector containing volume for each channel defined in
     *                EffectConfig for output buffer expressed in 8.24 fixed
     *                point format.
     * @return result updated volume values. It is OK to receive an empty vector
     *                as a result in which case the effect framework has
     *                delegated volume control to another effect.
     * @return result updated volume values.
     * @return retval operation completion status.
     */
    @callflow(next={"*"})
    setAndGetVolume(vec<uint32_t> volumes)
            generates (Result retval, vec<uint32_t> result);

    /*
     * Notify the effect of the volume change. The effect implementation must
     * set EFFECT_FLAG_VOLUME_IND flag in its descriptor to receive this
     * command.
     *
     * @param volumes vector containing volume for each channel defined in
     *                EffectConfig for output buffer expressed in 8.24 fixed
     *                point format.
     * @return retval operation completion status.
     */
    volumeChangeNotification(vec<uint32_t> volumes)
            generates (Result retval);

    /*
     * Set the audio mode. The effect implementation must set
     * EFFECT_FLAG_AUDIO_MODE_IND flag in its descriptor to receive this command
+5 −0
Original line number Diff line number Diff line
@@ -66,6 +66,11 @@ Return<void> AcousticEchoCancelerEffect::setAndGetVolume(
    return mEffect->setAndGetVolume(volumes, _hidl_cb);
}

Return<Result> AcousticEchoCancelerEffect::volumeChangeNotification(
        const hidl_vec<uint32_t>& volumes) {
    return mEffect->volumeChangeNotification(volumes);
}

Return<Result> AcousticEchoCancelerEffect::setAudioMode(AudioMode mode) {
    return mEffect->setAudioMode(mode);
}
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ struct AcousticEchoCancelerEffect : public IAcousticEchoCancelerEffect {
    Return<Result> setDevice(AudioDevice device)  override;
    Return<void> setAndGetVolume(
            const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb)  override;
    Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes)  override;
    Return<Result> setAudioMode(AudioMode mode)  override;
    Return<Result> setConfigReverse(
            const EffectConfig& config,
+5 −0
Original line number Diff line number Diff line
@@ -81,6 +81,11 @@ Return<void> AutomaticGainControlEffect::setAndGetVolume(
    return mEffect->setAndGetVolume(volumes, _hidl_cb);
}

Return<Result> AutomaticGainControlEffect::volumeChangeNotification(
        const hidl_vec<uint32_t>& volumes) {
    return mEffect->volumeChangeNotification(volumes);
}

Return<Result> AutomaticGainControlEffect::setAudioMode(AudioMode mode) {
    return mEffect->setAudioMode(mode);
}
+1 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ struct AutomaticGainControlEffect : public IAutomaticGainControlEffect {
    Return<Result> setDevice(AudioDevice device)  override;
    Return<void> setAndGetVolume(
            const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb)  override;
    Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes)  override;
    Return<Result> setAudioMode(AudioMode mode)  override;
    Return<Result> setConfigReverse(
            const EffectConfig& config,
Loading