Opened 3 years ago

Last modified 8 weeks ago

#13121 assigned Patch - Feature

Sat>IP client support

Reported by: cg@… Owned by: Klaas de Waal
Priority: minor Milestone: 32.0
Component: MythTV - Recording Version: Master Head
Severity: low Keywords:
Cc: Ticket locked: no

Description

The changes in the branch at https://github.com/cguedel/mythtv/tree/devel/satip add Sat>IP support to the backend. This allows the backend to use Sat>IP compliant networked tuners to record DVB-C/DVB-S/DVB-T programs.

This works relatively stable for me, however I can only test DVB-C on one network. Also, the channel scanner seems to be broken for this network, so I can't really test that.

EIT scanning is also working.

Support for DVB-S is certainly lacking, as the Diseqc configuration is missing altogether.

Also, this only implements the "Unicast Only Profile" as per the Sat>IP spec found at http://www.satip.info/sites/satip/files/resource/satip_specification_version_1_2_2.pdf. Multicast is not supported.

Attachments (7)

gdb.txt (52.4 KB) - added by Mike Bibbings 3 months ago.
gdb.txt backtrace seg fault
mythbackend.20200719123309.24920.log (254.8 KB) - added by Mike Bibbings 3 months ago.
mythbackend log
20200726_satip_teardown.patch (572 bytes) - added by Mike Bibbings 3 months ago.
Teardown patch
gdb.2.txt (43.5 KB) - added by Mike Bibbings 3 months ago.
backtrace chanscan seg fault
mythtv-setup.20200730131428.19054.log.zip (76.2 KB) - added by Mike Bibbings 3 months ago.
mythtv-setup log chanscan seg fault
mythtv-setup.20200809123425.79080.log.zip (973.2 KB) - added by Mike Bibbings 3 months ago.
mythtv-setup log tbs6280
gdb-tbs6280.txt (71.1 KB) - added by Mike Bibbings 3 months ago.
gdb backtrace tbs6280

Download all attachments as: .zip

Change History (44)

comment:1 Changed 3 years ago by Peter Bennett

Component: MythTV - GeneralMythTV - Recording
Owner: set to JYA
Type: Bug Report - GeneralPatch - Feature

comment:2 Changed 5 months ago by Klaas de Waal

Owner: changed from JYA to Klaas de Waal
Status: newassigned

comment:3 Changed 4 months ago by Klaas de Waal

Milestone: needs_triage32.0
Severity: mediumlow

Thanks for supplying the patch; it is now in v32/master.

The patch has been updated for today's master and there have been some issues fixed.

Testing has been done with minisatip connnected to a DVB-S2 card in the same machine as the mythbackend and with a Telestar Digibit R1 box.

Satellite LNB selection via DiSeqC is defined in the Sat>IP protocol but is not yet implemented.

It is possible to use the same Video Source for a /dev/dvb tuner and for a Sat>IP tuner when they are connected to the same source.

The Sat>IP support is still a new and relatively untested feature; if anybody finds problems when testing this please add comments to this ticket.

comment:4 Changed 3 months ago by Mike Bibbings

build from source on Xubuntu 18.04 fails:

