Mailing List Archive

CardUtil::CreateCaptureCard / CardUtil::CreateCardInput and mythconverg.inputgroup
Hi David,

After a call to
CardUtil::CreateCaptureCard()
and
CardUtil::CreateCardInput()

The resulting capturecard and inputgroup tables look like:

select * from capturecard;
+--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
| cardid | parentid | videodevice
| audiodevice | vbidevice | cardtype | defaultinput |
audioratelimit | hostname | dvb_swfilter | dvb_sat_type |
dvb_wait_for_seqstart | skipbtaudio | dvb_on_demand | dvb_diseqc_type |
firewire_speed | firewire_model | firewire_connection | signal_timeout |
channel_timeout | dvb_tuning_delay | contrast | brightness | colour | hue |
diseqcid | dvb_eitscan | inputname | sourceid | externalcommand |
changer_device | changer_model | tunechan | startchan | displayname |
dishnet_eit | recpriority | quicktune | schedorder | livetvorder | reclimit
| schedgroup |
+--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
| 1 | 0 | /usr/local/bin/mythexternrecorder --conf
/home/mythtv/etc/mag-1-2.conf | NULL | NULL | EXTERNAL |
Television | NULL | cubic.sobie.us | 0 |
0 | 1 | 0 | 1 | 0
| 0 | NULL | 0 | 0 |
4000 | 0 | 0 | 0 | 0 | 0 |
NULL | 0 | MPEG2TS | 2 | |
| | | | mag/1-2 | 0 |
1 | 0 | 1 | 0 | 1 | 1 |
+--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
1 row in set (0.001 sec)

select * from inputgroup;
+-------------+--------------+-----------------------------------------------------------------------------------------+
| cardinputid | inputgroupid | inputgroupname
|
+-------------+--------------+-----------------------------------------------------------------------------------------+
| 0 | 1 | cubic.sobie.us|/usr/local/bin/mythexternrecorder
--conf /home/mythtv/etc/mag-1-2.conf|1 |
| 1 | 1 | cubic.sobie.us|/usr/local/bin/mythexternrecorder
--conf /home/mythtv/etc/mag-1-2.conf|1 |
+-------------+--------------+-----------------------------------------------------------------------------------------+
2 rows in set (0.001 sec)

I am curious about the entry in inputgroup with a cardinputid of zero (0).
Is that what you would expect to see or is something amiss?

I know you did some magic to make "multirec" work without having to create
a bunch of inputs. Does this happen automatically with a call
CardUtil::CreateCaptureCard() and/or CardUtil::CreateCardInput(), or are
extra steps necessary? I see that the default "reclimit" is 1, but did not
dig enough to see if that is still relevant. Does the multirec magic happen
when schedgroup is 1?

To be clear, I am making these calls via the ServicesAPI and want to make
sure I am not missing any steps. I do want multirec to work.

Thanks,

John
Re: CardUtil::CreateCaptureCard / CardUtil::CreateCardInput and mythconverg.inputgroup [ In reply to ]
On Thu, Jul 07, 2022 at 01:33:49PM -0600, John P Poet wrote:
> Hi David,
>
> After a call to
> CardUtil::CreateCaptureCard()
> and
> CardUtil::CreateCardInput()
>
> The resulting capturecard and inputgroup tables look like:
>
> select * from capturecard;
> +--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
> | cardid | parentid | videodevice
> | audiodevice | vbidevice | cardtype | defaultinput |
> audioratelimit | hostname | dvb_swfilter | dvb_sat_type |
> dvb_wait_for_seqstart | skipbtaudio | dvb_on_demand | dvb_diseqc_type |
> firewire_speed | firewire_model | firewire_connection | signal_timeout |
> channel_timeout | dvb_tuning_delay | contrast | brightness | colour | hue |
> diseqcid | dvb_eitscan | inputname | sourceid | externalcommand |
> changer_device | changer_model | tunechan | startchan | displayname |
> dishnet_eit | recpriority | quicktune | schedorder | livetvorder | reclimit
> | schedgroup |
> +--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
> | 1 | 0 | /usr/local/bin/mythexternrecorder --conf
> /home/mythtv/etc/mag-1-2.conf | NULL | NULL | EXTERNAL |
> Television | NULL | cubic.sobie.us | 0 |
> 0 | 1 | 0 | 1 | 0
> | 0 | NULL | 0 | 0 |
> 4000 | 0 | 0 | 0 | 0 | 0 |
> NULL | 0 | MPEG2TS | 2 | |
> | | | | mag/1-2 | 0 |
> 1 | 0 | 1 | 0 | 1 | 1 |
> +--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
> 1 row in set (0.001 sec)
>
> select * from inputgroup;
> +-------------+--------------+-----------------------------------------------------------------------------------------+
> | cardinputid | inputgroupid | inputgroupname
> |
> +-------------+--------------+-----------------------------------------------------------------------------------------+
> | 0 | 1 | cubic.sobie.us|/usr/local/bin/mythexternrecorder
> --conf /home/mythtv/etc/mag-1-2.conf|1 |
> | 1 | 1 | cubic.sobie.us|/usr/local/bin/mythexternrecorder
> --conf /home/mythtv/etc/mag-1-2.conf|1 |
> +-------------+--------------+-----------------------------------------------------------------------------------------+
> 2 rows in set (0.001 sec)
>
> I am curious about the entry in inputgroup with a cardinputid of zero (0).
> Is that what you would expect to see or is something amiss?
>
> I know you did some magic to make "multirec" work without having to create
> a bunch of inputs. Does this happen automatically with a call
> CardUtil::CreateCaptureCard() and/or CardUtil::CreateCardInput(), or are
> extra steps necessary? I see that the default "reclimit" is 1, but did not
> dig enough to see if that is still relevant. Does the multirec magic happen
> when schedgroup is 1?
>
> To be clear, I am making these calls via the ServicesAPI and want to make
> sure I am not missing any steps. I do want multirec to work.
>
> Thanks,

