mythtv-setup freezes upon launching

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

User avatar
kmdewaal
Developer
Posts: 305
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: mythtv-setup freezes upon launching

Post by kmdewaal » Wed Jun 09, 2021 9:28 pm

And now it looks like I can somewhat reproduce this, using the 3rd database version.
I have changed the host name in the database tables storagegroup, program, recorded, capturecard and settings to the host name of my system and created the /var/lib/mythtv/.... storage group directories.
Now mythtv-setup starts OK. Alt-tab to other screen, then Alt-tab back to mythtv-setup and then it is not responsive anymore to the arrow keys; often Escape does cause an exit but not always.
The DB Error (StorageGroup::StorageGroup()) in the beginning is also present.
Note: this is now with a recent master.
With the v31 mythtv-setup there is a segfault in LibCecInitialise which looks similar to a bug I fixed a while ago.

User avatar
kmdewaal
Developer
Posts: 305
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: mythtv-setup freezes upon launching

Post by kmdewaal » Wed Jun 09, 2021 9:38 pm

The LibCecInitialize bug was fixed only in master, not in v31.See commit e787645fd974bbed6b02ed45ae3530477bb49c58.
This bug happened sometimes when mythfrontend was connected to a monitor or a TV that does not support CEC.

User avatar
bill6502
Developer
Posts: 1897
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: mythtv-setup freezes upon launching

Post by bill6502 » Wed Jun 09, 2021 9:44 pm

Would myhtv-setup.real --override-setting libCECEnabled=0 help?

ulmus-scott
Junior
Posts: 18
Joined: Sat Jun 05, 2021 12:50 am
United States of America

Re: mythtv-setup freezes upon launching

Post by ulmus-scott » Wed Jun 09, 2021 10:56 pm

bill6502:
Would myhtv-setup.real --override-setting libCECEnabled=0 help?
libcec is not installed, so there is no difference.

Code: Select all

htpc@htpc-HP:~$ mythtv-setup.real -v most,norefcount --loglevel=debug > mythtv-setup-12-2021-06-09T1834.log 2>&1
htpc@htpc-HP:~$ mythtv-setup.real -v most,norefcount --loglevel=debug --override-setting libCECEnabled=0 > mythtv-setup-13-2021-06-09T1836.log 2>&1

log 12:
libcec.so.6: cannot open shared object file: No such file or directory
E  CECAdapter: Failed to load libcec.
becomes
log 13:
I  CECAdapter: libCEC support is disabled.

User avatar
kmdewaal
Developer
Posts: 305
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: mythtv-setup freezes upon launching

Post by kmdewaal » Thu Jun 10, 2021 9:00 pm

About the DB Error (StorageGroup::StorageGroup()) in the beginning of the log file.
This error is caused by the setting StartupScreenDelay.
This can be set in the mythfrontend configuration menu "Theme/Screen settings" and this is the help text:
The Startup Screen will show the progress of starting the frontend if frontend startup takes longer than this number of seconds.
If this setting is not present in the settings table then a time of 2 seconds is used as default.
However, the setting is present in the database with value 0 and this is then the value used.
I have not completely followed the logic but this value causes the first database access to fail with the "Driver not loaded" status.
In mythtv-setup the first access tries to find directories for storage group "Themes" and this will thus always fail if the StartupScreenDelay setting is 0.

I do not have a clue if this is related to the "mythtv-setup freezes" problem but you can always try.
You can either set the value with mythfrontend, set the value with mysql or delete the setting, also with mysql.
Setting the value with mysql can be done like this:

Code: Select all

MariaDB [mythconverg]> update settings set data='2' where value='StartupScreenDelay';

User avatar
kmdewaal
Developer
Posts: 305
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: mythtv-setup freezes upon launching

Post by kmdewaal » Thu Jun 10, 2021 9:38 pm

The first database does NOT have the StartupScreenDelay setting so a value of 2 seconds will be used.
The second and the third databases do have a StartupScreenDelay setting of 0.

