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

Queuing broken #704

Closed
djreedoo opened this issue Apr 13, 2024 · 53 comments
Closed

Queuing broken #704

djreedoo opened this issue Apr 13, 2024 · 53 comments
Labels
bug Something isn't working

Comments

@djreedoo
Copy link

djreedoo commented Apr 13, 2024

Context

Please provide any relevant information about your setup

  • Add-on Version: 7.9.5
  • Kodi Version: Omega
  • Kodi GUI Language: french
  • Operating System: Coreelec S905X4 NE
  • Operating System Language: french

Expected Behavior

Please describe the behavior you are expecting.

Queuing to work

Current Behavior

What is the current behavior?
If I launch a single title from my phone, it perfectly works.
When adding YouTube titles from my phone to queue, I can see them added in queue in Yatse but when the current title ends it returns to homescreen.
If I launch a whole playlist, I have an error message, If I launch a title while already playing one, it stops ans returns to homescreen.
I've used queuing for years without any problems but since a few month it regular.



Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Add titles to queue to Yatse
  2. Wait or press for next title

Log

Please include a complete debug log.

hastebin - ewiwadobat.pdf


Additional Information

Please provide any additional information that may be helpful.


@djreedoo djreedoo added the bug Something isn't working label Apr 13, 2024
@MoojMidge
Copy link
Collaborator

A debug log is required.

@neo-neo1
Copy link

neo-neo1 commented Apr 14, 2024

The latest version has indeed made the playlist more buggy than it already was. I'll get around to posting logs when I can.

@MoojMidge
Copy link
Collaborator

@neo-neo1 - perhaps, but I don't experience any issues with it, so without a log can't do much.

@djreedoo - FYI when you edit a post no notifications are sent, so I didn't see your log until someone else commented in this issue. Also your log has also been truncated because you have converted it to PDF without wrapping, next time just share a link to wherever you have uploaded the log.

As to the issues you are reporting:

When adding YouTube titles from my phone to queue, I can see them added in queue in Yatse but when the current title ends it returns to homescreen.

There is nothing shown in the log indicating anything is being queued, which is probably why nothing plays after the current title ends - nothing has been queued to be played after the current title. I don't use Yatse, so I don't know what it is doing, but whatever it is trying doesn't appear to be working. If you produce a debug log then that might provide more useful information, otherwise suggest raising an issue with Yatse.

If I launch a whole playlist, I have an error message

The error message is that your API key is invalid. Check it and make sure it is entered into the plugin settings correctly.

If I launch a title while already playing one, it stops ans returns to homescreen.

There is nothing shown in the log indicating this is happening. Are you trying to do this from Yatse or from within the plugin?

@tbjorheim
Copy link

I have the same issue. Here is a log when I started one, and then put another in queue. The first one played ok, but then it returned to the start screen instead of playing the second one.

https://paste.kodi.tv/saquvohilo.kodi

@MoojMidge
Copy link
Collaborator

Thanks, but I know why the playback may stop. I need to understand what leads up to that occurring, because I don't have the same issue.

I specifically need a debug log. It needs to include the period from when a video is queued, to when it fails to play.

@MoojMidge
Copy link
Collaborator

@tbjorheim - from your log, how many videos were in the playlist? Was it only two items, or more?

All - does the issue only occur when queueing a video while already playing the last video in a playlist? Does playback fail for any video that has not been queued in the last position of the playlist?

@djreedoo
Copy link
Author

@neo-neo1 - perhaps, but I don't experience any issues with it, so without a log can't do much.

@djreedoo - FYI when you edit a post no notifications are sent, so I didn't see your log until someone else commented in this issue. Also your log has also been truncated because you have converted it to PDF without wrapping, next time just share a link to wherever you have uploaded the log.

As to the issues you are reporting:

When adding YouTube titles from my phone to queue, I can see them added in queue in Yatse but when the current title ends it returns to homescreen.

There is nothing shown in the log indicating anything is being queued, which is probably why nothing plays after the current title ends - nothing has been queued to be played after the current title. I don't use Yatse, so I don't know what it is doing, but whatever it is trying doesn't appear to be working. If you produce a debug log then that might provide more useful information, otherwise suggest raising an issue with Yatse.