I'll have to do an in-depth look at the code later, probably this
evening. If I recall correctly, and that's not a certainty,
CreatCaptureCard() is the main function for CardUtil users to use and
CreateCardInput() is an internal, helpper function.

Also, multirec support I added for schedule as group still uses an
input in the database for each virtual tuner. Doing what I originally
wanted to do would break too many, interal APIs take way too long to
put them back together. I think we're stuck with that approach for
the forseeable future.

David
--
David Engel
david@istwok.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: CardUtil::CreateCaptureCard / CardUtil::CreateCardInput and mythconverg.inputgroup [ In reply to ]
On Thu, Jul 07, 2022 at 01:33:49PM -0600, John P Poet wrote:
> Hi David,
>
> After a call to
> CardUtil::CreateCaptureCard()
> and
> CardUtil::CreateCardInput()
>
> The resulting capturecard and inputgroup tables look like:
>
> select * from capturecard;
> +--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
> | cardid | parentid | videodevice
> | audiodevice | vbidevice | cardtype | defaultinput |
> audioratelimit | hostname | dvb_swfilter | dvb_sat_type |
> dvb_wait_for_seqstart | skipbtaudio | dvb_on_demand | dvb_diseqc_type |
> firewire_speed | firewire_model | firewire_connection | signal_timeout |
> channel_timeout | dvb_tuning_delay | contrast | brightness | colour | hue |
> diseqcid | dvb_eitscan | inputname | sourceid | externalcommand |
> changer_device | changer_model | tunechan | startchan | displayname |
> dishnet_eit | recpriority | quicktune | schedorder | livetvorder | reclimit
> | schedgroup |
> +--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
> | 1 | 0 | /usr/local/bin/mythexternrecorder --conf
> /home/mythtv/etc/mag-1-2.conf | NULL | NULL | EXTERNAL |
> Television | NULL | cubic.sobie.us | 0 |
> 0 | 1 | 0 | 1 | 0
> | 0 | NULL | 0 | 0 |
> 4000 | 0 | 0 | 0 | 0 | 0 |
> NULL | 0 | MPEG2TS | 2 | |
> | | | | mag/1-2 | 0 |
> 1 | 0 | 1 | 0 | 1 | 1 |
> +--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
> 1 row in set (0.001 sec)
>
> select * from inputgroup;
> +-------------+--------------+-----------------------------------------------------------------------------------------+
> | cardinputid | inputgroupid | inputgroupname
> |
> +-------------+--------------+-----------------------------------------------------------------------------------------+
> | 0 | 1 | cubic.sobie.us|/usr/local/bin/mythexternrecorder
> --conf /home/mythtv/etc/mag-1-2.conf|1 |
> | 1 | 1 | cubic.sobie.us|/usr/local/bin/mythexternrecorder
> --conf /home/mythtv/etc/mag-1-2.conf|1 |
> +-------------+--------------+-----------------------------------------------------------------------------------------+
> 2 rows in set (0.001 sec)
>
> I am curious about the entry in inputgroup with a cardinputid of zero (0).
> Is that what you would expect to see or is something amiss?
>
> I know you did some magic to make "multirec" work without having to create
> a bunch of inputs. Does this happen automatically with a call
> CardUtil::CreateCaptureCard() and/or CardUtil::CreateCardInput(), or are
> extra steps necessary? I see that the default "reclimit" is 1, but did not
> dig enough to see if that is still relevant. Does the multirec magic happen
> when schedgroup is 1?
>
> To be clear, I am making these calls via the ServicesAPI and want to make
> sure I am not missing any steps. I do want multirec to work.

