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

Video stream max resolution 720p after Shield sleep -> wakeup #699

Closed
pipsen opened this issue Apr 12, 2024 · 12 comments
Closed

Video stream max resolution 720p after Shield sleep -> wakeup #699

pipsen opened this issue Apr 12, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@pipsen
Copy link

pipsen commented Apr 12, 2024

Context

Please provide any relevant information about your setup

  • Add-on Version: 7.0.5
  • Kodi Version: 12.0.0 Omega
  • Kodi GUI Language: German
  • Operating System: Nvidia Shield Android
  • Operating System Language: German

Expected Behavior

My Youtube Plugin setting for streamselection is "quality". If everything is working fine, it should select a 4K stream, if available.


Current Behavior

When KODI is up and running together with DENON AVR and TV, everything is working fine.
As soon as I put NVIDIA Shield to sleep and switch off TV and DENON.. after a wakeup the streamselection decides to 720p.


Steps to Reproduce

  1. Starting condition is an up and running KODI, AVR and TV
  2. Put Shield to sleep mode, switch off TV and AVR
  3. Wait for some time, until sleep really in place (check: KODI web interface not responding any more)
  4. Wakeup from sleep, switch on AVR and KODI
  5. Start 4K youtube video -> Video is playing in 720p
  6. Quit KODI -> Nvidia Shield main menu
  7. Start KODI from main menu
  8. Start same Youtube video again -> playing in 4K

Log

Debug Log #1 after wakup (steps 1-6)
kodi-afterSleep.log

Debug Log #2 after restart (steps 7-8)
kodi-afterRestart.log


Additional Information

compare


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

MoojMidge commented Apr 12, 2024

Why not respond in #633 when details were asked for? Worked around the problem there, but your system/network seems broken and fails again when resuming from sleep.

How is your local network set up? Are you using a VPN? Why don't you listen on 0.0.0.0 in the plugin settings?

There is an option in Kodi for Maximum wait time for network, try enabling that and see if it helps.

@pipsen
Copy link
Author

pipsen commented Apr 12, 2024

  • no server is used, just a KODI in a local home network with internet access
  • no special settings for local network, just normal static IP, Subnetwork, default Gateway, DNS, nothing unusual
  • I will retest retest with powermanagement.waitfornetwork = 10s
  • no special kodion settings:

<setting id="kodion.http.listen" default="true">0.0.0.0</setting> <setting id="kodion.http.port" default="true">50152</setting> <setting id="kodion.http.ip.whitelist" default="true" /> <setting id="kodion.access_token" default="true" /> <setting id="kodion.access_token.expires" default="true">0</setting> <setting id="kodion.mpd.hdr" default="true">true</setting> <setting id="kodion.mpd.limit.30" default="true">false</setting> <setting id="kodion.mpd.live_stream.selection.1" default="true">0</setting> <setting id="kodion.mpd.live_stream.selection.2" default="true">0</setting> <setting id="kodion.mpd.live_streams" default="true">true</setting> <setting id="kodion.mpd.proxy.port" default="true">8000</setting> <setting id="kodion.playback.history" default="true">false</setting> <setting id="kodion.refresh_token" default="true" /> <setting id="kodion.video.quality.mpd" default="true">true</setting>

@MoojMidge
Copy link
Collaborator

nothing unusual

Nothing unusual except the device name used for hostname is an IP address, your device loopback interface doesn't work, and all your local services are binding to a network interface.

What shows up when you go to Settings > Advanced > HTTP Server > Select listen IP?

@pipsen
Copy link
Author

pipsen commented Apr 13, 2024

There are two fields:

  • Listen IP: 0.0.0.0
  • Select Listen IP: empty

=> When I click on "Select Listen IP", I can choose between 0.0.0.0, 127.0.0.1 and 10.10.10.50 (my static IP). But the addon some exits and nothing has changed when I enter again the settings.

@MoojMidge
Copy link
Collaborator

When I click on "Select Listen IP", I can choose between 0.0.0.0, 127.0.0.1 and 10.10.10.50 (my static IP). But the addon some exits and nothing has changed when I enter again the settings.

Try and use 10.10.10.50 then. It is what everything else on your system is doing.

@pipsen
Copy link
Author

pipsen commented Apr 14, 2024

Try and use 10.10.10.50 then. It is what everything else on your system is doing.

Alright, I will give it a try and will return in a few days - thank you

@pipsen
Copy link
Author

pipsen commented Apr 15, 2024

IP address has changed in log, but problem still the same
kodi.log

I can understand, that have some network errors during the nighttime, as the NVIDIA Shield is somehow in sleep mode. I also can not access via HTTP Remote Control or Web Interface during that time.

But I dont understand the network issues at 2024-04-15 15:44:53.410 T:8515 when everthing is up and running, and I would like to playback a youtube video. As soon as I restart KODI, the problem is gone -> Indicator for a bug, not a misconfiguration.

@MoojMidge
Copy link
Collaborator

Unfortunately I don't have any good ideas as to how to resolve your particular issue.

As I said, for some reason your loopback interface doesn't work, and when putting your device to sleep the http server that this plugin uses is not shutdown properly and therefore can't restart properly.

This plugin uses a fixed port so that people can easily access the API configuration page, so once that port is selected it needs to be accessible, and once bound it needs to be able to be unbound when the http server stops. I am not sure if there is anyway for a plugin to know that your device is going to sleep, but because it doesn't know, it doesn't do this.

If a random port was used, then the problem could be ignored. That's the only thing I can think of that may work.

@MoojMidge
Copy link
Collaborator

How do you normally put your device to sleep?

Have made some changes so the http server will shutdown when Kodi is idle.

I don't think it will necessarily help your situation, but it might be able to shutdown before your device goes to sleep, and therefore then be able to restart properly.

You can test it using https://github.com/MoojMidge/plugin.video.youtube/releases/tag/v7.0.6%2Bbeta.2

@pipsen
Copy link
Author

pipsen commented Apr 20, 2024

How do you normally put your device to sleep?

Two ways... either via idle timeout and automatic sleep after a while, or via an adb command sent by my ioBroker via Harnomy remote "input keyevent KEYCODE_SLEEP"

At the moment I use a workaround, when I switch off with ioBroker with a script:

  • Close Kodi application
  • put NVIDIA Shield to sleep

Switch on:

  • wake up NVIDIA
  • startup KODI app

=> Consequently, I have a freshly started KODI, and the problem does not appear. But I will test you beta anyways

@MoojMidge
Copy link
Collaborator

via idle timeout and automatic sleep after a while

The http server shut-down on idle should work in this scenario. The timeout in the plugin is 30s, so as long as your device only goes to sleep after an idle period greater than that, it should avoid this problem.

MoojMidge added a commit to MoojMidge/plugin.video.youtube that referenced this issue Apr 21, 2024
- Attempt to shutdown before network interface stops anxdpanic#699
- Can't use onScreensaverActivated/onScreensaverDeactivated as screensaver may not be enababled
@Uukrull
Copy link
Contributor

Uukrull commented Apr 21, 2024

I had the same problem with my Shield TV and the latest beta fixed it. Many thanks!

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

3 participants