fgl27 / smarttv-twitch

Twitch client for Samsung Smart TVs 2015 and newer models, in doubt read the README bellow
GNU General Public License v3.0
165 stars 18 forks source link

Ads playing crashing the app #277

Open Elapsed opened 10 months ago

Elapsed commented 10 months ago

Describe the bug Ads, starting Sep 1st have started to play, and when they finish the app fully crashes. When trying to relaunch the app, when you play a channel the same round of ads will play again, and again they crash. The only workaround is watching in an official app, watching the group of ads, rebooting the tv, and then watching again.

Now the ads don't always crash the app, but it does cause audio and video glitches for a short time after the ads play.

I don't have it installed with the debug tool, I will do that now and get a log tomorrow, but I felt this was important to get up.

To Reproduce Steps to reproduce the behavior:

  1. Go to any channel with ads
  2. Watch ads
  3. Right at the end of the ads the app crashes

Expected behavior I expected no ads, as you have had it that way for many years now. But as long as I can watch without it crashing I'm happy

Device:

Elapsed commented 10 months ago

I cannot get the debug tool to launch, not sure why

Screenshot 2023-09-02 224049

fgl27 commented 10 months ago

I don't know why the tool will not work.

If you can share the logs will help.

There is s related issue

https://github.com/fgl27/smarttv-twitch/issues/241

Yozze85 commented 10 months ago

I have the same problem on my Q8FN but not on my Q60R.

I am surprised that i even get ads when i am subscribed to a channel.

Did twitch change something on their API or why are there suddenly ads showing?

fgl27 commented 10 months ago

I have the same problem on my Q8FN but not on my Q60R.

I am surprised that i even get ads when i am subscribed to a channel.

Did twitch change something on their API or why are there suddenly ads showing?

the app doesn't have access to your twitch sub or turbo privileged.

you can see what the app has here

https://github.com/fgl27/smarttv-twitch#twitchtv-app-for-samsung-tv-authorization-request-page

twitch sometimes doesn't show ads for some reason now they show to more people.

No "me too" please, one person reporting an issue is fine, we need someone to help debug and not add to the complaining.

Yozze85 commented 10 months ago

well you say it as if i wouldnt have provided further information by telling where the problem occurs and where not.

i could try to help with debugging but i am not familiar on how to debug samsung tv apps.

fgl27 commented 10 months ago

well you say it as if i wouldnt have provided further information by telling where the problem occurs and where not.

i could try to help with debugging but i am not familiar on how to debug samsung tv apps.

Here is the how to log

https://github.com/fgl27/smarttv-twitch/issues/250#issuecomment-1328306442

maeseoki commented 9 months ago

Hello @fgl27 . I managed to debug the application when crashing while playing ads (used Chromium 74 because "--disable-web-security and "--disable-site-isolation-trials" flags wasn't working for me).

Here is the screenshot when the crash occurs: Crash 1

And the code in the debugger i that column:

Captura de pantalla 2023-09-30 210544

Hope it helps to find the problem here. Dont heasiate to ask If you want me to try something.

fgl27 commented 9 months ago

It does help, but not to resolve.

that crash is outside the app code, on the Samsung avplayer API, that the app doesn't control.

@maeseoki can you run the test again but this time install not from release?

If yes install it by downloading the repo

From

https://github.com/fgl27/smarttv-twitch/archive/refs/heads/master.zip

Or from the main page... code > download zip

image

and them here https://github.com/fgl27/smarttv-twitch#setup-the-application

import this folder https://github.com/fgl27/smarttv-twitch/tree/master/app

and then when the error occurred before screenshotting open these triangular buttons

image

like this, so we can see the full path it takes to crash

image

Maybe with this extra info, we will understand this better and help.

Thanks for the help.

jazha commented 7 months ago

I am currently trying to get the debug app to work on my TV as OP seems to be missing.

I had to setup Tizen Studio etc from scratch, and I have imported the "app" folder from the master branch. I deleted the Twitch app from the TV. When I try to run it I get this error, and it is so unspecified I dont even know where to start.

Please advice

2023-11-29 13_11_40-workspace - Tizen Studio

fgl27 commented 7 months ago

That is a Tizen SDK bug.

On windows it has various problems, Samsung doesn't properly support it.

As is an java error maybe changing the java version helps but maybe not.

So try a old version of java to see if that helps.

I use Ubuntu and is working fine, but the last time I update Tizen was months ago. So if someone try that maybe buged also.

jazha commented 7 months ago

Thanks for the quick reply, I will find a spare machine here to setup with Ubuntu tonight, and then hopefully get some debugging done.

jazha commented 7 months ago

I have my spare laptop setup and I finished configuring the Tizen studio, with certificates etc. I could finally reupload the app to the TV successfully using the 4.0.1_V9.zip file

I wanted to test Tizen studio using that file as I cannot figure out any way to get past the error I get when trying to install the from the "app" folder in the master.zip.

Is there something I need to do before I can use the master.zip to install the debug version? Any extra steps etc? I get the same error as above for the master.zip method to try to get debug version installed.

My TV is Tizen 3.0, if that has any implications

fgl27 commented 7 months ago

No diff the install process is the same, the normal mode and debug must give you the same error.

does?

jazha commented 7 months ago

No diff the install process is the same, the normal mode and debug must give you the same error.

does?

I can install and run both modes from the 4.0.1_V9.zip. I get no output in debug mode from running it from this file.

I cannot install or run any of the modes from importing the app folder in the master.zip.

Not sure how to proceed. Should I get output from the app running it in debug when using the files from 4.0.1_V9.zip ?

jazha commented 7 months ago

I got it running, apparently I needed to build a signed package first, I did not realize it wouldnt just do it itself automatically. I got the master.zip version running now, but debug on my ubuntu machine only shows a blank white page. Suggestions of how to get them to talk together?

fgl27 commented 7 months ago

None, let me see it

jazha commented 7 months ago

It looks like the debugger backend isnt working correctly somehow. It gives no error, just a blank white page after uploading the app to the tv via the "run debug as" meny

debug

fgl27 commented 7 months ago

What browser is that?

Chrome always works for me, but you need to defined it as default browser.

jazha commented 7 months ago

What browser is that?

Chrome always works for me, but you need to defined it as default browser.

It is the latest chrome, and it is configured in the studio. Problem is it comes up blank. I tried googling, and the answer seemed to be to try older versions, which I did. I tried different versions of both Chrome and Chromium, unfortunately none worked correctly, so I'm stuck for now.

Its late here, so I will try more after I get some sleep. Hopefully I can get it debugging tomorrow

jazha commented 7 months ago

Got it running I think, I could not sleep and tried alot of different solutions from various sources on the internet. Could you confirm I am in the right place? Should I look in the console for logs, or is there somewhere else? I'm off sleep now, hopefully getting something running will ease my brain ;)

console

fgl27 commented 7 months ago

Just the console, reproduce the issue a few times

Open any log that has a button in the form of a triangle and take some screen shots

jazha commented 7 months ago

Hello, I caught the crash, here is the only error it shows in console. It keeps throwing the same error multiple times over and over, black screen on TV and no resuming of the stream. If you need more info from somewhere else, or more data, just let me know.

error

fgl27 commented 7 months ago

No that is it.

The player has already those two methods that are supposed to check if the player for some reason stops and restores things.

But I didn't expect that crash, I will add an improvement to account for crashes, and wherever it happens the player will just restart the playback.

I let you know when this is pushed to the app.

Thank you great work!

jazha commented 7 months ago

No that is it.

The player has already those two methods that are supposed to check if the player for some reason stops and restores things.

But I didn't expect that crash, I will add an improvement to account for crashes, and wherever it happens the player will just restart the playback.

I let you know when this is pushed to the app.

Thank you great work!

Nice to hear, and happy to be able to help with this.

The app is a great service to us with a TV that doesnt have Twitch available by normal channels.

I should be the one to thank you for your continued support to the project :)

Looking forward to testing the app when the push has gone through. Thanks again!

fgl27 commented 7 months ago

The above was deployed to the app if you have the release installed it must receive the update, just close the app if open and reopen it for it to receive it.

The behavior now must be that the app will detect the problem and restart the player, but as I can't get this I don't know the behavior so it may just restart and work or something else.

If the problem persists repeat the log pelase.

jazha commented 7 months ago

Hello, I updated the app and checked that it had the new date set in app. The ad that causes the crash ran directly, and unfortunately it crashed again, see attached image for console output error2

fgl27 commented 7 months ago

Yes the player is gone there....

After that can you exit the player, then open a new stream and it plays fine?

jazha commented 7 months ago

The player crashed after exiting the ad and trying to restart the stream.

It looks like the player tries to continue after the ad crash: error3part1

Errors after the player tries to play(I still havent touched any buttons at this point), seems to fail. error3part2

After exiting the ad, and trying to restart stream, the app just closes, I get no error in console unfortunately, this is the last messages before the crash: error3part3

Hope it helps to narrow it down :)

fgl27 commented 7 months ago

Seems that the player is just gone, I have no idea how to recover from this error, and the biggest problem is that it crashes the app itself, which is almost impossible to achieve unless is an OS problem related to the player implementation on Tizen, which this problem is.

The above separates it player initialization function, it may fix but if it doesn't I can have some more info trying to understand what to do next.

please test again and share the logs even if work share it.

jazha commented 7 months ago

Two logs here, first one is the same type of crash we had with the ad. Next is the app actually managing to survive the crash, so it worked 1 out of 2 times :)

Log for crash, without recovery: error4

Log for crash with successful recovery: works1

fgl27 commented 7 months ago

OK, will see if I can improve this. Later I share another update.

Thank you!

jazha commented 7 months ago

OK, will see if I can improve this. Later I share another update.

Thank you!

No, thank you! I just had the same ad, and it managed to recover again. Will post more if I can figure out the condition for the first crash. For now, the fix is successful 2 out of 3 times :)

fgl27 commented 7 months ago

The above must improve things, not 100% as this will probably never be 100% unless Samsung deals with the issues.

Test and let me know the result.

jazha commented 7 months ago

The above must improve things, not 100% as this will probably never be 100% unless Samsung deals with the issues.

Test and let me know the result.

I havent had the correct ad to test the crashing yet, but I have had 2 random crashes without any logs being posted to the console with the last version.

fgl27 commented 7 months ago

Very odd, the app closes the player before logging, maybe is the closing that crashes

Will add some log to see if it's

jazha commented 7 months ago

Very odd, the app closes the player before logging, maybe is the closing that crashes

Will add some log to see if it's

I'll be able to run more tests tomorrow, for now I need to get to sleeping, its past midnight here just now.

fgl27 commented 7 months ago

Thank you no rush.

I push the above just to be sure closing is crashing the app.

When you have time to test let me know the result.

fgl27 commented 7 months ago

Here is some link from Samsung documentation

https://www.samsungdforum.com/b2b/Guide/GuideT3/TIZENH_GUIDE

The above is very helpful for TV apps as it has various TV-specific helps

image

This is the original Samsung Avplay documentation

https://developer.samsung.com/smarttv/develop/api-references/samsung-product-api-references/avplay-api.html

Anyone who wanna try something, can just download the main repo and modify the content of the app folder and install it just like explained on the main page but on the import step use the app folder not the extracted release.

jazha commented 7 months ago

I was able to watch for a few hours today before a crash. The ad that crashes on it recovered from 3 or 4 times successfully. I wasnt watching just as the app crashed, so I cannot tell if it was from an ad or just the player crashing, maybe you can tell from the logs.

This was the crash I believe error5

I saw this further down, but I dont belive it is connected to the crash issue error6

And finally this is a log from a successful recover from an ad crash: works2

I am going to take a look at the documentation, to see if it has specifices for my TV. For now the results seem random if the app will crash or not, but its much better than before we started the debug :)