Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#7232 closed defect (fixed)

DVB scanning channels fails with error parsing parameters

Reported by: Tim Jordan <tim@…> Owned by: danielk
Priority: minor Milestone: 0.22
Component: MythTV - General Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

SVN Revision 22166

On trying to scan channels gui reports error parsing parameters and log reports DTVMux, Error: ParseTuningParams? -- Unknown tuner type

I have tried deleting all cards and re-adding but does not seem to help

Attachments (2)

channelscan.patch (4.7 KB) - added by mythtv@… 14 years ago.
7232-v1.patch (5.8 KB) - added by danielk 14 years ago.
possible fix

Download all attachments as: .zip

Change History (12)

comment:1 Changed 14 years ago by mythtv@…

I am experiencing the same problem.

I have identified the cause on my system to be problems with DTVTunerType::kTunerTypeUnknown being defined as 0x8000000, which gcc 4.3.3 wishes to represent as an unsigned value on my 32-bit system. Commit #21935 attempted to resolve the signed/unsigned comparison compiler warnings, however this change breaks comparisons with DTVTunerType::kTunerTypeUnknown on my system. i.e. the code in ScanWizard::SetPage() from libs/libmythtv/scanwizard.cpp

    DTVTunerType parse_type = DTVTunerType::kTunerTypeUnknown;
    if (parse_type != DTVTunerType::kTunerTypeUnknown)
    {
        // This code gets executed (which is wrong!!)
    }

The attached patch resolves these problems by eliminating the comparison operators from the DTVTunerType class.

The patch additionally removed the comparison operators from the DTVParamHelper class, as they are unnecessary, and removes the need for DTVTunerType::initStr() function, which was extremely inefficient.

Changed 14 years ago by mythtv@…

Attachment: channelscan.patch added

comment:2 Changed 14 years ago by danielk

Milestone: unknown0.22
Owner: changed from Isaac Richards to danielk
Status: newaccepted
Version: unknownhead

comment:3 Changed 14 years ago by tim Jordan <tim@…>

patch fixes the problem

Changed 14 years ago by danielk

Attachment: 7232-v1.patch added

possible fix

comment:4 Changed 14 years ago by danielk

Status: acceptedinfoneeded

Tim, can you try the 7232-v1 patch and let me know if it works?

comment:5 in reply to:  4 Changed 14 years ago by mythtv@…

Yes, the 7232-v1.patch also resolves the problem.

The problem appears to lie in the comparison that was being perform within DTVTunerType::operator!=() reinterpret casting the value member to be an unsigned int would be another solution.

It's slightly inaccurate to complain that gcc is treating the enumeration inconsistently. The problems are caused by the fact that 0x80000000 is an unsigned integer and as such is too large to fit within a signed integer type. The code is incorrect, not the compiler.

It is better to compare objects of the same type, which is why I proposed the solution I did.

comment:6 Changed 14 years ago by tim@…

Yes this also seems to have fixed it

Thanks

Tim

comment:7 Changed 14 years ago by danielk

Resolution: fixed
Status: infoneededclosed

(In [22254]) Fixes #7232. Fixes problem with enum handling in latest gcc.

comment:8 Changed 14 years ago by danielk

Peter, I think a reasonable interpretation of C++03, keeping C in mind, will cause 0x80000000 to be treated as an 32 bit integer containing the value 0x80000000. What I think happened is they added support for C++0x which allows you to specify the underlying type of the enumeration. And since the code was being rewritten the pre-existing logic which tried to be compatible with C99 code and how enum's have traditionally been handled was replaced with something quirky and less well thought out. Now whether the MythTV code as written is incorrect depends on whether what the compiler is doing now is in fact allowed by C++03; and I'm not sure after staring at way too much of the spec. When I'm not sure that's generally a good reason to avoid the code whether it really is correct or not.

comment:9 Changed 14 years ago by anonymous

Can this be re-opened please, it seems this fix is causing

"ERROR: invalid channel.(.;)"

for two New Zealand DVB-T HDHomerun users when trying to scan channels. mythtv-setup crashes instead of scanning the channels.

Problem may be in lines 249-257 of hdhrchannel.cpp

For me this this is running 20090806 firmware on mythbuntu 9.10 and fixes 22824. Also known to occur on 22778.

comment:10 Changed 14 years ago by qupada@…

I'm the other user referred to by anonymous. Running .22 r22824 on Gentoo amd64, HDHR firmware 20091024.

Seeing these two packets repeated 8,000-13,000 times when beginning a scan, after which mythtv-setup segfaults (tcpdump -iwlan0 -vv -s0 -A 'host 192.168.10.136')

15:22:36.916921 IP (tos 0x0, ttl 64, id 29588, offset 0, flags [DF], proto TCP (6), length 82)

192.168.10.42.49891 > 192.168.10.136.65001: Flags [P.], cksum 0xfb83 (correct), seq 366375:366417, ack 287898, win 5840, length 42

E..Rs.@.@.1... *.. .......qr.|..P.........."../tuner0/channel...qam:474000000...O.

15:22:36.917657 IP (tos 0x0, ttl 64, id 51255, offset 0, flags [none], proto TCP (6), length 73)

192.168.10.136.65001 > 192.168.10.42.49891: Flags [P.], cksum 0x9db2 (correct), seq 287898:287931, ack 366417, win 1460, length 33

E..I.7..@..u.. ... *.....|....q.P.............ERROR: invalid channel.(.;)

Note: See TracTickets for help on using tickets.