badaix / snapdroid

Snapcast client for Android
GNU General Public License v3.0
127 stars 25 forks source link

Close unexpectedly on local playback #9

Closed armageddon421 closed 6 years ago

armageddon421 commented 6 years ago

When I press play at the top the App closes unexpectedly. The music is then playing perfectly fine while that error dialog ist still open but obviously stops as soon as I choose to close or restart the app. This is on a oneplus 6 with Android 8.1.0/Oxygen OS 5.1.5

armageddon421 commented 6 years ago

This happened with the version 0.14.0 from the GitHub releases. I just tried the play store version (it reports 0.14.0.14) and there everything seems fine.

maweki commented 6 years ago

It happened for me with both 0.13 and 0.14 with Oreo.

badaix commented 6 years ago

I think it's broken since I've updated the SDK version to 26: f422fb7. I guess that the crash is related to the updated notification API, which unfortunately seems not to be solved with 872350b (as far as I remember there was a bug report with a stack trace and the Android Linter was also pointing me to the notification API). Can you please provide a stack trace of the crash? Unfortunately, I cannot reproduce the bug with the emulator, and my latest phone is running Marshmallow. Also I wasn't aware of a Playstore version. I found this one, which seems to be from this fork, and this fork is still at SDK version 25, so it shouldn't be affected from notification crash.

kutmasterk commented 6 years ago

This is what i get on 8.1 with a logcat running during the crash:


05-29 09:33:32.816  3124  6050 D audio_route: Apply path: speaker-protected
05-29 09:33:32.823  3124  6050 D audio_hw_primary: enable_snd_device: snd_device(95: vi-feedback)
05-29 09:33:32.823  3124  6050 D audio_route: Apply path: vi-feedback
05-29 09:33:32.823  3124  6050 D audio_hw_primary: enable_audio_route: usecase(24) apply and update mixer path: spkr-vi-record
05-29 09:33:32.823  3124  6050 D audio_route: Apply path: spkr-vi-record
05-29 09:33:32.844  3537  3570 W ActivityManager: Error showing notification for service
05-29 09:33:32.844  3537  3570 W ActivityManager: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=default_notification_channel_id pri=0 contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x40 color=0x00000000 actions=1 vis=PRIVATE)
05-29 09:33:32.844  3537  3570 W ActivityManager:   at com.android.server.am.ServiceRecord$1.run(ServiceRecord.java:532)
05-29 09:33:32.844  3537  3570 W ActivityManager:   at android.os.Handler.handleCallback(Handler.java:790)
05-29 09:33:32.844  3537  3570 W ActivityManager:   at android.os.Handler.dispatchMessage(Handler.java:99)
05-29 09:33:32.844  3537  3570 W ActivityManager:   at android.os.Looper.loop(Looper.java:164)
05-29 09:33:32.844  3537  3570 W ActivityManager:   at android.os.HandlerThread.run(HandlerThread.java:65)
05-29 09:33:32.844  3537  3570 W ActivityManager:   at com.android.server.ServiceThread.run(ServiceThread.java:46)
05-29 09:33:32.847  3537  5921 I WifiService: acquireWifiLock uid=10080 lockMode=3
05-29 09:33:32.851  3124  6050 D audio_hw_primary: enable_audio_route: usecase(1) apply and update mixer path: low-latency-playback
05-29 09:33:32.851  3124  6050 D audio_route: Apply path: low-latency-playback
05-29 09:33:32.852  1525  1525 D AndroidRuntime: Shutting down VM
05-29 09:33:32.852  1525  1525 E AndroidRuntime: FATAL EXCEPTION: main
05-29 09:33:32.852  1525  1525 E AndroidRuntime: Process: de.badaix.snapcast, PID: 1525
05-29 09:33:32.852  1525  1525 E AndroidRuntime: android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=default_notification_channel_id pri=0 contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x40 color=0x00000000 actions=1 vis=PRIVATE)
05-29 09:33:32.852  1525  1525 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1768)
05-29 09:33:32.852  1525  1525 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:106)
05-29 09:33:32.852  1525  1525 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:164)
05-29 09:33:32.852  1525  1525 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6494)
05-29 09:33:32.852  1525  1525 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
05-29 09:33:32.852  1525  1525 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
05-29 09:33:32.852  1525  1525 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
05-29 09:33:32.856  3537  6051 W ActivityManager:   Force finishing activity de.badaix.snapcast/.MainActivity
05-29 09:33:32.862  3537  3571 I ActivityManager: Showing crash dialog for package de.badaix.snapcast u0
05-29 09:33:32.889  3124  6050 E msm8974_platform: ramp_speaker_gain: Could not get ctl for mixer cmd - Left Speaker Gain or Right Speaker Gain, not applying speaker gain ramp
05-29 09:33:32.889  3124  6050 D audio_hw_primary: out_write: retry previous failed cal level set
05-29 09:33:32.889  3124  6050 W msm8974_platform: platform_send_gain_dep_cal: Usecase list is empty
05-29 09:33:32.896  3537  8030 I OpenGLRenderer: Initialized EGL, version 1.4
05-29 09:33:32.896  3537  8030 D OpenGLRenderer: Swap behavior 2
05-29 09:33:33.358  3537  3570 W ActivityManager: Activity pause timeout for ActivityRecord{416b287 u0 de.badaix.snapcast/.MainActivity t37454 f}
05-29 09:33:33.366  3124  3527 D audio_hw_primary: disable_audio_route: usecase(1) reset and update mixer path: low-latency-playback
05-29 09:33:33.380  3124  3527 D audio_hw_primary: disable_snd_device: snd_device(95: vi-feedback)
05-29 09:33:33.380  3124  3527 D audio_hw_primary: disable_audio_route: usecase(24) reset and update mixer path: spkr-vi-record
badaix commented 6 years ago

Please try this version: Snapcast_0.14.80.apk.zip

kutmasterk commented 6 years ago

Yes, this works.

The "now playing" notification does trigger a notification sound tho. Don't know if this is intended, but it would be better without a sound.

badaix commented 6 years ago

It's not intended to play a sound. This version might be silent, and hopefully doesn't vibrate or blink: Snapcast_0.14.81.apk.zip

armageddon421 commented 6 years ago

This fixed it for me, thank you very much!

kutmasterk commented 6 years ago

Yes, new version is silent. Working as expected on Android 8.1. Thanks!

badaix commented 6 years ago

fixed in release v0.15.0