anxdpanic / plugin.video.youtube

Watch your favorite YouTube content on Kodi
https://ytaddon.panicked.xyz/forum
700 stars 113 forks source link

Audio skipping on Vero V #928

Open MoojMidge opened 1 month ago

MoojMidge commented 1 month ago
  • It has a 3 second black out of video and audio in the first 5-10 seconds, then it has audio dropouts every 3 seconds continuously.

There is a lot going on in your log. Your settings appear to indicate that you have an 8 channel speaker setup. Is this actually the case?

It's actually a 5.1.2 (Dolby Atmos w/ 2 up-firing,) setup, which is confusing how to actually configure in the settings. It's pretty happy up or down-mixing, however.

Can you get a debug log where you are only playing the video that skips continuously?

I've attached a new log with just the attempt to play the video that skips audio.

kodi.log

Originally posted by @scrampker in https://github.com/anxdpanic/plugin.video.youtube/issues/920#issuecomment-2398252248

MoojMidge commented 1 month ago

Can you describe in greater detail what actually happens when the audio skips?

Does the video skip or lag as well?

Does the audio pop or is there any other distortion, hiss, or noise? Or does it just stop and restart?

scrampker commented 1 month ago

Hopefully this will help: 00s - start video. audio and video start like normal. 02s - video and audio together both black out/drop out for 2-3 seconds. 04s - video and audio together both return for 5 seconds. 07s - audio drops out for 2 seconds. 09s - audio returns for 5 seconds. 14s - audio drops out for 2 seconds. 16s - audio returns for 5 seconds.

rinse, repeat. There's no other distortion or artifacts. The video continues to play fine. Typically when I see this issue, I do notice that the feed is VP9... however I've tried intentionally changing the feed from the in-video menu, and even when I drop to h264 or whatever, it continues to skip.

dtteufel commented 1 month ago

@MoojMidge
Feel free to delete if you consider this irrelevant!

I am also seeing/hearing an occasional Audio dropout when playing YouTube videos. This occurs randomly, perhaps around every 10 min, and lasts for about second. Audio simply goes silent and then resumes. Nothing is logged - either in normal or Debug log. Since the event throws no exception messages or triggers any other Error Message.

I am left wondering if this is perhaps not a YT plug-in issue - perhaps a Kodi bug.

Perhaps related to these settings? From System/Settings Menu Settings level: Advanced Description: Set the properties of the audio output. Available options are as follows:

Fixed - Output properties are set to the specified sampling rate & speaker configuration at all times. This option disables passthrough.
Best Match - Output properties are set to always be as close a match to the source properties as possible.
Optimised - Output properties are set at the start of playback and will not change if the properties of the source change.
MoojMidge commented 1 month ago

Feel free to delete if you consider this irrelevant!

Not at all, it is useful information

Nothing is logged - either in normal or Debug log.

Perhaps enabling component specific logging for the following may indicate something:

The lack of anything obvious was why I was asking questions - at first glance there doesn't appear to be anything wrong in the log associated with the YouTube plugin or audio in general. However...

00s - start video. audio and video start like normal. 02s - video and audio together both black out/drop out for 2-3 seconds. 04s - video and audio together both return for 5 seconds.

This is expected due to the change in display refresh rate

07s - audio drops out for 2 seconds. 09s - audio returns for 5 seconds. 14s - audio drops out for 2 seconds. 16s - audio returns for 5 seconds.

This is not expected, but as per the log seems to match the ongoing download of the individual audio and video segments.

@dtteufel - I think your issue may be different if it is not happening repeatedly at a repeatedly fast frequency i.e. every few seconds

Perhaps related to these settings?

Is there any change in changing Settings > System > Audio > Output configuration to Optimised?

@scrampker - can you try turning off YouTube > Settings > General > Stream features > Enable AAC audio and seeing if there is any difference?

scrampker commented 1 month ago

Unfortunately toggling AAC audio does nothing for the skips. I tried disabling vorbis, opus, aac, surround sound audio, ac-3, eac-3, and DTS, and the skipping audio persists.

Interestingling, when I force it to audio only, it says Opus 2.0 for the stream, and there's no skipping, other than that weird @1s blip on every video ever.

scrampker commented 1 month ago

Disabling high framerate video resolves the skipping problem. I can re-enable all other features and it still plays smoothly.... however... the resulting video is some really low-quality stream. I suppose when 60fps is denied, it drops down to some transcoded 480p VP9 version. When I browse available streams, there's nothing higher.

