SchedulesDirect / mfdb-json

mythfilldatabase grabber for the Schedules Direct JSON service
14 stars 3 forks source link

Issues with SiliconDust HDHomeRun Prime and sd-utility.php #4

Closed SubHermit closed 10 years ago

SubHermit commented 10 years ago

I had troubles getting my Myth backend (0.27+fixes) to successfully tune and pull program data from an HDHomeRun Prime with (ugh) CableCard (on Verizon FiOS). After significant head-bashing and learning enough about SQL to dump the channel records in the SQL table 'channel' I saw that Myth needs the atsc_major_chan field set to the virtual channel number or the signal monitor setup in Myth will fail and no MPEG data would be pulled from the Prime.

I also found that two other fields in the channel records were being set up differently using json - mplexid and serviceid. Both were left at the default NULL using sd-utility.php instead of 32767 and 0 that they were set to using the old lineup grabber. I don't really know if these two fields really make a difference, but I changed them anyway.

Patches have been given to the good Powers that Be, and should show up in a pull request.

kd7lxl commented 10 years ago

I'll add a "me too". As per an email conversation with @rkulagowski on July 16, I had to run the following query to get my HDHomeRun Prime to tune (after running sd-utility.php):

UPDATE `mythconverg`.`channel`
SET `atsc_major_chan` = `freqid`,
    `mplexid` = '32767',
    `serviceid` = '0'

I didn't get as far as submitting a patch, however. Thanks.

rkulagowski commented 10 years ago

Line 575 of sd-utility.php has this code now:

if ($transport == "Cable")
                {
                    $channum = $mapArray["channel"];
                    $stmt = $dbh->prepare(
                        "INSERT INTO channel(chanid,channum,freqid,sourceid,xmltvid,mplexid,serviceid,atsc_major_chan)
                         VALUES(:chanid,:channum,:freqid,:sourceid,:xmltvid,:mplexid,:serviceid,:atsc_major_chan)");

                    try
                    {
                        $stmt->execute(array("chanid"          => (int)($sourceID * 1000) + (int)$channum,
                                             "channum"         => ltrim($channum, "0"),
                                             "freqid"          => $channum,
                                             "sourceid"        => $sourceID, "xmltvid" => $stationID,
                                             "mplexid"         => 32767,
                                             "serviceid"       => 0,
                                             "atsc_major_chan" => $channum));
                    } catch (PDOException $e)

So I believe that the database should be configured correctly now. Is everyone still having this issue with the latest git pull on 20140530?

rkulagowski commented 10 years ago

This has been confirmed as fixed with another user. Please make sure that you're running API:20140530, v0.15

./sd-utility.php --help

If you are on API20131021, please switch to the API20140530 branch:

git pull git checkout API-20140530

If you have not already been on API20140530, then you will need to re-add your lineups to the server (it is a different database).

If you are on 0.15 and are still having issues with the HDHR Prime then open a new ticket.