原因是首次开机播放开机铃声的时候,铃声音量没有初始化完成。volume 为0
修改:
frameworks/av/services/audioflinger/Threads.cpp
// prepareTracks_l() must be called with ThreadBase::mLock held
AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTracks_l(
Vector< sp<Track> > *tracksToRemove)
{
...
// Delegate volume control to effect in track effect chain if needed
if (chain != 0 && chain->setVolume_l(&vl, &vr)) {
// Do not ramp volume if volume is controlled by effect
param = AudioMixer::VOLUME;
// Update remaining floating point volume levels
vlf = (float)vl / (1 << 24);
vrf = (float)vr / (1 << 24);
track->mHasVolumeController = true;
} else {
// force no volume ramp when volume controller was just disabled or removed
// from effect chain to avoid volume spike
if (track->mHasVolumeController) {
param = AudioMixer::VOLUME;
}
track->mHasVolumeController = false;
}
/*jicong.wang modify for task start {@*/
char mvalue[PROPERTY_VALUE_MAX] = { 1 };
property_get("service.bootanim.exit", mvalue, "");
if (strcmp(mvalue,"0") == 0){
vlf = 0.25f;
vrf = 0.25f;
}
/*jicong.wang modify for task end @}*/
}