tobexyz / yaacc-code

YAACC - UPNP Client and Server
Other
94 stars 13 forks source link

Crash when swiping to receivers #91

Closed cweiske closed 5 months ago

cweiske commented 5 months ago

I am running yaacc 4.0.3 from f-droid on a Wileyfox Swift that runs Android 10 / LineageOS 17. When starting the app and clicking on "receivers" (Empfänger), it crashes. yacc-crash.log

Exception lines from the log:

01-15 20:33:11.776 11711 11765 E AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
01-15 20:33:11.776 11711 11765 E AndroidRuntime: Process: de.yaacc, PID: 11711
01-15 20:33:11.776 11711 11765 E AndroidRuntime: java.lang.RuntimeException: An error occurred while executing doInBackground()
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at android.os.AsyncTask$4.done(AsyncTask.java:399)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at java.util.concurrent.FutureTask.run(FutureTask.java:271)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:919)
01-15 20:33:11.776 11711 11765 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: Action can not be null
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at org.fourthline.cling.model.action.ActionInvocation.<init>(ActionInvocation.java:76)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at org.fourthline.cling.model.action.ActionInvocation.<init>(ActionInvocation.java:46)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at org.fourthline.cling.support.renderingcontrol.callback.GetVolume.<init>(GetVolume.java:41)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at org.fourthline.cling.support.renderingcontrol.callback.GetVolume.<init>(GetVolume.java:37)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at de.yaacc.upnp.UpnpClient$3.<init>(UpnpClient.java:1344)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at de.yaacc.upnp.UpnpClient.getVolume(UpnpClient.java:1344)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at de.yaacc.browser.DeviceVolumeStateLoadTask.doInBackground(DeviceVolumeStateLoadTask.java:27)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at de.yaacc.browser.DeviceVolumeStateLoadTask.doInBackground(DeviceVolumeStateLoadTask.java:10)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at android.os.AsyncTask$3.call(AsyncTask.java:378)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
01-15 20:33:11.776 11711 11765 E AndroidRuntime:    ... 4 more
tobexyz commented 5 months ago

Hi, thank you for your report. It seems one of your receivers does not support the setting of the volume. The code now is able to work with this situation. Maybe there are more situations on the player ui. Please try to build and install the branch feat/issue91. If you are not able to, you can also unzip and install the attached debug apk

yaacc-debug.zip

cweiske commented 5 months ago

Now it crashes at GetMute:

01-17 08:19:36.225  6898  6968 E AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
01-17 08:19:36.225  6898  6968 E AndroidRuntime: Process: de.yaacc, PID: 6898
01-17 08:19:36.225  6898  6968 E AndroidRuntime: java.lang.RuntimeException: An error occurred while executing doInBackground()
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at android.os.AsyncTask$4.done(AsyncTask.java:399)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at java.util.concurrent.FutureTask.run(FutureTask.java:271)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:919)
01-17 08:19:36.225  6898  6968 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: Action can not be null
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at org.fourthline.cling.model.action.ActionInvocation.<init>(ActionInvocation.java:76)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at org.fourthline.cling.model.action.ActionInvocation.<init>(ActionInvocation.java:46)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at org.fourthline.cling.support.renderingcontrol.callback.GetMute.<init>(GetMute.java:38)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at org.fourthline.cling.support.renderingcontrol.callback.GetMute.<init>(GetMute.java:35)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at de.yaacc.upnp.UpnpClient$1.<init>(UpnpClient.java:1245)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at de.yaacc.upnp.UpnpClient.getMute(UpnpClient.java:1245)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at de.yaacc.browser.DeviceMuteStateLoadTask.doInBackground(DeviceMuteStateLoadTask.java:26)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at de.yaacc.browser.DeviceMuteStateLoadTask.doInBackground(DeviceMuteStateLoadTask.java:10)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at android.os.AsyncTask$3.call(AsyncTask.java:378)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
01-17 08:19:36.225  6898  6968 E AndroidRuntime:    ... 4 more

The UPnP renderer not support volume/mute is:

D de.yaacc.upnp.UpnpClient: No action get volume found on Device: dreambox Gemini-dm7080

which is an extension for the dreambox satellite receiver: http://wiki.blue-panel.com/index.php/GP4_Plugins_(en)

tobexyz commented 5 months ago

Ok, thanks I will fix it and give you feedback.

tobexyz commented 5 months ago

Hi @cweiske, give it a next try please...

yaacc-debug.zip

cweiske commented 5 months ago

It works! No crash anymore. But when the player does not support setting volume or mute, the volume and mute buttons should not be shown (or be disabled). 2024-01-17 yaacc receiver

tobexyz commented 5 months ago

Hi @cweiske, now the controls are disabled, if the volume and mute action is not supported. Please test the current version with your device, thanks! yaacc-debug.zip

cweiske commented 5 months ago

The changes work fine. Thank you for fixing this bug so quickly.

tobexyz commented 5 months ago

integrated the feature branch to develop. The fix will be included in the next release