ulmus-scott
Junior
Posts: 18
Joined: Sat Jun 05, 2021 12:50 am
United States of America

Re: mythtv-setup freezes upon launching

Post by ulmus-scott » Fri Jun 11, 2021 4:48 pm

kmdewaal:
About the DB Error (StorageGroup::StorageGroup()) in the beginning of the log file.
This error is caused by the setting StartupScreenDelay.
Does the backend use a 2s delay regardless of the setting? Looking at the backend logs it always shows:

Code: Select all

I  Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 2000
The StartupScreenDelay setting does seem to be causing the issue I'm having.


I changed the setting in the frontend to 2 (backend-4, frontend-3). I then closed and relaunched the frontend (frontend-4). Upon running mythtv-setup (log 14), it worked properly.

I changed the setting to 0 using mysql, ran mythtv-setup (log 15), and it still worked fine. The log still shows a delay of 2000 (ms) and no error.

Code: Select all

I  Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 2000
After resetting the setting to 0 in the frontend (increased to 2, saved, and then set back to 0) (backend-5, frontend-5), I ran mythtv-setup (logs 16 and 17); it was frozen.

I set the setting to 2 in the frontend (backend-6, frontend-6), and ran mythtv-setup (log 18); it works properly.

I set the setting to 0 in the frontend (backend-7, frontend-7), and ran mythtv-setup (log 19); it was frozen, showing a grayed out menu.

I changed the setting to 2 using mysql, ran mythtv-setup (log 20), and it works fine. However, the log still shows a delay of 0 and the error. I think the progress bar did flash.
I ran mythtv-setup (log 21) again; it works fine, showing a delay of 2000 and no error in the log and no progress bar.

After changing the setting to 0 using mysql, I ran mythtv-setup (log 22); it works fine, but shows no progress bar and the log still shows a delay of 2000 and no error.
Running mythtv-setup (log 23) again, it was frozen on a grayed out menu, showed the progress bar and a delay of 0 and the error in the log.

Oddly, the changes via mysql seem to take two runs of mythtv-setup to propagate fully, while the change via the frontend affects the next run of mythtv-setup.


I reset StartupScreenDelay on the other machine to 2 in the frontend, and mythtv-setup works without issue.

I had set StartupScreenDelay to 0 because the frontend can take some time to launch, so it can easily be launched multiple times (using a shortcut on the desktop). Also, I don't think the 2 seconds delay was accurate (admittedly, I never timed it and it is not a critical delay). I liked it showing a screen instantly, letting you know it has been launched and is loading. (Although, the progress bar only ever showed a thin sliver filled on the left, unless the backend was not running.) Since it works fine with the delay, I can use it like that, but it is strange that it has other affects than just showing a progress bar.

User avatar
kmdewaal
Developer
Posts: 305
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: mythtv-setup freezes upon launching

Post by kmdewaal » Fri Jun 11, 2021 9:32 pm

OK, so this
The StartupScreenDelay setting does seem to be causing the issue I'm having.
does mean that the problem is solved by setting a value of 2. The lowest value is 1 second and that also works for me.
Does the backend use a 2s delay regardless of the setting?
The backend is a command line application without a GUI so it is correct that it does not look at the StartupScreenDelay setting.
Oddly, the changes via mysql seem to take two runs of mythtv-setup to propagate fully, while the change via the frontend affects the next run of mythtv-setup.
I found in the code this in mythcontext.cpp:1474 this reference:

Code: Select all

cache/contextcache.xml
which, if I understand the code correct, caches a few settings including the StartupScreenDelay and uses that initially. This must be what causes the propagation delay.

I do agree that this is a bug. What seems to happen is that the StartupScreenDelay is used as the timeout value for the very first SQL query and when this is zero the first SQL query fails. If this can be easily fixed then I will do that and otherwise I will create a Github issue.
For the time being I suggest to use a StartupScreenDelay setting of 1 or more.

Thanks for the reports and the extensive testing!

Post Reply