koying / SPMC

fork of xbmc/kodi
Other
634 stars 257 forks source link

Jittery Playback in Windowed mode in Surface #615

Open primaeval opened 7 years ago

primaeval commented 7 years ago

The jittery windowed playback bug is back. SPMC was working perfectly whereas Kodi was jittery. Now they are both as bad as each other. You win some, you lose some. ;) Here is an example of the play method using windowed mode in TV Guide Fullscreen. https://github.com/primaeval/script.tvguide.fullscreen/blob/799bfb3808e0a2c47b8b3f3d2a2442c09a40ffe8/gui.py#L2117 You can recreate the error by playing the BBC iPlayer streams from plugin.video.iplayerwww in the main repo in a TV Guide such as TV Guide Fullscreen.

koying commented 7 years ago

Debug log? As a reminder, there is a builtin log uploader at "Settings-System-Logging-Upload a debug log..."

primaeval commented 7 years ago

Thanks. This problem keeps coming back. It is better on some Android devices than others. The Nvidia Shield has been pretty good so far until 16.5.x.

Bad 16.5.3 http://paste.semperpax.com/pvj3ndfmg Good 16.4.0 https://gist.github.com/primaeval/efa7a5031aa697af9edc643051da803b

Using TV Guide Fullscreen and BBC TV addons from my repo: https://github.com/primaeval/repository.primaeval

koying commented 7 years ago

The obvious difference is that 16.5.x uses Mediacodec(Surface) by default again, as kodi What if you disable it?

primaeval commented 7 years ago

Well spotted. That seems to fix it. Thanks and Merry Christmas.

Perhaps it would be better turned off by default again. Several people that have told me they also had to downgrade to 16.4 because of this.

koying commented 7 years ago

Is there a pattern re system having issues ?

primaeval commented 7 years ago

The only pattern I could see was your stuff was good, Kodi was bad. ;) But there is something very strange about starting video's in windowed mode. There might not be so much optimisation then as whoever wrote the code thought that in windowed mode the video would always be smaller than fullscreen and so the quality didn't matter so much. The TV Guides use windowed mode in a window that is as big as the desktop because it allows for osd overlays.

JFG90 commented 7 years ago

I'm also getting jittery playback when playing live tv streams, never used to get it before on 16.4.2 is there anyway this can be fixed?

koying commented 7 years ago

@primaeval Could you test http://download.semperpax.com/spmc/android-arm/SPMC-spmc-jarvis-72302b2-armeabi-v7a.apk

Should fix the jitter in Windowed Surface mode

primaeval commented 7 years ago

Excellent. That works perfectly. Thanks. What did you do?

koying commented 7 years ago

Err... Fixed Windowed mode with Surface ;)

If you want the gorry details, windowed mode + multi-layered video (as Surface is, vs. the "normal" way, which is OpenGL) was designed for aml and rpi, which use a somewhat different rendering loop.

primaeval commented 7 years ago

Thanks. I saw a ton of changes in the last commit to do with surface. It's still holiday mode in my brain so I was just looking for the executive summary.

JFG90 commented 7 years ago

I've been getting jittery playback on tv streams so hopefully this should fix?

koying commented 7 years ago

Ah, yeah. I pushed unrelated code regarding dynamic allocation of surfaces.

@JonnyGadd Yeah, the build should fix that as well, although it's an unrelated issue

JFG90 commented 7 years ago

Awesome thanks I'll test it and get back to you, this version ok to run on the shield?

primaeval commented 7 years ago

It ran on my shield tv box perfectly.

JFG90 commented 7 years ago

Just tested and my playback still becomes jittery after 30 seconds or so it's odd it never used to do it on 16.4.2

primaeval commented 7 years ago

Here is the debug log from my test for a minute or so of CBBC in TV Guide Fullscreen. It worked fine. http://paste.semperpax.com/pty5p3cgv

koying commented 7 years ago

@JonnyGadd Please push a log: https://github.com/koying/SPMC/wiki/How-do-I-publish-a-debug-log%3F

JFG90 commented 7 years ago

Ok I will do

JFG90 commented 7 years ago

Log uploaded

pyt9wizly

primaeval commented 7 years ago

@JonnyGadd 16.5-3 doesn't work. Try the link koying posted to 16.6.0 http://download.semperpax.com/spmc/android-arm/SPMC-spmc-jarvis-72302b2-armeabi-v7a.apk

koying commented 7 years ago

@JonnyGadd Besides, you seem to have another issue:

11:49:53.006 T:1488927024 ERROR: SQL: [Textures13.db] Some kind of disk I/O error occurred

You might want to delete Textures13.db so that it's re-created

JFG90 commented 7 years ago

I had tried on 16.6 and it was the same so reverted back, ok delete textures, where would I find that? I made my own build so would it delete the skin?

koying commented 7 years ago

The db is in /sdcard/Android/data/com.semperpax.spmc16/files/.spmc/userdata/Database/

JFG90 commented 7 years ago

Ok cool thankyou so hopefully it will fix the picture jittering?

koying commented 7 years ago

Not a clue, but I'll definitely not investigate any issues on a borked install ;)

primaeval commented 7 years ago

@JonnyGadd I would recommend renaming the whole spmc data folder so you can isolate this jittering issue before you start fixing everything else. rename /sdcard/Android/data/com.semperpax.spmc16 to /sdcard/Android/data/com.semperpax.spmc16.save

JFG90 commented 7 years ago

Fair enough I understand I'm guessing you mean a build is a borked install? Lol

koying commented 7 years ago

Not necessarily, although it makes debugging harder, I just mean that an install with a corrupted database is not a good base to investigate ;)

JFG90 commented 7 years ago

Ok if you like if i still get issues I will back my build up on a fresh install of spmc no build?

JFG90 commented 7 years ago

Primaeval what would renaming it do?

JFG90 commented 7 years ago

Can't find a textures.db

primaeval commented 7 years ago

In this case nothing I think, because koying has made a separate folder for the test so it won't overwrite your main settings. I've got a lot of renamed folders in data now so please correct me if I'm wrong. Have a look for com.semperpax.spmctest and com.semperpax.spmc16. /sdcard/Android/data/com.semperpax.spmctest

JFG90 commented 7 years ago

I don't have that in mine mate, just what the spmc folder is usually named

primaeval commented 7 years ago

The textures db path should be something like this then: /sdcard/Android/data/com.semperpax.spmc16/files/.spmc/userdata/Database/Textures13.db

Make sure you have hidden files turned on in a decent File Manager. The .spmc folder will be hidden by default.

JFG90 commented 7 years ago

Yes mate use es file Explorer and it's not there :(

primaeval commented 7 years ago

Just the textures db or the whole com.semperpax.spmc16 tree?

JFG90 commented 7 years ago

Textures.db isn't in the database folder mate

primaeval commented 7 years ago

Even when you restart SPMC?

JFG90 commented 7 years ago

You mean restart then minimise spmc and then have look?

primaeval commented 7 years ago

Yes. If you look in your log there is something very strange going on with textures13.db

ERROR: SQL: [Textures13.db] Some kind of disk I/O error occurred
                                            Query: SELECT id, cachedurl, lasthashcheck, imagehash, width, height FROM texture JOIN sizes ON (texture.id=sizes.idtexture AND sizes.size=1) WHERE url='/storage/emulated/0/Android/data/com.semperpax.spmc16/files/.spmc/addons/script.exodus.artwork/resources/media/exodus/next.png'

That is why you need to isolate this jittering problem from the exodus problem that is giving you a disk I/O error.

JFG90 commented 7 years ago

It's not exodus that's giving me the jittery playback it's flawless IPTV streams, they never used to jitter on 16.4.2 only since these new updates

primaeval commented 7 years ago

Have you installed 16.6.0 yet?

JFG90 commented 7 years ago

Yer tried it earlier and it was still the same I'm out now so will have to try look for texture file again later

primaeval commented 7 years ago

We're going around in circles here.

  1. exit spmc
  2. rename /sdcard/Android/data/com.semperpax.spmc16 to /sdcard/Android/data/com.semperpax.spmc16.save
  3. install http://download.semperpax.com/spmc/android-arm/SPMC-spmc-jarvis-72302b2-armeabi-v7a.apk
  4. start spmc 16.6.0
  5. install your tv guide
  6. install your iptv addon
  7. play a jittery stream in your tv guide
  8. post the log here
JFG90 commented 7 years ago

Ah right ok i get you now yes alright I'll do that :) won't be til tomorrow now though, I'll keep posted thanks for your help!

JFG90 commented 7 years ago

Guys just thought I'd report back, so it turns out the jittering I was getting must have been server related from the IPTV service, as they were down for maintenance this morning and after testing when it was all back up and running it seems fine, 16.6 be pushed on the playstore?

JFG90 commented 7 years ago

So it turns out it's still jittering, could someone have a look I've uploaded a new log, on 16.6 fresh install wih no build, paste is po8qfs8at

primaeval commented 7 years ago

From that log it looks like you played a channel from the flawless addon directly, not in windowed mode from a TV Guide. If that's the case and it jitters it that seems like a different issue to the one in this Issue that koying fixed. I'll butt out now and let the master take over. :)

JFG90 commented 7 years ago

Yes i didn't think it would matter doing it from the guide as it's the same issues using directly through the addon, will he see this?