Bug 371540 - kaffeine 2.0.4 hangs on changing channels plus
Summary: kaffeine 2.0.4 hangs on changing channels plus
Status: RESOLVED WORKSFORME
Alias: None
Product: kaffeine
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Kubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Mauro Carvalho Chehab
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-23 19:58 UTC by Alan
Modified: 2017-02-16 17:13 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
attachment-20207-0.html (1.49 KB, text/html)
2017-02-16 15:44 UTC, Alan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alan 2016-10-23 19:58:44 UTC
Kaffeine 2.0.4 on kubuntu 16.10.
On entry the last selected TV channel will be playing. 
An attempt to select another channel causes it to hang.
Continued attempts produce error messages like this when run from a terminal.
[00007f6ec4000e38] core stream error: cannot pre fill buffer

Several stations on the programme guide show gibberish in the title column. e.g.
23/10/2016 22:45 00:15 [wierd characters]     BBC NEWS HD

Reproducible: Always

Steps to Reproduce:
1. Just execute.
2.
3.

Actual Results:  
As described above.


When run from a terminal, the terminal will display this right from the start:

23-10-16 20:32:16.049 [Warning ] Error while preparing statement 'table RecordingSchedule has no column named Subheading Unable to execute statement'
23-10-16 20:32:16.050 [Warning ] Error while preparing statement 'no such column: Subheading Unable to execute statement'
23-10-16 20:32:16.050 [Warning ] Error while executing statement 'no such column: Subheading Unable to execute statement'
23-10-16 20:32:19.466 [Info    ] Using built-in dvb device manager
23-10-16 20:32:19.552 [Info    ] Found dvb device P1131716062800011: TurboSight TBS 62x0 DVBT/T2 frontend
23-10-16 20:32:19.556 [Info    ] Found dvb device P1131716062800011: TurboSight TBS 62x0 DVBT/T2 frontend
Comment 1 Jan Michel 2016-11-01 19:41:26 UTC
> Kaffeine 2.0.4 on kubuntu 16.10.
> [00007f520409c318] core stream error: cannot pre fill buffer

I have the same problem. In some cases (about 20%) changing channels (by any means, e.g. in the channel list or by typing the number or with Channel-Up/Down shortcut) does not work. Screen stays black. Changing channels several times more and it works again.

Receiver is a Hauppauge soloHD:
[107784.603983] si2168 8-0064: Silicon Labs Si2168-B40 successfully identified
[107784.603984] si2168 8-0064: firmware version: B 4.0.2
[107784.605638] si2157 9-0060: Silicon Labs Si2147/2148/2157/2158 successfully attached

The other symptoms mentioned by Alan do not appear in my case.
The problem never appeared with Kubuntu 16.04 or earlier versions.
Comment 2 Alan 2016-11-07 11:08:54 UTC
Now version 2.0.5 under Mageia 6 sta1 is much the same. 

To change channels I have to select one exit from kaffeine and bring it up again.

The title column ion the Program Guide has some entries readable and some complete garbage.

