-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Samsung devices: Local or networked mp3 file plays twice rather than ending #4519
Comments
I downloaded the test app but cannot reproduce. The mp3 file (duration 2:42) played, the ended event was triggered and the toast you've added was displayed as expected. |
Closing for now because everything seems to work fine. Please provide additional information here if you want us to look again, and we'll re-open. |
After I received your comment, I realized that I just tested the demo app only on the samsung device I tested other devices such as LG Pad , Samsung mobile phone and many others but I didn't make the same I recorded the bug scene and attached below and attached the source code again. below is the source code. below is the bug scene which I captured. |
That's really weird. Please could you provide the output of |
I captured the adb bugreport after looping occured. |
Unfortunately the important bits are for some reason missing from the bug report. Could you instead try running |
I logcated two files under one device with difference exo versions( v2.8.0 vs v2.7.3). The other was logcated under v2.7.3 version , which works well. I Hope you have good news. |
Are you using the standard ExoPlayer demo app? I'd expect logging from ExoPlayer's |
I didn't know you need that EventLogger. Here is the logs. Thanks. |
Hello! I found the revision where it was broken 3c78dc22. This is due to on some devices MediaCodec.BufferInfo.size is not equal to zero when (outputBufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0. |
Interesting find, but how does the last output buffer being non-empty result in the described behavior? The only thing I can think of is if the last buffer somehow spuriously contains the entire stream again, but perhaps I've misunderstood. |
@ojw28 Do you need any logs or report? |
Given you can reproduce the issue, I was hoping you could debug further and explain exactly what's happening. I doubt we'll be able to figure it out from the logs. |
This comment has been minimized.
This comment has been minimized.
My Device "the samsung's s-pad device (SM-T 530)" is still not working properly when playing mp3. I recently found the below log when it ended playing mp3 and entered the dummy stage. [log] I downloaded the exoplayer source code which currently available in github.com and then found the exact match line "library\core\src\main\java\com\google\android\exoplayer2\audio\DefaultAudioSink.java" line 673 so It would be great that you could fix the problem, and I want to know how to addListener to DefaultAudioSink to catch that event. So It would be great to know how to add listener to DefaultAudioSink. |
I suspect the SOC vendor provided MP3 decoder just isn't doing the right thing on this device. Does it fix things if you modify
If so, we can probably put a targeted workaround in place to fix this (similar to adding the code block above, but additionally targeted to the specific problematic device). |
Yes, It worked fine when I added the code block you gave . |
Issue: #4519 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=211646358
It seems like I've encountered the exact same issue repeatedly on Samsung GT-I9515 4.4.2 and SM-G350 4.2.2 |
Thanks |
I'm sorry but I'm currently super busy (I'm overloaded with migrating many legacy apps to targetSdk=26 before November 1st) but for now I can confirm that downgrading to 2.7.3 fixed the problem. |
Those devices appear to have different chipsets, so it doesn't appear to be exactly the same. I suspect a different decoder is used. I think we'll need more information to add workarounds for those, including |
I have exact same issue on Samsung SM-T231, GT-I9152, GT-P5220. Can we use "omx.google.mp3.decoder" to avoid this problem ? |
@dungnn1991 - Please send a pull request to |
Reopening to try and better understand the extent of the problem [Internal tracking ref: 121260468]. |
TODO:
|
Issue #4519 PiperOrigin-RevId: 226205245
Issue #4519 PiperOrigin-RevId: 226205245
Users started reporting issues after an update to 2.8.* and newer. And there are some issues, e.g. google/ExoPlayer#4519
I believe I'm also seeing this issue on multiple Galaxy S3's (SCH-I535 with 4.4.2). STATE_ENDED does not occur, the playhead position resets to the beginning of the file. Oddly, I don't hear any audio at that point, although the playhead is still progressing. I can confirm this started with ExoPlayer v2.8.0 and is still present in v2.9.3 If I setRepeatMode to Player.REPEAT_MODE_ONE or ALL, the device does properly repeat the track after it ends and playback seems normal. But with REPEAT_MODE_NONE, playback does not end cleanly. I don't know if it matters but the player returns different durations for the same file when I test with ExoPlayer v2.7.3 (working) vs v2.8.0+ (not working). The v2.8.0+ ExoPlayers are indicating the file is over 20,000 MS longer than the 2.7.3 player says it is. |
Actually, our two Galaxy S3s are different models: SCH-I535 SPH-L710 |
Please can you provide the media file that you're seeing this with? This is unlikely to be device specific (although the repeating part might be). |
Unfortunately, I cannot provide example files. I'm working with large, copyrighted audiobook files. You are correct, I see the same differences in duration between v2.7.3 and v2.9.3 on a Pixel 2 where there are no playback problems. I just checked multiple files and the two ExoPlayer versions consistently report different durations for the same files. It doesn't seem to be file specific. |
I suspect the duration differences are the result of an intentional change (not sure which one, but @andrewlewis might). For the playing-twice issue, I guess we need to add SCH-I535 and SPH-L710 to the blacklist. |
Regarding the duration change, there was a fix for constant bitrate MP3s in 975ed6c. This should make audio frame timestamps consistent when playing from the start vs with seeking and the duration calculation. |
Issue: #4519 PiperOrigin-RevId: 229145790
Issue: #4519 PiperOrigin-RevId: 229145790
I had to downgrade back to 2.7.3, many phones seem to still have codec related problems on 2.9.3. I think choosing codecs in MediaCodecUtil should be prioritized (not first in returned list). Are you guys using this updated (2.7.3+) EP version in apps like Youtube / Google Play Music? No bug reports, really..? Just asking. |
Some of our internal apps are using |
I think the point here is this issue seems to be pretty common with older 4.4.x Samsung devices and they notoriously release dozens of minor hardware variations which all have unique model names. Blacklisting by specific models is helping but surely dozens of others remain affected. We can report models that we have in our device collection and, for example, 2.9.4 should now work for the devices we happen to have but we are still reluctant to move forward from v2.7.3 because of models that remain unblacklisted that would suddenly come out of the woodwork if we rolled out v2.9.x. |
One alternative we are considering is raising our minSdkVersion from 14/4.0 to 21/5.0 so we can at least leave potentially affected users with a version of the app that works after we move forward with ExoPlayer 2.9.x. |
We could just blacklist |
Issue: #4519 PiperOrigin-RevId: 232299233
The much wider fix ref'd above should address this issue on all pre-Lollipop devices. We're not aware of any Lollipop+ devices that are affected, but if you've seen this please let us know. |
Issue: #4519 PiperOrigin-RevId: 232299233
The wider fix has been released in 2.9.5. |
Issue: google#4519 PiperOrigin-RevId: 232299233
I found the same issue, network mp3 file is not properly finished, just played twice when I used 2.9.6 exo library. I tested in two different devices.
|
@getyoteamsolutions - Please provide complete information about the devices. The informal names aren't sufficient for us to be able to apply the workaround. Can you capture a bugreport with |
Before filing an issue:
When reporting a bug:
Issue description
When I Played the mp3 file, I didn't get the result "Player.STATE_ENDED" right after the mp3 file was finished.
I think that It happened in library version over 2.8.0 and not happened below 2.7.3
and I expected that it would have fixed in the version 2.8.2 but, It didn't happed.
Reproduction steps
Very simple.. when you play the mp3 file in the sample app then, you can find that i am right.
Link to test content
any contents in the name of mp3s.
Version of ExoPlayer being used
it has the problem over 2.8.0 but, is ok below 2.7.3
Device(s) and version(s) of Android being used
i am using the samsung's s-pad device (SM-T 530)
A full bug report captured from the device
I don't have the error message because it isn't the error when think otherwise.
so I have to attach the sample source which i tested. so that you can find what i mean easily.
ExoAudioTestWithActivity.zip
The text was updated successfully, but these errors were encountered: