Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#802 closed defect (fixed)

DiSEqC confuses channel changing with LiveTV

Reported by: nooneimprt4nt@… Owned by: danielk
Priority: minor Milestone: 0.20
Component: dvb Version: head
Severity: medium Keywords: dvb diseqc
Cc: Ticket locked: no

Description

When trying to change channels in liveTV where it would change ports on a DiSEqC switch, I get a message that says:

TVRec(1) Error: Channel: '110' was not found in the database.
Most likely, your DefaultTVChannel setting is wrong.
Could not start livetv.

This occurs because in GetChannelValue?() channelinput = "DiSEqC Switch Input 1" (I find this by setting a breakpoint in GetChannelValue?() and printing channelinput) but channel 110 should be on 'Input 2' as can be seen here:

select channel.sourceid,channum,inputname from channel,cardinput where channum=110 and cardinput.sourceid=channel.sourceid;
+----------+---------+-----------------------+
| sourceid | channum | inputname             |
+----------+---------+-----------------------+
|        2 | 110     | DiSEqC Switch Input 2 |

channelinput is incorrect because chan->GetCurrentInput?() returns channelnames[0] (no place in the dvb code seems to change the value of currentcapchannel), and channelnames only gets set in DVBChannel::SwitchToInput?() which is only called once (from TVRec::InitChannel?)

I'm not sure how this is supposed to work.

Interestingly enough, this seems to only happen in LiveTV (recordings work OK), and I can see that a command was sent to the diseqc to switch. If I hack the SELECT command in GetChannelValue?, I can make it change channels fine.

For other cards (which use channel.cpp), it is apparent that all sources are enumerated, but it looks like they are not used in dvbchannel.cpp I could probably work up a patch if I understood the intention of how this code should work

Attachments (4)

dvbchannel.patch (911 bytes) - added by nooneimprt4nt@… 18 years ago.
patch
dvbchannel.2.patch (3.5 KB) - added by nooneimprt4nt@… 18 years ago.
dvbchannel.3.patch (3.5 KB) - added by nooneimprt4nt@… 18 years ago.
Oops. deleted a space somehow. this one is right
dvbchannel.alt.8.patch (5.3 KB) - added by nooneimprt4nt@… 18 years ago.
Alternate version

Download all attachments as: .zip

Change History (14)

comment:1 Changed 18 years ago by nooneimprt4nt@…

The attached patch will fix the problem (though it is a round-about way to do it). It'd be nicer to be know the inputname up front, rather than fetching it from the DB each time. Also, the fact that noone else has reported this indicates that perhaps this is fixing the symptom of some other problem, though for the life of me, I see no way for the channelnames[currentcapchannel] value to get updated while using DVB in the current code.

Changed 18 years ago by nooneimprt4nt@…

Attachment: dvbchannel.patch added

patch

comment:2 Changed 18 years ago by anonymous

Component: mythtvdvb
Owner: changed from Isaac Richards to danielk

comment:3 Changed 18 years ago by danielk

Milestone: 0.20

DVBChannel should be more like Channel, with knowledge of its inputs. But for some reason inputs were left out of the initial DVBChannel implemention and I haven't gotten around to fixing it.

Do you feel up to creating a patch that fixes this deficiency in the DVBChannel?

comment:4 Changed 18 years ago by nooneimprt4nt@…

Sure. I just wanted to be sure I wasn't going crazy, and that it really wasn't implemented first. I'll do it in a similar way to what is done in channel.cpp

comment:5 Changed 18 years ago by nooneimprt4nt@…

Component: dvbmythtv
Milestone: 0.20
Owner: changed from danielk to Isaac Richards

I am including a patch which fixes this in a more appropriate manner. It still does not use the channelnames[] map the way it was originally intended, but I'm not sure it makes sense with respect to a diseqc switch. Basically, to use the map as expected, the dvbchannel struct would need to include cardinputid somewhere, which would be used as the index into channelnames[]. However, if you need to do that, you might as well just get the actual inputname and use that directly (which is what I've done). It all comes down to the fact that there is no way to gaurantee a 1:1 mapping between a switch <port,pos> pair and its inputname (though in theory they would be unique).

If you'd prefer a different manner, let me know, but everything else I tried got pretty complex. I suppose it would make sense to index off of cardinputid if we wanted to support external channel changes, and that would be easy enough to do, but the method I chose resulted in the minimal amount of code changes.

Changed 18 years ago by nooneimprt4nt@…

Attachment: dvbchannel.2.patch added

Changed 18 years ago by nooneimprt4nt@…

Attachment: dvbchannel.3.patch added

Oops. deleted a space somehow. this one is right

comment:6 Changed 18 years ago by anonymous

Component: mythtvdvb
Milestone: 0.20
Owner: changed from Isaac Richards to danielk

Changed 18 years ago by nooneimprt4nt@…

Attachment: dvbchannel.alt.8.patch added

Alternate version

comment:7 Changed 18 years ago by nooneimprt4nt@…

The alternate version stores the cardinputid in dvbchannel_t (instead of storing the inputname directly), and uses it as the key for channelnames and inputChannel. Both patches are equally functional, just a matter of taste. In theory this one should be more flexible as far as adding features go, I guess.

comment:8 Changed 18 years ago by danielk

(In [8277]) References #802.

2nd patch from nooneimprt4nt AT gmail , com

This fixes the problem, so long as the channum's are unique across all inputs on a card.

nooneimprt4nt, can you look at SwitchToInput?() and see if you could make it perform the DiSEqC switch to the specified input even if a channum exists on two inputs? You probably need to make some modifications to GetChannelOptions?()...

comment:9 Changed 18 years ago by danielk

Resolution: fixed
Status: newclosed

(In [8293]) Fixes #802, and fixes #820, by applying patch from #820.

Thanks, nooneimprt4nt :)

comment:10 Changed 18 years ago by danielk

(In [8307]) Fixes #824, references #820, references #802.

Fix from Tj NG for a problem with fetching transport options when the inputs on two different cards share the same video source, introduced by the input switching patch in #820.

Note: See TracTickets for help on using tickets.