Okay. I've refreshed my memory and remember what a mess is still left
over.

The inputgroup entry with cardinputid = 0 is a hold over from Daniel
K's bad design of that table. Basically, that entry is a placeholder
for the mythtv-setup GUI to see the group name. It's eventually
cleaned up when CardUtil::UnlinkInputGroup(0, 0) is called. The
services API or whatever it ultimately calls also needs to make sure
that cleanup occurs. It's harmless as there can never be an inputid =
0 but still should be cleaned up.

The separate CardUtil::CreateCaptureCard() and
CardUtil::CreateCardInput() methods are a holdover from the very, old
days when they were truly separate. The intent that was never
finished was to combine the mythtv-setup screens for capture cards and
inputs together. The new services API should not perpetuate that
split card/input interface. IOW, the new API should have a single
CreateInput() method exposed to API users. (*) (**). As I've stated
before the old, services API for cards and inputs was so bad, it
should simple be deleted and never spoken of again.

David

(*)At the time card/input was refactored, "input" was chosen as the
perferred name for tuner thingies. I think all user-facing code
except mythtv-setup tries to follow that naming.

(**)Unless you are feeling really enegetic and want to rewrite much of
CardUtil and it's callers to fully eradicate the remaining vestiges of
separete cards and inputs, the API will need to call the separate,
lower, level methods in the right way. See CaptureCard::Save() and
CardInput::Save() in videosource.cpp for examples.

--
David Engel
david@istwok.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: CardUtil::CreateCaptureCard / CardUtil::CreateCardInput and mythconverg.inputgroup [ In reply to ]
On Thu, Jul 7, 2022 at 5:02 PM David Engel <david@istwok.net> wrote:

> On Thu, Jul 07, 2022 at 01:33:49PM -0600, John P Poet wrote:
> > Hi David,
> >
> > After a call to
> > CardUtil::CreateCaptureCard()
> > and
> > CardUtil::CreateCardInput()
> >
> > The resulting capturecard and inputgroup tables look like:
> >
> > select * from capturecard;
> >
> +--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
> > | cardid | parentid | videodevice
> > | audiodevice | vbidevice | cardtype | defaultinput |
> > audioratelimit | hostname | dvb_swfilter | dvb_sat_type |
> > dvb_wait_for_seqstart | skipbtaudio | dvb_on_demand | dvb_diseqc_type |
> > firewire_speed | firewire_model | firewire_connection | signal_timeout |
> > channel_timeout | dvb_tuning_delay | contrast | brightness | colour |
> hue |
> > diseqcid | dvb_eitscan | inputname | sourceid | externalcommand |
> > changer_device | changer_model | tunechan | startchan | displayname |
> > dishnet_eit | recpriority | quicktune | schedorder | livetvorder |
> reclimit
> > | schedgroup |
> >
> +--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
> > | 1 | 0 | /usr/local/bin/mythexternrecorder --conf
> > /home/mythtv/etc/mag-1-2.conf | NULL | NULL | EXTERNAL |
> > Television | NULL | cubic.sobie.us | 0 |
> > 0 | 1 | 0 | 1 |
> 0
> |
> > 4000 | 0 | 0 | 0 | 0 |
> 0 |
> > NULL | 0 | MPEG2TS | 2 | |
> > | | | | mag/1-2 | 0 |
> > 1 | 0 | 1 | 0 | 1 | 1
> |
> >
> +--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
> > 1 row in set (0.001 sec)
> >
> > select * from inputgroup;
> >
> +-------------+--------------+-----------------------------------------------------------------------------------------+
> > | cardinputid | inputgroupid | inputgroupname
> > |
> >
> +-------------+--------------+-----------------------------------------------------------------------------------------+
> |/usr/local/bin/mythexternrecorder
> > --conf /home/mythtv/etc/mag-1-2.conf|1 |
> > | 1 | 1 | cubic.sobie.us
> |/usr/local/bin/mythexternrecorder
> > --conf /home/mythtv/etc/mag-1-2.conf|1 |
> >
> +-------------+--------------+-----------------------------------------------------------------------------------------+
> > 2 rows in set (0.001 sec)
> >
> > I am curious about the entry in inputgroup with a cardinputid of zero
> (0).
> > Is that what you would expect to see or is something amiss?
> >
> > I know you did some magic to make "multirec" work without having to
> create
> > a bunch of inputs. Does this happen automatically with a call
> > CardUtil::CreateCaptureCard() and/or CardUtil::CreateCardInput(), or are
> > extra steps necessary? I see that the default "reclimit" is 1, but did
> not
> > dig enough to see if that is still relevant. Does the multirec magic
> happen
> > when schedgroup is 1?
> >
> > To be clear, I am making these calls via the ServicesAPI and want to make
> > sure I am not missing any steps. I do want multirec to work.
>
> Okay. I've refreshed my memory and remember what a mess is still left
> over.
>
> The inputgroup entry with cardinputid = 0 is a hold over from Daniel
> K's bad design of that table. Basically, that entry is a placeholder
> for the mythtv-setup GUI to see the group name. It's eventually
> cleaned up when CardUtil::UnlinkInputGroup(0, 0) is called. The
> services API or whatever it ultimately calls also needs to make sure
> that cleanup occurs. It's harmless as there can never be an inputid =
> 0 but still should be cleaned up.
>
> The separate CardUtil::CreateCaptureCard() and
> CardUtil::CreateCardInput() methods are a holdover from the very, old
> days when they were truly separate. The intent that was never
> finished was to combine the mythtv-setup screens for capture cards and
> inputs together. The new services API should not perpetuate that
> split card/input interface. IOW, the new API should have a single
> CreateInput() method exposed to API users. (*) (**). As I've stated
> before the old, services API for cards and inputs was so bad, it
> should simple be deleted and never spoken of again.
>
> David
>
> (*)At the time card/input was refactored, "input" was chosen as the
> perferred name for tuner thingies. I think all user-facing code
> except mythtv-setup tries to follow that naming.
>
> (**)Unless you are feeling really enegetic and want to rewrite much of
> CardUtil and it's callers to fully eradicate the remaining vestiges of
> separete cards and inputs, the API will need to call the separate,
> lower, level methods in the right way. See CaptureCard::Save() and
> CardInput::Save() in videosource.cpp for examples.
>
> --
> David Engel


