完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
Platform: ROCKCHIP
OS: Android 6.0 Kernel: 3.10.92 Android系统默认播放停止后3秒会进入Standby模式以节省电源. 需求: 禁止进入Standby HAL层虽然提供了Standby接口,但是不能直接屏蔽掉, 因为里面有pcm_close() 和播放的pcm_start()配对. 解决方法: 增加standby的延迟时间,默认3秒,可以改成一天或者更久. [kris@:~/rk3288/frameworks/av]$ g df diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h index 08fa70d..a5244d3 100644 --- a/services/audioflinger/AudioFlinger.h +++ b/services/audioflinger/AudioFlinger.h @@ -86,7 +86,7 @@ class ServerProxy; // This is typically due to audio mixer and resampler limitations. #define FCC_8 8 // FCC_8 = Fixed Channel Count 8 -static const nsecs_t kDefaultStandbyTimeInNsecs = seconds(3); +static const nsecs_t kDefaultStandbyTimeInNsecs = seconds(60*60*24); 也可以通过property来设置: void AudioFlinger::onFirstRef() { int rc = 0; Mutex::Autolock _l(mLock); /* TODO: move all this work into an Init() function */ char val_str[PROPERTY_VALUE_MAX] = { 0 }; if (property_get("ro.audio.flinger_standbytime_ms", val_str, NULL) >= 0) { uint32_t int_val; if (1 == sscanf(val_str, "%u", &int_val)) { mStandbyTimeInNsecs = milliseconds(int_val); ALOGI("Using %u mSec as standby time.", int_val); } else { mStandbyTimeInNsecs = kDefaultStandbyTimeInNsecs; ALOGI("Using default %u mSec as standby time.", (uint32_t)(mStandbyTimeInNsecs / 1000000)); } } mPatchPanel = new PatchPanel(this); mMode = AUDIO_MODE_NORMAL; } |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
基于米尔瑞芯微RK3576核心板/开发板的人脸疲劳检测应用方案
3237 浏览 0 评论
3081 浏览 1 评论
2559 浏览 1 评论
3897 浏览 1 评论
4629 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-2-2 14:30 , Processed in 0.547385 second(s), Total 42, Slave 36 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号