WIP Faster channel switching for tvheadend/vdr addons
#31
I've been trying to figure out where we should load channel settings since the call has to be moved if we want it to work when <cacheindvdplayer> is set to false. https://github.com/Jalle19/xbmc/commit/7...5a1212dffb is obviously wrong since it is called everytime you try to switch subtitles using the "star" button. I'm currently doing it at https://github.com/xbmc/xbmc/blob/master...r.cpp#L909 but I'm not sure loading settings on every stream change is the right way to do it. It works fine overall but I'm thinking it could have unintended consequences if e.g. a new subtitle stream suddenly appears in the stream.

What about CDVDPlayer::SwitchChannel()?

@opdenkamp any thoughts on this?
Reply
#32
Opened a branch for this fix here. I realized that this only works for tvheadend/vdr so I need your help in figuring out where exactly to put the call.
Reply
#33
Quote:I guess the biggest slowdown comes from the caching, another part is the unnecessary call to RequestStreams() that I removed (it was always done twice when switching channels)
there's two calls indeed, because it will call it when it receives a stream change packet. that shouldn't slow things down (noticeably)

what are you trying to fix with the channel settings changes?
opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
Reply
#34
What we currently have in load/save channelsSettings is a chain of work arounds. First OpenDefaultStreams was not able to open desired streams because those were not ready. Then we delayed load settings and opened audio/subs explicitly. Because of delayed load we observed overwrite of settings after a failed channels switch -> valid flag was introduced.

Now the original problem is solved: OpenDefaultStreams is called after a stream change. If load/save is touched, it should be aligned with load/save of video settings. The work arounds can be cleaned-up.
Reply
#35
(2014-01-13, 19:13)opdenkamp Wrote: what are you trying to fix with the channel settings changes?

AFAICT, if pvr.cacheindvdplayer is set to false, CDVDPlayer::CachePVRStream() will always return false, which means the caching state will never enter the state CACHESTATE_PVR, which means that the if-block where the stored channel settings are loaded won't be reached.

@FernetMenta: thanks for the explanation. Are you saying we should attempt to load the settings where OpenDefaultStreams() is called?
Reply
#36
Quote:Are you saying we should attempt to load the settings where OpenDefaultStreams() is called?

No, do you see video settings loaded in OpenDefaultStreams? I say load channel settings should be aligned with load/save video settings.
Reply
#37
I need to do some more digging then, I'm not familiar with that part of the code. I still think it could be a good idea to also load them during a stream change, since there's the possibility that the user has set e.g. Finnish subtitles as default for a channel, but when he switched to it the program didn't have any subtitles. Once a non-Finnish program starts the user would likely want the subs enabled, and at the moment that won't happen.
Reply
#38
There is no need to reinvent the wheel. All bits are already in place: a stream change triggers OpenDefaultStreams which opens audio and subs according the the channel settings. Once settings are loaded you can't reload them because it would overwrite changes you have made since loading. Settings are saved on stop.
Video settings are handled in application and FileStateJob. Exactly at those places in the code where video settings are handled, channels settings should be handled as well. The other bits should be cleaned out.
Reply
#39
Alright, thanks for the pointers, I'll have a look. You're incorrect about "settings are saved on stop" though, PVR channel settings are saved all over the place.

I started working on unifying the channel settings some time ago so that they're stored just like all other video items, I'll see if I can find some time to clean it up and push it to Github.
Reply
#40
NICE! Just found this setting and works rather well.

The video is very quick to change now, even faster than my old dbox which is great.

No problems with audio dropouts as far as my limited testing has gone.

Using TVheadend client/server on same box.
Reply
#41
Hi zag,
what exact setting are you talking about?
Reply
#42
I was frustrated at the channel changing speed in Kodi using tvheadend (especially as its on the same htpc box as the tv client) so did a google search.

This page came up as the first hit, so I added the setting to advancesettings.xml in my "userdata" folder on OpenELEC

PHP Code:
<pvr>
      <
cacheindvdplayer>false</cacheindvdplayer>
</
pvr

Unfortunately after a bit of testing, the speed of change is now VERY quick, but it seems to pause for about 0.5 seconds on the 1st video frame for the audio and video to start.

A little disappointing as it takes away from the smooth experience of browsing channels seen on some modern set top boxes.
Reply
#43
What kind of TV source do you have in tvheadend?
Reply
#44
Testing with uk freesat DVB-S2
Reply
#45
(2015-11-25, 13:18)zag Wrote: I was frustrated at the channel changing speed in Kodi using tvheadend (especially as its on the same htpc box as the tv client) so did a google search.

This page came up as the first hit, so I added the setting to advancesettings.xml in my "userdata" folder on OpenELEC

PHP Code:
<pvr>
      <
cacheindvdplayer>false</cacheindvdplayer>
</
pvr

Unfortunately after a bit of testing, the speed of change is now VERY quick, but it seems to pause for about 0.5 seconds on the 1st video frame for the audio and video to start.

A little disappointing as it takes away from the smooth experience of browsing channels seen on some modern set top boxes.

Note that I dropped this on VideoPlayer branch -> 17.0
Reply

Logout Mark Read Team Forum Stats Members Help
Faster channel switching for tvheadend/vdr addons1