Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mythexternrecorder requires configuration filename to be fully qualified while mythtv-setup does not #670

Closed
JanCeuleers opened this issue Nov 27, 2022 · 8 comments

Comments

@JanCeuleers
Copy link
Contributor

  • Platform: Ubuntu 20.04

uname -a

Linux hobbiton 5.4.0-132-generic #148-Ubuntu SMP Mon Oct 17 16:02:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

  • MythTV version: fixes/32

mythbackend --version

Please attach all output as a file in bug reports.
MythTV Version : v32.0+fixes.202211251949.2af1c2064e~ubuntu20.04.1
MythTV Branch : fixes/32
Network Protocol : 91
Library API : 32.20200101-1
QT Version : 5.12.8
Options compiled in:
linux profile use_hidesyms using_alsa using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_dvb using_firewire using_frontend using_hdhomerun using_satip using_vbox using_ceton using_joystick_menu using_libcec using_libcrypto using_gnutls using_libdns_sd using_libfftw3 using_libxml2 using_lirc using_mheg using_opengl using_egl using_qtwebkit using_qtscript using_qtdbus using_taglib using_v4l2 using_v4l2prime using_x11 using_system_libbluray using_systemd_notify using_systemd_journal using_drm using_bindings_perl using_bindings_python using_bindings_php using_freetype2 using_mythtranscode using_opengl using_egl using_drm using_vaapi using_nvdec using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2 using_libmp3lame

What steps will reproduce the bug?

I have created an external recorder entry using mythtv-setup, specifying "/usr/bin/mythexternrecorder --conf mythexternrecorder1.conf" as the video device. I then scanned for channels which was successful, suggesting that mythtv-setup was able to find the configuration file as that is where the channels file is specified. (Or perhaps it queried the channels through mythexternrecorder, which means that mythexternrecorder itself was able to find the configuration file and the channels= directive it contains).

However, when actually trying to record something through this external recorder mythexternrecorder cannot find its configuration file, leading to very obscure error messages in the log. I was able to fix that as follows:

mysql> update capturecard set videodevice="/usr/bin/mythexternrecorder --conf /home/mythtv/mythexternrecorder1.conf" where videodevice="/usr/bin/mythexternrecorder --conf mythexternrecorder1.conf";

In other words: mythexternrecorder can only find its configuration file when streaming if it is fully-qualified. Suggesting that the current directory from which mythexternrecorder is invoked differs between mythbackend and mythtv-setup (which are both run as the same user: mythtv).

How often does it reproduce? Is there a required condition?

I only tried this once.

What is the expected behaviour?

  1. If mythexternrecorder cannot open its configuration file it should emit a clear error message to that effect. At the moment this can only be inferred from obscure log entries such as "ERR:Already dead" and "ERR:Not open".
  2. Consistent behaviour between mythtv-setup and mythbackend.

What do you see instead?

As described above: when setting up the external recorder in mythtv-setup one has the impression that all is well because at that time the channel scan works which means that the configuration file was found. Yet when attempting a recording using the external recorder mythexternrecorder cannot find its configuration file, leading to the m_fatal flag being noticed set in MythExternRecApp::Open when called from MythExternRecApp::LockTimeout.

Additional information

@jpoet
Copy link
Member

jpoet commented Nov 27, 2022

The "External (blackbox) Recorder" mechanism has no way to know what any external recorder application does or does not need for arguments. This means there is no way for it to validate those arguments.

The Wiki page for the "generic" mythexternrecorder application says:

The path to the configuration file must be fully qualified such that mythexternrecorder can find its configuration file regardless of the current directory when it is invoked.

Further, when running
mythexternrecorder --help
it says:

--conf Path to a configuration file in INI format.

If you would like to update the wiki to make the warning stronger, please do.

@jpoet jpoet closed this as completed Nov 27, 2022
@JanCeuleers
Copy link
Contributor Author

JanCeuleers commented Nov 27, 2022 via email

@JanCeuleers
Copy link
Contributor Author

JanCeuleers commented Nov 27, 2022 via email

@jpoet
Copy link
Member

jpoet commented Nov 27, 2022

There should have been a message to that effect in the mythexternrecorder log file. Was there not?

@JanCeuleers
Copy link
Contributor Author

JanCeuleers commented Nov 28, 2022 via email

@JanCeuleers
Copy link
Contributor Author

JanCeuleers commented Nov 28, 2022 via email

@jpoet
Copy link
Member

jpoet commented Dec 11, 2022

I just pushed a fix of mythexternrecorder such that it will report to mythbackend when it cannot find the config file.

@JanCeuleers
Copy link
Contributor Author

JanCeuleers commented Dec 12, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants