diff options
author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2011-09-18 07:52:00 +0700 |
---|---|---|
committer | Pawit Pornkitprasan <p.pawit@gmail.com> | 2011-09-18 07:52:00 +0700 |
commit | ea3d5e1f6f3edd3da51e403cb5bfdfaab9b5b8ee (patch) | |
tree | 0f71a8b17e89e9e09b7083215d78c640fea8c3e0 /libaudio/AudioHardware.cpp | |
parent | 53bda4538aef48b39d56bc7ff1b8f6007333bbd8 (diff) | |
download | device_samsung_aries-common-ea3d5e1f6f3edd3da51e403cb5bfdfaab9b5b8ee.zip device_samsung_aries-common-ea3d5e1f6f3edd3da51e403cb5bfdfaab9b5b8ee.tar.gz device_samsung_aries-common-ea3d5e1f6f3edd3da51e403cb5bfdfaab9b5b8ee.tar.bz2 |
Set proper FM volume on start
Change-Id: I144433443cbf5c65693cbe584e987977c9f4d24b
Diffstat (limited to 'libaudio/AudioHardware.cpp')
-rw-r--r-- | libaudio/AudioHardware.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libaudio/AudioHardware.cpp b/libaudio/AudioHardware.cpp index c958e36..3e28448 100644 --- a/libaudio/AudioHardware.cpp +++ b/libaudio/AudioHardware.cpp @@ -98,6 +98,7 @@ AudioHardware::AudioHardware() : mActivatedCP(false), #ifdef HAVE_FM_RADIO mFmFd(-1), + mFmVolume(1), mFmResumeAfterCall(false), #endif mDriverOp(DRV_NONE) @@ -636,6 +637,7 @@ status_t AudioHardware::setMasterVolume(float volume) #ifdef HAVE_FM_RADIO status_t AudioHardware::setFmVolume(float v) { + mFmVolume = v; if (mFmFd > 0) { __u8 fmVolume = (AudioSystem::logToLinear(v) + 5) / 7; LOGD("%s %f %d", __func__, v, (int) fmVolume); @@ -808,6 +810,8 @@ void AudioHardware::enableFMRadio() { if (mFmFd < 0) { mFmFd = open("/dev/radio0", O_RDWR); + // In case setFmVolume was called before FM was enabled, we save the volume and call it here. + setFmVolume(mFmVolume); } } } |