[mythtv-commits] Ticket #13371: HDHomeRun DVB-C device seen as DVB-T
MythTV
noreply at mythtv.org
Tue Jan 8 21:47:54 UTC 2019
#13371: HDHomeRun DVB-C device seen as DVB-T
-------------------------------------+-------------------------------------
Reporter: Klaas de Waal | Owner: (none)
Type: Bug Report - | Status: new
General |
Priority: minor | Milestone: needs_triage
Component: MythTV - Channel | Version: Unspecified
Scanner | Keywords: DVB DVB-C channelscan
Severity: medium | HDHomeRun HDHR3-4DC
Ticket locked: 0 |
-------------------------------------+-------------------------------------
The HDHomeRun HDHR3-4DC DVB-C network tuner is seen by MythTV as a DVB-T
device.\\
This can be verified with a channel scan in mythtv-setup and selecting a
"Full Scan (Tuned)"; it is then possible to fill in all the DVB-T tuning
parameters instead of those for DVB-C.\\
The following code in cardutil.cpp is where it starts:
{{{
bool CardUtil::HDHRdoesDVB(const QString &device)
{
(void) device;
#ifdef USING_HDHOMERUN
hdhomerun_device_t *hdhr;
hdhr = hdhomerun_device_create_from_str(device.toLatin1(), nullptr);
if (!hdhr)
return false;
const char *model = hdhomerun_device_get_model_str(hdhr);
if (model && strstr(model, "dvb"))
{
hdhomerun_device_destroy(hdhr);
return true;
}
hdhomerun_device_destroy(hdhr);
#endif
return false;
}
}}}
What happens here is that the firmware identification string is searched
for the presence of "dvb" in the string. This is the case for the
HDHR3-4DC with firmware "hdhomerun3_dvbc".\\
In scanwizardconfig.cpp, where HDHRDoesDVB() is called, it is then decided
that this is a DVB-T device:
{{{
case CardUtil::HDHOMERUN:
if (CardUtil::HDHRdoesDVB(CardUtil::GetVideoDevice(cardid)))
{
addSelection(tr("Full Scan"),
QString::number(FullScan_DVBT), true);
addSelection(tr("Full Scan (Tuned)"),
QString::number(NITAddScan_DVBT));
}
}}}
Amazingly, the HDHR device does work most of the time because mythtv-setup
generates tuning commands of the form "auto:<frequency", e.g.
"auto:474000000", and this works often but not always.
With experimenting I found that the HDHR has a parameter
/sys/dvbc_modulation which contains the tuning parameters that it tries
when it gets the "auto:<frequency>: command.\\
If parameter /sys/dvbc_modulation does contain the correct modulation
parameters then all works OK but otherwise tuning fails.
The value can be read and written with the hdhomerun_config utility which
can be downloaded from silicondust.com\\
On my system it looks like this:
{{{
[klaas at modu ~]$ hdhomerun_config 1410F45C get /sys/dvbc_modulation
a8qam64-6875 a8qam256-6900
[klaas at modu ~]$
}}}
I have described this in more detail in a comment in ticket #12792.\\
However, it would be much better if MythTV always works without other
support applications and for this it needs to generate explicit tuning
parameters such as "a8qam256-6900".
The code for this is already present in hdhrchannel.cpp:
{{{
static QString format_dvbc(const DTVMultiplex &tuning, const QString &mod)
{
const QChar b = tuning.bandwidth.toChar();
if ((QChar('a') == b) || (mod == "auto"))
return "auto"; // uses bandwidth from channel map
else if ((QChar('a') != b) && (tuning.symbolrate > 0))
return QString("a%1%2-%3")
.arg(b).arg(mod).arg(tuning.symbolrate/1000);
return QString("auto%1c").arg(b);
}
}}}
I have verified with a quick hack that if this routine generates a string
with bandwidth/modulation/symbolrate such as "a8qam256-9600" that tuning
does work correct.\\
A complete solution consists of the following parts:\\
(1) change tuner type to DVB-C for the HDHR DVB-C devices\\
(2) add selection item for channel bandwidth (auto, 8, 7, 6 MHz)\\
(3) store the bandwidth value in the database tables dtv_multiplex and
channelscan_dtv_multiplex\\
There is no database schema change needed; there is already a "bandwidth"
field which is currently always 'a'.\\
The code for this is currently somewhere halfway.
--
Ticket URL: <https://code.mythtv.org/trac/ticket/13371>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list