make[2]: Entering directory '/srv/mike/build/mythtv/mythtv/libs/libmythtv'
ccache g++ -c -pipe -D_FILE_OFFSET_BITS=64 -DPIC -std=c++17 -faligned-new -DNDEBUG -fomit-frame-pointer -fPIC -DQT_DISABLE_DEPRECATED_BEFORE=0x050700 -msse -pthread -g -Wall -Wextra -Wpointer-arith -fvisibility-inlines-hidden -Wdouble-promotion -Wduplicated-cond -Wlogical-op -Wmissing-declarations -Wnull-dereference -Woverloaded-virtual -Wshadow -funit-at-a-time -Wzero-as-null-pointer-constant -Wsuggest-override -I/usr/include/freetype2 -I/usr/include/libpng16 -isystem ../../external/libmythdvdnav/dvdnav -isystem ../../external/libmythdvdnav/dvdread -fvisibility=hidden -D_REENTRANT -fPIC -DMMX -Dusing_libcec -D_GNU_SOURCE -DUSING_LIBCRYPTO -DUSING_LIBASS -DUSING_V4L2PRIME -DUSING_VDPAU -DUSING_VAAPI -DUSING_NVDEC -DFFTW3_SUPPORT -DUSING_X11 -DUSING_OPENGL -DUSING_EGL -DUSING_AIRPLAY -DUSING_MHEG -DUSING_FRONTEND -DUSING_ALSA -DUSING_OSS -DUSING_V4L2 -DUSING_LINUX_FIREWIRE -DUSING_FIREWIRE -DUSING_IPTV -DUSING_HDHOMERUN -DHDHOMERUN_HEADERFILE=\"libhdhomerun/hdhomerun.h\" -DHDHOMERUN_V2 -DUSING_SATIP -DUSING_VBOX -DUSING_CETON -DUSING_IVTV -DUSING_HDPVR -DUSING_DVB -DUSING_BACKEND -DMTV_API -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_XML_LIB -DQT_SQL_LIB -DQT_CORE_LIB -I. -isystem /usr/include/libxml2 -isystem /usr/include/X11 -I.. -I../.. -I../.. -I../../external/FFmpeg -I. -I../libmyth -I../libmyth/audio -I../libmythbase -Impeg -Ichannelscan -Ivisualisations -Imheg -Idecoders -Iopengl -Iio -Icaptions -Irecorders -Irecorders/dvbdev -Irecorders/rtp -Irecorders/vbitext -Irecorders/HLS -I../libmythlivemedia/BasicUsageEnvironment/include -I../libmythlivemedia/BasicUsageEnvironment -I../libmythlivemedia/groupsock/include -I../libmythlivemedia/groupsock -I../libmythlivemedia/liveMedia/include -I../libmythlivemedia/liveMedia -I../libmythlivemedia/UsageEnvironment/include -I../libmythlivemedia/UsageEnvironment -I../libmythbase -I../libmythui -I../libmythupnp -I../libmythservicecontracts -I../../external/libmythdvdnav/dvdnav -I../../external/libmythdvdnav/dvdread -I../../external/nv-codec-headers/include -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtXml -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -Imoc -isystem /usr/include/libdrm -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o obj/satipstreamhandler.o recorders/satipstreamhandler.cpp
recorders/satipstreamhandler.cpp: In member function ‘virtual void SatIPStreamHandler::run()’:
recorders/satipstreamhandler.cpp:184:14: error: ‘std::this_thread’ has not been declared
         std::this_thread::sleep_for(std::chrono::milliseconds(40));
              ^~~~~~~~~~~
Makefile:18961: recipe for target 'obj/satipstreamhandler.o' failed
make[2]: *** [obj/satipstreamhandler.o] Error 1
make[2]: Leaving directory '/srv/mike/build/mythtv/mythtv/libs/libmythtv'
Makefile:265: recipe for target 'sub-libmythtv-make_first' failed
make[1]: *** [sub-libmythtv-make_first] Error 2
make[1]: Leaving directory '/srv/mike/build/mythtv/mythtv/libs'
Makefile:66: recipe for target 'libs' failed
make: *** [libs] Error 2

buildbot for master ubuntu 18.04 is also showing failure https://code.mythtv.org/buildbot/#/builders/22/builds/713

build from source on Xubuntu 20.04 is ok.

Mike

comment:5 Changed 3 months ago by Klaas de Waal <kdewaal@…>

In c56ac71e6a/mythtv:

Fix compiler warning

Fixed compiler warning about use of NULL instead of nullptr.

Refs #13121

comment:6 Changed 3 months ago by Klaas de Waal

There is an issue with Multirec and EIT on the SatIP tuner. This can be avoided by disabling Multirec. To do that set the "Max Recordings" to 1 and uncheck the "Schedule as Group" in the Input Connections dialog of mythtv-setup.

comment:7 Changed 3 months ago by Mike Bibbings

Klaas,

In mythtv-setup Capture Card for Sat>IP I think an "Enable/Disable? EIT" checkbox is required. I ran a quick test with 4 x DVB/S2 tuners setup in minisatip and EIT processing was continuously running on all 4 tuners.

Whilst on the subject of eit, does "SATIP" need to be added in https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/tv_rec.cpp

void TVRec::CloseChannel(void)
{
    if (m_channel &&
        ((m_genOpt.m_inputType == "DVB" && m_dvbOpt.m_dvbOnDemand) ||
         m_genOpt.m_inputType == "FREEBOX" ||
         m_genOpt.m_inputType == "VBOX" ||
         m_genOpt.m_inputType == "HDHOMERUN" ||
         CardUtil::IsV4L(m_genOpt.m_inputType)))
    {
        m_channel->Close();
    }
}

