[mythtv-commits] Ticket #13443: V4L2 error message for each CaptureCard
MythTV
noreply at mythtv.org
Sat Apr 6 20:52:32 UTC 2019
#13443: V4L2 error message for each CaptureCard
-------------------------------------+-------------------------------------
Reporter: Klaas de Waal | Owner: Klaas de Waal
Type: Patch - Bug Fix | Status: assigned
Priority: minor | Milestone: needs_triage
Component: MythTV - Mythtv- | Version: Master Head
setup | Keywords: V4L2 DVB capturecard
Severity: low | setup
Ticket locked: 0 |
-------------------------------------+-------------------------------------
After selecting mythtv-setup page "Capture cards" the following error
message is given in the log for each defined capture card:
{{{
2019-04-06 22:26:13.504850 E V4L2(): Could not open '':
eno: No such file or directory (2)
}}}
This message is also given when a new capture card is created by selecting
"(New capture card)".
What happens is that, when mythtv is configured to support V4L2, each
instantiation of a CaptureCard object causes a call to
V4L2encGroup::probeCard. However, at this moment there is no device name
so this fails.
The easy fix is to not call probeCard if the device name is empty.\\
A patch for this is attached.
However, it maybe possible that there is a more elegant solution.
The following is a description of what happens in videosource.cpp and
v4l2util.cpp.\\
Creation of the CaptureCard:
{{{
CaptureCard::CaptureCard(bool use_card_group)
: m_id(new ID)
{
addChild(m_id);
if (use_card_group)
CaptureCardGroup(*this);
addChild(new Hostname(*this));
}
}}}
In CaptureCardGroup::CaptureCardGroup a new V4L2encGroup is created:
{{{
#ifdef USING_V4L2
cardtype->addTargetedChild("V4L2ENC", new V4L2encGroup(parent,
*cardtype));
}}}
In V4L2encGroup::V4L2encGroup then the card probe is called:
{{{
probeCard(m_device->getValue());
}}}
N.B. The attached patch modifies the above so that probeCard is only
called when the device name is not empty.
In V4L2encGroup::probeCard an instance of V4L2util is created:
{{{
void V4L2encGroup::probeCard(const QString &device_name)
{
#ifdef USING_V4L2
QString card_name = tr("Failed to open");
QString card_info = card_name;
V4L2util v4l2(device_name);
}}}
The actual error message this ticket is about is then finally given in
V4l2util::Open
{{{
m_fd = open(dev_name.toLatin1().constData(), O_RDWR);
if (m_fd < 0)
{
LOG(VB_GENERAL, LOG_ERR, LOC +
QString("Could not open '%1': ").arg(dev_name) + ENO);
return false;
}
}}}
--
Ticket URL: <https://code.mythtv.org/trac/ticket/13443>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list