My first thought was that CardUtil::UnlinkInputGroup(0, 0) should be added
to the bottom of CardUtil::CreateCardInput, but that would be *slightly*
inefficient.

Apparently there is an issue with the ServicesAPI and a limit to the
maximum number of arguments. With V2, long argument lists are being passed
as JSON to get around that issue. I will take a look at merging the
capturecard and cardinput API calls for V2.

John
Re: CardUtil::CreateCaptureCard / CardUtil::CreateCardInput and mythconverg.inputgroup [ In reply to ]
On 7/7/22 19:13, John P Poet wrote:
> On Thu, Jul 7, 2022 at 5:02 PM David Engel <david@istwok.net> wrote:
>
> On Thu, Jul 07, 2022 at 01:33:49PM -0600, John P Poet wrote:
> > Hi David,
> >
> > After a call to
> > CardUtil::CreateCaptureCard()
> > and
> > CardUtil::CreateCardInput()
> >
> > The resulting capturecard and inputgroup tables look like:
> >
> > select * from capturecard;
> >
> +--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
> > | cardid | parentid | videodevice
> >                  | audiodevice | vbidevice | cardtype |
> defaultinput |
> > audioratelimit | hostname       | dvb_swfilter | dvb_sat_type |
> > dvb_wait_for_seqstart | skipbtaudio | dvb_on_demand |
> dvb_diseqc_type |
> > firewire_speed | firewire_model | firewire_connection |
> signal_timeout |
> > channel_timeout | dvb_tuning_delay | contrast | brightness |
> colour | hue |
> > diseqcid | dvb_eitscan | inputname | sourceid | externalcommand |
> > changer_device | changer_model | tunechan | startchan |
> displayname |
> > dishnet_eit | recpriority | quicktune | schedorder | livetvorder
> | reclimit
> > | schedgroup |
> >
> +--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
> > |      1 |        0 | /usr/local/bin/mythexternrecorder --conf
> > /home/mythtv/etc/mag-1-2.conf | NULL        | NULL | EXTERNAL |
> > Television   |           NULL | cubic.sobie.us
> <http://cubic.sobie.us> |            0 |
> >  0 |                     1 |           0 |  1 |               0
> > |              0 | NULL           |                   0 |       
>       0 |
> >            4000 |                0 |        0 |   0 |      0 |   0 |
> >     NULL |           0 | MPEG2TS   |        2 |          |
> >      |               |          |           | mag/1-2    |     
>      0 |
> >         1 |         0 |          1 |           0 |   1 |       
>   1 |
> >
> +--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
> > 1 row in set (0.001 sec)
> >
> > select * from inputgroup;
> >
> +-------------+--------------+-----------------------------------------------------------------------------------------+
> > | cardinputid | inputgroupid | inputgroupname
> >                                            |
> >
> +-------------+--------------+-----------------------------------------------------------------------------------------+
> > |           0 |            1 | cubic.sobie.us
> <http://cubic.sobie.us>|/usr/local/bin/mythexternrecorder
> > --conf /home/mythtv/etc/mag-1-2.conf|1 |
> > |           1 |            1 | cubic.sobie.us
> <http://cubic.sobie.us>|/usr/local/bin/mythexternrecorder
> > --conf /home/mythtv/etc/mag-1-2.conf|1 |
> >
> +-------------+--------------+-----------------------------------------------------------------------------------------+
> > 2 rows in set (0.001 sec)
> >
> > I am curious about the entry in inputgroup with a cardinputid of
> zero (0).
> > Is that what you would expect to see or is something amiss?
> >
> > I know you did some magic to make "multirec" work without having
> to create
> > a bunch of inputs. Does this happen automatically with a call
> > CardUtil::CreateCaptureCard() and/or
> CardUtil::CreateCardInput(), or are
> > extra steps necessary? I see that the default "reclimit" is 1,
> but did not
> > dig enough to see if that is still relevant. Does the multirec
> magic happen
> > when schedgroup is 1?
> >
> > To be clear, I am making these calls via the ServicesAPI and
> want to make
> > sure I am not missing any steps. I do want multirec to work.
>
> Okay.  I've refreshed my memory and remember what a mess is still left
> over.
>
> The inputgroup entry with cardinputid = 0 is a hold over from Daniel
> K's bad design of that table.  Basically, that entry is a placeholder
> for the mythtv-setup GUI to see the group name.  It's eventually
> cleaned up when CardUtil::UnlinkInputGroup(0, 0) is called. The
> services API or whatever it ultimately calls also needs to make sure
> that cleanup occurs.  It's harmless as there can never be an inputid =
> 0 but still should be cleaned up.
>
> The separate CardUtil::CreateCaptureCard() and
> CardUtil::CreateCardInput() methods are a holdover from the very, old
> days when they were truly separate.  The intent that was never
> finished was to combine the mythtv-setup screens for capture cards and
> inputs together.  The new services API should not perpetuate that
> split card/input interface.  IOW, the new API should have a single
> CreateInput() method exposed to API users. (*) (**).  As I've stated
> before the old, services API for cards and inputs was so bad, it
> should simple be deleted and never spoken of again.
>
> David
>
> (*)At the time card/input was refactored, "input" was chosen as the
> perferred name for tuner thingies.  I think all user-facing code
> except mythtv-setup tries to follow that naming.
>
> (**)Unless you are feeling really enegetic and want to rewrite much of
> CardUtil and it's callers to fully eradicate the remaining vestiges of
> separete cards and inputs, the API will need to call the separate,
> lower, level methods in the right way.  See CaptureCard::Save() and
> CardInput::Save() in videosource.cpp for examples.
>
> --
> David Engel
>
>
> My first thought was that  CardUtil::UnlinkInputGroup(0, 0) should be
> added to the bottom of CardUtil::CreateCardInput, but that would be
> /slightly/ inefficient.
>
> Apparently there is an issue with the ServicesAPI and a limit to the
> maximum number of arguments. With V2, long argument lists are being
> passed as JSON to get around that issue. I will take a look at merging
> the capturecard and cardinput API calls for V2.
>
> John
>
>
I am already using the capturecard apis as they are now, in developing
the new setup pages. The new setup works the same as the old setup. If
you want to join the capture card creation page with the input setup
page let me know how it should look. The problem I see is that you have
to set up the listings source before you set up the input, so it makes
somewhat sense to have them separate, i.e. create capture card, then
create listings source, then link them up using the input setup.
Otherwise you would have to set up your listings source before the
capture card.

