gedoor / legado

Legado 3.0 Book Reader with powerful controls & full functions❤️阅读3.0, 阅读是一款可以自定义来源阅读网络内容的工具,为广大网络文学爱好者提供一种方便、快捷舒适的试读体验。
GNU General Public License v3.0
30.4k stars 3.96k forks source link

小说tts朗读一段时间后自动停止 #3862

Closed ISNing closed 7 months ago

ISNing commented 8 months ago

确认 / Assignments

问题描述 / Describe Bugs

小说tts朗读一段时间后自动停止,稳定复现 似乎是前台服务没有起来?但是媒体操作(耳机线控)正常工作,通知也有

复现步骤 / How to reproduce

打开文本朗读,约等待十几秒

确认 / Assignment

其他信息 / Additions

No response

日志提交 / Relevant log output

SDK_INT=34 WebViewUserAgent=Mozilla/5.0 (Linux; Android 14; 23049RAD8C Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/123.0.6312.40 Mobile Safari/537.36 MODEL=23049RAD8C RELEASE=14 MANUFACTURER=Xiaomi versionName=3.23.110211 versionCode=14860 BRAND=Redmi android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{1546d4b u0 io.legado.app.release/io.legado.app.service.HttpReadAloudService} at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2250) at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2221) at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2515) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:224) at android.os.Looper.loop(Looper.java:318) at android.app.ActivityThread.main(ActivityThread.java:8759) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:561) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013) Caused by: android.app.StackTrace: Last startServiceCommon() call for this service was made here at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1963) at android.app.ContextImpl.startForegroundService(ContextImpl.java:1917) at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:841) at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:841) at androidx.core.content.ContextCompat$Api26Impl.startForegroundService(SourceFile:1) at androidx.core.content.ContextCompat.startForegroundService(SourceFile:7) at io.legado.app.model.v0.i(SourceFile:26) at io.legado.app.ui.book.read.config.g2.onClick(SourceFile:98) at android.view.View.performClick(View.java:7799) at android.view.View.performClickInternal(View.java:7776) at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0) at android.view.View$PerformClick.run(View.java:31135) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) ... 6 more android.app.StackTrace: Last startServiceCommon() call for this service was made here at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1963) at android.app.ContextImpl.startForegroundService(ContextImpl.java:1917) at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:841) at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:841) at androidx.core.content.ContextCompat$Api26Impl.startForegroundService(SourceFile:1) at androidx.core.content.ContextCompat.startForegroundService(SourceFile:7) at io.legado.app.model.v0.i(SourceFile:26) at io.legado.app.ui.book.read.config.g2.onClick(SourceFile:98) at android.view.View.performClick(View.java:7799) at android.view.View.performClickInternal(View.java:7776) at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0) at android.view.View$PerformClick.run(View.java:31135) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:224) at android.os.Looper.loop(Looper.java:318) at android.app.ActivityThread.main(ActivityThread.java:8759) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:561) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)

阅读版本 / Legado version

3.24.040700

Android版本 / Android version

Android 14

机型 / Model

Redmi Note12 Turbo

821938089 commented 8 months ago

先去其他设置里打开记录日志,复现后去我的-关于-导出日志,然后上传日志

ISNing commented 8 months ago

08_04-01-00-26_957.log 这是我用logcat抓取的完整日志

821938089 commented 8 months ago

试试最新测试版

ISNing commented 8 months ago

还是会暂停 appLog-24-04-08 10_36_38.240.txt

821938089 commented 8 months ago

日志显示应用进入后台一分钟后服务就被杀掉了,应该是手机系统问题,检查有没有开了省电模式,还有应用的省电策略、自启动等等

ISNing commented 8 months ago

修改电池优化为无限制后不会停止了,但正常来讲播放媒体的软件不应该会被系统杀死的啊🤔我看媒体播放器那并没有显示正在播放,是因为更新后没有正确接入系统媒体播放的api吗?我记得以前是有的,在某次更新后才出现现在的情况。

ISNing commented 8 months ago

而且hyperos似乎都没有电池优化的入口,我在activity列表里才找到入口

821938089 commented 8 months ago

我也是HyperOS,但是却没遇到这个问题,后台一直播放都不会被杀,感觉很玄学。 系统媒体播放的api具体是哪个?

ISNing commented 8 months ago

我也是HyperOS,但是却没遇到这个问题,后台一直播放都不会被杀,感觉很玄学。 系统媒体播放的api具体是哪个?

image 我看到在播放的时候,这里并不会显示专辑名之类的信息。 我记得以前在朗读时,通知是直接调用的系统自带的媒体通知样式,系统能获取到专辑图片和媒体名称,现在的似乎是自定义的通知样式(也可能是我记错了) (我猜测是这方面的问题,但就算有这个问题,正常来说系统也不应该杀带前台服务的应用啊,确实很玄学)