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

v34 DiSEqC switch configuration not possible with webapp #995

Open
nick-reachcomp opened this issue Dec 12, 2024 · 10 comments
Open

v34 DiSEqC switch configuration not possible with webapp #995

nick-reachcomp opened this issue Dec 12, 2024 · 10 comments
Assignees

Comments

@nick-reachcomp
Copy link

Trying to follow the DiSEqC switch configuration procedure (described in the MythTV wiki Channel_Scanning#DiSEqC_switch_configuration documentation) with MythTV v34, I couldn't achieve this with the Backend webapp and I had to revert to using the deprecated Myth Backend Setup (mythtv-setup).

Ideally in "Capture Cards", when specifying a card as being an n-port DiSEqC switch, each of the ports should be available in the "Input Connections" in order to be associated with a video source. If this requires multiple capture-card entries for the same device (as is currently the case) then it should be possible via the webapp to set these up manually (or they could even be created automatically?).

I managed to complete the DiSEqC switch setup successfully using the deprecated mythtv-setup, but this should not be removed from the distribution until DiSEqC configuration is fully possible via the webapp interface.

More info is provided in the MythTV Official Community Forum where I posted topic #28344:
"v34 DiSEqC switch configuration not possible with webapp"
https://forum.mythtv.org/viewtopic.php?p=28344#p28344

@bennettpeter bennettpeter self-assigned this Dec 14, 2024
@bennettpeter
Copy link
Member

I can fix the code if I understand the issues and there is somebody who can test the changes. I do not have the needed equipment to test this.

Possibly all the is required is a fix to the "Open DVB card on demand" setting.

Please let me know if you are able to test any fixes to the code that I make.

To start, I will need to know the detailed steps you went through until you hit the first problem - what devices you set up, in what order, the parameters you used. I can make code changes or other suggestions as I try to fix the problem.

@nick-reachcomp
Copy link
Author

Thanks @bennettpeter . I do have the equipment and if there is code that needs to be tested I can try to create a test environment so that I can test the changes without upsetting my primary system.

I suspect that it may be more than just a fix to the "Open DVB card on demand" setting, as ticking/unticking this box currently doesn't seem to make any difference to the error (see detailed steps below). Also the old deprecated mythtv-setup provided a facility to specify the "LNB" satellite device connected to each of the ports of the DiSEqC switch (creating the entries in the "diseqc_tree" table in the underlying database - see below), but I couldn't see where this was possible in the new webapp.

As you requested, I'll outline below:

  • the detailed steps I went through using the webapp
  • the parts I had to use the old deprecated mythtv-setup for
  • how the final working configuration appears in the webapp (and in the underlying database)

The configuration steps I took in the MythTV Setup webapp are:

  1. In the "Capture Cards" tab:
    a) Click "New Capture Card", select "DVB-T/S/C,..." and click OK.
    b) Expand the newly created list entry "DVB()"
    c) In "DVB Device" pulldown select the corresponding device, in my case "/dev/dvb/adapter2/frontend0"
    d) The first time this device is added, in the "Satellite Settings" section, click "New Satellite Device", select device type "Switch" and click OK, in the "Switch Type" select "DiSEqC" and specify the Number of ports (in my case 4). (I think the "Open DVB card on demand" option was ticked at this point, but I don't remember for sure).
    e) Repeat steps 1.a) to 1.c) to create another capture card entry with the same device for each of the remaining (3) ports on the DiSEqC switch...
    *** The message "Warning: This device is already in use" appears in red text
    *** The warning does not clear if the "Open DVB card on demand" option is ticked/unticked.
    *** Clicking the "Save" button gives the message "ERROR: Backend Network Failure", and the additional capture card entries cannot be created.

  2. In "Video Sources" tab (this part worked fine):
    a) Click "New Video Source", give it a name (e.g. "Astra2-EIT") and click "Save"
    b) Repeat 2.a) for each of the other satellite sources (in my case "Hotbird-EIT", "Hellas-EIT", "Astra1-EIT").

  3. In the "Input Connections" tab:
    a) Each of the capture cards listed can be expanded to assign a Video Source.
    *** However, the Capture Card for the DiSEqC switch is only listed once, because the additional Capture Card entries (for each DiSEqC switch port) could not be created in step 1. Therefore it's not possible to assign each of the device's DiSEqC ports to its corresponding Video Source.