Another problem is that there will be some 10 capture card setup pages
to be developed, for all the capture card types, but it seems tedious to
have the input setup process repeated in the code 10 times for each
capture card type.

You can test the setup pages I have already done. I have done the
general setup, and the ceton and DVB capture cards so far, plus the
deletion of cards, delete all cards, delete all cards on all hosts.

The update for capture cards via the API is rather primitive and
different from others, you specify database columns to update one at a
time. I have used it anyway.

Peter
Re: CardUtil::CreateCaptureCard / CardUtil::CreateCardInput and mythconverg.inputgroup [ In reply to ]
On Thu, Jul 07, 2022 at 08:27:33PM -0400, Peter Bennett wrote:
>
> On 7/7/22 19:13, John P Poet wrote:
> > On Thu, Jul 7, 2022 at 5:02 PM David Engel <david@istwok.net> wrote:
> >
> > On Thu, Jul 07, 2022 at 01:33:49PM -0600, John P Poet wrote:
> > > Hi David,
> > >
> > > After a call to
> > > CardUtil::CreateCaptureCard()
> > > and
> > > CardUtil::CreateCardInput()
> > >
> > > The resulting capturecard and inputgroup tables look like:
> > >
> > > select * from capturecard;
> > >
> > +--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
> > > | cardid | parentid | videodevice
> > >? ? ? ? ? ? ? ? ? | audiodevice | vbidevice | cardtype |
> > defaultinput |
> > > audioratelimit | hostname? ? ? ?| dvb_swfilter | dvb_sat_type |
> > > dvb_wait_for_seqstart | skipbtaudio | dvb_on_demand |
> > dvb_diseqc_type |
> > > firewire_speed | firewire_model | firewire_connection |
> > signal_timeout |
> > > channel_timeout | dvb_tuning_delay | contrast | brightness |
> > colour | hue |
> > > diseqcid | dvb_eitscan | inputname | sourceid | externalcommand |
> > > changer_device | changer_model | tunechan | startchan |
> > displayname |
> > > dishnet_eit | recpriority | quicktune | schedorder | livetvorder
> > | reclimit
> > > | schedgroup |
> > >
> > +--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
> > > |? ? ? 1 |? ? ? ? 0 | /usr/local/bin/mythexternrecorder --conf
> > > /home/mythtv/etc/mag-1-2.conf | NULL? ? ? ? | NULL | EXTERNAL |
> > > Television? ?|? ? ? ? ? ?NULL | cubic.sobie.us
> > <http://cubic.sobie.us> |? ? ? ? ? ? 0 |
> > >? 0 |? ? ? ? ? ? ? ? ? ? ?1 |? ? ? ? ? ?0 | ?1 |? ? ? ? ? ? ? ?0
> > > |? ? ? ? ? ? ? 0 | NULL? ? ? ? ? ?|? ? ? ? ? ? ? ? ? ?0 |? ? ? ?
> > ? ? ? 0 |
> > >? ? ? ? ? ? 4000 |? ? ? ? ? ? ? ? 0 |? ? ? ? 0 | ? 0 |? ? ? 0 |? ?0 |
> > >? ? ?NULL |? ? ? ? ? ?0 | MPEG2TS? ?|? ? ? ? 2 | ? ? ? ? ?|
> > >? ? ? |? ? ? ? ? ? ? ?|? ? ? ? ? |? ? ? ? ? ?| mag/1-2 ? ?|? ? ?
> > ? ? ?0 |
> > >? ? ? ? ?1 |? ? ? ? ?0 |? ? ? ? ? 1 |? ? ? ? ? ?0 | ? 1 |? ? ? ?
> > ? 1 |
> > >
> > +--------+----------+------------------------------------------------------------------------+-------------+-----------+----------+--------------+----------------+----------------+--------------+--------------+-----------------------+-------------+---------------+-----------------+----------------+----------------+---------------------+----------------+-----------------+------------------+----------+------------+--------+-----+----------+-------------+-----------+----------+-----------------+----------------+---------------+----------+-----------+-------------+-------------+-------------+-----------+------------+-------------+----------+------------+
> > > 1 row in set (0.001 sec)
> > >
> > > select * from inputgroup;
> > >
> > +-------------+--------------+-----------------------------------------------------------------------------------------+
> > > | cardinputid | inputgroupid | inputgroupname
> > >? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
> > >
> > +-------------+--------------+-----------------------------------------------------------------------------------------+
> > > |? ? ? ? ? ?0 |? ? ? ? ? ? 1 | cubic.sobie.us
> > <http://cubic.sobie.us>|/usr/local/bin/mythexternrecorder
> > > --conf /home/mythtv/etc/mag-1-2.conf|1 |
> > > |? ? ? ? ? ?1 |? ? ? ? ? ? 1 | cubic.sobie.us
> > <http://cubic.sobie.us>|/usr/local/bin/mythexternrecorder
> > > --conf /home/mythtv/etc/mag-1-2.conf|1 |
> > >
> > +-------------+--------------+-----------------------------------------------------------------------------------------+
> > > 2 rows in set (0.001 sec)
> > >
> > > I am curious about the entry in inputgroup with a cardinputid of
> > zero (0).
> > > Is that what you would expect to see or is something amiss?
> > >
> > > I know you did some magic to make "multirec" work without having
> > to create
> > > a bunch of inputs. Does this happen automatically with a call
> > > CardUtil::CreateCaptureCard() and/or
> > CardUtil::CreateCardInput(), or are
> > > extra steps necessary? I see that the default "reclimit" is 1,
> > but did not
> > > dig enough to see if that is still relevant. Does the multirec
> > magic happen
> > > when schedgroup is 1?
> > >
> > > To be clear, I am making these calls via the ServicesAPI and
> > want to make
> > > sure I am not missing any steps. I do want multirec to work.
> >
> > Okay.? I've refreshed my memory and remember what a mess is still left
> > over.
> >
> > The inputgroup entry with cardinputid = 0 is a hold over from Daniel
> > K's bad design of that table.? Basically, that entry is a placeholder
> > for the mythtv-setup GUI to see the group name.? It's eventually
> > cleaned up when CardUtil::UnlinkInputGroup(0, 0) is called. The
> > services API or whatever it ultimately calls also needs to make sure
> > that cleanup occurs.? It's harmless as there can never be an inputid =
> > 0 but still should be cleaned up.
> >
> > The separate CardUtil::CreateCaptureCard() and
> > CardUtil::CreateCardInput() methods are a holdover from the very, old
> > days when they were truly separate.? The intent that was never
> > finished was to combine the mythtv-setup screens for capture cards and
> > inputs together.? The new services API should not perpetuate that
> > split card/input interface.? IOW, the new API should have a single
> > CreateInput() method exposed to API users. (*) (**).? As I've stated
> > before the old, services API for cards and inputs was so bad, it
> > should simple be deleted and never spoken of again.
> >
> > David
> >
> > (*)At the time card/input was refactored, "input" was chosen as the
> > perferred name for tuner thingies.? I think all user-facing code
> > except mythtv-setup tries to follow that naming.
> >
> > (**)Unless you are feeling really enegetic and want to rewrite much of
> > CardUtil and it's callers to fully eradicate the remaining vestiges of
> > separete cards and inputs, the API will need to call the separate,
> > lower, level methods in the right way.? See CaptureCard::Save() and
> > CardInput::Save() in videosource.cpp for examples.
> >
> > -- David Engel
> >
> >
> > My first thought was that? CardUtil::UnlinkInputGroup(0, 0) should be
> > added to the bottom of CardUtil::CreateCardInput, but that would be
> > /slightly/ inefficient.
> >
> > Apparently there is an issue with the ServicesAPI and a limit to the
> > maximum number of arguments. With V2, long argument lists are being
> > passed as JSON to get around that issue. I will take a look at merging
> > the capturecard and cardinput API calls for V2.
> >
> > John
> >
> >
> I am already using the capturecard apis as they are now, in developing the
> new setup pages. The new setup works the same as the old setup. If you want
> to join the capture card creation page with the input setup page let me know
> how it should look. The problem I see is that you have to set up the
> listings source before you set up the input, so it makes somewhat sense to
> have them separate, i.e. create capture card, then create listings source,
> then link them up using the input setup. Otherwise you would have to set up
> your listings source before the capture card.

I feel pretty strongly that they should be combined. The split dates
all the way back to the earyly days of analog, capture cards where
there were multiple inputs (tuner, composite, s-video, etc.). Those
are by far the exception these days and have been for a long time.
Keeping that distinction only promotes unnecessary confusion.

FWIW, I think creating video source logically comes first.
Regardless, it should be allowed to leave the videosource blank/empty
and fill it in later.

> Another problem is that there will be some 10 capture card setup pages to be
> developed, for all the capture card types, but it seems tedious to have the
> input setup process repeated in the code 10 times for each capture card
> type.
>
> You can test the setup pages I have already done. I have done the general
> setup, and the ceton and DVB capture cards so far, plus the deletion of
> cards, delete all cards, delete all cards on all hosts.
>
> The update for capture cards via the API is rather primitive and different
> from others, you specify database columns to update one at a time. I have
> used it anyway.

By repeating, are you talking about C++ code or whatever web GUI
framework you all are using or both? I'm guessing you mean the
framework. Does it not support some form of code re-use?

David
--
David Engel
david@istwok.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: CardUtil::CreateCaptureCard / CardUtil::CreateCardInput and mythconverg.inputgroup [ In reply to ]
On 08/07/2022 02:23, David Engel wrote:

>
> I feel pretty strongly that they should be combined. The split dates
> all the way back to the earyly days of analog, capture cards where
> there were multiple inputs (tuner, composite, s-video, etc.). Those
> are by far the exception these days and have been for a long time.
> Keeping that distinction only promotes unnecessary confusion.
>
> FWIW, I think creating video source logically comes first.
> Regardless, it should be allowed to leave the videosource blank/empty
> and fill it in later.


