Opened 4 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#13501 closed Bug Report - General (fixed)

"Schedule As Group" not selected by default

Reported by: Klaas de Waal Owned by: Peter Bennett
Priority: minor Milestone: 31.0
Component: MythTV - Mythtv-setup Version: Master Head
Severity: low Keywords: scheduling
Cc: gigem, Stuart Auchterlonie Ticket locked: no

Description

On request of gigem, a detailed description of this issue.

Problem description

In mythtv-setup, after creating a new capture card entry and then configuring it in page "5. Input connections"/"Interactions between inputs", the option "Schedule as Group" is not selected. Also the "Max recordings" is 1.

The default for the "Schedule as Group" should be selected and the "Max recordings" should be 2.

How to reproduce this

  • System: fedora 31 (with mariadb)
  • Today's master (20191106)
  • Create new database from mythtv/mythtv/database/mc.sql
  • Run mythtv-setup, select country Netherlands and language English
  • Run mythtv-setup again, update database to version 1352
  • Go through the following menu steps in mythtv-setup:
    1. Capture cards
      (New capture card)
      New capture card >
      Card type: DVB-T/S/C, ATSC or ISDB-T tuner card
      Select MyGiga? DVB-T2 USB stick
    2. Video sources
      (New video source)
      New video source > (add name, rest is default)
    3. Input connections
      Select video source
      Interactions between inputs >

In this page:

Max recordings: 1
Schedule as group: not selected

Exit and save

This is then the content of database table capturecard:

MariaDB [mythconverg]> select cardid,parentid,cardtype,schedgroup from capturecard;
+--------+----------+----------+------------+
| cardid | parentid | cardtype | schedgroup |
+--------+----------+----------+------------+
|      1 |        0 | DVB      |          0 |
+--------+----------+----------+------------+
1 row in set (0.000 sec)

Analysis:

It is the intention that "Schedule as group" is default selected, as shown by the code in videosource.cpp:160-161 where the value is set true:

        setLabel(QObject::tr("Schedule as group"));
        setValue(true);

It is the intention that "Max recordings" is default 2, as shown by the code in videosource.cpp:64:

static const uint kDefaultMultirecCount = 2;

which is then used in videosource.cpp:3108.

