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

ADD: [amcs] restart codec when surface is lost and found #12858

Merged
merged 1 commit into from Oct 5, 2017

Conversation

@koying
Copy link
Contributor

commented Sep 30, 2017

Fixes issue when, eg, playback is interrupted by chromecast, and surface is lost

@CiNcH83

This comment has been minimized.

Copy link

commented Oct 1, 2017

Can you provide a test-build?

@MartijnKaijser

This comment has been minimized.

Copy link
Member

commented Oct 1, 2017

It's on the server

@CiNcH83

This comment has been minimized.

Copy link

commented Oct 1, 2017

Resume after focus loss seems to be fixed. Tried Chromecast, the "open with" dialog when connecting an USB storage and switching to another app.

What people still have to keep in mind is that when doing some Chromecast or switching app, a running PVR only goes into pause, which means that it keeps fully running, writing data to some timeshift buffer, which might be desired or not. In the latter case, people have to stop playback manually.

@koying

This comment has been minimized.

Copy link
Contributor Author

commented Oct 1, 2017

Yeah. Might want to do stop altogether when PVR is involved.
That will avoid headaches ;)

@MartijnKaijser Do you think just stopping is ok, or is it worth looking for advanced solutions.

@MartijnKaijser

This comment has been minimized.

Copy link
Member

commented Oct 1, 2017

I'm OK with stopping. Maybe later we can look for a better solution.

@MartijnKaijser

This comment has been minimized.

Copy link
Member

commented Oct 4, 2017

Maybe we can already get this merged?

@koying

This comment has been minimized.

Copy link
Contributor Author

commented Oct 4, 2017

@CiNcH83 Continuing from 12866
Yep, it works if the codec is completely deleted on my Sony (nothing really Sony specific, the issue would be the same on all single decoder devices)

It's tricky to restart it though, as the shutdown of the codec from, e.g. ChromeCast, takes a while, and surely longer than when we get the signal that the surface is available again.

I confirmed it working with a semi-hack, but I have to think about a better way, if possible

@CiNcH83

This comment has been minimized.

Copy link

commented Oct 4, 2017

I retested on Sony Android TV with Kodi being paused in the background. I tested with file (H.264 720p50) from USB (to eliminate potential PVR and network problems). Here is what I tried during file playback...

(1) Initiate Chromecast playback of some YouTube clip:
Video plays at reduced resolution, starting in slow motion, constantly interrupting showing the "LOADING..." OSD, as if it needs to rebuffer which can't be the case though as Kodi in the background is neither consuming any CPU time nor network traffic.
When I stop playback in Kodi before I start Chromecast playback, everything is perfectly fine. Full resolution and smooth playback.

(2) Pressing HOME > open Netflix:
I tried a network bandwidth test in the Netflix settings which yielded the maximum of my broadband connection. So network seems to work perfectly fine while Kodi is paused in the background.
When I now try to play some Netflix movie or show, buffering is very slow, always stopping at exactly 24%. When I now go back HOME, the Kodi 'Now Playing' card has a Netflix symbol to the lower right, while it still mentions the file which is currently being paused in Kodi. When I enter it, I see the still image of the paused file, but I can't do anything. Can't bring up Kodi controls, go back, whatever. After several seconds, Netflix stops working (Android says "Unfortunately, Netflix has stopped"), and I can fully use Kodi again.

So pausing Kodi in the background does not work at all for me, neither for PVR nor for file. Might be due to the slow Sony TV.

Here is a video of the Netflix incident (2). Netflix crashes at the very end of the video.

So like @FernetMenta wrote, I would also do a stop. Things seem to go wrong as soon as another app tries to do some video playback. If I think about it more, it might very well be a video decoder resource shortage, with the second video (Chromecast, Netflix) having to use SW. A SHIELD can probably cope with that. DRM video might require HW video decoding though.

@koying koying force-pushed the koying:fixamcsfL_PR branch from 64b9402 to 42906d4 Oct 4, 2017
@CiNcH83

This comment has been minimized.

Copy link

commented Oct 4, 2017

BTW. According to Sony MediaTek MT5890 specs, the SoC can handle up to 4 AVC or HEVC 1080p60 streams. As for 4K and VP9 generally, it can only do 1 stream.

I only tested YouTube which is VP9 most probably and Netflix in 4K. I should probably try some Netflix 1080p. It is still a problem for the mentioned cases where only 1 stream is supported..

@koying

This comment has been minimized.

Copy link
Contributor Author

commented Oct 5, 2017

Will already merge this one, to unblock the cases where:

  1. multiple decoders are readily available
  2. focus is lost to a non-video app
@koying koying merged commit f86bf08 into xbmc:master Oct 5, 2017
1 check passed
1 check passed
default You're awesome. Have a cookie
Details
@koying koying deleted the koying:fixamcsfL_PR branch Oct 5, 2017
@Rechi Rechi added this to the L 18.0-alpha1 milestone Oct 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.