If I launch a whole playlist, I have an error message

The error message is that your API key is invalid. Check it and make sure it is entered into the plugin settings correctly.

If I launch a title while already playing one, it stops ans returns to homescreen.

There is nothing shown in the log indicating this is happening. Are you trying to do this from Yatse or from within the plugin?

I use it from Yatse but Kore experienced the same issue. I changed the Api Key and it now works in any situations described previously.
The remaining problem compared to a few month ago is that it takes 5 to 10s between titles it used to be 2 to 3.
Thank you for your time and kindness.

@MoojMidge
Copy link
Collaborator

Good to hear the problem is resolved. I'll leave this open though, would like to hear from the others who indicated they had similar problems.

The remaining problem compared to a few month ago is that it takes 5 to 10s between titles it used to be 2 to 3.

This is fixed in https://github.com/anxdpanic/plugin.video.youtube/releases/tag/v7.0.6%2Bbeta.1

Thank you for your time and kindness.

No problem

@tbjorheim
Copy link

@MoojMidge In the previous example I had two videos, but it's the same issue even if I add two or more. And it does not only fail during the last video in playlist. I'm only able to play one, then it stops. Even if I add many to the queue.

I enabled debug log and did the following:

Added video nr 1. When the video has started playing, I added two more. I checked the queue in Yatse and all three items are in the queue.

But when the first video ended, it stops playing and return back to the Kodi interface.

New log including debug log: https://paste.kodi.tv/isimiporuf.kodi

MoojMidge added a commit to MoojMidge/plugin.video.youtube that referenced this issue Apr 16, 2024
# Possibly fix issues reported in comments of anxdpanic#704
@MoojMidge
Copy link
Collaborator

@MoojMidge In the previous example I had two videos, but it's the same issue even if I add two or more. And it does not only fail during the last video in playlist. I'm only able to play one, then it stops. Even if I add many to the queue.

Yep, that's what I meant. The key is that you are queueing up another video while currently playing the last video in the playlist, as opposed to queueing up a whole bunch of videos all in one go, or queueing multiple videos one by one while not playing anything, or playing an existing playlist.

I enabled debug log and did the following:

Thanks. Strangely enough the debug log still doesn't show anything being queued. May need JSON-RPC or Announcer component debug logging for that. Regardless, seems to match what I think the problem may be.

Can you see if https://github.com/MoojMidge/plugin.video.youtube/releases/tag/v7.0.6%2Bbeta.2 resolves the problem?

@tbjorheim
Copy link

Can you see if https://github.com/MoojMidge/plugin.video.youtube/releases/tag/v7.0.6%2Bbeta.2 resolves the problem?

Tried this, and it does not work quite as it should.

If I start one video, and then queue another, the second video starts but it seems to start in the middle (maybe where I stopped it last time).

If I start one video, and then queue two more, it plays the first one and then the last one (it skipped the second one). In this case it's also start in the middle of the video, and not from start.

I haven't tested with adding a playlist. The way I use this is mainly to watch music videos. I start one, and then put others in queue. I have used this for a long time, and it has been working perfectly (only issue I must not send a new video to the queue when it's buffering between songs, then Kodi crashes). I also like the flexibility with this way of using it, since it's possible to send to the queue from multiple devices. But after the 7.0.5 update, something must have been changed. It was then it stopped working.

Let me know if you need any more information or testing. I really like it to get working again. :)

@MoojMidge
Copy link
Collaborator

MoojMidge commented Apr 16, 2024

only issue I must not send a new video to the queue when it's buffering between songs, then Kodi crashes

The reason why the queueing is not working as it should is because of a workaround to avoid this exact problem.

If I start one video, and then queue another, the second video starts but it seems to start in the middle (maybe where I stopped it last time).

This can be fixed (maybe)

If I start one video, and then queue two more, it plays the first one and then the last one (it skipped the second one). In this case it's also start in the middle of the video, and not from start.

Can you get me a debug log of this? Can't seem to replicate it myself