We definitely should be thinking of how to make setup easier especially
for first time users so anything that makes it more user friendly is a
good thing IMHO. I think Peter is more inclined to just cut and paste
what we do already in mythtv-setup whereas I wanted to at least try to
make improvements as we went along that's why I dropped out of working
on this he has more energy and stronger ideas/opinions than I do so I
will just let him get one with it :) I do understand it is way easier
and quicker to just copy mythtv-setup. I'm sure we would all appreciate
any ideas to improve the UI/UX to make it more users friendly in the WebApp.


One concern with the Angular WebApp is just how slow it has become for
me. At the start when it was small and simple it was fairly zippy but as
more gets added to it it has become really sluggish taking over 10
seconds to refresh some times. I've not seen anyone else reporting
problems so it could just be my setup though?


>> Another problem is that there will be some 10 capture card setup pages to be
>> developed, for all the capture card types, but it seems tedious to have the
>> input setup process repeated in the code 10 times for each capture card
>> type.
>>
>> You can test the setup pages I have already done. I have done the general
>> setup, and the ceton and DVB capture cards so far, plus the deletion of
>> cards, delete all cards, delete all cards on all hosts.
>>
>> The update for capture cards via the API is rather primitive and different
>> from others, you specify database columns to update one at a time. I have
>> used it anyway.
> By repeating, are you talking about C++ code or whatever web GUI
> framework you all are using or both? I'm guessing you mean the
> framework. Does it not support some form of code re-use?
>
> David