When configuring source, I can only use autoscan. The UK channels do not show up in the listing.
Comment 3 Mauro Carvalho Chehab 2016-12-02 08:21:20 UTC
(In reply to Alan from comment #0)

> When run from a terminal, the terminal will display this right from the
> start:
> 
> 23-10-16 20:32:16.049 [Warning ] Error while preparing statement 'table
> RecordingSchedule has no column named Subheading Unable to execute statement'
> 23-10-16 20:32:16.050 [Warning ] Error while preparing statement 'no such
> column: Subheading Unable to execute statement'
> 23-10-16 20:32:16.050 [Warning ] Error while executing statement 'no such
> column: Subheading Unable to execute statement'

The above messages indicate that the sql lite database is corrupted.
You could remove it by removing this file:
     ~/.local/share/kaffeine/sqlite.db
and then re-add your recording schedule and other configuration options that are stored there.

> 23-10-16 20:32:19.466 [Info    ] Using built-in dvb device manager
> 23-10-16 20:32:19.552 [Info    ] Found dvb device P1131716062800011:
> TurboSight TBS 62x0 DVBT/T2 frontend
> 23-10-16 20:32:19.556 [Info    ] Found dvb device P1131716062800011:
> TurboSight TBS 62x0 DVBT/T2 frontend

Those messages are OK, but don't help to diagnose any problem. You should enable debug messages by calling kaffeine with the "--debug" option in order to have more logs.

> Several stations on the programme guide show gibberish in the title column.
> e.g.
> 23/10/2016 22:45 00:15 [wierd characters]     BBC NEWS HD

Program guides in UK uses non-standard charset tables. Currently, Kaffeine doesn't have support for that. One of the issues is that it seems that there are some patent issues related to the usage of such tables.
Comment 4 Mauro Carvalho Chehab 2016-12-02 08:30:05 UTC
(In reply to Alan from comment #0)
> Kaffeine 2.0.4 on kubuntu 16.10.
> On entry the last selected TV channel will be playing. 
> An attempt to select another channel causes it to hang.

What do you mean by hang? It would be nice to have the debug logs showing what happens when you change the channel.

> Continued attempts produce error messages like this when run from a terminal.
> [00007f6ec4000e38] core stream error: cannot pre fill buffer

Such message comes from libVlc and simply indicate that it failed to parse or display a MPEG Transport Stream. If you're getting this, Kaffeine didn't hang. Probably, it switched the channel and sent the data to libVlc, but either the TS stream is corrupted (week signal or too much interference) or it failed to identify the start of the TS frames. LibVlc 2.x has some issues decoding MPEG-4. Although still experimental, libVlc 3.0 seems better to parse streams with MPEG-4.
Comment 5 Alan 2016-12-07 20:03:23 UTC
Dear Mauro

I did a little research on your behalf. See below:


On 02/12/16 08:21, Mauro Carvalho Chehab wrote:
https://bugs.kde.org/show_bug.cgi?id=371540

--- Comment #3 from Mauro Carvalho Chehab <mchehab+kde@kernel.org> ---

> Several stations on the programme guide show gibberish in the title column.
> e.g.
> 23/10/2016 22:45 00:15 [wierd characters]     BBC NEWS HD

You wrote:
---------

Program guides in UK uses non-standard charset tables. Currently, Kaffeine
doesn't have support for that. One of the issues is that it seems that there
are some patent issues related to the usage of such tables.

 From the uk.tech.digital.tv Newsgroup
-------------------------------------

Monday 05 Dec 2016 13:34:36

On 04/12/16 22:14, Pinnerite wrote:
> I had been struggling to deploy a computer program called Kaffeine
> 2.0.5 because that version supposedly could process DVB-T2 (HD)
> signals.
>
> However I couldn't test it because its channel search routine seemed
> to find and list everything from Berlin to Hanoi but not UK channels.
>
> Finding no help on the wwww I finally wrote to the developer,
> receiving the following reply a couple of days ago.
>
> "Program guides in UK uses non-standard charset tables. Currently,
> Kaffeine doesn't have support for that. One of the issues is that it
> seems that there are some patent issues related to the usage of such
> tables."
>
> So why are we Brits locked out?
> Another reason for Bill to Brexit I'll bet. :)
>
> Alan

On DVB-T2 the EIT tables are compressed using Huffman coding, using the
same coding table as Freesat. This reduces the size of the EIT and thus
the bandwidth that has to be used to broadcast it.

I believe that the coding table is subject to copyright and is not
generally made available. However it was speedily reverse engineered and
most open-source media players include the reverse-engineered version by
default.
Dave

Regards, Alan Secker
Comment 6 Mauro Carvalho Chehab 2016-12-27 18:23:58 UTC
(In reply to Alan from comment #5)
> On DVB-T2 the EIT tables are compressed using Huffman coding, using the
> same coding table as Freesat. This reduces the size of the EIT and thus
> the bandwidth that has to be used to broadcast it.
> 
> I believe that the coding table is subject to copyright and is not
> generally made available. However it was speedily reverse engineered and
> most open-source media players include the reverse-engineered version by
> default.

Yes, UK uses FreeSat's huffman codes. There are some open source programs that implement it. The huffman decoding itself is OK. The problem is that Freesat use some char tables that seem to be under some copyright protection. Adding it to Kaffeine (or to libdvbv5) could cause some legal issues, with would prevent distros to be able to ship it. 

The best would be to have some sort of plugin that would allow someone to download such tables and/or a huffmann parsing library. Unfortunately, currently, I don't have time to work on such code. If someone wants to develop it in a way that would keep the Kaffeine code clean of legal issues, I'll gladly apply it.
Comment 7 Mauro Carvalho Chehab 2017-02-16 12:18:50 UTC
(In reply to Alan from comment #0)
> Kaffeine 2.0.4 on kubuntu 16.10.
> On entry the last selected TV channel will be playing. 
> An attempt to select another channel causes it to hang.
> Continued attempts produce error messages like this when run from a terminal.
> [00007f6ec4000e38] core stream error: cannot pre fill buffer

This BZ ended by being diverged to a different issue (EPG guide on UK).

Not sure if what's reported on this BZ still occurs, e. g. : "kaffeine hangs on changing channels".

Today, I solved a relevant performance issue related to EPG handling that could be badly affecting channel switch.

Could you please check if the problem on switching channels were solved on the upstream version?
Comment 8 Alan 2017-02-16 15:44:51 UTC
Created attachment 104059 [details]
attachment-20207-0.html

I'm sorry no. Kaffeine does not support UK HD channels, which led to the 
OS being replaced by MAG 5.1.


On 16/02/17 12:18, Mauro Carvalho Chehab wrote:

https://bugs.kde.org/show_bug.cgi?id=371540

--- Comment #7 from Mauro Carvalho Chehab <mchehab+kde@kernel.org> ---
(In reply to Alan from comment #0)

> Kaffeine 2.0.4 on kubuntu 16.10.
> On entry the last selected TV channel will be playing.
> An attempt to select another channel causes it to hang.
> Continued attempts produce error messages like this when run from a terminal.
> [00007f6ec4000e38] core stream error: cannot pre fill buffer

This BZ ended by being diverged to a different issue (EPG guide on UK).

Not sure if what's reported on this BZ still occurs, e. g. : "kaffeine hangs on
changing channels".

Today, I solved a relevant performance issue related to EPG handling that could
be badly affecting channel switch.

Could you please check if the problem on switching channels were solved on the
upstream version?
Comment 9 Mauro Carvalho Chehab 2017-02-16 17:13:13 UTC
(In reply to Alan from comment #8)
> (In reply to Mauro from comment #7)

> > Could you please check if the problem on switching channels were solved on
> > the
> > upstream version?
> 
> I'm sorry no. Kaffeine does not support UK HD channels, which led to the 
> OS being replaced by MAG 5.1.

Ok. Well, as this bug can't be reproduced anymore, I'll close it with WORKSFORME status.

If you or anyone has a similar issue and can reproduce it, just re-open.

With regards to UK HG EPG handling, we'll need either some formal authorization from copyright owners of their Huffman-based encoding or some way to allow plugin an external parser for it that could be shipped outside Kaffeine, in order to avoid possible legal issues for distributions.