google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.74k stars 6.03k forks source link

Exoplayer failing when playing an 8 channel audio file in Android 8.0 #4924

Open roundsmapp opened 6 years ago

roundsmapp commented 6 years ago

Issue description

Exoplayer is failing when playing audio files, mp3 or ogg, with 8 channels, in Android 8.0, in some specific Samsung phones.

By "failing" I mean it plays the audio as if it was in very slow motion, not in a smooth way, in those specific devices.

It plays well in other devices tested so far, Samsung and other brands. It even plays well in a Samsung S7 with Android 8.0.

Reproduction steps

  1. modify file media.exolist.json to play one single ogg file
  2. place this ogg file in the assets directory
  3. modify method initializePlayer() within class PlayerActivity, replacing following code line: player.prepare(mediaSource, !haveResumePosition, false); by code lines below, in order to play in loop mode: LoopingMediaSource loopingSource = new LoopingMediaSource(mediaSource, 100); player.prepare(loopingSource, !haveResumePosition, false);
  4. Play the demo

Link to test content

Audio sample file sent by e-mail to dev.exoplayer@gmail.com.

Version of ExoPlayer being used

2.8.1

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

Samsung S9 SM-G9600 and A5 SM-A520F, both running Android 8.0.0. I have noticed also that both of them have the Octa-core chip. It may be a coincidence or not.

A full bug report captured from the device

There is no abnormal message shown in logcat when testing.

roundsmapp commented 6 years ago

Hello, @andrewlewis , any news about this issue?

andrewlewis commented 6 years ago

The most similar device I could get hold of was a Samsung Galaxy S9 samsung/starltexx/starlte:8.0.0/R16NW/G960FXXU2BRGA:user/release-keys and I couldn't reproduce the issue on there, but it appears to have a different chipset unfortunately. Can you reproduce the issue on any other devices?

Do you have the same issue when playing the media via MediaPlayer with adb shell am start -a android.intent.action.VIEW -d "file:///sdcard/some_file_name.ogg" -t "audio/*"? What about if you play it from a file:// URI rather than as an asset, and without looping?

andrewlewis commented 5 years ago

Closing due to inactivity.

roundsmapp commented 5 years ago

Hello, Andrew,

Can we reopen this Issue? I have more data from the guys that are testing the App.

Thank you