At this point I had to revert to the deprecated MythTV Backend (mythtv-setup). I deleted the previous Capture Cards and then created new Capture Card instances for this device for each port of the DiSEqC switch. I also created the corresponding Input Connections (as in step 3 above) in the deprecated mythtv-setup, though perhaps(?) this would have been possible via the webapp once the capture card devices had been created.

Back in the webapp I can now see the working configuration:

  • all Capture Cards are listed correctly, including the multiple instances of the same device for the card connected to the 4-port DiSEqC switch, listed as:

    • DVB /dev/dvb/adapter2/frontend0 (Astra2)
    • DVB /dev/dvb/adapter2/frontend0 (Hotbird)
    • DVB /dev/dvb/adapter2/frontend0 (Hellas)
    • DVB /dev/dvb/adapter2/frontend0 (Astra1)
      The "Frontend ID" for each capture card instance shows "Could not get card info for card /dev/dvb/adapter2/frontend0" ("... appears the card can be in use by another program").
      Each card instance has "Open DVB card on demand" ticked.
      For each of the Capture Card instances, expanding "Satellite Settings" shows the DiSEqC Switch configuration with 4 ports. Each port has its own "Satellite Settings" item that can be expanded to show Satellite Receiver (LNB) details (including a "Description" field that appears in brackets in the list above).
  • all Video Sources are listed correctly

  • all Input Connections are listed correctly, including the multiple capture card instances associated with the corresponding Video Source:

    • DVB /dev/dvb/adapter2/frontend0 (Astra2) => Astra2-EIT
    • DVB /dev/dvb/adapter2/frontend0 (Hotbird) => Hotbird-EIT
    • DVB /dev/dvb/adapter2/frontend0 (Hellas) => Hellas-EIT
    • DVB /dev/dvb/adapter2/frontend0 (Astra1) => Astra1-EIT
      However, the "Satellite Switch Port" value for each input connection is -1,0,1,2 respectively (rather than 0,1,2,3 that is the "ordinal" value in the database "diseqc_tree" table as shown below).

Finally, the corresponding entries in the underlying database tables are:

mysql> select cardid,parentid,videodevice,cardtype,diseqcid,sourceid from capturecard;
+--------+----------+-----------------------------+----------+----------+----------+
| cardid | parentid | videodevice                 | cardtype | diseqcid | sourceid |
+--------+----------+-----------------------------+----------+----------+----------+
|      3 |        0 | /dev/dvb/adapter2/frontend0 | DVB      |        1 |        2 |
|      7 |        0 | /dev/dvb/adapter2/frontend0 | DVB      |        1 |        3 |
|      8 |        0 | /dev/dvb/adapter2/frontend0 | DVB      |        1 |        4 |
|      9 |        0 | /dev/dvb/adapter2/frontend0 | DVB      |        1 |        5 |
+--------+----------+-----------------------------+----------+----------+----------+
mysql> select diseqcid,parentid,ordinal,type,subtype,description,switch_ports from diseqc_tree order by diseqcid;
+----------+----------+---------+--------+--------------+-------------+--------------+
| diseqcid | parentid | ordinal | type   | subtype      | description | switch_ports |
+----------+----------+---------+--------+--------------+-------------+--------------+
|        1 |     NULL |       0 | switch | diseqc       | Switch      |            4 |
|        5 |        1 |       0 | lnb    | voltage_tone | Astra1      |            0 |
|        6 |        1 |       1 | lnb    | voltage_tone | Hotbird     |            0 |
|        7 |        1 |       2 | lnb    | voltage_tone | Hellas      |            0 |
|        8 |        1 |       3 | lnb    | voltage_tone | Astra1      |            0 |
+----------+----------+---------+--------+--------------+-------------+--------------+
mysql> select sourceid,name from videosource;
+----------+--------------+
| sourceid | name         |
+----------+--------------+
|        2 | Astra2-EIT   |
|        3 | Hotbird-EIT  |
|        4 | Hellas-EIT   |
|        5 | Astra1-EIT   |
+----------+--------------+

@bennettpeter
Copy link
Member

bennettpeter commented Dec 16, 2024

  • e) Repeat steps 1.a) to 1.c) to create another capture card entry with the same device for each of the remaining (3) ports on the DiSEqC switch...
    *** The message "Warning: This device is already in use" appears in red text
    *** The warning does not clear if the "Open DVB card on demand" option is ticked/unticked.
    *** Clicking the "Save" button gives the message "ERROR: Backend Network Failure", and the additional capture card entries cannot be created.

I have a DVB card although I do not have a satellite system. Using latest master on a development system I went through your steps. I do see the message "Warning: This device is already in use". "Open DVB card on demand" is checked by default. When saving I get "Saved Successfully". I do not get "ERROR: Backend Network Failure" and I successfully created 4 capture cards with the same device (In my case /dev/dvb/adapter0/frontend0).

The "ERROR: Backend Network Failure" message is a catch-all for any problem saving the entry on the backend. If you can look at the backend log and see if there was an error message when you got the "ERROR: Backend Network Failure", that may tell us where it is going wrong.

Possibly this is a bug that has been fixed but the fix has not been included in your MythTV version. Please tell me the exact mythtv version you are using (mythutil --version will show it).

@nick-reachcomp
Copy link
Author

nick-reachcomp commented Dec 17, 2024

The system is a fresh (<2 weeks) install of Xubuntu 24.04.1 LTS with all updates applied.
Here's the output from mythutil --version:

MythTV Version : v34.0+fixes.20240210.e3e165a1-0ubuntu6
MythTV Branch : fixes/34
Network Protocol : 91
Library API : 34.20220913-1
QT Version : 5.15.12
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_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_system_libudfread 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

In /var/log/mythtv/mythbackend.log there are lots of entries like this:

2024-12-07T16:40:41.770219+00:00 muses mythbackend: mythbackend[1673]: E HTTP6 cardutil.cpp:928 (**ProbeCurrentDeliverySystem**) **CardUtil: open failed** (/dev/dvb/adapter2/frontend0)#012#011#011#011eno: Device or resource busy (16)

2024-12-07T16:44:11.757002+00:00 muses mythbackend: mythbackend[1673]: E HTTP5 cardutil.cpp:1249 (**OpenVideoDevice**) CardUtil: **Can't open DVB frontend** (/dev/dvb/adapter2/frontend0) for /dev/dvb/adapter2/frontend0.#012#011#011#011eno: Device or resource busy (16)

However, I can't directly relate these to my actions on the webapp. When I next have access to the machine I'll clear out the Capture Card and Input Connection entries and monitor the logs while I try the configuration again, and post the findings.

Just as background, I also have another DVB card (DVB-T2) that's a dual-tuner and appears as /dev/dvb/adapter0 and /dev/dvb/adapter1 and that's straightforward. It's just the DVB-S2 card /dev/dvb/adapter2 that gave the issue in the webapp, and I suspect it'd be ok if the card was connected directly to one satellite LNB, but the problem occurs specifically because it needs to be configured as a multi-port DiSEqC switch - that's the part I had to revert to the deprecated MythTV Backend setup for.

@bennettpeter
Copy link
Member

During Capture Card setup when you select a device from the drop down list, it opens the card to find some information from it, and then displays the "Frontend ID", in my case it shows "Samsung S5H1411 QAM/8VSB Frontend" in the "Frontend ID" on the page. While looking up the information the backend log displays something like this:

CardUtil(/dev/dvb/adapter0/frontend0): Delivery systems: ATSC DVB-C/B
CardUtil: Current delivery system: ATSC

If setup could not open the card in your case it would show nothing in the "Frontend ID" and an error message in the log. Does it display the "Frontend Id" for you?

However you said you had an error when saving the card. I do not think it needs to open the card at that point, so I suspect something else is wrong during the save process.

@bennettpeter
Copy link
Member

If @nick-reachcomp cannot test this, please can somebody who has appropriate equipment test this for me and let me know the backend error message.

@nick-reachcomp
Copy link
Author

Apologies for the delay, I've been dealing with a separate display issue on that machine (I had to remove the DVB-S card in order to make physical space for an NVidia graphics card to resolve display issues with the AMD/ATI Radeon onboard graphics when connected to a TV).

In any case, today I managed to temporarily re-install the DVB-S card for the purposes of testing for this issue. After deleting the previous /dev/dvb/adapter2/frontend0 Capture Cards (and their corresponding Input Connections) I was able to create multiple Capture Card entries for the /dev/dvb/adapter2/frontend0 device via the MythTV Setup webapp. Further to your previous message, the "Frontend ID" was displayed correctly as "TurboSight TBS 6981 DVB-S/S2", and more generally all "Save" operations completed successfully throughout.

However, in order to create the corresponding "Input Connection" entries for each of the DiSEqC Switch ports, and in particular to be able to specify a port number for each input connection, I had to repeat the Satellite Switch & LNB configuration in each of the four corresponding Capture Card entries. Consequently, the SQL queries that I posted previously now return results (see below) that are not consistent with the "clean" table contents that I previously reported after setting things up with the deprecated Myth Backend Setup (mythtv-setup).

mysql> select cardid,parentid,videodevice,cardtype,diseqcid,sourceid from capturecard order by cardid+0;
+--------+----------+-----------------------------+----------+----------+----------+
| cardid | parentid | videodevice                 | cardtype | diseqcid | sourceid |
+--------+----------+-----------------------------+----------+----------+----------+
|      1 |        0 | /dev/dvb/adapter0/frontend0 | DVB      |        0 |        1 |
|      2 |        0 | /dev/dvb/adapter1/frontend0 | DVB      |        0 |        1 |
|     11 |        2 | /dev/dvb/adapter1/frontend0 | DVB      |        0 |        1 |
|     12 |        1 | /dev/dvb/adapter0/frontend0 | DVB      |        0 |        1 |
|     13 |        0 | /dev/dvb/adapter2/frontend0 | DVB      |        9 |        2 |
|     14 |        0 | /dev/dvb/adapter2/frontend0 | DVB      |       14 |        3 |
|     15 |        0 | /dev/dvb/adapter2/frontend0 | DVB      |       19 |        4 |
|     17 |        0 | /dev/dvb/adapter2/frontend0 | DVB      |       25 |        5 |
+--------+----------+-----------------------------+----------+----------+----------+
8 rows in set (0.00 sec)
mysql> select diseqcid,parentid,ordinal,type,subtype,description,switch_ports from diseqc_tree order by diseqcid;
+----------+----------+---------+--------+--------------+-------------+--------------+
| diseqcid | parentid | ordinal | type   | subtype      | description | switch_ports |
+----------+----------+---------+--------+--------------+-------------+--------------+
|        9 |     NULL |       0 | switch | diseqc       | Switch      |            4 |
|       10 |        9 |       0 | lnb    | voltage_tone | LNB         |            0 |
|       11 |        9 |       0 | lnb    | voltage_tone | LNB         |            0 |
|       12 |        9 |       0 | lnb    | voltage_tone | LNB         |            0 |
|       13 |        9 |       0 | lnb    | voltage_tone | LNB         |            0 |
|       14 |     NULL |       0 | switch | diseqc       | Switch      |            4 |
|       15 |       14 |       0 | lnb    | voltage_tone | LNB         |            0 |
|       16 |       14 |       0 | lnb    | voltage_tone | LNB         |            0 |
|       17 |       14 |       0 | lnb    | voltage_tone | LNB         |            0 |
|       18 |       14 |       0 | lnb    | voltage_tone | LNB         |            0 |
|       19 |     NULL |       0 | switch | diseqc       | Switch      |            4 |
|       20 |       19 |       0 | lnb    | voltage_tone | LNB         |            0 |
|       21 |       19 |       0 | lnb    | voltage_tone | LNB         |            0 |
|       22 |       19 |       0 | lnb    | voltage_tone | LNB         |            0 |
|       23 |       19 |       0 | lnb    | voltage_tone | LNB         |            0 |
|       25 |     NULL |       0 | switch | diseqc       | Switch      |            4 |
|       26 |       25 |       0 | lnb    | voltage_tone | LNB         |            0 |
|       27 |       25 |       0 | lnb    | voltage_tone | LNB         |            0 |
|       28 |       25 |       0 | lnb    | voltage_tone | LNB         |            0 |
|       29 |       25 |       0 | lnb    | voltage_tone | LNB         |            0 |
+----------+----------+---------+--------+--------------+-------------+--------------+
20 rows in set (0.00 sec)