Mike

comment:8 Changed 3 months ago by Mike Bibbings

Klaas,

Just tried DVB-T/T2 UK Freeview and it basically worked, although the "SETUP" messages are out of specification (minisatip does not seem to care), a couple of examples:

Jul 16 13:34:13 2004-satip mythbackend: mythbackend[6844]: D CoreContext recorders/satiprtsp.cpp:233 (sendMessage) SatIPRTSP[2]: sendMessage write: SETUP rtsp://192.168.0.221:554/?freq=498.00&bw=8&msys=dvbt&tmode=auto&mtype=unknownqam&gi=132&fec=auto RTSP/1.0

Jul 16 13:38:08 2004-satip mythbackend: mythbackend[6844]: D TVRecEvent recorders/satiprtsp.cpp:233 (sendMessage) SatIPRTSP[2]: sendMessage write: SETUP rtsp://192.168.0.221:554/?freq=474.00&bw=8&msys=dvbt2&tmode=auto&mtype=unknownqam&gi=132&fec=auto RTSP/1.0

Here are contents of dtv_multiplex table after channel scan:

------+---------+---------------+-----------+--------------+---------+---------+------------+----------------+---------------------+-------------------+
| mplexid | sourceid | transportid | networkid | frequency | inversion | symbolrate | fec  | polarity | modulation | bandwidth | lp_code_rate | transmission_mode | guard_interval | visible | constellation | hierarchy | hp_code_rate | mod_sys | rolloff | sistandard | serviceversion | updatetimestamp     | default_authority |
+---------+----------+-------------+-----------+-----------+-----------+------------+------+----------+------------+-----------+--------------+-------------------+----------------+---------+---------------+-----------+--------------+---------+---------+------------+----------------+---------------------+-------------------+
|       1 |        1 |       16515 |      9018 | 474000000 | 0         |          0 | auto | v        | auto       | 8         | auto         | a                 | 1/32           |       0 | auto          | n         | auto         | DVB-T2  | 0.35    | dvb        |             33 | 2020-07-16 12:40:44 |                   |
|       2 |        1 |        8194 |      9018 | 498000000 | 0         |          0 | auto | v        | auto       | 8         | auto         | a                 | 1/32           |       0 | auto          | n         | auto         | DVB-T   | 0.35    | dvb        |             33 | 2020-07-16 12:40:44 |                   |
|       3 |        1 |        4173 |      9018 | 522000000 | 0         |          0 | auto | v        | auto       | 8         | auto         | a                 | 1/32           |       0 | auto          | n         | auto         | DVB-T   | 0.35    | dvb        |             33 | 2020-07-16 12:40:44 |                   |
|       4 |        1 |       12294 |      9018 | 570000000 | 0         |          0 | auto | v        | auto       | 8         | auto         | a                 | 1/32           |       0 | auto          | n         | auto         | DVB-T   | 0.35    | dvb        |             33 | 2020-07-16 12:40:44 |                   |
|       5 |        1 |       20544 |      9018 | 594000000 | 0         |          0 | auto | v        | auto       | 8         | auto         | a                 | 1/32           |       0 | auto          | n         | auto         | DVB-T   | 0.35    | dvb        |             33 | 2020-07-16 12:40:44 |                   |
|       6 |        1 |       24640 |      9018 | 690000000 | 0         |          0 | auto | v        | auto       | 8         | auto         | a                 | 1/32           |       0 | auto          | n         | auto         | DVB-T   | 0.35    | dvb        |             33 | 2020-07-16 12:40:44 |                   |
|       7 |        1 |       40960 |      9018 | 746000000 | 0         |          0 | auto | v        | auto       | 8         | auto         | a                 | 1/32           |       0 | auto          | n         | auto         | DVB-T2  | 0.35    | dvb        |             33 | 2020-07-16 12:40:44 |                   |
+---------+----------+-------------+-----------+-----------+-----------+------------+------+----------+------------+-----------+--------------+-------------------+----------------+---------+---------------+-----------+--------------+---------+---------+------------+----------------+---------------------+-------------------+
7 rows in set (0.00 sec)

Test Configuration:

MythTV Version : v32.0~master.202007151913.b76dbf4~ubuntu20.04.1 combined FE/Backend

UK Freeview from SandyHeath? transmitter

tuner is TBS 6280 Dual DVB-T/T2 PCI-e using TBS drivers with kernel Linux 2004-satip 5.4.0-40-generic #44-Ubuntu SMP Tue Jun 23 00:01:04 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux under Xubuntu 20.04

Minisatip Version: 1.0.3-e8bb03b running on same hardware as mythbackend

Mike

comment:9 Changed 3 months ago by Klaas de Waal <kdewaal@…>

In 8cf47d3c2c/mythtv:

Sat>IP client support

First version of Sat>IP client support.
Tested with DVB-S/S2 but not with DVB-C and DVB-T/T2.
DVB-S/S2 is tested with minisatip and TELESTAR Digibit box.
LNB selection with DiSEqC is not yet supported, only direct LNB connections.
Channel scanning works although less reliable than with /dev/dvb tuners.
EIT does work and making recordings does work. Live TV can be an issue.

Refs #13121

comment:10 Changed 3 months ago by Klaas de Waal <kdewaal@…>

In 18e7ec722/mythtv:

Add missing C++ include

Added C++ include <thread> for std::this_thread.

Refs #13121

comment:11 Changed 3 months ago by Mike Bibbings

Klaas,

mythconverg database schema update is required to add SatIP Recorder to profilegroups with associated entries in recordingprofiles otherwise mythbackend reports errors like :

Jul 17 11:20:53 2004-satip mythbackend: mythbackend[5769]: E Scheduler tv_rec.cpp:4159 (LoadProfile) TVRec[1]: Profile 'Default' not found, and unable to load fallback profile 'Default'.  Results may be unpredicable
Jul 17 11:20:53 2004-satip mythbackend: mythbackend[5769]: E TVRecEvent tv_rec.cpp:4159 (LoadProfile) TVRec[1]: Profile 'Live TV' not found, and unable to load fallback profile 'Default'.  Results may be unpredicable
Jul 17 11:20:55 2004-satip mythbackend: mythbackend[5769]: E TVRecEvent tv_rec.cpp:4159 (LoadProfile) TVRec[1]: Profile 'Default' not found, and unable to load fallback profile 'Default'.  Results may be unpredicable

Manually adding the following to the database stopped the error messages above.

direct to database INSERT INTO profilegroups SET name = 'SatIP Recorder', cardtype = 'SATIP', is_default = 1;
Note the id created in this case 19
INSERT INTO recordingprofiles SET name = "Default", profilegroup = 19;
INSERT INTO recordingprofiles SET name = "Live TV", profilegroup = 19;
INSERT INTO recordingprofiles SET name = "High Quality", profilegroup = 19;
INSERT INTO recordingprofiles SET name = "Low Quality", profilegroup = 19;

see dbcheck.cpp dbver == "1339" for an example using Vbox

$SCHEMA_VERSION in mythtv/binding/perl/MythTV.pm and mythtv/bindings/python/MythTV/static.py will also need updating to next schema version.

Mike

comment:12 Changed 3 months ago by Klaas de Waal <kdewaal@…>

In 379584c73a/mythtv:

Sat>IP Multirec support

Added Multirec to the Sat>IP client support, along the lines on how it is done for HDHomeRun. Tested with minisatip on Astra-2 satellite.

Refs #13121

comment:13 Changed 3 months ago by Klaas de Waal

Mike,

Thanks for the testing and for the tips. Expect fixes in the near future.

Issues not solved yet:

  • DVB-T2 tuning parameters
  • Recording profiles (was this not something from the PVR150/500 days, setting MPEG encoding parameters?)
  • MPTS full TS recording; described in the Sat>IP protocol but not yet implemented.

As yet untested:

  • DVB-C with minisatip

There are also still some stability issues with the TELESTAR Digibit satellite box.

comment:14 Changed 3 months ago by Mike Bibbings

Hi Klaas,

I am seeing a mythbackend seg fault on exit from LiveTV

Attached are gdb.txt and mythbackend log relating to the backtrace. I suspect it has something to do with the change that added SATIP to void TVRec::CloseChannel?(void) in tv_rec.cpp

Please attach all output as a file in bug reports.
MythTV Version : v32-Pre-699-g0db4df0b2f
MythTV Branch : master
Network Protocol : 91
Library API : 32.20200101-1
QT Version : 5.9.5
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_hdpvr using_ivtv using_joystick_menu using_libcec using_libcrypto using_gnutls using_libdns_sd using_libfftw3 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_libbluray_external using_xrandr using_profiletype 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

Changed 3 months ago by Mike Bibbings

