Skip to content

Commit

Permalink
No Signal/Noise and no Signal Strength with Si2168-based tuners
Browse files Browse the repository at this point in the history
The Linux driver for the Si2168 only implements the DVBv5 calls
to retrieve the signal strength etc.
The MythTV code first tries the DVBv3 call and if that fails
with an EOPNOTSUPP then the DVBv5 call is tried.
This worked correct until Linux kernel changed the
error code from EOPNOTSUPP to ENOTSUPP (value 524).
This fix adds a test on ENOTSUPP in addition to the existing
test on EOPNOTSUPP.
  • Loading branch information
kmdewaal committed Mar 11, 2019
1 parent 62ae089 commit 9a174ff
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions mythtv/libs/libmythtv/recorders/dvbchannel.cpp
Expand Up @@ -49,6 +49,11 @@
#include "dvbcam.h"
#include "tv_rec.h"

// Returned by drivers on unsupported dvbv3 ioctl calls
#ifndef ENOTSUPP
#define ENOTSUPP 524
#endif

static void drain_dvb_events(int fd);
static bool wait_for_backend(int fd, int timeout_ms);
static struct dvb_frontend_parameters dtvmultiplex_to_dvbparams(
Expand Down Expand Up @@ -1159,7 +1164,7 @@ double DVBChannel::GetSignalStrength(bool *ok) const
if (ret < 0)
{
#if DVB_API_VERSION >=5
if (errno == EOPNOTSUPP)
if (errno == EOPNOTSUPP || errno == ENOTSUPP)
{
return GetSignalStrengthDVBv5(ok);
}
Expand Down Expand Up @@ -1247,7 +1252,7 @@ double DVBChannel::GetSNR(bool *ok) const
if (ret < 0)
{
#if DVB_API_VERSION >=5
if (errno == EOPNOTSUPP)
if (errno == EOPNOTSUPP || errno == ENOTSUPP)
{
return GetSNRDVBv5(ok);
}
Expand Down Expand Up @@ -1318,7 +1323,7 @@ double DVBChannel::GetBitErrorRate(bool *ok) const
if (ret < 0)
{
#if DVB_API_VERSION >=5
if (errno == EOPNOTSUPP)
if (errno == EOPNOTSUPP || errno == ENOTSUPP)
{
return GetBitErrorRateDVBv5(ok);
}
Expand Down Expand Up @@ -1382,7 +1387,7 @@ double DVBChannel::GetUncorrectedBlockCount(bool *ok) const
if (ret < 0)
{
#if DVB_API_VERSION >=5
if (errno == EOPNOTSUPP)
if (errno == EOPNOTSUPP || errno == ENOTSUPP)
{
return GetUncorrectedBlockCountDVBv5(ok);
}
Expand Down Expand Up @@ -1507,6 +1512,8 @@ static bool wait_for_backend(int fd, int timeout_ms)

// This is supposed to work on all cards, post 2.6.12...
fe_status_t status;
memset(&status, 0, sizeof(status));

if (ioctl(fd, FE_READ_STATUS, &status) < 0)
{
LOG(VB_GENERAL, LOG_ERR,
Expand Down

0 comments on commit 9a174ff

Please sign in to comment.