@neo-neo1
Copy link

Can confirm everything stated above. For me it occurs around 25% of the time so replicating it to get a debug log isn't straightforward.

@MoojMidge
Copy link
Collaborator

Can confirm everything stated above. For me it occurs around 25% of the time so replicating it to get a debug log isn't straightforward.

At this stage, even a non-debug log may be useful.

Alternatively can use the following in your advancedsettings.xml and leave it logging until the problem occurs. Can then remove it from advancedsettings.xml. See https://kodi.wiki/view/Log_file/Advanced for further details on usage.

<advancedsettings version="1.0">
    <loglevel hide="true">1</loglevel>
</advancedsettings>

MoojMidge added a commit to MoojMidge/plugin.video.youtube that referenced this issue Apr 17, 2024
# Possibly fix issues reported in comments of anxdpanic#704
@MoojMidge
Copy link
Collaborator

Another attempt at fixing the crashes without messing with playlists too much:
https://github.com/MoojMidge/plugin.video.youtube/releases/tag/v7.0.6%2Bbeta.2

Same version number as before, but has been updated. See if that works any better.

@tbjorheim
Copy link

Another attempt at fixing the crashes without messing with playlists too much: https://github.com/MoojMidge/plugin.video.youtube/releases/tag/v7.0.6%2Bbeta.2

Same version number as before, but has been updated. See if that works any better.

Installed this, and now things seems to work mostly as it should. :)

But when testing, two small issues occurred:

  1. One of the videos I have watched before started in the middle, as mentioned before. But only the first time. When I watched the same video again, it was from the beginning. Maybe just a temporary issue.

  2. I watched like 20 videos when testing it, and two times it stopped with an error. But I wasn't fast enough to see what the error said, and I can't find it in the log. Might be some temporary error, since the exact same video worked when I tried again later. I don't know how the plugin is set up to work if there is an error playing an item in the playlist. The best way would be to just skip the item and continue on the next item, but in these cases it stopped. I know that at least one of the times it happened, there was more items in the playlist.

But in overall, it works a lot better now. So thanks a lot for fixing this. :)

@MoojMidge
Copy link
Collaborator

2. I don't know how the plugin is set up to work if there is an error playing an item in the playlist. The best way would be to just skip the item and continue on the next item

This is what can lead to Kodi crashing as it ends up being very similar to this:

only issue I must not send a new video to the queue when it's buffering between songs, then Kodi crashes

The purpose of the workaround is to only continue when it is safe to do so by clearing the playlist and then reloading it a bit later when Kodi is no longer busy. If it just stops then that means the playlist wasn't reloaded. If you provide the logs can try and see why that may have occurred.

@neo-neo1
Copy link

Another attempt at fixing the crashes without messing with playlists too much: https://github.com/MoojMidge/plugin.video.youtube/releases/tag/v7.0.6%2Bbeta.2

Same version number as before, but has been updated. See if that works any better.

So far it seems 7.0.6 beta 2 alleviated the problem (knock on wood).

However, there's another intermittent queue adjacent problem which still occurs on 7.0.6 beta 2

If I start a video from queue then minimize it to navigate elsewhere in Kodi during that initial minimization of the video it'll start playing the next video in queue. Almost as if the playing video crashes and it starts playing the next video in queue. This doesn't occur often, about once in 25 tries.

@MoojMidge
Copy link
Collaborator

Really need a log to do anything. Even a non-debug log will identify if this is caused by the crash workaround or something else.

@MoojMidge
Copy link
Collaborator

Closing this with the release of v7.0.6+beta.2. If there are further related issues create a new issue and post a debug log.

@djreedoo
Copy link
Author

Thank you very much!

@Doktor-X
Copy link

Doktor-X commented Apr 28, 2024

@MoojMidge I still have problems with this, i have try all sort of things downgraded coreelec from 21 nightly to regular then from regular to 20 (because I thought that was the problem, and that something changed over time in kodi itself) and still cant start video playing from yatse queuing or even start playing new video when old one is still running, this all worked for long time and now its not.

@MoojMidge
Copy link
Collaborator