Note in the second query that the "ordinal" field doesn't contain the correct port numbers, and the "description" field doesn't contain the correct names ("Astra1", "Hotbird", "Hellas" and "Astra2") as it did when I previously used the deprecated Myth Backend Setup (mythtv-setup). Also, back in the web app when I go into the "Input Connections" section the port numbers that I had assigned as 1, 2, 3 and 4 respectively now show as -1, 0, 1 and 2 respectively.

During the time period that I was setting things up, there were no error or warning messages in the /var/log/mythtv/mythbackend.log but only repeated messages along the lines of:

mythbackend[1706]: I HTTP6 cardutil.cpp:671 (ProbeDeliverySystems) CardUtil(/dev/dvb/adapter2/frontend0): Delivery systems: DVB-S DVB-S2
mythbackend[1706]: I HTTP6 cardutil.cpp:1047 (ProbeBestDeliverySystem) CardUtil: Current delivery system: DVB-S
mythbackend[1706]: I HTTP6 cardutil.cpp:1075 (ProbeBestDeliverySystem) CardUtil: Changing delivery system from DVB-S to DVB-S2

In summary, the setup process in the webapp "appeared" to go through more cleanly but still resulted in strange and incorrect-looking configuration in the database, particularly the diseqc_tree table. If there is some "trick" that I'm missing during the setup procedure it's certainly not obvious to me what I should be doing.

@bennettpeter
Copy link
Member

I do not have any experience with satellite devices so please correct me where I am wrong. I would think that the way to set it up is as follows:

if you have added several DVB cards, in Input Connections, add the switch at the bottom of the first DVB device. Give it a suitable name so you can identify it later. Add your LNBs. Then at the bottom of the second DVB card in Input Connections, instead of clicking "New satellite device", click "Connect to existing satellite device" and select the one you already created in the first case. You should see the whole structure of switch and LNBs under the second card. Repeat for the third and fourth card. This way you avoid creating 4 switches and 12 LNBs when you only need 1 switch and 4 LNBs.

I don't know why you have to add 4 capture cards when you actually only have one?

@nick-reachcomp
Copy link
Author

Ideally I'd think there should be one Capture Card instance with one Switch and, in my case, 4 LNBs... then one Input Connection for each LNB (i.e. each leaf node of the diseqc tree). This doesn't happen though and historically, according to the official documentation for the deprecated MythTV Backend Setup, the solution was to have to create multiple capture card instances. If the reason for this was the structure of the underlying database (perhaps?) then presumably something similar has to be done with the webapp, but it's not clear to me how and I can't find any clear official documentation on this. I'm not familiar with that "Connect to existing satellite device" option but it sounds like that could be a key part of the solution. For sure if I'm able to re-instate the DVB-S card on my machine at some point I'll test that and report the results. Thanks for your time and effort on this issue.

@bennettpeter
Copy link
Member

I suspect that the old work-around way of doing things may no longer be necessary with the web app.

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