Attachment: gdb.txt added

gdb.txt backtrace seg fault

Changed 3 months ago by Mike Bibbings

mythbackend log

comment:15 Changed 3 months ago by Mike Bibbings

At end of mythbackend.log there are some suspicious messages relating to QT timers and socket operations.

2020-07-19 13:33:57.375449 D [24920/24937] TVRecEvent recorders/streamhandler.cpp:155 (Stop) - SH[1](uuid:11223344-9999-0000-b7ae-c8600014a53d:DVBS2:0): Stopping
2020-07-19 13:33:57.375451 D [24920/24937] TVRecEvent recorders/streamhandler.cpp:158 (Stop) - SH[1](uuid:11223344-9999-0000-b7ae-c8600014a53d:DVBS2:0): Stopped
2020-07-19 13:33:57.375459 I [24920/24937] TVRecEvent mythcommandlineparser.cpp:2643 (operator()) - Qt: QSocketNotifier: Socket notifiers cannot be enabled or disabled from 
another thread
2020-07-19 13:33:57.375472 I [24920/24937] TVRecEvent mythcommandlineparser.cpp:2643 (operator()) - Qt: QObject::~QObject: Timers cannot be stopped from another thread
2020-07-19 13:33:57.375474 I [24920/24937] TVRecEvent mythcommandlineparser.cpp:2643 (operator()) - Qt: QSocketNotifier: Socket notifiers cannot be enabled or disabled from 
another thread
2020-07-19 13:33:57.375516 I [24920/24937] TVRecEvent tv_rec.cpp:3638 (TuningShutdowns) - TVRec[1]: Tearing down RingBuffer
2020-07-19 13:33:57.375602 I [24920/24937] TVRecEvent tv_rec.cpp:4438 (ClearFlags) - TVRec[1]: ClearFlags(PENDINGACTIONS,) -> RunMainLoop,RingBufferReady, @ tv_rec.cpp:3644
2020-07-19 13:33:57.375602 I [24920/24920] CoreContext mythcommandlineparser.cpp:2643 (operator()) - Qt: QSocketNotifier: Invalid socket 24 and type 'Read', disabling...
2020-07-19 13:33:57.375609 I [24920/24920] CoreContext mythcommandlineparser.cpp:2643 (operator()) - Qt: QSocketNotifier: Invalid socket 25 and type 'Read', disabling...
2020-07-19 13:33:57.375626 D [24920/24948] ProcessRequest livetvchain.cpp:34 (~LiveTVChain) - LiveTVChain(live-mike-GL62-7QF-2020-07-19T12:33:48Z): dtor
2020-07-19 13:33:57.375689 I [24920/24920] CoreContext mythcommandlineparser.cpp:2643 (operator()) - Qt: QSocketNotifier: Invalid socket 24 and type 'Read', disabling...
2020-07-19 13:33:57.375692 I [24920/24920] CoreContext mythcommandlineparser.cpp:2643 (operator()) - Qt: QSocketNotifier: Invalid socket 25 and type 'Read', disabling...
2020-07-19 13:33:57.375710 I [24920/24920] CoreContext mythcommandlineparser.cpp:2643 (operator()) - Qt: QSocketNotifier: Invalid socket 24 and type 'Read', disabling...
2020-07-19 13:33:57.375713 I [24920/24920] CoreContext mythcommandlineparser.cpp:2643 (operator()) - Qt: QSocketNotifier: Invalid socket 25 and type 'Read', disabling...
2020-07-19 13:33:57.375718 I [24920/24920] CoreContext mythcommandlineparser.cpp:2643 (operator()) - Qt: QSocketNotifier: Invalid socket 24 and type 'Read', disabling...
2020-07-19 13:33:57.375720 I [24920/24920] CoreContext mythcommandlineparser.cpp:2643 (operator()) - Qt: QSocketNotifier: Invalid socket 25 and type 'Read', disabling...
2020-07-19 13:33:57.375723 I [24920/24920] CoreContext mythcommandlineparser.cpp:2643 (operator()) - Qt: QSocketNotifier: Invalid socket 24 and type 'Read', disabling...
2020-07-19 13:33:57.375724 I [24920/24920] CoreContext mythcommandlineparser.cpp:2643 (operator()) - Qt: QSocketNotifier: Invalid socket 25 and type 'Read', disabling...
2020-07-19 13:33:57.375728 I [24920/24920] CoreContext mythcommandlineparser.cpp:2643 (operator()) - Qt: QSocketNotifier: Invalid socket 24 and type 'Read', disabling...
2020-07-19 13:33:57.375729 I [24920/24920] CoreContext mythcommandlineparser.cpp:2643 (operator()) - Qt: QSocketNotifier: Invalid socket 25 and type 'Read', disabling...
2020-07-19 13:33:57.375733 I [24920/24920] CoreContext mythcommandlineparser.cpp:2643 (operator()) - Qt: QSocketNotifier: Invalid socket 24 and type 'Read', disabling...
:

comment:16 Changed 3 months ago by Klaas de Waal <kdewaal@…>

In 55432fdd4/mythtv:

Sat>IP add EIT checkbox

Add EIT checkbox to enable/disable EIT scanning.
Add tuner type SATIP to TVRec::CloseChannel?.

Refs #13121

comment:17 Changed 3 months ago by Klaas de Waal <kdewaal@…>

In 0448b6f9e/mythtv:

Add profile group for Sat>IP recorder

Add profile group and recording profiles for the Sat>IP recorder.
Increase database version to 1364.

Refs #13121

comment:18 Changed 3 months ago by Klaas de Waal <kdewaal@…>

In 1d56b04ef7/mythtv:

Sat>IP DVB-T2 tuning parameters

Completed the DVB-T2 tuning parameter string representations.
Use "auto" for all parameters that are not known.
This is not specified in the Sat>IP specification but it does
specify that all unknown values are to be ignored in which
case the server can do what it thinks best.

Refs #13121

comment:19 Changed 3 months ago by Mike Bibbings

TEARDOWN is sending extraneous ? character after stream identifier:

2020-07-25 17:08:02.306141 D [27761/27801] Scanner recorders/satiprtsp.cpp:235 (sendMessage) - SatIPRTSP[1]: sendMessage write: TEARDOWN rtsp://192.168.0.202:554/stream=1? RTSP/1.0

Change in satiprtsp.cpp see 20200726_satip_teardown.patch

Changed 3 months ago by Mike Bibbings

Teardown patch

comment:20 Changed 3 months ago by Mike Bibbings <mike.bibbings@…>

In 45ed62ad9c/mythtv:

Remove extraneous ? character in Sat>IP TEARDOWN message

Refs #13121

Signed-off-by: Klaas de Waal <kdewaal@…>

comment:21 Changed 3 months ago by Mike Bibbings

I am seeing on occasion mythtv-setup seg faulting whilst channel scanning on DVB-T/T2 (UK Freeview)

Attached are gdb backtrace and mythtv-setup log.

In this case minisatip is running remote to mythtvbackend on a Raspberry Pi3 with TVHAT tuner which has the following capabilities:

pi@pi3-20200724:~/build/w_scan2 $ dvb-fe-tool
Device Sony CXD2880 (/dev/dvb/adapter0/frontend0) capabilities:
     CAN_2G_MODULATION
     CAN_FEC_1_2
     CAN_FEC_2_3
     CAN_FEC_3_4
     CAN_FEC_4_5
     CAN_FEC_5_6
     CAN_FEC_7_8
     CAN_FEC_AUTO
     CAN_GUARD_INTERVAL_AUTO
     CAN_INVERSION_AUTO
     CAN_MUTE_TS
     CAN_QAM_16
     CAN_QAM_32
     CAN_QAM_64
     CAN_QAM_128
     CAN_QAM_256
     CAN_QAM_AUTO
     CAN_QPSK
     CAN_RECOVER
     CAN_TRANSMISSION_MODE_AUTO
DVB API Version 5.11, Current v5 delivery system: DVBT2
Supported delivery systems:
     DVBT
    [DVBT2]
Frequency range for the current standard:
From:             174 MHz
To:               862 MHz
Step:            1.00 kHz

Changed 3 months ago by Mike Bibbings

Attachment: gdb.2.txt added

backtrace chanscan seg fault

Changed 3 months ago by Mike Bibbings

mythtv-setup log chanscan seg fault

comment:22 Changed 3 months ago by Klaas de Waal <kdewaal@…>

In b2672ec3a/mythtv:

Sat>IP client KeepAlive? timer

Improve the RTSP KeepAlive? timer handling, inspired by how it is done in the Ceton RTSP handler.

Refs #13121

comment:23 Changed 3 months ago by Klaas de Waal

Hi Mike,

The above patch does solve a stability issue that came up when stress testing with a local DVB-S minisatip and a real networked Sat>IP box, also DVB-S.

However, your DVB-T2 scanning crash does look different. The plan is to reproduce this by attaching a MyGica? USB stick to a RPi3 and run minisatip on that. I do not expect that the hat does make any difference.

N.B. If there is any special incantation for the minisatip that you use please post that also.

comment:24 Changed 3 months ago by Mike Bibbings

Hi Klaas,

Nothing special for minisatip on Pi3, invoked at default by sudo ./minisatip

built from master source https://github.com/catalinii/minisatip

minisatip configuration


Linux DVB:				  enabled
Common Interface (needs DVBEN50221):	  disabled
OpenSSL (AES as part of DVBAPI):	  enabled
Embedded system:			  disabled
DVBCSA (needs libdvbcsa):		  disabled
Netceiver support:			  disabled
SatIP Client:				  enabled
Static:					  disabled
dvbapi:					  enabled
axe:					  disabled
enigma:					  disabled

I use the same default minisatip build and configuration everywhere including Xubuntu 18.04 and Xubuntu 20.04

Mike

comment:25 Changed 3 months ago by Klaas de Waal

The segfault when scanning for DVB-T2 channels can be now reproduced, with the MyGica? USB stick and minisatip in my development box. To be continued.

comment:26 Changed 3 months ago by Klaas de Waal <kdewaal@…>

In 2daf1a046a/mythtv:

Sat>IP client -- Discard old RTP packets

After tuning to a new channel discard all RTP packets received before the new channel is
tuned and the PLAY command is given with at least one pid.
Do not process any RTP packet after a TEARDOWN command is given.

Refs #13121

comment:27 Changed 3 months ago by Mike Bibbings

Hi Klaas,

I am still seeing mythtv-setup seq fault whilst channel scanning on UK Freeview (DVB/T-T2) with latest master e015e7a. In this case it is a TBS6280 tuner with minisatip on same machine.

Attached are mythtv-setup.log and associated gdb backtrace. Note the seg fault happened after a number of channel scans (full scan).

Mike

Changed 3 months ago by Mike Bibbings

mythtv-setup log tbs6280

Changed 3 months ago by Mike Bibbings

Attachment: gdb-tbs6280.txt added

gdb backtrace tbs6280

comment:28 Changed 3 months ago by Klaas de Waal

Hi Mike,

Thanks for testing, looks like this is the same crash as before. So the discarding of old packets does not solve it, only makes the problem less frequent. Looks like a concurrency/locking issue as valgrind does not show anything.

Other bugs that are still present:

  • When configured with a single tuner instance and Schedule as Group disabled, then the backend crashes on EIT when the single tuner instance is closed. This is accompanied with Qt error messages about doing things in the wrong thread. Removing SATIP from the close in tv_rec.cpp, or having at least two tuner instances, does fix this for now.
  • Channelscan timeouts while actually finding all the channels.

Have been testing with minisatip and DVB-C and that works OK.

To be continued.

comment:29 Changed 2 months ago by peper03

Hi Klaas,

I had a bit of time to play around with this and immediately hit the two bugs you mentioned.

I've not managed to find a solution to them but thought I'd add what I've found so far:

The crash appears to be because SatIPChannel::Open is called in ChannelBase::CreateChannel? via TVRec::CreateChannel? at start-up in the main thread, but SatIPChannel::Close is called from the TVRec thread when the recording. This is what is causing the error messages about the wrong threads and appears to be what is leading to the SIGSEGV.

ChannelBase::CreateChannel? almost immediately closes the channel if it's DVB, HDHOMERUN or a V4L card, but not if it's SatIP. Adding SatIP here stops the recording even starting and I haven't had time to investigate why.

Regarding the channel scan, I'm not sure if it's the same issue you are seeing but I had to tell it to use only DVB-S instead of DVB-S2 before the scan would work. The DVB-S2 channels were still found and a brief look in Wireshark seemed to indicate that MPEG-TS packets were being received when DVB-S2 was selected but nothing appeared in mythtv-setup and it timed out on the first transponder.

comment:30 Changed 2 months ago by Klaas de Waal

Hi Richard,

Thanks for looking into this. You are completely right about the bits in ChannelBase?, I had overlooked this. Getting the recording to start again after the channel has been closed in ChannelBase? is being fixed.

What is still going wrong in the channel scan is timeouts. They are almost all caused by, after doing the tuning, receiving a PAT from the previously tuned frequency. Tuning is complete when all PMTs of all channels have been received and this then never happens. How to filter out the packets from the previous frequency is still an issue. One possibility is to check more on transport ID if that is known, but this is a biggish change to the common code and not limited to SatIP.

About DVB-S/S2, in the "Full Scan (Tuned)" you have to specify the delivery system and the other tuning parameters of the initial frequency you want to start with.

comment:31 Changed 2 months ago by Klaas de Waal <kdewaal@…>

In 00a94e00c1/mythtv:

Sat>IP client -- Limit number of pids in PLAY request

Limit the number of pids in a PLAY request to 32.
If the requested number of pids is higher then select all pids.
This selects then the complete transport stream without filtering.
Such a high number of pids only happens with channel scanning
when the PMT pids for all channels in the PAT are selected.
Testing with hardware Sat>IP box, the Telestar Digibit R1, shows
that this box becomes unhappy when the number of pids is too large.
The software minisatip implementation does not have this limit.
Note that the limit for the number of pids in the DVB code
in MythTV is 64. This is not enough for some transports found
on satellite Astra-1 on 19.2E.

Refs #13121

comment:32 Changed 2 months ago by Klaas de Waal <kdewaal@…>

In d6e04a4e8a/mythtv:

Sat>IP client -- Reset tuner lock status

Reset tuner lock status after TEARDOWN and SETUP messages.
This prevents accessing the pid handling code with the list of pids from the previous channel when there is no tuner lock.

Refs #13121

comment:33 Changed 2 months ago by Klaas de Waal <kdewaal@…>

In 027f1291b/mythtv:

Sat>IP client -- Never close channel

Keep the channel always open.
This avoids a Qt issue about opening and closing in different threads that only
happens when "Max Recordings" is set to 1 and the "Schedule as Group" is unchecked.
A more elegant solution would be to insure that opening and closing happens always
in the same thread like it is done in the ceton driver.

Refs #13121

comment:34 Changed 2 months ago by Klaas de Waal <kdewaal@…>

In cf09ffe847/mythtv:

Sat>IP client -- Add recording of MPTS streams

Add the capability to record a full transport stream, similar to how it is done for the HDHomeRun tuners.
Reduce the interval to wait before processing received RTP packets from 200 to 20 milliseconds.
This greatly reduces the number of missed RTP packets and the corresponding "Sequence number" error messages.

Refs #13121

comment:35 Changed 2 months ago by Klaas de Waal <kdewaal@…>

In 728b5a68d/mythtv:

Sat>IP client -- Fix compilation warning

Fix compilation warning introduced with the MPTS patch.

Refs #13121

comment:36 Changed 2 months ago by Klaas de Waal <kdewaal@…>

In d9589fd1de/mythtv:

Sat>IP client -- Remove unused variables

Removed two unused variables and other cosmetic cleanup.

Refs #13121

comment:37 Changed 8 weeks ago by Klaas de Waal

Current status:

  • Supports DVB-C/T/T2/S/S2
  • Does NOT support DiSeqC yet
  • Supports channel scans
  • Tested with minisatip (DVB-C/T2/S/S2) and with the Telebit Digibit R1 box (DVB-S/S2)
  • No crashes observed for some time now

Implementation details that might be improved:

  • Open/close code. Channels are always kept open because opening and closing gives all kinds of errors.
  • Reducing the RTP packet processing interval from 200 to 20 ms does fix a problem with missing RTP packets in MPTS recordings but there is no logical reason why this should make a difference. A possible reason can be the implementation of the underlying packetbuffer code because random numbers are used to identify packets and there is always a risk of collusion when storing a large number of packets.
  • Channel scans work OK but sometimes the PAT of the previous transport is processed. This does cause a timeout but the scan results are OK. The difficult part is here that MythTV assumes that as soon as a tuning command is given that everything that is received after that is from the requested frequency. This is not really true in networked environments where packets are buffered. One possible solution, which would improve scanning for all tuner types, is to filter on transport ID when that is known. This requires storage of the transport ID in table dtv_multiplex and it somehow changes the concept of tuning from tuning to a frequency into tuning to a transport ID.
  • Tuning timeout default values are quite high and are correct for DVB-S/S2 but could be reduced for DVB-C and DVB-T2. The actual values can of course be configured in the Capture Card page of mythtv-setup.
Note: See TracTickets for help on using tickets.