MoojMidge commented Apr 28, 2024

Can't do much without a debug log

@Doktor-X
Copy link

Doktor-X commented Apr 28, 2024

Can't do much without a debug log

I have entire log with almost all options enabled its [REDACTED]mb in size, but i see that its contains all sorts of personal info like ip and so, so im not comfortable uploading that publicly. How can i send it to you privately?

@MoojMidge
Copy link
Collaborator

MoojMidge commented Apr 28, 2024

@Doktor-X - I tried editing your previous message to remove the size from the text and it appears to have worked, as that information is now gone from the message, and the edit history.

You can go https://gist.github.com/ and create a secret gist with your log. Note that not all of the log is required, just the part from when you queue a video and/or try to start playing it.

You can then add the link to the secret gist here and I can delete it once I have opened it. You can then delete the gist as well.

Note that there is still a chance that someone can see the link before I delete it.

Alternatively you can try and contact me on Discord. My username is the same as on Github.

@MoojMidge
Copy link
Collaborator

@Doktor-X - Don't need to do anything with your device. While I didn't expect Yatse to be doing what it is doing, there is nothing technically wrong with what it is doing, and a proper bug fix may not come for a long time (or at all) from Kodi, so in the meantime will see what can be done in this plugin.

If you can install v7.0.7+beta.1 and then just test this:

If i send yt video to kodi while video is still playing then that corrent video stop and new begin, and if i queuing video then kodi display message that video is added to queuing and when corrent video go to end new video start.

If it doesn't work then you can send a new debug log, otherwise just let me know that it is now working OK.

@Doktor-X
Copy link

I'll test later tonight and let you know the results and send the log if it doesn't work. The worst thing about this whole story is that I don't know exactly when the problems started, so I can go back to it. Although question is if i even knew when problems started would it be able to start the video when youtube is constantly changing its api

@MoojMidge
Copy link
Collaborator

I know when the problem started, because it is caused by a workaround for another bug, but you won't be able to go back to a version without the issue due to Youtube changes.

I am not willing to remove the workaround because without it I experience fairly regular crashes, but if I can't resolve these unintended side effects then will need to make it optional.

See how you go, hopefully it is all sorted now.

@Doktor-X
Copy link

woo-hoo, its working, using 7.0.7 beta1 works, now again i can start playing new video when old one is still playing and i can add videos to queue, thanks Mooj for fix, now i dont know is anything broken with this change but at least this problem is fixed or patched

@MoojMidge
Copy link
Collaborator

That's good. It was not tested apart from making sure it loads without error, so something is bound to have broken, but if there are no major issues can merge it here and release for wider testing.

@Doktor-X
Copy link

At the moment all is working (at least on amlogic s905x3 coreelec), all videos play in 4k, skipping all over video works, age gate videos also works (account login requirement ofc)

@neo-neo1
Copy link

neo-neo1 commented May 1, 2024

At the moment all is working (at least on amlogic s905x3 coreelec), all videos play in 4k, skipping all over video works, age gate videos also works (account login requirement ofc)

Do you use CoreELEC? I'm also on a S905X3 box

@Doktor-X
Copy link

Doktor-X commented May 1, 2024

Do you use CoreELEC? I'm also on a S905X3 box

Yes nightly build

@MoojMidge MoojMidge mentioned this issue May 3, 2024
@Fludizz
Copy link

Fludizz commented May 4, 2024

I have managed to get a debug log if thats still required for this issue.

With 7.0.6 - the queuing works a lot better than older versions but we still have a high rate of misses in one specific scenario:
After a fresh reboot, start a Youtube video, and queue another video. In the vast majority of cases this fails to continue to play. When this first video and failure to play has happened, the issue does not reoccur until the box is rebooted.

We see this behaviour on RPi5, RPi3 and x86 Generic versions of LibreELEC12.0.0. The debuglog is for the x86 Generic box.
kodi.log

@Doktor-X
Copy link

Doktor-X commented May 4, 2024

I have managed to get a debug log if thats still required for this issue.

