jnappse
Posts: 5
Joined: Wed Mar 31, 2021 6:32 am

TV Hat trouble with DVB-T2

Wed Mar 31, 2021 12:23 pm

I wonder if anyone is having similar problems?

I recently bought an rpi3b+ with the tv-hat (March 2021). I can not make it tune to hd channels, only sd-channels. Some facts:
- The intention is to get a new smaller 'TV-computer'
- OS: Raspian Lite 'Buster'
- Using VDR with rpihddevice, channles.conf from my working TV-computer (ASRock Nettop ION / yavdr)
- Tuning to SD channels (DVB-T) works nicely with TV-hat
- Tuning to HD channles (DVB-T2) fails with TV-hat
- A DVB-T2 usb-stick from old computer connected to RPI can tune hd-channels
- Using w_scan with TV-hat does not find any DVB-T2 muxes
- Antenna signal strength is 74% according to vdr-plugin-devstatus using old hauppauge usb-stick DVB-T only
- The support for scanning and signal strength in DVB-T2 usb-sticks under Linux/Rasbian seems lacking
- I live in Sweden where a mix of DVB-T2 and DVB-T muxes are present (Teracom Göteborg/Brudaremossen)

I am starting to suspect that my TV-hat is broken, but how could I verify that?

johndavies
Posts: 215
Joined: Fri Dec 20, 2013 1:00 pm

Re: TV Hat trouble with DVB-T2

Wed Mar 31, 2021 4:33 pm

You do not have to use tvheadend. Look on the Internet for "t2scan." Download it. cd into its folder and read file README.md. Follow the instructions to compile the program, You should be able to run it straight away in a Terminal to make a list of HD channels:

Code: Select all

sudo t2scan -t2 -oxine -o /home/pi/channels_new.conf
Use "Copy" and "Paste" to add the HD channels to your channels.conf file. Add dvbv5-scan and dvb5-zap as these may be useful later on. You add these and some other programs by typing:

Code: Select all

sudo apt install dvb-tools
Look on the Internet for "dvbjet" and compile that as well. If you use Google you may see a number of my posts dealing with dvb and HD underneath the "dvbjet"information.If you know some of the HD frequencies that your local transmitter uses, you can use vlc to scroll through them.

Code: Select all

 vlc dvb-t2://frequency=(a nine digit number for the UK):bandwidth=8 
The first programme in the list should start playing. You can see the names of all the channels contained
within that frequency by going to "Playback" on the vlc menu and then clicking on "Programme".

"dvbv5-scan" makes its channel list in a different way to "w_scan" and "t2scan" but all 3 programmes can convert their output to the other form. I found a program which set up a menu to show my favourite SD and HD channels using VLC. "dvbjet" has a timer feature which allows recordings within a 24 hour window. "dvbv5-zap" can be used to record with a program called "at" which needs to be downloaded or with the raspberry pi's very own "crontab -e." "tzap" can be used torecord SD programmes using"at" and "crontab-e".

Code: Select all

tzap "DMAX" -r -t 3600 -o /home/pi/Videos/AusGHS5E3
Use the internet to find out how it works
I am afraid that I have not explained this as clearly as I should. If you are totally confused look at the information on the Internet near "dvbjet"

jnappse
Posts: 5
Joined: Wed Mar 31, 2021 6:32 am

Re: TV Hat trouble with DVB-T2

Fri Apr 02, 2021 1:40 pm

Thank you for directions, I have gotten a bit further.
- t2scan works with the hat. It finds all muxes and services dvb-t and dvb-t2
- t2scan does not work with my other dvb-t2 usb stick (Hauppauge PCTV NanoStick T2 HD 290e)
- dvbjet with mpegts can extract .ts file playable with 'vlc -vv --vout mmal_vout file.ts from the hat
- dvbjet with mpegts can extract .ts file playable with 'vlc -vv --vout mmal_vout file.ts from the 290e stick
- No other scanning tools works: w_scan, w_scan2 or dvbv5_scan
- I have found no zap tool that tunes dvb-t2 for the hat
- t2scan -r with the hat says signal strength -36.2 dBm and signal quality 32.7dB (on the dvb-t2 mux where my FTA services are)
- The playable .ts file from the hat is very poor quality, lots of glitches and image distortions
- The playable .ts file from the 290e is of good stable quality both audio and video
- VDR does not play dvb-t2 channels from hat with channels.conf produced by t2scan
- My Samsung TV when connected to same antenna says signal quality is 85-95% on the DVB-T2 mux (522000000)

If something is wrong with the hat hardware, it is probably the antenna connection. Given that t2scan works and that content (albeit poor quality) can be extracted from a dvb-t2 channel, it can not be completely broken. I have no reference to what 'good' numbers for signal strength and quality with t2scan is though.

Also, as I run Raspbian Lite without X, running VLC is a research project in commandline args.
I tried 'vlc -vv --vout mmal_vout dvb-t2://frequency=522000000:bandwidth=8:program=6130' but it gives no output and lands me in an interactive prompt mode. '6130' being the service-ID of one of the FTA channels on the dvb-t2 mux.

In general the compatibility of various dvb hardware under Linux/Debian/raspbian with the kernel-drivers and viewing software seems a bit shaky.

Again, thank you for your help and input. I will continue to try to nail down what works what does not.

johndavies
Posts: 215
Joined: Fri Dec 20, 2013 1:00 pm

Re: TV Hat trouble with DVB-T2

Fri Apr 02, 2021 2:52 pm

You obviously know a lot more than me; I am just a blundering amateur. What little brain I have left has little room for technical information. You seem to base your vlc command line instructions on the system used by Windows. If I am loading a TV programme via vlc, I use a simpler set of insructions e.g.

Code: Select all

vlc dvb-t2://frequency=746000000:bandwidth=8 :program=40960
For some reason the space left the "8" and the ":" is very important. The TV programme will not load without that space being left. The ".ts" programmes saved by programs other than vlc do not play sound. I can quickly get around that problem by playing them with the mpv player which can be loaded from the Raspberry pi repository. If you create a TV station list that dvbv5-scan can use, you need to use the actual transmitter details which I assume can be found in /usr/share/dvb/dvb-t/.

Code: Select all

dvbv5-scan uk-SuttonColdfield  -O ZAP -o /home/pi/channelsnew.conf
This should save a channels list in the same format as t2scan and w_scan (-O ZAP being the critical command) but it sometimes misses out the names of the HD channels while including all the other details. That is when I have to load the frequency into vlc so I can use Playback and Programme to see the names of the channels soI can enter them manually. I suppose you must be using an aerial signal amplifier if you need more than one output. I have used an RTL2832 which I originally bought very cheaply to tune SDR radio. I could not get this to work very well but it was very good at tuning in SD TV and Radio signals

jnappse
Posts: 5
Joined: Wed Mar 31, 2021 6:32 am

Re: TV Hat trouble with DVB-T2

Sat Apr 03, 2021 9:44 am

Dont feel like no expert, more like labchimp pressing random buttons, hoping for the banana…

I finally made vlc produce audio and video (TV4) on my rpi console from the hat, using the following command:

Code: Select all

vlc -v dvb-t://adapter=0:frequency=650000000:bandwidth=8 :program=1040 --vout mmal_vout
This is of course DVB-T, for DVB-T2 using my other Hauppauge USB-stick the following command also works nicely (SVT1)

Code: Select all

vlc -v dvb-t2://adapter=1:frequency=522000000:bandwidth=8 :program=6310 --vout mmal_vout
The above DVB-T2 command does not work for adapter=0, ie the hat. vlc fails to tune, no FE_HAS_LOCK in debug prints.
My conclusion is that this is a kernel/driver stack issue with DVB-T2 and the hat. At least with Swedish DVB-T2 transmissions.

Code: Select all

raspberrypi:~/dvb# uname -a
Linux raspberrypi 5.10.17-v7+ #1403 SMP Mon Feb 22 11:29:51 GMT 2021 armv7l GNU/Linux
So I'll 'stick with my sticks' for now and hope for future improvements to the kernel driver for the hat.

jnappse
Posts: 5
Joined: Wed Mar 31, 2021 6:32 am

Re: TV Hat trouble with DVB-T2

Sun Apr 04, 2021 5:41 pm

It turns out that tvheadend is able to both scan and tune DVB-T2 on the hat, where both vlc and vdr fails.
That means that the kernel/driver stack is not to blame.

It is more likely that tvheadend is more intelligent in trying out all the DVB parameters when set to 'auto', ie. fec, guard, inversion, plp-id and whatever. I suspect there is some combination of these that can be given explicitedly to vlc by command line but I have had no success yet.

I guess the labchimp will need to press a lot of buttons. The permutations are at least a finite set...

johndavies
Posts: 215
Joined: Fri Dec 20, 2013 1:00 pm

Re: TV Hat trouble with DVB-T2

Mon Apr 05, 2021 7:11 am

I only used tvheadend for a short time. I wanted to learn how to use the command line to download TV programmes and it sometimes stopped the Sony chip from working. I can play and download T2 TV programs with my TVHat. Either yours is faulty or the aerial signal reaching it is not strong enough for it to pick up T2 signals. Have you tried changing the aerial cable to the Pi TVHat or using a sgnal booster? Have you tried running th Pi TVHat alone? dvbjet and dvbv5-zap will record T2 Programmes on my Raspberry Pi 4. dvbjet uses the channels.conf file while I can only get the dvbv5-zap programme to use its own dvb_channel.conf file. This can be generated in this way:

Code: Select all

dvbv5-scan uk-Sutton Coldfield -o dvb_channel.conf
and a HD programme can be copied by typing in a command like the following:

Code: Select all

dvbv5-zap "BBC TWO HD" -c dvb_channel.conf -r -t 3600 -o /home/pi/Videos/Title.Of.Programme
I set up a simple menu to play my favourite TV channels by using a programme I found on the Internet which uses VLC. It would convert the entire channels.conf list but I found it easier to copy the individual entries ten times and input the details for my favourite ten channels. The Text Editor file was saved on the Desktop as an .m3u one. Note that the final line needs to show whether the signal is dvb-t or dvb-t2. I have now completely run out of ideas.

Code: Select all

#EXTINF:1,Sky News
	#EXTVLCOPT:dvb-frequency=666000000
	#EXTVLCOPT:program=22080
	#EXTVLCOPT:dvb-bandwidth=8
	dvb-t://
	#EXTINF:1,PBS America HD + 1
	#EXTVLCOPT:dvb-frequency=746000000
	#EXTVLCOPT:program=41248
	#EXTVLCOPT:dvb-bandwidth=8
	dvb-t2://
	#EXTINF:1,PBS America SD
	#EXTVLCOPT:dvb-frequency=618000000
	#EXTVLCOPT:program=27968
	#EXTVLCOPT:dvb-bandwidth=8
	dvb-t://
If you are using another adapter, you need an extra line above the dvb-t or dvb-t2 which contains its details

Code: Select all

#EXTVLCOPT:dvb-adapter=1

jnappse
Posts: 5
Joined: Wed Mar 31, 2021 6:32 am

Re: TV Hat trouble with DVB-T2

Tue Apr 20, 2021 9:43 pm

Pressed a lot of buttons, sadly no banana…

I can make dvbv5-scan find my DVB-T2 channels through another adapter. I can then change the 'stream id' from '0' to '1' in the conf-file and make dvbv5-zap tune using the HAT. Tvheadend also tunes nicely, but vdr, vlc and Kaffeine fails.

From what I learned about DVB-T2, it seems it can use a 'single' or 'multi' frequency strategy SFT or MFT. In Sweden we have SFT and then we have 'plp-id != 0', aka 'streamid' in the dvbv5-zap conf-file.

My tentative conclusion is that the drivers for some adapters are more permissive with respect to having DVB-parameters, like plp-id, not set or set to 'auto', whereas the drivers for the HAT needs it set explicitedly.

It then also seems some software like dvbv5-zap and tvheadend can set this parameter explicitedly, whereas some other like vdr can not. vdr has parameters in a channels.conf like 'BnnDnnCnnTnnYnnSnnYnnPnn' etc. plp-id is the 'P', but setting 'P1' or 'P999' aka 'auto' makes vdr say 'channel not available'. Setting 'P0' makes vdr try to tune but it fails with the HAT. vdr tunes nicely with my other DVB-T2 adapters, using 'P0', which is the wrong setting but seemingly fixed by the drivers of the other adapters.

johndavies
Posts: 215
Joined: Fri Dec 20, 2013 1:00 pm

Re: TV Hat trouble with DVB-T2

Sat May 08, 2021 10:35 am

There is one obvious piece of information which I completely forgot about. The Foundation tried to reduce costs by asking people who needed to play certain video files to buy codecs for MPEG2 and VC1. Afte receiving a few pounds (krone??) in payment it would send a code to be entered. . Here are some details which I found. You probably have done this.


Hardware decoding of additional codecs on the Pi 3 and earlier models can be enabled by purchasing a licence that is locked to the CPU serial number of your Raspberry Pi.
codecs.raspberrypi.org is the address to enter in Chromium.

On the Raspberry Pi 4, the hardware codecs for MPEG2 or VC1 are permanently disabled and cannot be enabled even with a licence key; on the Pi 4, thanks to its increased processing power compared to earlier models, MPEG2 and VC1 can be decoded in software via applications such as VLC. Therefore, a hardware codec licence key is not needed if you're using a Pi 4.

decode_MPG2
decode_MPG2 is a licence key to allow hardware MPEG-2 decoding, e.g. decode_MPG2=0x12345678.


decode_WVC1
decode_WVC1 is a licence key to allow hardware VC-1 decoding, e.g. decode_WVC1=0x12345678.

If you have multiple Raspberry Pis and you've bought a codec licence for each of them, you can list up to eight licence keys in a single config.txt, for example decode_MPG2=0x12345678,0xabcdabcd,0x87654321. This enables you to swap the same SD card between the different Pis without having to edit config.txt each time.

User avatar
rpdom
Posts: 18727
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: TV Hat trouble with DVB-T2

Sat May 08, 2021 11:42 am

In fact the Codec Licence is permanent once set. You only need to boot the Pi with the correct licence key in config.txt once and a flag is set in OTP to say that codec has been permanently enabled on that Pi.
Unreadable squiggle

Return to “HATs and other add-ons”