Custom sounds not working - file open fails on Android 10/11 #85

Closed
opened 2021-03-18 00:58:21 +00:00 by fernlover · 10 comments
fernlover commented 2021-03-18 00:58:21 +00:00 (Migrated from gitlab.com)

Custom sounds can be selected and appear registered in the UI but nothing plays. Tried .wav and .mp3 formats, to no avail.

Update: attached logcat showing file open fails, suggesting a possible problem with permissions (the app has been granted Storage in Settings FWIW).

According to this StackOverflow Q, changes may be needed for this to work on Android 10 and 11.

Related issue: #74

Workaround suggested by @jonkeim verified to work on Android 10.

Device: guacamole

Android: 10 / LineageOS 17.1 21-03-14

03-26 03:17:07.928 20068 20068 D MeditationAssistant: pref_session_delay current value - 0:0
03-26 03:17:07.928 20068 20068 D MeditationAssistant: TimePreference (pref_session_delay) restoreValue: true - defaultValue: null - defaultv: 00:00 - time: 0:0
03-26 03:17:07.935 20068 20068 D MeditationAssistant: pref_session_interval current value - 1:0
03-26 03:17:07.935 20068 20068 D MeditationAssistant: TimePreference (pref_session_interval) restoreValue: true - defaultValue: null - defaultv: 00:00 - time: 1:0
03-26 03:17:07.947 20068 20068 D MeditationAssistant: pref_meditationstreakbuffer current value - 6:0
03-26 03:17:07.947 20068 20068 D MeditationAssistant: TimePreference (pref_meditationstreakbuffer) restoreValue: true - defaultValue: null - defaultv: 00:00 - time: 6:0
03-26 03:17:07.949 20068 20068 D MeditationAssistant: pref_session_delay value: 0:0
03-26 03:17:07.949 20068 20068 D MeditationAssistant: pref_session_interval value: 1:0
03-26 03:17:11.728 20068 20068 D MeditationAssistant: Selected: 1 - custom
03-26 03:17:21.173 20068 20068 D MeditationAssistant: Starting runnable
03-26 03:17:21.272 20068 20068 D MeditationAssistant: Stopping - start:0 stop:0
03-26 03:17:22.551 20068 20068 D MeditationAssistant: WAKELOCKER: Releasing all wakelocks
03-26 03:17:22.554 20068 20068 W MediaPlayer: Couldn't open /storage/emulated/0/SyncThing/Bells/255762__squidocto__bell-bowl-g-ish.wav
03-26 03:17:22.554 20068 20068 W MediaPlayer: java.io.FileNotFoundException: No content provider: /storage/emulated/0/SyncThing/Bells/255762__squidocto__bell-bowl-g-ish.wav
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1673)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1503)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1420)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at android.media.MediaPlayer.attemptDataSource(MediaPlayer.java:1101)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1073)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1001)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at sh.ftp.rocketninelabs.meditationassistant.MeditationAssistant.cacheSound(MeditationAssistant.java:12)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at sh.ftp.rocketninelabs.meditationassistant.MeditationAssistant.cacheSessionSounds(MeditationAssistant.java:5)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at sh.ftp.rocketninelabs.meditationassistant.MainActivity.pressMeditate(MainActivity.java:101)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at java.lang.reflect.Method.invoke(Native Method)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at android.view.View$DeclaredOnClickListener.onClick(View.java:6108)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at android.view.View.performClick(View.java:7259)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at android.view.View.performClickInternal(View.java:7236)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at android.view.View.access$3600(View.java:801)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at android.view.View$PerformClick.run(View.java:27892)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at android.os.Handler.handleCallback(Handler.java:883)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at android.os.Handler.dispatchMessage(Handler.java:100)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at android.os.Looper.loop(Looper.java:214)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at android.app.ActivityThread.main(ActivityThread.java:7356)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at java.lang.reflect.Method.invoke(Native Method)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
03-26 03:17:22.554 20068 20068 W MediaPlayer: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940)
03-26 03:17:22.555 20068 20068 W System.err: java.io.FileNotFoundException: /storage/emulated/0/SyncThing/Bells/255762__squidocto__bell-bowl-g-ish.wav: open failed: EACCES (Permission denied)
03-26 03:17:22.555 20068 20068 W System.err: 	at libcore.io.IoBridge.open(IoBridge.java:496)
03-26 03:17:22.555 20068 20068 W System.err: 	at java.io.FileInputStream.<init>(FileInputStream.java:159)
03-26 03:17:22.555 20068 20068 W System.err: 	at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1182)
03-26 03:17:22.556 20068 20068 W System.err: 	at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1160)
03-26 03:17:22.556 20068 20068 W System.err: 	at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1076)
03-26 03:17:22.556 20068 20068 W System.err: 	at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1001)
03-26 03:17:22.556 20068 20068 W System.err: 	at sh.ftp.rocketninelabs.meditationassistant.MeditationAssistant.cacheSound(MeditationAssistant.java:12)
03-26 03:17:22.556 20068 20068 W System.err: 	at sh.ftp.rocketninelabs.meditationassistant.MeditationAssistant.cacheSessionSounds(MeditationAssistant.java:5)
03-26 03:17:22.556 20068 20068 W System.err: 	at sh.ftp.rocketninelabs.meditationassistant.MainActivity.pressMeditate(MainActivity.java:101)
03-26 03:17:22.556 20068 20068 W System.err: 	at java.lang.reflect.Method.invoke(Native Method)
03-26 03:17:22.556 20068 20068 W System.err: 	at android.view.View$DeclaredOnClickListener.onClick(View.java:6108)
03-26 03:17:22.556 20068 20068 W System.err: 	at android.view.View.performClick(View.java:7259)
03-26 03:17:22.556 20068 20068 W System.err: 	at android.view.View.performClickInternal(View.java:7236)
03-26 03:17:22.556 20068 20068 W System.err: 	at android.view.View.access$3600(View.java:801)
03-26 03:17:22.556 20068 20068 W System.err: 	at android.view.View$PerformClick.run(View.java:27892)
03-26 03:17:22.556 20068 20068 W System.err: 	at android.os.Handler.handleCallback(Handler.java:883)
03-26 03:17:22.556 20068 20068 W System.err: 	at android.os.Handler.dispatchMessage(Handler.java:100)
03-26 03:17:22.556 20068 20068 W System.err: 	at android.os.Looper.loop(Looper.java:214)
03-26 03:17:22.556 20068 20068 W System.err: 	at android.app.ActivityThread.main(ActivityThread.java:7356)
03-26 03:17:22.556 20068 20068 W System.err: 	at java.lang.reflect.Method.invoke(Native Method)
03-26 03:17:22.556 20068 20068 W System.err: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
03-26 03:17:22.556 20068 20068 W System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940)
03-26 03:17:22.557 20068 20068 W System.err: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
03-26 03:17:22.557 20068 20068 W System.err: 	at libcore.io.Linux.open(Native Method)
03-26 03:17:22.557 20068 20068 W System.err: 	at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
03-26 03:17:22.557 20068 20068 W System.err: 	at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
03-26 03:17:22.557 20068 20068 W System.err: 	at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
03-26 03:17:22.557 20068 20068 W System.err: 	at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7255)
03-26 03:17:22.557 20068 20068 W System.err: 	at libcore.io.IoBridge.open(IoBridge.java:482)
03-26 03:17:22.557 20068 20068 W System.err: 	... 21 more
03-26 03:17:22.557 20068 20068 E MeditationAssistant: Failed to load sound: /storage/emulated/0/SyncThing/Bells/255762__squidocto__bell-bowl-g-ish.wav
Custom sounds can be selected and appear registered in the UI but nothing plays. Tried .wav and .mp3 formats, to no avail. Update: attached logcat showing file open fails, suggesting a possible problem with permissions (the app has been granted Storage in Settings FWIW). [According to this StackOverflow Q](https://stackoverflow.com/questions/8854359/exception-open-failed-eacces-permission-denied-on-android), changes may be needed for this to work on Android 10 and 11. **Related issue**: #74 [Workaround suggested by @jonkeim](https://gitlab.com/tslocum/meditationassistant/-/issues/74#note_413405925) verified to work on Android 10. Device: guacamole Android: 10 / LineageOS 17.1 21-03-14 ``` 03-26 03:17:07.928 20068 20068 D MeditationAssistant: pref_session_delay current value - 0:0 03-26 03:17:07.928 20068 20068 D MeditationAssistant: TimePreference (pref_session_delay) restoreValue: true - defaultValue: null - defaultv: 00:00 - time: 0:0 03-26 03:17:07.935 20068 20068 D MeditationAssistant: pref_session_interval current value - 1:0 03-26 03:17:07.935 20068 20068 D MeditationAssistant: TimePreference (pref_session_interval) restoreValue: true - defaultValue: null - defaultv: 00:00 - time: 1:0 03-26 03:17:07.947 20068 20068 D MeditationAssistant: pref_meditationstreakbuffer current value - 6:0 03-26 03:17:07.947 20068 20068 D MeditationAssistant: TimePreference (pref_meditationstreakbuffer) restoreValue: true - defaultValue: null - defaultv: 00:00 - time: 6:0 03-26 03:17:07.949 20068 20068 D MeditationAssistant: pref_session_delay value: 0:0 03-26 03:17:07.949 20068 20068 D MeditationAssistant: pref_session_interval value: 1:0 03-26 03:17:11.728 20068 20068 D MeditationAssistant: Selected: 1 - custom 03-26 03:17:21.173 20068 20068 D MeditationAssistant: Starting runnable 03-26 03:17:21.272 20068 20068 D MeditationAssistant: Stopping - start:0 stop:0 03-26 03:17:22.551 20068 20068 D MeditationAssistant: WAKELOCKER: Releasing all wakelocks 03-26 03:17:22.554 20068 20068 W MediaPlayer: Couldn't open /storage/emulated/0/SyncThing/Bells/255762__squidocto__bell-bowl-g-ish.wav 03-26 03:17:22.554 20068 20068 W MediaPlayer: java.io.FileNotFoundException: No content provider: /storage/emulated/0/SyncThing/Bells/255762__squidocto__bell-bowl-g-ish.wav 03-26 03:17:22.554 20068 20068 W MediaPlayer: at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1673) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1503) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1420) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at android.media.MediaPlayer.attemptDataSource(MediaPlayer.java:1101) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1073) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1001) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at sh.ftp.rocketninelabs.meditationassistant.MeditationAssistant.cacheSound(MeditationAssistant.java:12) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at sh.ftp.rocketninelabs.meditationassistant.MeditationAssistant.cacheSessionSounds(MeditationAssistant.java:5) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at sh.ftp.rocketninelabs.meditationassistant.MainActivity.pressMeditate(MainActivity.java:101) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at java.lang.reflect.Method.invoke(Native Method) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at android.view.View$DeclaredOnClickListener.onClick(View.java:6108) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at android.view.View.performClick(View.java:7259) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at android.view.View.performClickInternal(View.java:7236) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at android.view.View.access$3600(View.java:801) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at android.view.View$PerformClick.run(View.java:27892) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at android.os.Handler.handleCallback(Handler.java:883) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at android.os.Handler.dispatchMessage(Handler.java:100) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at android.os.Looper.loop(Looper.java:214) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at android.app.ActivityThread.main(ActivityThread.java:7356) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at java.lang.reflect.Method.invoke(Native Method) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491) 03-26 03:17:22.554 20068 20068 W MediaPlayer: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940) 03-26 03:17:22.555 20068 20068 W System.err: java.io.FileNotFoundException: /storage/emulated/0/SyncThing/Bells/255762__squidocto__bell-bowl-g-ish.wav: open failed: EACCES (Permission denied) 03-26 03:17:22.555 20068 20068 W System.err: at libcore.io.IoBridge.open(IoBridge.java:496) 03-26 03:17:22.555 20068 20068 W System.err: at java.io.FileInputStream.<init>(FileInputStream.java:159) 03-26 03:17:22.555 20068 20068 W System.err: at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1182) 03-26 03:17:22.556 20068 20068 W System.err: at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1160) 03-26 03:17:22.556 20068 20068 W System.err: at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1076) 03-26 03:17:22.556 20068 20068 W System.err: at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1001) 03-26 03:17:22.556 20068 20068 W System.err: at sh.ftp.rocketninelabs.meditationassistant.MeditationAssistant.cacheSound(MeditationAssistant.java:12) 03-26 03:17:22.556 20068 20068 W System.err: at sh.ftp.rocketninelabs.meditationassistant.MeditationAssistant.cacheSessionSounds(MeditationAssistant.java:5) 03-26 03:17:22.556 20068 20068 W System.err: at sh.ftp.rocketninelabs.meditationassistant.MainActivity.pressMeditate(MainActivity.java:101) 03-26 03:17:22.556 20068 20068 W System.err: at java.lang.reflect.Method.invoke(Native Method) 03-26 03:17:22.556 20068 20068 W System.err: at android.view.View$DeclaredOnClickListener.onClick(View.java:6108) 03-26 03:17:22.556 20068 20068 W System.err: at android.view.View.performClick(View.java:7259) 03-26 03:17:22.556 20068 20068 W System.err: at android.view.View.performClickInternal(View.java:7236) 03-26 03:17:22.556 20068 20068 W System.err: at android.view.View.access$3600(View.java:801) 03-26 03:17:22.556 20068 20068 W System.err: at android.view.View$PerformClick.run(View.java:27892) 03-26 03:17:22.556 20068 20068 W System.err: at android.os.Handler.handleCallback(Handler.java:883) 03-26 03:17:22.556 20068 20068 W System.err: at android.os.Handler.dispatchMessage(Handler.java:100) 03-26 03:17:22.556 20068 20068 W System.err: at android.os.Looper.loop(Looper.java:214) 03-26 03:17:22.556 20068 20068 W System.err: at android.app.ActivityThread.main(ActivityThread.java:7356) 03-26 03:17:22.556 20068 20068 W System.err: at java.lang.reflect.Method.invoke(Native Method) 03-26 03:17:22.556 20068 20068 W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491) 03-26 03:17:22.556 20068 20068 W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940) 03-26 03:17:22.557 20068 20068 W System.err: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied) 03-26 03:17:22.557 20068 20068 W System.err: at libcore.io.Linux.open(Native Method) 03-26 03:17:22.557 20068 20068 W System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:167) 03-26 03:17:22.557 20068 20068 W System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252) 03-26 03:17:22.557 20068 20068 W System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:167) 03-26 03:17:22.557 20068 20068 W System.err: at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7255) 03-26 03:17:22.557 20068 20068 W System.err: at libcore.io.IoBridge.open(IoBridge.java:482) 03-26 03:17:22.557 20068 20068 W System.err: ... 21 more 03-26 03:17:22.557 20068 20068 E MeditationAssistant: Failed to load sound: /storage/emulated/0/SyncThing/Bells/255762__squidocto__bell-bowl-g-ish.wav ```
fernlover commented 2021-03-26 02:34:37 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
fernlover commented 2021-03-26 02:43:38 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
fernlover commented 2021-03-26 02:44:04 +00:00 (Migrated from gitlab.com)

Updated bug report with additional debug information and possible indication for resolving.

Updated bug report with additional debug information and possible indication for resolving.
fernlover commented 2021-03-26 02:46:25 +00:00 (Migrated from gitlab.com)

changed title from Custom sounds not working{-?-} to Custom sounds not working{+ - file open fails on Android 10/11+}

changed title from **Custom sounds not working{-?-}** to **Custom sounds not working{+ - file open fails on Android 10/11+}**
fernlover commented 2021-03-26 02:58:02 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
fernlover commented 2021-03-26 02:59:44 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
MovingEarth commented 2021-03-26 13:26:56 +00:00 (Migrated from gitlab.com)

According to my test, Merge Request !6 (to fix #74) fixes this issue too

According to my test, Merge Request !6 (to fix #74) fixes this issue too
tslocum commented 2021-03-27 23:19:55 +00:00 (Migrated from gitlab.com)

Please confirm whether this is resolved in version 1.6.4.

Please confirm whether this is resolved in version 1.6.4.
fernlover commented 2021-03-27 23:25:16 +00:00 (Migrated from gitlab.com)

@tslocum Thanks for the new release. Is it possible to install your builds over F-Droid's ?

It's failing for me right ("App not installed", might have to wait for F-Droid to update its build otherwise.

@tslocum Thanks for the new release. Is it possible to install your builds over F-Droid's ? It's failing for me right ("App not installed", might have to wait for F-Droid to update its build otherwise.
tslocum commented 2021-03-27 23:26:54 +00:00 (Migrated from gitlab.com)

F-Droid releases are signed with a different key, so it is not possible to install my builds over them. You would need to delete the app first (but you would lose all app data).

F-Droid releases are signed with a different key, so it is not possible to install my builds over them. You would need to delete the app first (but you would lose all app data).
tslocum added the
bug
label 2021-05-12 17:33:51 +00:00
tslocum added this to the 1.6.7 milestone 2021-05-12 17:41:55 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tslocum/meditationassistant#85
No description provided.