With 7.0.6 - the queuing works a lot better than older versions but we still have a high rate of misses in one specific scenario: After a fresh reboot, start a Youtube video, and queue another video. In the vast majority of cases this fails to continue to play. When this first video and failure to play has happened, the issue does not reoccur until the box is rebooted.

We see this behaviour on RPi5, RPi3 and x86 Generic versions of LibreELEC12.0.0. The debuglog is for the x86 Generic box. kodi.log

Not for me, i have just try reboot my coreelec 21.1 nightly, started video after reboot using yatse and when video started i started new video again and this works

@neo-neo1
Copy link

neo-neo1 commented May 7, 2024

Yeah Queue is is still broken but I stopped mentioning it since I dont have access to pull a log currently. A few Queue issues exist such as it soft crashing and the entire list of Queued videos disappears.

@Fludizz
Copy link

Fludizz commented May 7, 2024

Got another random occurrence of Queuing failing - unfortunately no debug logging enabled at the time, but I did see this in the normal log that could be a pointer. Seemingly it was unable to play a video from the playlist ("unplayable"), twice, and that triggered an issue. It must be noted that both video's were played successfully after the queue stopping.

2024-05-07 18:26:47.578 T:1486     info <general>: COutput::OnExit: Output Thread terminated
2024-05-07 18:26:47.578 T:949      info <general>: VAAPI::Close - closing decoder context
2024-05-07 18:26:47.580 T:949      info <general>: GLES: Selecting YUV 2 RGB shader
2024-05-07 18:26:47.791 T:959      info <general>: CActiveAE::ApplySettings - Forcing samplerate to 48000
2024-05-07 18:26:48.029 T:1124     info <general>: [plugin.video.youtube] Running: YouTube (7.0.6.3) on Omega (Kodi-21.0) with Python 3.11.9
                                                   Path: /play/
                                                   Params: {'video_id': 'WCW6pxB-KKg'}
