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

Report non-fatal errors through callbacks and not just as logcat warning #6384

Closed
fguinet opened this issue Sep 4, 2019 · 5 comments
Closed
Assignees

Comments

@fguinet
Copy link

fguinet commented Sep 4, 2019

Hi,

in case of an Audio discontinuity detected (cf. DefaultAudioSink line 644 : Log.e(TAG, "Discontinuity detected [expected ...) nothing is raised to the AnalyticsListener (such as for onPositionDiscontinuity).
Is it a bug, a new feature to be explored or simply as designed ?
I would be very happy to have this on a coming version to better track the audio discontinuity of some live streams.

Best regards,

Fabien

@ojw28
Copy link
Contributor

ojw28 commented Sep 4, 2019

@tonihei - Seems worth propagating to AudioRendererEventListener and AnalyticsListener?

@tonihei
Copy link
Collaborator

tonihei commented Sep 4, 2019

As far as I can see there are 3 reasons why such a discontinuity in DefaultAudioSink can happen:

  1. A regular, expected discontinuity because something changed in the track selection, the media queue, or the media period reports a discontinuity in the source. This gets all handled in ExoPlayerImplInternal and gets reported as onPositionDiscontinuity. The DefaultAudioSink ends up with the START_NEED_SYNC flag because the audio renderer position is reset and needs syncing.
  2. Buffers in the audio renderer are skipped on purpose because they are marked as decode-only. Given that this is likely only happening after a seek or other expected discontinuities, there is no reason to report that again.
  3. Unexpected discrepancies between the expected media timestamp and the actual media timestamp. That's the warning on L644 in DefaultAudioSink you mentioned. If I remember correctly, you only end up in there if you have malformed media. For all other media issues, we tend to just log a warning as long as we can continue playback as in this case. So I'm not sure we should report it.

@andrewlewis may know more details about the cases for which this particular warning can occur.

I would be very happy to have this on a coming version to better track the audio discontinuity of some live streams.

Can you explain in more detail what you are seeing and what you expect to see? Might be that you are actually looking for audible audio underruns, which are already reported via onAudioUnderrun.

@fguinet
Copy link
Author

fguinet commented Sep 4, 2019 via email

@tonihei
Copy link
Collaborator

tonihei commented Sep 5, 2019

That makes complete sense.

I just wonder if that case is any different from many other non-fatal warnings we have across our code base. Whenever we log something with the warning level, it means we recognized a problem but the problem is most likely non-fatal and we can just continue playback. But in all cases, it would we be good to report this to analytics systems if possible to know that an unexpected situation occurred. So far, the only non-fatal errors reported through the listeners are load errors that can be retried. I think if we report this kind of non-fatal error, we should think about a way to report all of them and not just this particular one.

Marking as an enhancement again to track reporting generic non-fatal errors.

@tonihei tonihei changed the title Audio Discontinuity detection Report non-fatal errors through callbacks and not just as logcat warning Sep 5, 2019
@tonihei
Copy link
Collaborator

tonihei commented Feb 17, 2021

We decided to report non-fatal errors with more targeted callbacks corresponding to the area in which they occurred (for example onAudioSinkError, onAudioCodecError or onVideoCodecError. So no need for the generic non-fatal callback anymore.

The initially requested reporting of the non-fatal but unexpected audio timestamp discontinuities will be reported as AudioSink.UnexpectedDiscontinuityException through onAudioSinkError in the future.

@tonihei tonihei closed this as completed Feb 17, 2021
kim-vde pushed a commit that referenced this issue Feb 19, 2021
This is preferable to just logging to LogCat so that listeners can
report this to analytics systems if required.

Issue: #6384
PiperOrigin-RevId: 357906079
kim-vde pushed a commit that referenced this issue Feb 19, 2021
We already report these errors through callbacks to interested listeners.
However, to ease debugging with bugreports and local error detection,
it's helpful to also log these non-fatal execptions to logcat. Otherwise
nothing in logcat indicates that the player recovered from an exception.

Issue: #6384
PiperOrigin-RevId: 357923899
@google google locked and limited conversation to collaborators Apr 19, 2021
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

4 participants