This is based on my rather limited knowledge of Angular so may not be
fully correct.


Angular is very component orientated which does promote creating
reusable components although that's often easier said than done. It's
TypeScript based which is itself based on Java so you can use all the
class inheritance stuff from there if you want. It's very similar to
Qt's QML in many ways like the idea of everything being a component and
there are some elements of QML's declarative nature where setting a
property value can propagate to other properties without having to do
anything.


Each component in Angular usually has an HTML part and a TypeScript part
and optionally each component can have a CSS or SCSS part and there can
also be a test part which I don't think we use at the moment. We have
opted to put each of those parts in there own file but they could be all
in one file if you wanted.


One downside to everything being a component is the code for the WebApp
quickly becomes a mass of files that can be hard to navigate and find
stuff if they are not carefully organized. Each component has 4 files! 
I can envisage when the WebApp is fully developed there could easily be
many hundreds or even thousands of files involved.


I don't know the specifics of what Peter is talking about but there may
be a way split the pages up in such a way they can share code or html.


Paul H.

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: CardUtil::CreateCaptureCard / CardUtil::CreateCardInput and mythconverg.inputgroup [ In reply to ]
On 08/07/2022 00:00, David Engel wrote:

> (**)Unless you are feeling really enegetic and want to rewrite much of
> CardUtil and it's callers to fully eradicate the remaining vestiges of
> separete cards and inputs, the API will need to call the separate,
> lower, level methods in the right way. See CaptureCard::Save() and
> CardInput::Save() in videosource.cpp for examples.
>

Aren't separate cards and inputs a valid setup in a multi satellite
setup?

There is only 1 card, and a diseq switch which allows you to select
which satellite you are receiving from at the time?
(simplified to avoid going into deep technical details)

Regards
Stuart
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: CardUtil::CreateCaptureCard / CardUtil::CreateCardInput and mythconverg.inputgroup [ In reply to ]
On Tue, Jul 12, 2022 at 03:35:23PM +0100, Stuart Auchterlonie wrote:
> On 08/07/2022 00:00, David Engel wrote:
>
> > (**)Unless you are feeling really enegetic and want to rewrite much of
> > CardUtil and it's callers to fully eradicate the remaining vestiges of
> > separete cards and inputs, the API will need to call the separate,
> > lower, level methods in the right way. See CaptureCard::Save() and
> > CardInput::Save() in videosource.cpp for examples.
> >
>
> Aren't separate cards and inputs a valid setup in a multi satellite
> setup?
>
> There is only 1 card, and a diseq switch which allows you to select
> which satellite you are receiving from at the time?
> (simplified to avoid going into deep technical details)

No, it hasn't been that way for a long time. For both diseqc and old,
analog cards, a separate, parent input needs to be setup for each,
distinct, use case (satellite for diseqc and physical input for
analog). Special, "device", input groups are automatically setup for
each case to prevent them from being used at the same time.

David
--
David Engel
david@istwok.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org