[mythtv] How is cardinputid chosen?
Michael T. Dean
mtdean at thirdcontact.com
Tue Oct 3 04:16:29 UTC 2006
On 10/02/06 20:11, Jack Perveiler wrote:
>I recently switched one of my pvr500 tuners to use s-video instead of the
>tuner. I made sure it was the lower card number because I'd like it to be used
>in case of a tie with the other card. I want it favored, but not so much that
>I'd want something recorded later instead of on the other card so I'd rather
>not set the input priority.
>
>When I schedule a recording, however, the second card is used instead of the
>first. Here's my car descriptions:
>
>mysql> select cardid,cardtype,defaultinput from capturecard;
>
>+--------+----------+--------------+
>| cardid | cardtype | defaultinput |
>+--------+----------+--------------+
>| 1 | DVB | DVBInput |
>| 2 | DVB | DVBInput |
>| 3 | MPEG | S-Video 1 |
>| 4 | MPEG | Tuner 1 |
>+--------+----------+--------------+
>
>Everything looks ok there to me (lower cardid has the S-Video attached to it).
>
>Now for the cardinputid:
>
>mysql> select cardinputid,cardid,sourceid,inputname,preference from cardinput;
>+-------------+--------+----------+-----------+------------+
>| cardinputid | cardid | sourceid | inputname | preference |
>+-------------+--------+----------+-----------+------------+
>| 1 | 1 | 1 | DVBInput | 0 |
>| 2 | 0 | 0 | | 0 |
>| 3 | 0 | 0 | | 0 |
>| 4 | 0 | 0 | | 0 |
>| 5 | 2 | 1 | DVBInput | 0 |
>| 6 | 0 | 0 | | 0 |
>| 8 | 0 | 0 | | 0 |
>| 9 | 4 | 3 | Tuner 1 | 0 |
>| 10 | 3 | 2 | S-Video 1 | 0 |
>+-------------+--------+----------+-----------+------------+
>
>Odd, the lower cardid with the lower sourceid ended up with a higher
>cardinputid...
>
>
...
>The wiki says
>that the scheduler will use a lower input id over a higher, so I'm guessing the
>fact that cardid 3 gets the larger carinputid is my real problem.
>
>
Yep.
>Which leads me to my question... how is cardinputid chosen? I see it's an
>autoincrement field, so it's assigned when the insert is made into the table.
>So how is the insert order determined? Nothing jumped out at me in
>mythtv-setup... is it just the order in which video sources are mapped to
>inputs?
>
>
Yep.
>And, since mine seems funky, is it as simple for me to fix as just switching
>the cardid and sourceid's between those cardinputids?
>
Yep. Although the recommended approach is to fix things through
mythtv-setup (which may involve deleting the capture card and re-adding
it at this point) rather than via SQL.
And, although this question has a lot of "technical" stuff, it's really
more of a -users question than a -dev question. After all, think of how
many users could have been helped by your explaining how cardinputid is
chosen. (And, since it's not asking for feedback on a potential change,
discussing an already-committed change, discussing an approach for
fixing a bug, ... it's not really a -dev question.)
Mike
More information about the mythtv-dev
mailing list