Bug 418236 - EPG information does not display properly with high-definition channels on DVB-T2
Summary: EPG information does not display properly with high-definition channels on DV...
Status: ASSIGNED
Alias: None
Product: kaffeine
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Mauro Carvalho Chehab
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-26 21:04 UTC by jules
Modified: 2021-08-07 17:34 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jules 2020-02-26 21:04:55 UTC
SUMMARY
When viewing UK high definition channels in Programme Guide, Kaffeine shows unreadbale characters for programme names and descriptions. Similarly for the On Screen Display of programme information.

STEPS TO REPRODUCE
1. View a high definition channel, e.g. 'BBC ONE HD'
2. Open Programme Guide
3. or press 'O' to show On Screen Display.

OBSERVED RESULT
Unreadable characters.

EXPECTED RESULT
Readable text.

SOFTWARE/OS VERSIONS

Linux: Devuan GNU/Linux 3

KDE Plasma Version: 
KDE Frameworks Version: kde-runtime 4:17.08.3-2.1
Qt Version: libqt4-dev 4:4.8.7+dfsg-18

Kaffeine is built from latest source, sha=ea35f1eb49 'Fix minor EBN issues', Date:   Wed Dec 11 20:57:46 2019 +0200.

ADDITIONAL INFORMATION

Problem happens for all high definition channels. On normal definition channels the problem does not occur - EPG information display fine.

Hardware is Hauppauge WinTV-dual HD, identifying as si2168 Silicon Labs Si2168-B40.

Examples of raw bytes passed to src/dvb/dvbsi.cpp:DvbSiText::convertText():

    1f 01 d9 af d8 ab eb 0f 1f 3b e4 cc
    1f 02 57 3c 95 d3 5b f4 27 a1 7d 57 4d ec 78 ed fc 73 c9 6e ab 57 ad 78 ce f6 6d 66 9f 00 74 40
    1f 02 e5 61 6d 94 b0 04 fe 6e 3b 3b 27 f6 6e d2 97 e8 60
    1f 02 20 bc 35 e1 db 2e 7f 66 cb d2 f3 fc 74 de 53 dd bb 60 4a e7 e2 fa d3 26 f6 e7 bb 0c 23 65 19 d4 f4 4f 0f dd 0a bc ca 0d 5f 1f 89 4a 03 ed b2 96 00 9f 96 fc

DvbSiText::convertText() doesn't seem to have a path to handle the two apparent prefixes '0x1f 0x01' and '0x1f 0x2'. I've tried modifying it to use each of the available decoders (DvbSiText::TextEncoding is 0..19), but none of them seems to give readable text.
Comment 1 jules 2021-06-20 16:37:15 UTC
I have a fix for this, using huffman decoder from tvheadend.
Comment 2 Mauro Carvalho Chehab 2021-06-21 14:37:04 UTC
(In reply to jules from comment #1)
> I have a fix for this, using huffman decoder from tvheadend.

Decoding UK tables it is not hard, but the question is whether this is legal or not. The better would be to have the huffmann decoding on a separate repository (either as a daemon or as a plugin), in order to avoid adding something on Kaffeine that could prevent it from being distributed.
Comment 3 jules 2021-06-21 15:05:36 UTC
The tvheadend code is GPL, same as Kaffeine.

So there shouldn't be any problem with copying and modifying the code for use in Kaffeine?

Original code is here:

    https://github.com/tvheadend/tvheadend/blob/master/src/epggrab/support/freesat_huffman.c

My patch is here (not necessarily permanently):

    http://op59.net/kaffeine-epg-hd-patch.txt
Comment 4 jules 2021-08-07 16:37:10 UTC
I would be grateful if someone could respond to my previous message about the EPG patch being GPL.
Comment 5 Bug Janitor Service 2021-08-07 17:34:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/kaffeine/-/merge_requests/3