scrampker commented 1 month ago

Okay, so what I'm seeing is that some videos have 30fps copies at 1080p or whatever, but it's fairly common to not have full-res when high fps is disabled. Interesting issue. I can't imagine the Vero V would choke on 4k60 let alone 1080p60.

scrampker commented 1 month ago

I do wonder if the skin can affect any of this? I noticed that I still get the @2s dropout at the beginning of every video. Sure wish I could get rid of that, and also enable high frame rate. Let me know if you need any other logs. Thanks for all the hard work!

MoojMidge commented 3 weeks ago

Disabling high framerate video resolves the skipping problem. I can re-enable all other features and it still plays smoothly.... however... the resulting video is some really low-quality stream.

Can you link to an example video?

scrampker commented 3 weeks ago

Disabling high framerate video resolves the skipping problem. I can re-enable all other features and it still plays smoothly.... however... the resulting video is some really low-quality stream.

Can you link to an example video?

Video of the initial black-out: https://youtu.be/moBeCsSfrN8

Also, any thoughts on why high frame-rate video causes the recurring skips?

MoojMidge commented 3 weeks ago

Video of the initial black-out: https://youtu.be/moBeCsSfrN8

I meant can you link to a video where you see playback using a low quality stream when you disable the high framerate video setting and where enabling high framerate video results in skips. But I think I may know what causes that problem anyway.

Also, any thoughts on why high frame-rate video causes the recurring skips?

Nope. As mentioned before:

This is not expected, but as per the log seems to match the ongoing download of the individual audio and video segments.

Perhaps enabling component specific logging for the following may indicate something:

  • Audio component
  • audio/video timing information

Edit: Can you try only whitelisting only display modes with a refreshrate of 60 Hz or below? i.e. whitelist everything except 1920 x 1080 @ 120 Hz in Kodi > Settings > System > Display > Whitelist

scrampker commented 3 weeks ago

Whitelisting everything but 1080p120 does not fix the skip. I was a bit concerned to see that 4k60 4k120 are not available in the whitelist. Will have to investigate that a bit further.

I did a bunch of testing to see if we can make any sense of this situation:

skips: 1080p30 sdr - codecs: vp9/opus-2ch skips: 2160p60 sdr - codecs: vp9/opus-2ch skips: 2160p60 hlg hdr - codecs: vp9-opus-2ch skips: 2160p60 hlg hdr - codecs: vp9/opus-2ch skips: 720p30 sdr - codecs: h264/opus-2ch skips: 1080p60 sdr - codecs: vp9/opus-2ch skips: 1080p24 sdr - codecs: h264/opus-2ch

fine: 2160p60 hdr - codecs: av1/AAC-LC-6ch fine: 2160p24 sdr - codecs: vp9/opus-2ch fine: 2160p60 hdr - codecs: vp9/opus-2ch fine: 2160p60 hdr - codecs: av1/opus-2ch fine: 2160p24 sdr - codecs: vp9/opus-2ch fine: 1080p30 sdr - codecs: av1/aac-lc-6ch fine: 1080p25 sdr - codecs: h264/opus-2ch fine: 1080p30 sdr - codecs: h264/opus-2ch

Most of the time the skip happens around the 2s mark, but sometimes is later. In this video it skips at the 6s mark.

MoojMidge commented 3 weeks ago

No need to check a bunch of different videos, but if you can do the following that might provide some info:

Perhaps enabling component specific logging for the following may indicate something:

  • Audio component
  • audio/video timing information

Or, another hunch, this could be partially related to an issue someone else reported regarding ISA changing the selected stream after doing its initial bandwidth check.

Try disabling InputStream Adaptive > Settings > General > Auto determine initial bandwidth And then increase the following to 1000000 (based on your logs) InputStream Adaptive > Settings > General > Initial bandwidth (Kbps)

scrampker commented 2 weeks ago

Sorry for the delay. I'll look into the additional troubleshooting you sent over.

Interestingly, I found a creator whose videos still skip every 2-3s despite none of my other videos doing that (with HFR disabled.)

https://www.youtube.com/watch?v=1zHDS6vQbVo

MoojMidge commented 1 week ago

That linked video is a 4K VP9.2 video at 23.976 FPS with a bitrate of 14 mb/s, which is relatively high for YouTube.

Don't have any issues playing it, but there may be a hardware limitation associated with your device.

As mentioned previously, additional logging may provide some details, otherwise can't do much.