Bug #5447
tvheadend<->tvheadend via SAT>IP with ATSC-T tuner sets wrong frequency
100%
Description
I am setting up a test SAT>IP connection across the internet between two NATed tvheadend servers. The satip server has a ATSC-T tuner which is working fine. When setting up the satip client, I noticed a few things:
First, the IP addresses received in the desc.xml were the local address and not the external NAT address even if I select "Force RTSP announcement of the external (NAT) ip:port" - although this doesn't seem to be a problem - at least with TCP.
Second, at first I was not connecting properly, so I tried to manually set the "Tuner configuration:" on the client, but there is no option for ATSC. But at least when it did finally connect properly, the "auto" option worked and it recognized it as ATSC-T.
Third, I could not get a scan to work at all. Tcpdump showed no data being sent from the client to the server. Finally, after restarting the server, the client began attempting to scan. So even though the initial handshake appeared to be working, the server needs to be restarted after enabling SAT>IP???
And lastly, there is a problem with the frequency setting between the client and the server. On both machines, the muxes were manually entered and exactly the same. But while the client requests 525Mhz, the server is attempting to tune 0.525Mhz.
Client trace:
2018-12-19 20:51:22.413 [ INFO] mpegts: 525MHz in test - tuning on SAT>IP ATSC-T Tuner #1 (x.x.x.x:xxxx@TCP) 2018-12-19 20:51:22.413 [ DEBUG] satip: SAT>IP ATSC-T Tuner #1 (x.x.x.x:xxxx@TCP) - starting 525MHz in test 2018-12-19 20:51:22.413 [ TRACE] satip: SAT>IP ATSC-T Tuner #1 (x.x.x.x:xxxx@TCP) - start 2018-12-19 20:51:22.413 [ INFO] subscription: 025C: "scan" subscribing to mux "525MHz", weight: 2, adapter: "SAT>IP ATSC-T Tuner #1 (x.x.x.x:xxxx@TCP)", network: "test", service: "Raw PID Subscription" 2018-12-19 20:51:22.413 [ TRACE] satip: 00F3: SETUP params - fe=1&freq=525&msys=atsc&tvhweight=2&pids=0 2018-12-19 20:51:22.780 [ DEBUG] satip: x.x.x.x #1 - new session 14E7C29F stream id 10 2018-12-19 20:51:22.780 [ TRACE] satip: 00F3: PLAY params - addpids=1,8187&tvhweight=2 2018-12-19 20:51:37.773 [ TRACE] satip: SAT>IP ATSC-T Tuner #1 (x.x.x.x:xxxx@TCP) - OPTIONS request 2018-12-19 20:51:52.413 [ INFO] mpegts: 525MHz in test - scan no data, failed 2018-12-19 20:51:52.413 [ INFO] subscription: 025C: "scan" unsubscribing 2018-12-19 20:51:52.413 [ DEBUG] satip: SAT>IP ATSC-T Tuner #1 (x.x.x.x:xxxx@TCP) - stopping 525MHz in test 2018-12-19 20:51:52.413 [ TRACE] satip: SAT>IP ATSC-T Tuner #1 (x.x.x.x:xxxx@TCP) - input thread received mux close 2018-12-19 20:51:52.468 [ TRACE] satip: SAT>IP ATSC-T Tuner #1 (x.x.x.x:xxxx@TCP) - shutdown for /stream=10/14E7C29F
Server trace:
018-12-19 11:48:02.673 [ TRACE] satips: RTSP/1.0 SETUP rtsp://x.x.x.x:xxxx/?fe=1&freq=525&msys=atsc&tvhweight=2&pids=0{{Transport=RTP/AVP/TCP;interleaved=0-1,CSeq=1}} 2018-12-19 11:48:02.673 [ DEBUG] satips: 1/14E701BB/5: SETUP from x.x.x.x:xxxx ATSC-T freq 525000 mod AUTO pids 0 2018-12-19 11:48:02.673 [WARNING] satips: 1/14E701BB/5: create mux ATSC-T freq 525000 mod AUTO 2018-12-19 11:48:02.674 [ TRACE] satips: rtp queue 0x7fe98c0023c0 2018-12-19 11:48:02.674 [ INFO] mpegts: 0.525MHz in frontier - tuning on Samsung S5H1409 QAM/8VSB Frontend : ATSC-T #0 2018-12-19 11:48:02.674 [ ERROR] linuxdvb: Samsung S5H1409 QAM/8VSB Frontend : ATSC-T #0 - failed to tune [e=Invalid argument] 2018-12-19 11:48:02.674 [ DEBUG] satips: RTP streaming to x.x.x.x:xxxx open 2018-12-19 11:48:02.796 [ TRACE] satips: RTCP send to x.x.x.x:xxxx : ver=1.0;src=1;tuner=1,220,0,15,,,,,,,,;pids=0 2018-12-19 11:48:02.867 [ TRACE] satips: RTSP/1.0 PLAY rtsp://x.x.x.x:xxxx/stream=5?addpids=1,8187&tvhweight=2{{Session=14E701BB,CSeq=2}} 2018-12-19 11:48:02.867 [ DEBUG] satips: 1/14E701BB/5: PLAY from x.x.x.x:xxxx ATSC-T freq 525000 mod AUTO pids 0,1,8187 2018-12-19 11:48:02.946 [ TRACE] satips: RTCP send to x.x.x.x:xxxx : ver=1.0;src=1;tuner=1,220,0,15,,,,,,,,;pids=0,1,8187 2018-12-19 11:48:03.097 [ TRACE] satips: RTCP send to x.x.x.x:xxxx : ver=1.0;src=1;tuner=1,220,0,15,,,,,,,,;pids=0,1,8187 2018-12-19 11:48:03.247 [ TRACE] satips: RTCP send to x.x.x.x:xxxx : ver=1.0;src=1;tuner=1,220,0,15,,,,,,,,;pids=0,1,8187 2018-12-19 11:48:03.397 [ TRACE] satips: RTCP send to x.x.x.x:xxxx : ver=1.0;src=1;tuner=1,220,0,15,,,,,,,,;pids=0,1,8187 2018-12-19 11:48:03.547 [ TRACE] satips: RTCP send to x.x.x.x:xxxx : ver=1.0;src=1;tuner=1,220,0,15,,,,,,,,;pids=0,1,8187 2018-12-19 11:48:03.697 [ TRACE] satips: RTCP send to x.x.x.x:xxxx : ver=1.0;src=1;tuner=1,220,0,15,,,,,,,,;pids=0,1,8187 . . . 2018-12-19 11:48:06.400 [ TRACE] satips: RTCP send to x.x.x.x:xxxx : ver=1.0;src=1;tuner=1,220,0,15,,,,,,,,;pids=0,1,8187 2018-12-19 11:48:06.550 [ TRACE] satips: RTCP send to x.x.x.x:xxxx : ver=1.0;src=1;tuner=1,220,0,15,,,,,,,,;pids=0,1,8187 2018-12-19 11:48:06.674 [ NOTICE] subscription: 001E: No input source available for subscription "SAT>IP" to mux "0.525MHz in network"
(Ignore time differences, cut a paste was done at different times, but it is always the same sequence...)
Both are running recent builds of 4.3, although a few months apart in version.
History
Updated by Joe User almost 6 years ago
This change got it working, but not sure if it will break something else...
diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c index 483263d41..2f1822fbd 100644 --- a/src/satip/rtsp.c +++ b/src/satip/rtsp.c @@ -1207,6 +1207,7 @@ rtsp_parse_cmd } else if (msys == DVB_SYS_ATSC || msys == DVB_SYS_DVBC_ANNEX_B) { + freq *= 1000; if (!TAILQ_EMPTY(&hc->hc_req_args)) goto eargs; } else {
Updated by Joe User almost 6 years ago
"DVB_SYS_DVBC_ANNEX_B" is ATSC-C, so not regular DVB-C.
But, I will setup an ATSC-C network and check when I have time. If it is a problem the "if" can be separated...
Updated by Jaroslav Kysela almost 6 years ago
- Status changed from New to Fixed
- % Done changed from 0 to 100
Applied in changeset commit:tvheadend|833821fc6e556a455e3f6cfcb935e50dd82632bf.
Updated by Joe User almost 6 years ago
ATSC-C does not work. Client is sending two extra parameters (sr and specinv).
2018-12-20 21:29:06.340 [ TRACE] satip: 0012: SETUP params - fe=1&freq=525&sr=6.9&msys=dvbcb&specinv=1&tvhweight=10&pids=0
separating the systems and adding the paramaters to the server gets past that point, but the mux is not created.
diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c index 483263d41..d3878114d 100644 --- a/src/satip/rtsp.c +++ b/src/satip/rtsp.c @@ -1205,8 +1205,20 @@ rtsp_parse_cmd dmc->dmc_fe_stream_id = plp; dmc->dmc_fe_pls_code = ds; /* check */ - } else if (msys == DVB_SYS_ATSC || msys == DVB_SYS_DVBC_ANNEX_B) { + } else if (msys == DVB_SYS_ATSC) { + freq *= 1000; + if (!TAILQ_EMPTY(&hc->hc_req_args)) goto eargs; + + } else if (msys == DVB_SYS_DVBC_ANNEX_B) { + + freq *= 1000; + sr = atof(http_arg_get_remove(&hc->hc_req_args, "sr") ?: "0") *1000; + if (sr < 1000) goto end; + specinv = atoi(http_arg_get_remove(&hc->hc_req_args, "specinv") ?: "0"); + if (specinv < 0 || specinv > 1) goto end; + dmc->u.dmc_fe_qam.symbol_rate = sr; + dmc->dmc_fe_inversion = specinv; if (!TAILQ_EMPTY(&hc->hc_req_args)) goto eargs; } else {
2018-12-20 12:29:06.598 [ DEBUG] satips: 1/88849929/2: SETUP from x.x.x.x:xxxx ATSC-C freq 525000000 sym 6900 mod AUTO fec NONE ds 0 plp -1 pids 0 2018-12-20 12:29:06.598 [WARNING] satips: 1/88849929/2: unable to create mux ATSC-C freq 525000000 sym 6900 mod AUTO fec NONE ds 0 plp -1 2018-12-20 12:29:06.598 [ ERROR] satips: x.x.x.x: RTSP/1.0 SETUP (6) rtsp://x.x.x.x:xxxx/?fe=1&freq=525&sr=6.9&msys=dvbcb&specinv=1&tvhweight=10&pids=0 -- 405
I don't have time now to find out why the mux is not created with or without an sr, but if you don't see something obvious, I will test later and open a new bug report (hopefully with fix) later.
Maybe FEC needs to be set?? On the server it is set to auto.
Note: When I setup the mux on the satip server, I did not need to enter a symbol rate (0) and it works fine, but may have to do with HW/driver figuring it out...
Updated by Joe User almost 6 years ago
From here: [[https://www.kernel.org/doc/html/v4.9/media/uapi/dvb/frontend-property-cable-systems.html]]
It looks like ATSC-C (DVB-C Annex B) does not need sr or fec set. But the QAM mode should be set, although usually QAM256.
Updated by Jaroslav Kysela almost 6 years ago
- Status changed from Accepted to Fixed
Applied in changeset commit:tvheadend|833b61c4d14511ef20ac55a918a7fdc1c231fb0e.
Updated by Jaroslav Kysela almost 6 years ago
It seems that the problem is in the client code (sr/specinv). I've tried to fix this in the recent code.
Updated by Joe User almost 6 years ago
Thanks. Sorry, I did not have time to debug and now I have little time to test. Part of the problem is when changing from 4.3-1288~g66d6161c5 to a new build, I loose all my muxes??? I can recreate one for a quick test, but I need to go back to older version because I have many custom channels setup which will be painful to redo if I can't figure out why the muxes are disappearing...