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

Audio tracks switching on Chromecast #544

Closed
wipawan-zz opened this issue Oct 7, 2016 · 10 comments
Closed

Audio tracks switching on Chromecast #544

wipawan-zz opened this issue Oct 7, 2016 · 10 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly type: external An issue with an external dependency; not our issue; sometimes kept open for tracking
Milestone

Comments

@wipawan-zz
Copy link

wipawan-zz commented Oct 7, 2016

I encountered an issue while casting Shaka Player Demo on the Chromecast. The active audio track is not immediately changed after it is selected. It is only changed after I pause the video for a few seconds. I played "Angel One (multicodec, multilingual)". The same behaviour happens in my implementation.

Here's my code:
this.mediaPlayer.selectTrack(selectedAudioTrack, true); this.mediaPlayer.getConfiguration().abr.enabled = true;

@joeyparrish
Copy link
Member

@wipawan, please try to use the issue template we provide. There is much more information we need to investigate this:

  • What version of Shaka Player are you using?
  • Can you reproduce the issue with our latest release version?
  • Can you reproduce the issue with the latest code from master?
  • Can you reproduce the issue using our demo app?

@wipawan-zz
Copy link
Author

wipawan-zz commented Oct 8, 2016

@joeyparrish thanks for quick reply! please see my response below:

  • What version of Shaka Player are you using?
    I'm using Shaka Player v2. I installed via npm and run in compiled mode.
  • Can you reproduce the issue with our latest release version?
    Yes.
  • Can you reproduce the issue with the latest code from master?
    Yes.
  • Can you reproduce the issue using our demo app?
    Yes.

Audio tracks switching works perfectly with the player on Chrome browser. The issue seems to appear only when casting on Chromecast.

@joeyparrish joeyparrish added the type: bug Something isn't working correctly label Oct 18, 2016
@joeyparrish
Copy link
Member

I can reproduce using "Angel One" and the manual track controls in the "Info" panel of the demo app in uncompiled mode.

  • Switching text tracks has an immediate effect.
  • Switching audio tracks does have an effect, but it's not immediately obvious. If audio has been buffered until time 30, the audio change takes effect at time 30.
  • Switching video tracks behaves the same as audio.

You can make the track switching behavior more obvious by reducing the buffering goals. Run this in the JS console just after clicking "Load":

shakaDemo.player_.configure({streaming: {bufferingGoal: 5, bufferBehind: 5}});

So probably the bug is in clearing the buffer.

@joeyparrish joeyparrish added this to the v2.1.0 milestone Oct 18, 2016
@joeyparrish joeyparrish self-assigned this Oct 18, 2016
@joeyparrish joeyparrish added the type: external An issue with an external dependency; not our issue; sometimes kept open for tracking label Oct 18, 2016
@joeyparrish
Copy link
Member

So far, this appears to be a Chromecast bug. Shaka Player is calling remove(0, 60) on the audio SourceBuffer, and video.buffered reflects the removal, but the old content still gets rendered and does not get replaced. The same thing happens with video if you manually switch video tracks.

I will reach out to the Chromecast team for further assistance.

@joeyparrish
Copy link
Member

Quickest repro:

  1. Open Shaka Player demo.
  2. Click the cast button on the video controls.
  3. Click "Load" to load the "Angel One" clip.
  4. Expand the info panel.
  5. When the captain starts talking, select a different audio language.

The effect should be immediate because we clear the buffer. We even stop to buffer the new audio, but it doesn't take effect until after the previous data is rendered. If you've buffered the whole 60-second clip, you'll never hear the new audio.

@joeyparrish joeyparrish added type: external An issue with an external dependency; not our issue; sometimes kept open for tracking and removed type: external An issue with an external dependency; not our issue; sometimes kept open for tracking labels Oct 19, 2016
@joeyparrish
Copy link
Member

We will need some kind of workaround for Chromecast since clearing the buffer does not flush the pipeline. Chromecast team recommends seeking to flush.

joeyparrish added a commit that referenced this issue Oct 19, 2016
To work around a bug in Chromecast, seek after clearing the buffer.
This forces the device to flush the pipeline and remove any decoded
data from the old representation.

Closes #544

Change-Id: I3c34d344bfd856b429a360fc41ce7288791716bb
@joeyparrish
Copy link
Member

A workaround has been committed, but will not show up in our receiver demo until we deploy a new release to appspot. v2.0.1 is coming soon, though.

@wipawan-zz
Copy link
Author

thanks @joeyparrish!

sorry for the late reply. I managed to get to work by force seeking backward by one second (currentTime -= 1) . i'll keep a look out for the new version! 👍

@joeyparrish
Copy link
Member

JFYI, this fix was released as part of v2.0.1.

@jyavenard
Copy link

This caused regression #569

@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly type: external An issue with an external dependency; not our issue; sometimes kept open for tracking
Projects
None yet
Development

No branches or pull requests

4 participants