The database schema for capturecard shows this:
MariaDB [mythconverg]> describe capturecard;
+-----------------------+------------------+------+-----+------------+----------------+
| Field                 | Type             | Null | Key | Default    | Extra          |
+-----------------------+------------------+------+-----+------------+----------------+
| cardid                | int(10) unsigned | NO   | PRI | NULL       | auto_increment |
| parentid              | int(10) unsigned | NO   |     | 0          |                |
| videodevice           | varchar(128)     | YES  |     | NULL       |                |
| audiodevice           | varchar(128)     | YES  |     | NULL       |                |
| vbidevice             | varchar(128)     | YES  |     | NULL       |                |
| cardtype              | varchar(32)      | YES  |     | V4L        |                |
| defaultinput          | varchar(32)      | YES  |     | Television |                |
| audioratelimit        | int(11)          | YES  |     | NULL       |                |
| hostname              | varchar(64)      | YES  |     | NULL       |                |
| dvb_swfilter          | int(11)          | YES  |     | 0          |                |
| dvb_sat_type          | int(11)          | NO   |     | 0          |                |
| dvb_wait_for_seqstart | int(11)          | NO   |     | 1          |                |
| skipbtaudio           | tinyint(1)       | YES  |     | 0          |                |
| dvb_on_demand         | tinyint(4)       | NO   |     | 0          |                |
| dvb_diseqc_type       | smallint(6)      | YES  |     | NULL       |                |
| firewire_speed        | int(10) unsigned | NO   |     | 0          |                |
| firewire_model        | varchar(32)      | YES  |     | NULL       |                |
| firewire_connection   | int(10) unsigned | NO   |     | 0          |                |
| signal_timeout        | int(11)          | NO   |     | 1000       |                |
| channel_timeout       | int(11)          | NO   |     | 3000       |                |
| dvb_tuning_delay      | int(10) unsigned | NO   |     | 0          |                |
| contrast              | int(11)          | NO   |     | 0          |                |
| brightness            | int(11)          | NO   |     | 0          |                |
| colour                | int(11)          | NO   |     | 0          |                |
| hue                   | int(11)          | NO   |     | 0          |                |
| diseqcid              | int(10) unsigned | YES  |     | NULL       |                |
| dvb_eitscan           | tinyint(1)       | NO   |     | 1          |                |
| inputname             | varchar(32)      | NO   |     | None       |                |
| sourceid              | int(10) unsigned | NO   |     | 0          |                |
| externalcommand       | varchar(128)     | YES  |     | NULL       |                |
| changer_device        | varchar(128)     | YES  |     | NULL       |                |
| changer_model         | varchar(128)     | YES  |     | NULL       |                |
| tunechan              | varchar(10)      | YES  |     | NULL       |                |
| startchan             | varchar(10)      | YES  |     | NULL       |                |
| displayname           | varchar(64)      | NO   |     |            |                |
| dishnet_eit           | tinyint(1)       | NO   |     | 0          |                |
| recpriority           | int(11)          | NO   |     | 0          |                |
| quicktune             | tinyint(4)       | NO   |     | 0          |                |
| schedorder            | int(10) unsigned | NO   |     | 1          |                |
| livetvorder           | int(10) unsigned | NO   |     | 1          |                |
| reclimit              | int(10) unsigned | NO   |     | 1          |                |
| schedgroup            | tinyint(1)       | NO   |     | 0          |                |
+-----------------------+------------------+------+-----+------------+----------------+
42 rows in set (0.002 sec)


The last two fields are of interest: reclimit is default 1 and schedgroup is default 0.

It appears that the default values in the database do override the default values in the code.

This can be verified by modifying the database schema as follows:

MariaDB [mythconverg]> ALTER TABLE capturecard ALTER reclimit SET DEFAULT 2;
MariaDB [mythconverg]> ALTER TABLE capturecard ALTER schedgroup SET DEFAULT 1;

After this modification, the default for "Schedule as group" is selected and the default "Max recordings" is 2.

The way forward:

I suggest to following approach to resolve this:

  • Modify the database schema so the default values are correct.
  • Remove the C++ code that sets the default values as this code is apparently not working.

Notes:

As bugs go, this one is fairly easy to fix. Given that we are still before the v31 release this is an excellent moment to add a schema change. However, as discussed in IRC/#mythtv, it appears that the default values as described in this ticket are not reproducible everywhere and also there might be discussion on why the C++ code does not work for me. Hence this ticket.

Change History (3)

comment:1 Changed 3 weeks ago by David Engel <dengel@…>

Resolution: fixed
Status: newclosed

In f58f474bb1/mythtv:

Fix issues with default schedgroup and reclimit values.

My database had somehow been changed such that schedgroup was
defaulting to enabled but wasn't for others. That is fixed now.

Also, change the default reclimit officially back to 1. With
schedgroup enabled, the reclimit is automatically increased when
needed. For those few cases, where schedgroup can not be used, the
user can set the desired reclimit when disabling schedgroup.

Fixes #13501

comment:2 Changed 3 weeks ago by jpilk

I am not clear how this will affect the 'Upcoming Recordings' screen, which identifies the tuners in different ways; when 'upcoming' I believe the numbers identify the hardware, but for recordings in progress they have been confusing and may now be more so. I think I would prefer to always know the hardware...

comment:3 in reply to:  2 Changed 3 weeks ago by gigem

John, if you haven't already done so, please ask this on the mailing list or IRC. I'm not entirely sure what you are asking for but there are a number of ways to display the tuner information. It's usually just a matter of having your them of choice use the one you want.

Note: See TracTickets for help on using tickets.