De: Andrew Lewis notifications@github.com Enviado: quarta-feira, 19 de dezembro de 2018 11:03 Para: google/ExoPlayer Cc: roundsmapp; Author Assunto: Re: [google/ExoPlayer] Exoplayer failing when playing an 8 channel audio file in Android 8.0 (#4924)

Closed #4924https://github.com/google/ExoPlayer/issues/4924.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/google/ExoPlayer/issues/4924#event-2035749674, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Aj6r8rFaX5k45PeeuDieNUG-gy4Lssehks5u6kc3gaJpZM4XTSeD.

[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virus-free. www.avast.comhttps://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail

roundsmapp commented 5 years ago

Even using file:// instead of assets, the audio still fails. It works without looping, but it doesn't solve it, as looping is mandatory.

andrewlewis commented 5 years ago

@roundsmapp Are you saying that if you use looping the audio doesn't play smoothly, but it does play smoothly without? This sounds very strange. A recording of the problematic behavior might help us figure out what's going on.

Please could you also address the other questions from my comment of Nov 5?

roundsmapp commented 5 years ago

Summarizing the tests:

Failures are random. Don't have an specific time to occur. It can be at the beginning, after 1 min, at the end, etc.

I've tried to figure out how to launch Media Player from adb using continuous (looping) mode but I did't find a way. Can this be done?

roundsmapp commented 5 years ago

Video with recording of the problem just sent to dev.exoplayer@gmail.com.

roundsmapp commented 5 years ago

@andrewlewis Any news on this?

andrewlewis commented 5 years ago

It sounds a bit like the audio track is underrunning but you should see warnings output to logcat if that's happening.

Let's focus on the issue with playing the longer OGG file without looping, to keep things simple for now. Please could you send a bug report taken while reproducing the issue playing that stream with the unmodified ExoPlayer demo app? It may also be useful to have another bug report taken while playing that stream with MediaPlayer (where it plays correctly). Thanks.

roundsmapp commented 5 years ago

@andrewlewis I've sent the bug report to dev.exoplayer@gmail.com, under title Issue #4924

google-oss-bot commented 5 years ago

Hey @roundsmapp. 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 commented 5 years ago

Please ignore the comment from @google-oss-bot .

andrewlewis commented 5 years ago

@roundsmapp Sorry for the delay. The bug report provided is from ExoPlayer 2.7.1 and does show some AudioTrack underruns. There was at least one fix around tracking the audio position while looping since that build, so please could you update to tip-of-tree and try to reproduce this in the ExoPlayer demo app? As some time has passed it would also be worth checking for system updates for the affected device, in case there was also a decoder fix (to address the non-looping issue).

roundsmapp commented 5 years ago

@andrewlewis I'll do this upgrade and test it.

roundsmapp commented 5 years ago

I'm still working on this. The latest ExoPlayer version is 2.10.5. Is that correct?

andrewlewis commented 5 years ago

As of today 2.10.6 has been released. You can check by looking at the release notes.

google-oss-bot commented 5 years ago

Hey @roundsmapp. 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!

roundsmapp commented 4 years ago

I'm making another test. It took me a while to find a smartphone of the model that was having the issue (Samsung Galaxy S9). I just found a friend who has it. I'm waiting for him to conclude the tests (he lives far from me).

Therefore, I ask you to please give me some extra time to send the results.

google-oss-bot commented 4 years ago

Hey @roundsmapp. 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!

google-oss-bot commented 4 years ago

Since there haven't been any recent updates here, I am going to close this issue.

@roundsmapp if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

roundsmapp commented 4 years ago

I have found no more issues since upgrading to ExoPlayer 2.10.6. Thanks for the support.

roundsmapp commented 4 years ago

Hello, @ojw28 and @andrewlewis , the problem has resurfaced. It was apparently doing well, but when we tested it on a Samsung Galaxy S9 (SM-G9650), the app showed the exact same problem, with the audio failing to play smoothly.

The very same test was done, using the std exoplayer, 2.11.1 and playing a ogg audio file with 8 channels, stored locally in the device.

But, it also showed a very, very weird behaviour. My friend, who was making the test, decided to record this test using an app, called AZ Screen Recorder (downloaded from Google Play Store, id=com.hecorat.screenrecorder.free).

When making exoplayer play the audio and at the same time recording it using the mentioned app, exoplayer functioned perfeclty well. When exoplayer played the audio without recording the screen, exoplayer failed.

roundsmapp commented 4 years ago

Hello, @ojw28 , any news on this?

roundsmapp commented 4 years ago

Any news on this issue?

andrewlewis commented 4 years ago

I don't have the affected device here so there's not much we can do to investigate. If the issue is reproducible having taken all available system updates and it seems to be device-specific the best option may be to report it to Samsung.

roundsmapp commented 4 years ago

Is there a specific channel at Samsung? Looking at the internet I just can find normal customer service contact information, which is for device operational problems, not a model specific issue like this one we have.

andrewlewis commented 4 years ago

I'd try https://forum.developer.samsung.com/c/mobile/12 to start with. If you post the issue there it would be helpful if you could put a link to it here.

roundsmapp commented 4 years ago

ok. thanks

roundsmapp commented 4 years ago

This same problem is happening with the following smartphones:

So, it is not a Samsung exclusive problem. Are you able to test in any of the above models?

ojw28 commented 4 years ago

We'd already tested with a Galaxy S9 as noted above, which is supposed to be able to reproduce the problem according to https://github.com/google/ExoPlayer/issues/4924#issuecomment-574275500. I was also unable to reproduce this on a Samsung Galaxy S10 under normal circumstances.

Are you sure you're not doing anything that could be dramatically slowing down execution when reproducing this issue? For example, I am able to reproduce the issue if I attach the debugger and add in some particularly expensive break point logging. Does it occur when the demo app is just running on the device normally, without it being plugged in to a computer via USB, or anything like that?

As a more general point, do you control the content that your app is playing? If so, why are you delivering 8 channel audio?

roundsmapp commented 4 years ago

Answering your questions:

In several other devices, the app plays perfectly well, with the user able to control each of the 4 channels independently (right and left balancing, as well as the volume, min to max).

As I said, even on a Motorola One is failing.

ojw28 commented 4 years ago

I don't really know what to suggest here, unfortunately, since we're still unable to reproduce this locally. I think we'll probably just need to leave the issue open for a bit, in case some further information or additional reports are provided.

roundsmapp commented 4 years ago

I'm still fighting with this issue, not being able to release the App until it is solved. I'll make more tests on different devices. To be more productive, it'll help if you could give me a short list of which devices (smartphone models) you are able to do the test on your side, i.e., which brands/models, so I can try to find the same one here and see the behaviour.

Could you please provide such list?

roundsmapp commented 4 years ago

@ojw28 , any news on this issue? Could you please provide the list as I mentioned above? Tks

ojw28 commented 4 years ago

We have access to a fairly wide range of popular devices, although due to the current working-from-home situation getting hold of them is significantly more difficult than usual. We do have Galaxy S8, S10, S20 and various Nexus and Pixel devices to hand that we can conveniently test with.