Kodi Community Forum

Full Version: Wrong Tvheadend Channel sorting in XBMC htsp source
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

I am not sure if this error is caused by XBMC or by Tvheadend.

Tested with
Tvheadend 2.11 and svn-5322
XBMC Live 9.11 and XBMC Live Dharma Beta1

I have searched the forum/wiki/trac/bug reports and found a few entries regarding channel sorting, but none of them really described the problem I had.
(1 2 3)

Since I am not sure whether this is a XBMC or Tvheadend bug, according to "HOW-TO submit a proper Bug Report" I should post here in the forum to clarify this before submitting a bug report.

Howto reproduce the problem (on my system):

Add a htsp Tvheadend source (in my case htps://192.168.112.139:9982)

Browse to the htsp source. Then a list of channels are displayed in a certain order. Now when I select a channel and (most of the times) come back to the channel selection screen (by pressing "x" or "TAB" on the keyboard) the channels are displayed in a different order.

I then gave a few channels a specific channel number ( for example 1 to 11 see screenshot TVheadend settings 1 ) and then tried again. In the first XBMC screenshot you will see that the channel sorting is correct from 1 to 11.

I then select channel number 1 (Hitradio OE3), then I press "TAB" and then I see that the channel sorting is wrong (XBMC screenshot 2). You see in the XBMC screenshot number 2 that channel number 1 is now channel number 265.

I noticed this in the debug log:
19:20:21 T:3077838720 M:1976586240 DEBUG: CPlayerCoreFactory::GetPlayers(htsp://192.168.112.139:9982/tags/34/265.ts)

I don't think it is a coinsidense that the transport stream 265.ts is afterwards channel number 265 of the channel I selected instead of channel number 1 .....

I don't understand why, but through this behaviour the CH+ and CH- keys on my remote control (pgUP and pgDOWN on the keyboard) will always select the "wrong channels" because of the channel sorting is always changing.

XBMC 1 Channels sorting OK http://tinypic.com/r/19piqv/7
XBMC 2 Channels wrong sorting http://tinypic.com/r/2v9dv1x/7
Tvheadend settings 1 http://tinypic.com/r/xfqge9/7
Tvheadend settings 2 http://tinypic.com/r/al2khu/7

I disabled all Tvheadend features such as "monitor signal quality" as I have read in the forum that this could cause problems, but it didn't help.

Here are my debug log files of XBMC and Tvheadend. I enabled debug logging in XBMC, stopped xbmc via service xbmc-live stop, emptied the log file, and then started XBMC via service xbmc-live start and then reproduced the channel sorting "problem". Same with Tvheadend.

XBMC debug log http://pastebin.com/zbvmx5PZ
Tvheadend debug log http://pastebin.com/7eY1zYhc


Hope that anybody could give me a hint. Please also let me know if this is related to Tvheadend, so that I could file a bug report there, if this really is a bug.

Thanks for any help!
I can confirm this.
Since I was not the only one having this problem I concluded that this must be a bug, so I created a ticket @ http://trac.xbmc.org/ticket/10162
This "bug" still exists in tvheadend SVN 5455 (when trying with XBMC Dharma Beta2).

The problem is best reproducable if you stop/start tvheadend and then follow the steps in the post above

The problem "almost" disappears if:
- tvheadend finished scanning all channels after being started
- all channels have a channel number
- one channel has been watched for > 10 min
OK, I found a workaround:

http://pastebin.com/DxtJr9x0

In the tvheadend directory: /root/.hts/tvheadend/channels

there are various files, all with numbers, for example one file is named "125" and it contains a line: "channel_number: 4"

If I rename the file "125" to "4" (notice that now the name of the file is equivalent to the channel number), and if I do this for all files in that directory, => then restart tvheadend, then the sorting problem disappears completely!

It seems to me that either in the tvheadend or in the xbmc code, the display of the channel number is somewhere in the code done by the "channel_number" and somewhere by the name of the file or stream for example "125" or 125.ts => see my description 265.ts

I don't think that this is hard to fix...., just a variable change somwhere.. I hope
Seems that this has now been fixed:

http://trac.xbmc.org/ticket/10162#comment:8

https://github.com/opdenkamp/xbmc/commit...ece3dd6def

(haven't tested it yet though)