2024-05-07 18:26:48.045 T:949     error <general>: Playlist Player: skipping unplayable item: 1, path [plugin://plugin.video.youtube/play/?video_id=WCW6pxB-KKg]
2024-05-07 18:26:48.277 T:1124  warning <general>: [plugin.video.youtube] Multiple busy dialogs active - playlist cleared to avoid Kodi crash
2024-05-07 18:26:48.434 T:1497     info <general>: [plugin.video.youtube] Running: YouTube (7.0.6.3) on Omega (Kodi-21.0) with Python 3.11.9
                                                   Path: /play/
                                                   Params: {'video_id': 't3swShFvtZg'}
2024-05-07 18:26:48.445 T:949     error <general>: Playlist Player: skipping unplayable item: 2, path [plugin://plugin.video.youtube/play/?video_id=t3swShFvtZg]
2024-05-07 18:26:48.445 T:949   warning <general>: Attempt to set unplayable index 2
2024-05-07 18:26:48.445 T:949      info <general>: CVideoPlayer::CloseFile()
2024-05-07 18:26:48.445 T:949      info <general>: VideoPlayer: waiting for threads to exit
2024-05-07 18:26:48.445 T:949      info <general>: VideoPlayer: finished waiting
2024-05-07 18:26:48.445 T:949      info <general>: CVideoPlayer::CloseFile()
2024-05-07 18:26:48.445 T:949      info <general>: VideoPlayer: waiting for threads to exit
2024-05-07 18:26:48.445 T:949      info <general>: VideoPlayer: finished waiting
2024-05-07 18:26:49.277 T:1124  warning <general>: [plugin.video.youtube] Multiple busy dialogs active - reloading playlist
2024-05-07 18:26:49.286 T:1124    error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'ValueError'>
                                                   Error Contents: invalid literal for int() with base 10: 'None'
                                                   Traceback (most recent call last):
                                                     File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/plugin.py", line 17, in <module>
                                                       plugin_runner.run(youtube.Provider())
                                                     File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/plugin_runner.py", line 61, in run
                                                       plugin.run(provider, context)
                                                     File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/plugin/xbmc/xbmc_plugin.py", line 75, in run
                                                       if old_position and position == int(old_position):
                                                                                       ^^^^^^^^^^^^^^^^^
                                                   ValueError: invalid literal for int() with base 10: 'None'
                                                   -->End of Python script error report<--
                                                   
2024-05-07 18:26:54.436 T:1497  warning <general>: [plugin.video.youtube] Multiple busy dialogs active - playlist cleared to avoid Kodi crash```

@MoojMidge
Copy link
Collaborator

Doktor-X is using a newer beta version that already fixes the known issues with queuing. An updated version of that beta is available here: #740

@Fludizz, @neo-neo1 - are you still having issues when using this beta version?

@neo-neo1
Copy link

neo-neo1 commented May 8, 2024

Doktor-X is using a newer beta version that already fixes the known issues with queuing. An updated version of that beta is available here: #740

@Fludizz, @neo-neo1 - are you still having issues when using this beta version?

7.0.7 beta 1 doesn't open at all. Can't even open anything — error dialog popup:
"YouTube Error"
"Check the log for more informationm"
Has it been tested for Kodi 21?

And I get Kodi freezing when selecting "Restart Kodi" from Power UI on CoreELEC.

Appreciate your effort

Edit: heres a full debug log, more info than you need so please let me know when I can delete the link.

@neo-neo1
Copy link

neo-neo1 commented May 8, 2024

@MoojMidge thanks

@djreedoo
Copy link
Author

djreedoo commented May 8, 2024

This issue seems to be very tricky!
Thanks everyone for your time and work, really appreciated!

@Fludizz
Copy link

Fludizz commented May 8, 2024

Doktor-X is using a newer beta version that already fixes the known issues with queuing. An updated version of that beta is available here: #740

@Fludizz, @neo-neo1 - are you still having issues when using this beta version?

I'll have to try that a bit later, sorry. I wont have access to my kodi boxes in the next few days.

@MoojMidge
Copy link
Collaborator

@neo-neo1 - the stuff in my personal repository is almost never tested, it is just a backup and testing repository. When it has been tested, at least a little, I will create a PR on the official repository here where it can get tested further.

The log you sent through is from the old version from my personal repository. It has a number of issues in the non-unofficial zip file, as you have seen for yourself. The newer update is in the PR I linked to in this official repository and fixes those issues, but requires that you pull those changes via git. If you don't know how to do that, then just skip it for now, can download the zip file to test when the PR is merged.

Hadn't merged it yet because the Kodi mirrors were having some issues which was preventing the PR checks from completing.

@MoojMidge
Copy link
Collaborator

https://github.com/anxdpanic/plugin.video.youtube/releases/tag/v7.0.7%2Bbeta.1 is available. Can see if there is any improvement to this issue.

@Fludizz
Copy link

Fludizz commented May 12, 2024

Installed it on my kodi boxes and so far, it seems to have fixed it! Have not had any instances where it stopped playing the queue.
Thanks @MoojMidge !

@neo-neo1
Copy link

Installed it on my kodi boxes and so far, it seems to have fixed it! Have not had any instances where it stopped playing the queue. Thanks @MoojMidge !

Not for me

@MoojMidge
Copy link
Collaborator

If there are more edge cases, or other scenarios that may not be accounted for, I can see what else can be done, but without actual details can't do anything.

It will likely never fully be solved, but the alternative is Kodi crashing, which is obviously a worse result, so on balance think this issue can be considered resolved for now.

If something new comes to light, can create a new issue, or post the details here and this can be reopened.

@neo-neo1
Copy link

7.0.7 Beta 1 introduced another problem. 10% of the time when I open a video from the playlist it'll not play and opens a 'playlist error not found' Kodi pop-up window with an "Ok" button. But opening it again after that error will open successfully and work as expected. This results in having to double open when using playlist, affects roughly 10% of the time.

@MoojMidge
Copy link
Collaborator

Can you get a log of this? Even a non-debug log will be better than nothing

MoojMidge added a commit to MoojMidge/plugin.video.youtube that referenced this issue May 29, 2024
MoojMidge added a commit to MoojMidge/plugin.video.youtube that referenced this issue Jun 8, 2024
@MoojMidge MoojMidge mentioned this issue Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants