Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Failed to play audio on Android #144

Closed
AlexV525 opened this issue May 31, 2020 · 10 comments
Closed

[BUG] Failed to play audio on Android #144

AlexV525 opened this issue May 31, 2020 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@AlexV525
Copy link
Contributor

Flutter Version: 1.17.2

Lib Version: 1.6.4+2

Platform (Android / iOS / web) + version

Platform : Android 10/8 (iOS not tested)

Describe the bug

Failed to play audio on android with source error. Rollback to 1.6.2+3 works fine, so I believe the issue come from changes in 1.6.2+4.

Logs
E/ExoPlayerImplInternal( 5172): Source error
E/ExoPlayerImplInternal( 5172):   com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: java.io.FileNotFoundException: /external/audio/media/70: open failed: ENOENT (No such file or directory)
E/ExoPlayerImplInternal( 5172):       at com.google.android.exoplayer2.upstream.FileDataSource.open(FileDataSource.java:97)
E/ExoPlayerImplInternal( 5172):       at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:83)
E/ExoPlayerImplInternal( 5172):       at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:956)
E/ExoPlayerImplInternal( 5172):       at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:391)
E/ExoPlayerImplInternal( 5172):       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/ExoPlayerImplInternal( 5172):       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/ExoPlayerImplInternal( 5172):       at java.lang.Thread.run(Thread.java:919)
E/ExoPlayerImplInternal( 5172):   Caused by: com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: java.io.FileNotFoundException: /external/audio/media/70: open failed: ENOENT (No such file or directory)
E/ExoPlayerImplInternal( 5172):       at com.google.android.exoplayer2.upstream.FileDataSource.openLocalFile(FileDataSource.java:119)
E/ExoPlayerImplInternal( 5172):       at com.google.android.exoplayer2.upstream.FileDataSource.open(FileDataSource.java:88)
E/ExoPlayerImplInternal( 5172):       ... 6 more
E/ExoPlayerImplInternal( 5172):   Caused by: java.io.FileNotFoundException: /external/audio/media/70: open failed: ENOENT (No such file or directory)
E/ExoPlayerImplInternal( 5172):       at libcore.io.IoBridge.open(IoBridge.java:496)
E/ExoPlayerImplInternal( 5172):       at java.io.RandomAccessFile.<init>(RandomAccessFile.java:289)
E/ExoPlayerImplInternal( 5172):       at java.io.RandomAccessFile.<init>(RandomAccessFile.java:152)
E/ExoPlayerImplInternal( 5172):       at com.google.android.exoplayer2.upstream.FileDataSource.openLocalFile(FileDataSource.java:108)
E/ExoPlayerImplInternal( 5172):       ... 7 more
E/ExoPlayerImplInternal( 5172):   Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
E/ExoPlayerImplInternal( 5172):       at libcore.io.Linux.open(Native Method)
E/ExoPlayerImplInternal( 5172):       at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
E/ExoPlayerImplInternal( 5172):       at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
E/ExoPlayerImplInternal( 5172):       at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
E/ExoPlayerImplInternal( 5172):       at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7255)
E/ExoPlayerImplInternal( 5172):       at libcore.io.IoBridge.open(IoBridge.java:482)
E/ExoPlayerImplInternal( 5172):       ... 10 more
@florent37
Copy link
Owner

can you try the 1.6.4+2 ? please

@florent37
Copy link
Owner

since 1.6.4 I include a feature that try to play on explayer, then if it does not work, try with native media player

@florent37
Copy link
Owner

changelog

## 1.6.4+2

* Fixed bluetooth on android on some devices
* Fallback to android native MediaPlayer if exoplayer can't read the file
* Added `audio.updateMetas` to update notification content after creation

@AlexV525
Copy link
Contributor Author

Hmm, as I mentioned in description that I've already using 1.6.4+2 .

@florent37
Copy link
Owner

I'm going to see what happened in 1.6.2+4

@florent37
Copy link
Owner

I think I found, I switched from DefaultDataSource for FileDataSource on 1.6.2+3 -> 4

can you try with 1.6.4+4 I reverted it

@AlexV525
Copy link
Contributor Author

Works fine now, thanks for the fix!

BTW the update frequency of this package is quickly way more than I thought, several version were published just few days passed. 🤣

@florent37
Copy link
Owner

florent37 commented May 31, 2020

yes I fixed like 50 issues in 1 or 2 weeks :D since I added notification on this package I have no free time :)

@AlexV525
Copy link
Contributor Author

Hi there~

I'm here with a bad news, this was reproduced again on 2.0.7+9 with the exactly same error.

Is this related to DefaultDataSource you have mentioned before?

You can run the example from my package: flutter_wechat_assets_picker/example to see if it is reproducable.

Environments

  • Flutter version: 1.17.5
  • Package version: 2.0.7+9
  • Platform: Android 10
  • Devices: OnePlus 6T

Error logs

Logs from the console:

Logs
I/ExoPlayerImpl(25686): Init fb5504f [ExoPlayerLib/2.11.4] [OnePlus6T, ONEPLUS A6010, OnePlus, 29]
D/PlayerImplem(25686): trying to open with exoplayer(Default)
I/ExoPlayerImpl(25686): Init fc2f3ba [ExoPlayerLib/2.11.4] [OnePlus6T, ONEPLUS A6010, OnePlus, 29]
E/ExoPlayerImplInternal(25686): Source error
E/ExoPlayerImplInternal(25686):   com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: java.io.FileNotFoundException: /content:/media/external/audio/media/1565621: open failed: ENOENT (No such file or directory)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.upstream.FileDataSource.open(FileDataSource.java:97)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:177)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:83)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:956)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:391)
E/ExoPlayerImplInternal(25686):       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/ExoPlayerImplInternal(25686):       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/ExoPlayerImplInternal(25686):       at java.lang.Thread.run(Thread.java:919)
E/ExoPlayerImplInternal(25686):   Caused by: com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: java.io.FileNotFoundException: /content:/media/external/audio/media/1565621: open failed: ENOENT (No such file or directory)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.upstream.FileDataSource.openLocalFile(FileDataSource.java:119)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.upstream.FileDataSource.open(FileDataSource.java:88)
E/ExoPlayerImplInternal(25686):       ... 7 more
E/ExoPlayerImplInternal(25686):   Caused by: java.io.FileNotFoundException: /content:/media/external/audio/media/1565621: open failed: ENOENT (No such file or directory)
E/ExoPlayerImplInternal(25686):       at libcore.io.IoBridge.open(IoBridge.java:496)
E/ExoPlayerImplInternal(25686):       at java.io.RandomAccessFile.<init>(RandomAccessFile.java:289)
E/ExoPlayerImplInternal(25686):       at java.io.RandomAccessFile.<init>(RandomAccessFile.java:152)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.upstream.FileDataSource.openLocalFile(FileDataSource.java:108)
E/ExoPlayerImplInternal(25686):       ... 8 more
E/ExoPlayerImplInternal(25686):   Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
E/ExoPlayerImplInternal(25686):       at libcore.io.Linux.open(Native Method)
E/ExoPlayerImplInternal(25686):       at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
E/ExoPlayerImplInternal(25686):       at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
E/ExoPlayerImplInternal(25686):       at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
E/ExoPlayerImplInternal(25686):       at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7542)
E/ExoPlayerImplInternal(25686):       at libcore.io.IoBridge.open(IoBridge.java:482)
E/ExoPlayerImplInternal(25686):       ... 11 more
D/PLAYER  (25686): XXXX onPlayerError XXXX
D/PlayerImplem(25686): failed to open with exoplayer(Default)
I/ExoPlayerImpl(25686): Release fb5504f [ExoPlayerLib/2.11.4] [OnePlus6T, ONEPLUS A6010, OnePlus, 29] [goog.exo.core]
D/PlayerImplem(25686): trying to open with exoplayer(HLS)
D/PlayerImplem(25686): trying to open with exoplayer(DASH)
D/PlayerImplem(25686): trying to open with exoplayer(SmoothStreaming)
D/PlayerImplem(25686): trying to open with native mediaplayer
E/ExoPlayerImplInternal(25686): Source error
E/ExoPlayerImplInternal(25686):   com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: java.io.FileNotFoundException: /content:/media/external/audio/media/1565621: open failed: ENOENT (No such file or directory)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.upstream.FileDataSource.open(FileDataSource.java:97)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:177)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:83)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:956)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:391)
E/ExoPlayerImplInternal(25686):       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/ExoPlayerImplInternal(25686):       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/ExoPlayerImplInternal(25686):       at java.lang.Thread.run(Thread.java:919)
E/ExoPlayerImplInternal(25686):   Caused by: com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: java.io.FileNotFoundException: /content:/media/external/audio/media/1565621: open failed: ENOENT (No such file or directory)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.upstream.FileDataSource.openLocalFile(FileDataSource.java:119)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.upstream.FileDataSource.open(FileDataSource.java:88)
E/ExoPlayerImplInternal(25686):       ... 7 more
E/ExoPlayerImplInternal(25686):   Caused by: java.io.FileNotFoundException: /content:/media/external/audio/media/1565621: open failed: ENOENT (No such file or directory)
E/ExoPlayerImplInternal(25686):       at libcore.io.IoBridge.open(IoBridge.java:496)
E/ExoPlayerImplInternal(25686):       at java.io.RandomAccessFile.<init>(RandomAccessFile.java:289)
E/ExoPlayerImplInternal(25686):       at java.io.RandomAccessFile.<init>(RandomAccessFile.java:152)
E/ExoPlayerImplInternal(25686):       at com.google.android.exoplayer2.upstream.FileDataSource.openLocalFile(FileDataSource.java:108)
E/ExoPlayerImplInternal(25686):       ... 8 more
E/ExoPlayerImplInternal(25686):   Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
E/ExoPlayerImplInternal(25686):       at libcore.io.Linux.open(Native Method)
E/ExoPlayerImplInternal(25686):       at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
E/ExoPlayerImplInternal(25686):       at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
E/ExoPlayerImplInternal(25686):       at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
E/ExoPlayerImplInternal(25686):       at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7542)
E/ExoPlayerImplInternal(25686):       at libcore.io.IoBridge.open(IoBridge.java:482)
E/ExoPlayerImplInternal(25686):       ... 11 more
D/PLAYER  (25686): XXXX onPlayerError XXXX
D/PlayerImplem(25686): failed to open with exoplayer(Default)
I/ExoPlayerImpl(25686): Release fc2f3ba [ExoPlayerLib/2.11.4] [OnePlus6T, ONEPLUS A6010, OnePlus, 29] [goog.exo.core]
V/MediaPlayer(25686): resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
D/PlayerImplem(25686): trying to open with exoplayer(HLS)
D/PlayerImplem(25686): trying to open with exoplayer(DASH)
D/PlayerImplem(25686): trying to open with exoplayer(SmoothStreaming)
D/PlayerImplem(25686): trying to open with native mediaplayer
V/MediaPlayer(25686): cleanDrmObj: mDrmObj=null mDrmSessionId=null
V/MediaPlayer(25686): resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer(25686): cleanDrmObj: mDrmObj=null mDrmSessionId=null
E/MediaPlayerNative(25686): error (1, -2147483648)
E/MediaPlayerNative(25686): error (1, -2147483648)
D/PLAYER  (25686): XXXX MEDIAPLAYER CATCH XXXX
D/PLAYER  (25686): XXXX MEDIAPLAYER CATCH XXXX
D/PlayerImplem(25686): failed to open with native mediaplayer
V/MediaPlayer(25686): resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer(25686): cleanDrmObj: mDrmObj=null mDrmSessionId=null
W/System.err(25686): com.github.florent37.assets_audio_player.playerimplem.PlayerFinder$NoPlayerFoundException
W/System.err(25686): 	at com.github.florent37.assets_audio_player.playerimplem.PlayerFinder._findWorkingPlayer(PlayerFinder.kt:68)
W/System.err(25686): 	at com.github.florent37.assets_audio_player.playerimplem.PlayerFinder._findWorkingPlayer(PlayerFinder.kt:86)
W/System.err(25686): 	at com.github.florent37.assets_audio_player.playerimplem.PlayerFinder$_findWorkingPlayer$1.invokeSuspend(Unknown Source:12)
W/System.err(25686): 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
W/System.err(25686): 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:55)
W/System.err(25686): 	at android.os.Handler.handleCallback(Handler.java:883)
W/System.err(25686): 	at android.os.Handler.dispatchMessage(Handler.java:100)
W/System.err(25686): 	at android.os.Looper.loop(Looper.java:214)
W/System.err(25686): 	at android.app.ActivityThread.main(ActivityThread.java:7643)
W/System.err(25686): 	at java.lang.reflect.Method.invoke(Native Method)
W/System.err(25686): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
W/System.err(25686): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
D/PlayerImplem(25686): failed to open with native mediaplayer
V/MediaPlayer(25686): resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
V/MediaPlayer(25686): cleanDrmObj: mDrmObj=null mDrmSessionId=null
W/System.err(25686): com.github.florent37.assets_audio_player.playerimplem.PlayerFinder$NoPlayerFoundException
W/System.err(25686): 	at com.github.florent37.assets_audio_player.playerimplem.PlayerFinder._findWorkingPlayer(PlayerFinder.kt:68)
W/System.err(25686): 	at com.github.florent37.assets_audio_player.playerimplem.PlayerFinder._findWorkingPlayer(PlayerFinder.kt:86)
W/System.err(25686): 	at com.github.florent37.assets_audio_player.playerimplem.PlayerFinder$_findWorkingPlayer$1.invokeSuspend(Unknown Source:12)
W/System.err(25686): 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
W/System.err(25686): 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:55)
W/System.err(25686): 	at android.os.Handler.handleCallback(Handler.java:883)
W/System.err(25686): 	at android.os.Handler.dispatchMessage(Handler.java:100)
W/System.err(25686): 	at android.os.Looper.loop(Looper.java:214)
W/System.err(25686): 	at android.app.ActivityThread.main(ActivityThread.java:7643)
W/System.err(25686): 	at java.lang.reflect.Method.invoke(Native Method)
W/System.err(25686): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
W/System.err(25686): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
I/flutter (25686): PlatformException(OPEN, null, null)
E/flutter (25686): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(OPEN, null, null)
E/flutter (25686): 
I/flutter (25686): PlatformException(OPEN, null, null)
E/flutter (25686): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(OPEN, null, null)
E/flutter (25686): 

@AlexV525
Copy link
Contributor Author

/cc @florent37 for a ping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants