DVBT2 mux HTSP streaming problems while PASS profile is OK
HTS Tvheadend 4.2.7-44 installed as LibreELEC 9.0.2 Tvh-addon v9.0.118 running on Rpi2
Have tried with two DVBT2 USB dobgles:
1. Mygica T230C
2. XBOX one Digital DVB Tuner
With DVBT mux (non DVBT2) in my area, everything is OK, I can stream, record and watch on various clients:
1. Kodi HTSP PVR adon on MS windows and on Android TV
2. TVHClient (use PASS profile) on android phone and tablet
With DVBT2 mux in my area, I face problems with all channels of the mux when streamed with HTSP profile (Kodi HTSP PVR addon on windows or on Android TV, http://tvhserverip:9981/tv.html web gui on chrome) I face the following problems:
1. Sometimes - no sound
2. When sound plays, it is not synchronized with video and there are "short breaks" in sound every 2-3 seconds
When I stream the same DVBT2 mux with any client which use 'pass' profile (either android TVHClient or Kodi IP TV Simple addon), the above problems do not exist !
I could record snapshots of the problematic DVBT2 mux by playing the mux via TVH web gui and also by dvb5-zap dvb tools addon on the Rpi2 server and could record a snapshot of the DVBT2 mux stream with dvb5-zap
When a recorded mux file is played by clients such as VLC, it is decoded and played properly.
My assumption is that there is some problem when the tvheadend streams a live channel with HTSP profile and the problem is either with the tvheadend server or the DVBT2 mux.
I am attaching a snapshot of the problematic DVBT2 mux, recorded by playing the mux with the web gui.
I can attach any log or trace if requested to.
#3 Updated by Adam Wisher about 1 month ago
Are you connecting the DVB-T2 tuners directly to the Pi2?
Here in the UK, we have a mixture of DVB-T and DVB-T2 muxes, which I think is the same as there in Israel?
If I connect my PCTV 290e DVB-T2 USB tuner directly to my Pi, it plays any DVB-T services perfectly but DVB-T2 services glitch. I think the tuner might require more power to tune the DVB-T2 multiplexes - maybe try it with the tuner connected to a powered USB hub and see if that fixes your problem.
#4 Updated by nit nit about 1 month ago
I thought about that, but still do not understand why when a client streams DVBT2 channels from the same TVH server with the PASS profile, the channels play correctly.
I would be satisfied if I could use PASS profile with kodi HTSP client, but other streaming profiles than HTSP are not accepted buy that client.
#5 Updated by Em Smith about 1 month ago
In the logfile, you will normally see lines indicating what it has found when playing a channel, for example:
dvr: # type lang resolution aspect ratio sample rate channels dvr: 1 MPEG2VIDEO 720x576 ? dvr: 2 MPEG2AUDIO nar 96000 ? dvr: 3 MPEG2AUDIO eng 96000 ? dvr: 4 DVBSUB eng dvr: 5 TELETEXT dvr: 6 TEXTSUB eng
What do you see on the times it fails?
I noticed that your file has:
Stream #0:11[0x2f]: Audio: aac_latm (HE-AACv2) ( / 0x0011), 48000 Hz, stereo, fltp
Perhaps your player/tv/amp has problems with these newer codecs, or Tvheadend fails to pass them through? When the audio fails, you can on Kodi press "o" (letter oh), and perhaps "ctrl-shift o", to see onscreen codec information about what it is receiving. Sometimes Kodi is setup to "pass through" some codecs to the tv/amplifier that the device can't handle. So, my tv says it can handle some audio codecs, but doesn't do it correctly and I get silence. You should problem see something in Kodi about "audio" or "aq" (audio quality). Unfortunately, it all depends on the Kodi skin and version on how/what is displayed. If it says it is receiving audio (AAC), then the problem is Kodi config in its audio settings.
Hi Adam. thanks for the response
I am attaching logs from both TVH and Kodi player (running on PC x96 windows 10-64 bits):
The logs have been taken after tuning on a channel of the DVBT2 mux
Case 1: No audio at all
2019-05-25 19:45:49.139 mpegts: 562MHz in DVB-T Network - tuning on Panasonic MN88472 #0 : DVB-T #0 2019-05-25 19:45:49.140 subscription: 00B4: "10.0.0.20 [ nitnit | Kodi Media Center ]" subscribing on channel "Ch 11 HD Kan", weight: 150, adapter: "Panasonic MN88472 #0 : DVB-T #0", network: "DVB-T Network", mux: "562MHz", provider: "Idan +", service: "Ch 11 HD Kan", profile="htsp", hostname="10.0.0.20", username="nitnit", client="Kodi Media Center" 2019-05-25 19:45:49.265 linuxdvb: Unable to provide BER value. 2019-05-25 19:45:49.265 linuxdvb: Unhandled ERROR_BLOCK_COUNT scale: 0 2019-05-25 19:45:49.265 linuxdvb: Unable to provide UNC value. 2019-05-25 19:45:50.450 TS: DVB-T Network/562MHz/Ch 11 HD Kan: H264 @ #33 Continuity counter error (total 1) 2019-05-25 19:45:50.450 TS: DVB-T Network/562MHz/Ch 11 HD Kan: AAC @ #32 Continuity counter error (total 1) 2019-05-25 19:45:50.489 tbl-base: pat: 562MHz in DVB-T Network: invalid checksum (len 4098, errors 1) 2019-05-25 19:45:50.529 TS: DVB-T Network/562MHz/Ch 11 HD Kan Transport error indicator (total 1) 2019-05-25 19:45:51.112 TS: DVB-T Network/562MHz/Ch 11 HD Kan: DVBSUB @ #1025 Continuity counter error (total 1)
Kodi player info:
PVR Info: ... Receiving device: Panasonic MN88472 #0 : DVB-T #0 Device staus: GOOD ... BER: 00000000 UNC: 00030170 Signal Quality: 79% SNR: 0% Player process info: video decoder: ff-h264-d3d11va (HW) Pixel format: d3d11va_Vld Deinterlace method: unknown Video stream: 1,920X1,088 px, 1.78 AR, 25.000 FPS Audio stream: unknownm unknown, 0 bits, 0 Hz System memory usage: 27% System CPU usage: 6%
Case 2: Audio plays, not synchronized to video, "small" breaks every 2-3 seconds
2019-05-25 19:58:03.504 mpegts: 562MHz in DVB-T Network - tuning on Panasonic MN88472 #0 : DVB-T #0 2019-05-25 19:58:03.505 subscription: 00B6: "10.0.0.20 [ nitnit | Kodi Media Center ]" subscribing on channel "Ch 11 HD Kan", weight: 150, adapter: "Panasonic MN88472 #0 : DVB-T #0", network: "DVB-T Network", mux: "562MHz", provider: "Idan +", service: "Ch 11 HD Kan", profile="htsp", hostname="10.0.0.20", username="nitnit", client="Kodi Media Center" 2019-05-25 19:58:04.398 http: 10.0.0.20: HTTP/1.1 HEAD /imagecache/10 -- 404 2019-05-25 19:58:04.436 http: 10.0.0.20: HTTP/1.1 HEAD /imagecache/14 -- 404 2019-05-25 19:58:05.209 TS: DVB-T Network/562MHz/Ch 11 HD Kan: AAC @ #32 Continuity counter error (total 1) 2019-05-25 19:58:05.243 TS: DVB-T Network/562MHz/Ch 11 HD Kan Transport error indicator (total 1) 2019-05-25 19:58:05.244 tbl-base: pat: 562MHz in DVB-T Network: invalid checksum (len 4098, errors 1) 2019-05-25 19:58:05.929 TS: DVB-T Network/562MHz/Ch 11 HD Kan: H264 @ #33 Continuity counter error (total 1) 2019-05-25 19:58:05.930 TS: DVB-T Network/562MHz/Ch 11 HD Kan: DVBSUB @ #1025 Continuity counter error (total 1) 2019-05-25 19:58:07.191 htsp: 10.0.0.16 [ nitnit | android-tvheadend (TV) ]: Disconnected 2019-05-25 19:58:07.194 htsp: Got connection from 10.0.0.16 2019-05-25 19:58:07.194 htsp: 10.0.0.16: Welcomed client software: android-tvheadend (TV) (HTSPv23) 2019-05-25 19:58:07.198 htsp: 10.0.0.16 [ android-tvheadend (TV) ]: Identified as user 'nitnit' 2019-05-25 19:58:07.198 htsp: 10.0.0.16 [ nitnit | android-tvheadend (TV) ]: Privileges updated 2019-05-25 19:58:18.532 tsfix: The timediff for DVBSUB is big (1661829275), using audio dts
Kodi player info:
PVR Info: ... Receiving device: Panasonic MN88472 #0 : DVB-T #0 Device status: GOOD ... BER: 00000000 UNC: 00050170 Signal Quality: 79% SNR: 0% Player process info: video decoder: ff-h264-d3d11va (HW) Deinterlace method: unknown Video stream: 1,920X1,088 px, 1.78 AR, 25.000 FPS Audio stream: FL, FR, ff-aac, 32bits, 48,000 Hz System memory usage: 27% System CPU usage: 5% (changes up to 11%)
And again, when playing the same channel from the same server, same reception conditions with 'PASS' streaming profile (even with the sam Kodi client installation but with IPTV simple addon), the audio always plays fine and sybchronized !
The 0Hz in Kodi means it is not receiving audio.
I managed to find this thread which suggests to me that your audio might not be supported in 4.2:
"tvh is using ADTS at the moment, which doesn't support all of the AAC extensions; a move to use LATM is on the plan for release 4.4, but it won't make it into 4.2 (which is the next release, due shortly)."
Audio choppiness might be related too.
I don't know how well 4.3 works on Pi2/LibreElec. I expect it should be fine.
It should automatically take a backup on an upgrade, but you can always take a backup yourself (the "dvr" database format changes in 4.3), so if you try to downgrade you will lose any recordings you made on 4.3.
I run it on my machine and it works fine and has been stable.
Perhaps someone who has AAC-LATM audio streams will know it it works before you upgrade.
If you don't want to upgrade, there is an alternative. In Kodi, you can go to "Videos->Files->Add Source" (might be called something different in your version) and add the directory containing your tvheadend recordings to the list. You can then browse and play recordings from there. You would lose programme description, but I rarely bother reading descriptions since I know what I recorded.
To play live tv, you can then use "IPTV" inside Kodi. I don't use it, but I've read many people have used it. Since it doesn't use htsp, it might work for you.
I have tried Kodi with IPTV simple add on and its works fine with 'pass' streaming profile (no control over server side recording).
Since currently I do not have any important recordings to keep, I will try upgrading to TVH 4.3 and if encounter issues, I will downgrade back to 4.2.
I am waiting for CvH, the originator of "Tvheadend nightly builds for LE" thread in Libreelec forum https://forum.libreelec.tv/thread/3416-tvheadend-nightly-builds-for-le/ to restore his repo which is currently down.
Have upgraded today to TVH 4.3.1774.
I have not reconfigured TVH from scratch, and have let it to upgrade from the existing TVH 4.2 configuration.
It didnt solve the HTSP streaming problems ! It seems that the short sound stops are more rare but still having huge sync mismatch between video and sound.
I have also noticed on the TVH log, many indications "DVBSUB @ #1025: DTS and PCR diff is very big"
2019-05-31 17:57:59.021 parser: DVB-T Network/562MHz/Ch 11 HD Kan: DVBSUB @ #1025: DTS and PCR diff is very big (1661812117) 2019-05-31 17:58:02.345 parser: DVB-T Network/562MHz/Ch 11 HD Kan: DVBSUB @ #1025: DTS and PCR diff is very big (1661813503) 2019-05-31 17:58:05.227 parser: DVB-T Network/562MHz/Ch 11 HD Kan: DVBSUB @ #1025: DTS and PCR diff is very big (1661820750) 2019-05-31 17:58:07.252 parser: DVB-T Network/562MHz/Ch 11 HD Kan: DVBSUB @ #1025: DTS and PCR diff is very big (1661822583) 2019-05-31 17:58:09.348 parser: DVB-T Network/562MHz/Ch 11 HD Kan: DVBSUB @ #1025: DTS and PCR diff is very big (1661812967)
Are these messages indicate a problem with video-sound sync ?
If same mux as attached is problematical
ormat : MPEG-TS File size : 25.4 MiB Duration : 8 s 784 ms Start time : UTC 2019-03-16 11:19:57 End time : UTC 2019-03-16 11:20:03 Overall bit rate mode : Constant Overall bit rate : 24.6 Mb/s Network name : IDAN HD + Country : ISR Timezone : +02:00:00 Video #1 ID : 33 (0x21) Menu ID : 1 (0x1) Format : AVC Format/Info : Advanced Video Codec Format profile : [email protected] Format settings : CABAC / 3 Ref Frames Format settings, CABAC : Yes Format settings, RefFrames : 3 frames Codec ID : 27 Duration : 5 s 940 ms Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate : 25.000 FPS Standard : Component Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Interlaced Scan type, store method : Separated fields Scan order : Top Field First Color range : Limited Color primaries : BT.709 Transfer characteristics : BT.709 Matrix coefficients : BT.709 Audio #1 ID : 32 (0x20) Menu ID : 1 (0x1) Format : AAC LC SBR PS Format/Info : Advanced Audio Codec Low Complexity with Spectral Band Replication and Parametric Stereo Commercial name : HE-AACv2 Format settings : NBC Muxing mode : LATM Codec ID : 17-29 Duration : 7 s 168 ms Bit rate mode : Variable Channel(s) : 2 channels Channel layout : C Sampling rate : 48.0 kHz Frame rate : 23.438 FPS (2048 SPF) Compression mode : Lossy Delay relative to video : 824 ms Text #1 ID : 1025 (0x401) Menu ID : 1 (0x1) Format : DVB Subtitle Codec ID : 6 Language : Hebrew Menu #1 ID : 34 (0x22) Menu ID : 1 (0x1) Duration : 8 s 513 ms List : 32 (0x20) (AAC) / 33 (0x21) (AVC) / 1025 (0x401) (DVB Subtitle, Hebrew) Language : / / Hebrew Service name : Ch 11 HD Kan Service provider : Idan + Service type : digital television
Strange is audio is before video in menu
also audio is in strange format AAC LC SBR PS and synchronisation timing
Is any one try to repack it with ffmpeg?
My report above is for the same mux as referred by the URL in the description in top post above.
I have a longer recording of that mux (185MB), but for some reason I cant upload that file here.
The mux is played with no problems VLC and other players when streamed with 'pass' profile.