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

ExoPlayer can't play FLAC file but native MediaPlayer can #3738

Closed
Khang-NT opened this issue Jan 23, 2018 · 10 comments
Closed

ExoPlayer can't play FLAC file but native MediaPlayer can #3738

Khang-NT opened this issue Jan 23, 2018 · 10 comments

Comments

@Khang-NT
Copy link
Contributor

Issue description

I can't play this FLAC file with ExoPlayer: Download link - Drive
It says:

UnrecognizedInputFormatException: None of the available extractors (MatroskaExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, Ac3Extractor, TsExtractor, FlvExtractor, OggExtractor, PsExtractor, WavExtractor) could read the stream.

I used ExoPlayer without FLAC extension and this error occurs. FLAC codec is supported on Android 3.1+ which mentioned in Android - Supported Media Formats so it can play perfectly with MediaPlayer (I tested in my devices Android 5.1 and 7.0).

I also tried ExoPlayer with FLAC extension, on Android 5.1 device it plays nothing but noise sound, on Android 7.0 device it can play sound correctly, but I can't seek ( similar with #1808). Note: I can play with native MediaPlayer and seekable as well on both Android 5.1 and 7.0.

Reproduction steps

  • Download FLAC file below and play it without using FLAC extension
  • ExoPlayer throw error but MediaPlayer does not.
  • If test with FLAC extension, please try play on Android 5.1 or lower version.

Link to test content

https://drive.google.com/open?id=1_ykCaUovTcHwsGwNnQpO1k-lVEKKY03G

Version of ExoPlayer being used

I'm using 2.6.0.

Device(s) and version(s) of Android being used

Samsung s7 Android 7.0.
Tablet (unknown name) Android 5.1

A full bug report captured from the device

Source error.
                                                                                    com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (MatroskaExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, Ac3Extractor, TsExtractor, FlvExtractor, OggExtractor, PsExtractor, WavExtractor) could read the stream.
                                                                                        at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractorHolder.selectExtractor(ExtractorMediaPeriod.java:784)
                                                                                        at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:707)
                                                                                        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:315)
                                                                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                                        at java.lang.Thread.run(Thread.java:818)
@erdemguven erdemguven self-assigned this Jan 23, 2018
@erdemguven
Copy link
Contributor

Hi @Khang-NT,

We don't use platform FLAC decoder so you have to use the extension.

I tried the flac file you shared on Android 5 (Nexus 6) with the latest demo app, it plays fine. Please retry on a different device.

As you can see in the issue #1808, as your file doesn't have a seek table, unfortunately you can't seek in exoplayer currently.

@Khang-NT
Copy link
Contributor Author

Hi, thanks for your response.
I tested again with ExoPlayer demo, the result still is the same. I don't have more device to test, but current result shows that it's quite risk to use FLAC extension, it may not working for all.
Is it possible to fallback to platform decoder, or implement something like PlatformExtractor?

@erdemguven
Copy link
Contributor

It isn't possible use the platform library:
#2352 (comment)

Is the Android 5.1 device able to play other audio files using exoplayer?
Please provide a bug report captured using 'adb bugreport' shortly after reproducing the issue.

@Khang-NT
Copy link
Contributor Author

Output of adb bugreport exoplayer_demo.log
After play FLAC file using ExoPlayer demo app on Android 5.1 (only hear noise sound).

@Khang-NT
Copy link
Contributor Author

Khang-NT commented Feb 9, 2018

I guess the noise sound is only in MediaTek devices.

@liungkejin
Copy link

I have the same problem in Oppo R9tm Android 5.1 (MTK) phone!

@tonihei
Copy link
Collaborator

tonihei commented Aug 21, 2019

I'm aware that this issue is quite old, so sorry for the delay. But it looks as if the FLAC extension doesn't work on these devices? This sounds odd given that the whole purpose of these extension decoders is to provide a consistent experience across all devices.

We should probably get hold of one of the devices to test what's happening.

@andrewlewis Are you aware of any similar issues with the software decoders?

@tonihei tonihei assigned andrewlewis and unassigned erdemguven Aug 21, 2019
@balflear
Copy link

balflear commented Nov 21, 2019

Hi guys,
I'm having the same issue with playing FLAC with Exo-Player.
Currently i'm using the Exo-Player demo and device Galaxy S9 with Android 9.

The error is None of the available extractors (MatroskaExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, Ac3Extractor, TsExtractor, FlvExtractor, OggExtractor, PsExtractor, WavExtractor, AmrExtractor, Ac4Extractor, FlacExtractor) could read the stream.
With or without the extension i still can't play the FLAC using ExoPlayer.

Note: on Android 6.0 the error is different, which is another problem i guess...
com.google.android.exoplayer2.demo E/LoadTask: Unexpected exception loading stream java.lang.RuntimeException: com.google.android.exoplayer2.ext.flac.FlacDecoderException: Failed to load decoder native libraries.

@andrewlewis
Copy link
Collaborator

The FLAC extension should work from API level 16 onwards. The only reasons reasons I can think of for getting noise output are (1) the device's raw decoder MediaCodec (passing through data output by the FLAC extension's extractor) may be broken or (2) you may be hitting bug #6601 which relates to bit depth changes in playlists.

@balflear If the FLAC extension is set up correctly and you're playing a valid FLAC stream, the exception about "None of the available extractors ..." is unexpected. Behavior should not depend on the device's Android version. Please double check you are using a demo build variant that includes extensions and have followed the steps to build libflac in the extension readme. If you're still stuck after doing that, please provide a link to the media so we can try to reproduce here.

@google-oss-bot
Copy link
Collaborator

Hey @Khang-NT. We need more information to resolve this issue but there hasn't been an update in 14 days. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@ojw28 ojw28 closed this as completed Dec 19, 2019
@google google locked and limited conversation to collaborators Feb 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants