aaudio: apply volume in the MMAP data path
The volume scaling is in AudioStreamInternal and not the mixer
because we will need volume scaling in EXCLUSIVE mode too.
Bug: 37518243
Test: play a tone using NativeOboe app then press volume keys
Change-Id: Ibbac9770ea4493f8ade64681be86f109a92803cd
Signed-off-by: Phil Burk <philburk@google.com>
diff --git a/media/libaaudio/src/client/AudioStreamInternal.h b/media/libaaudio/src/client/AudioStreamInternal.h
index 8244311..e550ba3 100644
--- a/media/libaaudio/src/client/AudioStreamInternal.h
+++ b/media/libaaudio/src/client/AudioStreamInternal.h
@@ -22,11 +22,11 @@
#include "binding/IAAudioService.h"
#include "binding/AudioEndpointParcelable.h"
+#include "binding/AAudioServiceInterface.h"
#include "client/IsochronousClockModel.h"
#include "client/AudioEndpoint.h"
#include "core/AudioStream.h"
-
-#include "binding/AAudioServiceInterface.h"
+#include "utility/LinearRamp.h"
using android::sp;
using android::IAAudioService;
@@ -154,7 +154,7 @@
int64_t mLastFramesRead = 0; // used to prevent retrograde motion
int32_t mFramesPerBurst; // frames per HAL transfer
int32_t mXRunCount = 0; // how many underrun events?
- float mVolume = 1.0; // volume that the server told us to use
+ LinearRamp mVolumeRamp;
AAudioServiceInterface &mServiceInterface; // abstract interface to the service