measure DVB-C signal quality using USB adapter and Raspberry Pi
Added by Kevin Maguire over 1 year ago
Hi
I am in Germany, have connection to DVB-C signal from Vodafone, and am using a WinTV Dual USB stick connected to a Raspberry Pi model 3B.
Below is how kernel sees my adapter, I also used eprom-filter to swap to bulk mode and using firmware file there noted.
Generally things work OK, but I am still on the learning curve.
I am interested currently in using this setup to measure signal quality , and understand the numbers given. I have (for other reasons) suspicion quality may not be the best.
I've looked around for different ways, e.g. this was one suggestion:
- femon -H
FE: Silicon Labs Si2168 (DVBC)
Problem retrieving frontend information: Unknown error 524
status SCVYL | signal 0% | snr 0% | ber -1314722340 | unc -1944579584 | FE_HAS_LOCK
Problem retrieving frontend information: Unknown error 524
status SCVYL | signal 0% | snr 0% | ber -1314722340 | unc -1944579584 | FE_HAS_LOCK
does not seem to be working. This seems a little better
- dvb-fe-tool --femon
Lock (0x1f) Signal= -48.00dBm C/N= 36.75dB UCB= 0 postBER= 0
Lock (0x1f) Signal= -48.00dBm C/N= 36.75dB UCB= 0 postBER= 0
Lock (0x1f) Signal= -48.00dBm C/N= 36.75dB UCB= 0 postBER= 0
Lock (0x1f) Signal= -48.00dBm C/N= 36.75dB UCB= 0 postBER= 0
What's easiest/best way here?
I am pretty familiar with Linux command line, tools, utils, etc.
TIA for any help, KM
[ 11.297307] em28xx 1-1.5:1.0: dvb set to bulk mode.
[ 12.657400] em28xx 1-1.5:1.0: dvb ts2 set to bulk mode.
[ 13.314906] dvbdev: DVB: registering new adapter (1-1.5:1.0)
[ 13.315009] dvbdev: dvb_create_media_entity: media entity 'Silicon Labs Si2168' registered.
[ 13.330335] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered.
[ 13.502063] dvbdev: DVB: registering new adapter (1-1.5:1.0)
[ 13.502131] dvbdev: dvb_create_media_entity: media entity 'Silicon Labs Si2168' registered.
[ 13.509199] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered.
[ 13.516542] em28xx: Registered (Em28xx dvb Extension) extension
[ 15.506408] si2168 14-0067: Direct firmware load for dvb-demod-si2168-b40-01.fw failed with error -2
[ 15.508152] si2168 14-0067: please install firmware file 'dvb-demod-si2168-b40-01.fw'
[ 15.508181] si2168 14-0067: downloading firmware from file 'dvb-demod-si2168-02.fw'
[ 15.820030] si2168 12-0064: Direct firmware load for dvb-demod-si2168-b40-01.fw failed with error -2
[ 15.820133] si2168 12-0064: please install firmware file 'dvb-demod-si2168-b40-01.fw'
[ 15.820145] si2168 12-0064: downloading firmware from file 'dvb-demod-si2168-02.fw'
Replies (16)
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by saen acro over 1 year ago
There is two way to measure signal and quality by driver
by API version 3
by API version 5
but next moment is missing standard how driver report this values
some report from: 0-FF
others from 0-FFFF
or by 0-FFFFFF
Check if firmware is in /lib/firmware
Sometime with some drivers powersave disabling solve unloading of firmware.
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by Kevin Maguire over 1 year ago
Thanks for reply. See above:
[ 15.506408] si2168 14-0067: Direct firmware load for dvb-demod-si2168-b40-01.fw failed with error -2
[ 15.508152] si2168 14-0067: please install firmware file 'dvb-demod-si2168-b40-01.fw'
[ 15.508181] si2168 14-0067: downloading firmware from file 'dvb-demod-si2168-02.fw'
[ 15.820030] si2168 12-0064: Direct firmware load for dvb-demod-si2168-b40-01.fw failed with error -2
[ 15.820133] si2168 12-0064: please install firmware file 'dvb-demod-si2168-b40-01.fw'
[ 15.820145] si2168 12-0064: downloading firmware from file 'dvb-demod-si2168-02.fw'
That file (dvb-demod-si2168-02.fw ) is in /lib/firmware and is apparently loaded.
I also tried with dvb-demod-si2168-b40-01.fw, and will now try again, but I had some issues with that firmware.
So now that file is installed and pi rebooted.
dmesg | fgrep dvb
[ 11.568920] em28xx 1-1.5:1.0: dvb set to bulk mode.
[ 12.945573] em28xx 1-1.5:1.0: dvb ts2 set to bulk mode.
[ 13.704881] dvbdev: DVB: registering new adapter (1-1.5:1.0)
[ 13.704960] dvbdev: dvb_create_media_entity: media entity 'Silicon Labs Si2168' registered.
[ 13.726636] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered.
[ 13.836614] dvbdev: DVB: registering new adapter (1-1.5:1.0)
[ 13.836683] dvbdev: dvb_create_media_entity: media entity 'Silicon Labs Si2168' registered.
[ 13.848972] dvbdev: dvb_create_media_entity: media entity 'dvb-demux' registered.
[ 13.865460] em28xx: Registered (Em28xx dvb Extension) extension
[ 16.170435] si2168 14-0067: downloading firmware from file 'dvb-demod-si2168-b40-01.fw'
[ 16.878982] si2168 12-0064: downloading firmware from file 'dvb-demod-si2168-b40-01.fw'
[ 17.656083] si2168 12-0064: downloading firmware from file 'dvb-demod-si2168-b40-01.fw'
And now
- dvb-fe-tool --femon
(0x00) Signal= -46.00dBm
(0x00) Signal= -46.00dBm
(0x00) Signal= -45.00dBm
(0x00) Signal= -45.00dBm
(0x00) Signal= -46.00dBm
Is that good/bad/average ?
- femon -H -a 0 -f 0
FE: Silicon Labs Si2168 (DVBC)
Problem retrieving frontend information: Unknown error 524
status | signal 0% | snr 0% | ber -1686311460 | unc -1989406208 |
Problem retrieving frontend information: Unknown error 524
status | signal 0% | snr 0% | ber -1686311460 | unc -1989406208 |
Problem retrieving frontend information: Unknown error 524
status | signal 0% | snr 0% | ber -1686311460 | unc -1989406208 |
Problem retrieving frontend information: Unknown error 524
status | signal 0% | snr 0% | ber -1686311460 | unc -1989406208 |
Problem retrieving frontend information: Unknown error 524
status | signal 0% | snr 0% | ber -1686311460 | unc -1989406208 |
So not really any change there.
Note I am (with both firmwares) able to play ZDF with mpv on this file:
#EXTM3U
#EXTINF:-1,2 : ZDF
http://IP_ADDRESS:9981/stream/channel/a56b3bc9846e0a8576fc988cee4f1f3c?ticket=1ef34ef4c91891023634a890179b52e51692f95b
I am admittedly at edge of my understanding here!
Best, KM
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by Kevin Maguire over 1 year ago
- dvb-fe-tool -g -a 0 -f 0
FREQUENCY = 418000000
MODULATION = QAM/256
INVERSION = OFF
SYMBOL_RATE = 6900000
INNER_FEC = NONE
DELIVERY_SYSTEM = DVBC/ANNEX_A
case it helps
also screenshot from tvheadend when streaming attached
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by saen acro over 1 year ago
Try with more powerfull adapter for pi, 4A for example.
Or better use usb hub with external powering.
if have some cutting or BER
try with
http://tvh.ip.or.dns:9981/playlist/channels
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by Kevin Maguire over 1 year ago
I think you misunderstand my question, or assuming I know more than I (sadly) do.
I am not trying to eliminate/fix some streaming issue causing me any stress.
I am trying to establish IF I have excellent/good/low signal quality, by measuring it. Which I don't really know how to do, nor how to interpret the results of available tools (e.g. why is femon giving error above? Is (0x00) Signal= -46.00dBm good/bad/indifferent. )
( Analogy: if someone asked me to how to measure/assess their network bandwidth between A and B, I might ask them to run nectat/dd/similar over their link and if they shared results, give some advice. e.g. if they had 2 Gigabit Ethernet adapters, and got 2 MB/s between A and B, something is likely wrong. If the get 102 MB/s, probably they are doing pretty good.)
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by saen acro over 1 year ago
As I answer already,
DVBAPI version 3 and version 5 is used by different apps.
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by Kevin Maguire over 1 year ago
Thank you again for answering.
But again, the answer doesn't help me know any better what to do. I am happy to use DVBAPI v3 or v5 apps, I am completely agnostic on that, have no preference whatsoever.
I realize you are SME here, and I am not, thats why I am asking for user-level assistance/advice (run this command, look at that UI, value X means great, value Y means terrible, value Z tells you nothing, and so on).
if it helps, this is what I have installed, I can install other tools if required.
dpkg -l | egrep 'dvb|tvheadend' ii dvb-apps 1.1.1+rev1500-1.4 arm64 Digital Video Broadcasting (DVB) applications ii dvb-tools 1.20.0-2 arm64 Collection of command line DVB utilities ii dvbstream 0.6+cvs20090621-3 arm64 Broadcast a DVB Transport stream over a LAN ii dvbstreamer 2.1.0-5.1 arm64 a console based streamer for DVB/ATSC service(s) ii libdvbcsa1:arm64 1.1.0-2+b12 arm64 free implementation of the DVB/CSA ii libdvbpsi10:arm64 1.3.3-1 arm64 library for MPEG TS and DVB PSI tables decoding and generating ii libdvbv5-0:arm64 1.20.0-2 arm64 Libraries to control, scan and zap on Digital TV channels ii tvheadend 4.3-1994~gc7b713edb~bullseye arm64 Tvheadend
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by Jonas Lang over 1 year ago
A lot of those signal level readings can be quite arbitrary. Take them for what they are, a guide and use them accordingly, I wouldn’t base any equipment purchasing decisions around them. While scanning muxes what levels do you see in the Status tab.
Everyone here is a user. Those who are maintaining the project in some form or other can be found on the GitHub.
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by Kevin Maguire over 1 year ago
I am also not making no effort here, just reached limit of my knowledge.
So, eg, I created (DVBV5) format channels file.
dvbv5-scan -G /usr/share/tvheadend/data/dvb-scan/dvb-c/de-Regensburg-Vodafone-KM
(that file had the 29 frequencies I know are used for cable tv here)
and it created file with contents like
[Das Erste HD] SERVICE_ID = 10301 NETWORK_ID = 61441 TRANSPORT_ID = 10005 VIDEO_PID = 5101 AUDIO_PID = 5102 5103 5104 5105 5107 PID_0c = 1176 PID_0b = 2172 2171 PID_05 = 1170 FREQUENCY = 330000000 MODULATION = QAM/AUTO INVERSION = OFF SYMBOL_RATE = 6900000 INNER_FEC = AUTO DELIVERY_SYSTEM = DVBC/ANNEX_A
I converted to ZAP file.
I then tune with
# czap -c dvb_channel.zap "Das Erste HD" using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0' reading channels from file 'dvb_channel-1.zap' 1 Das Erste HD:330000000:INVERSION_OFF:6900000:FEC_AUTO:QAM_AUTO:5101:5102:10301 1 Das Erste HD: f 330000000, s 6900000, i 0, fec 9, qam 6, v 0x13ed, a 0x13ee, s 0x283d Version: 5.11 FE_CAN { DVB-T + DVB-T2 + DVB-C (A) } status 00 | signal 0000 | snr 007f | ber 8e3d9dc0 | unc 00000003 | status 1f | signal 0000 | snr 007f | ber 8e3d9dc0 | unc 00000003 | FE_HAS_LOCK status 1f | signal 0000 | snr 007f | ber 8e3d9dc0 | unc 00000003 | FE_HAS_LOCK status 1f | signal 0000 | snr 007f | ber 8e3d9dc0 | unc 00000003 | FE_HAS_LOCK status 1f | signal 0000 | snr 007f | ber 8e3d9dc0 | unc 00000003 | FE_HAS_LOCK
and can capture, look at bandwidth, and other stuff via something like
# dvbsnoop -s bandwidth -n 1024 5101 dvbsnoop V1.4.50 -- http://dvbsnoop.sourceforge.net/ --------------------------------------------------------- PID bandwidth statistics... PID: 5101 (0x13ed) - max packet count: 1024 --------------------------------------------------------- packets read: 35/(35) d_time: 0.004 s = 13160.000 kbit/s (Avrg: 13160.000 kbit/s) [bad: 0] packets read: 24/(59) d_time: 0.001 s = 36096.000 kbit/s (Avrg: 22184.000 kbit/s) [bad: 0] packets read: 17/(76) d_time: 0.008 s = 3196.000 kbit/s (Avrg: 9525.333 kbit/s) [bad: 0] packets read: 44/(120) d_time: 0.001 s = 66176.000 kbit/s (Avrg: 15040.000 kbit/s) [bad: 0] packets read: 19/(139) d_time: 0.007 s = 4082.286 kbit/s (Avrg: 11002.947 kbit/s) [bad: 0] packets read: 37/(176) d_time: 0.001 s = 55648.000 kbit/s (Avrg: 13931.789 kbit/s) [bad: 0]
This all looks pretty good to me.
I also see that if I try
# dvbsnoop -s signal 5110 dvbsnoop V1.4.50 -- http://dvbsnoop.sourceforge.net/ --------------------------------------------------------- Transponder/Frequency signal strength statistics... --------------------------------------------------------- Error(524): frontend ioctl: Unknown error 524 cycle: 1 d_time: 0.001 s
and using strace I can see this comes from:
openat(AT_FDCWD, "/dev/dvb/adapter0/frontend0", O_RDONLY) = 3 ... ioctl(3, FE_READ_SIGNAL_STRENGTH, 0x7fc1cd7158) = -1 ENOTSUPP (Unknown error 524)
and I presume ENOTSUPP means "Not supported" by driver/card/whatever.
But I'm still not knowing if I can evaluate signal quality somehow here.
Reason is I have many connection points I'd like to validate/check quality on each, and have idea what is "good" or "bad", or even "excellent" or "terrible"
Maybe with this hardware it is not possible, I an just asking.
thnx, KM
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by Jonas Lang over 1 year ago
Is this the tuner you’re using
https://www.linuxtv.org/wiki/index.php/Hauppauge_WinTV-dualHD#Firmware
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by Kevin Maguire over 1 year ago
Hi Jonas
Yes, Model 01590 (USB device ID 2040:0265) version.
I use the noted firmware release "The Model 01590 demodulator needs a firmware which can be found for example at http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-B40/4.0.11/dvb-demod-si2168-b40-01.fw"
though I used later one at same site (4.0.25 vs 4.0.1)
http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-B40/4.0.25/dvb-demod-si2168-b40-01.fw
I also changed to "bulk" mode using eprom-tinker.
# lsusb -v Bus 001 Device 004: ID 2040:0265 Hauppauge WinTV-dualHD DVB Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x2040 Hauppauge idProduct 0x0265 WinTV-dualHD DVB bcdDevice 1.00 iManufacturer 3 HCW iProduct 1 dualHD iSerial 2 0011574174 bNumConfigurations 1
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by saen acro over 1 year ago
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by Jonas Lang over 1 year ago
Again this isn’t really a TVH problem. It appears your frontend isn’t correctly loaded. Again it’s just a brief observation looking from the outside.
You may want to look at the LibreELEC solution linked here
https://forum.libreelec.tv/thread/24521-usb-tuner-recommendations-for-rpi/
If your tuner is recognised using LibreELEC out of the box it may be the simplest route to go.
As no doubt you are aware DVB USB devices are notorious for breaking with each kernel upgrade. Some are recognised but don’t function as expected. The LibreELEC solution could be your answer. Check in their forum to see if they can shed any further light on your problem.
As mentioned above the Brad Love Hauppauge Ubuntu could be a way to go too. I’ve used it on the x86_64 but never on an ARM processor.
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by Kevin Maguire over 1 year ago
Hi Jonas, Sean
Thanks for ideas. I didn't know about either Brad's repo, nor tsduck tool - I will checkout both.
"As no doubt you are aware DVB USB devices are notorious for breaking with each kernel upgrade"
I was certainly not aware on that, notorious to some but not me, so thanks for tip.
"It appears your frontend isn’t correctly loaded"
The terminology is (to me) new, but I am able to play/capture TS stream, see PIDs, bandwidth, etc using czap/dvbsnoop, so to my understanding that means my setup is at least mostly OK?
e.g. after I czap to a specific channel I can
cat /dev/dvb/adapter0/dvr0 > out.ts
and that TS file is perfectly playable with VLC and mpv.
Also tvheadnend itself works fine, able to stream the unencrypted channels.
The UI in tvheadend, when I'm streaming, shows something similar to screenshot above, which I re-attach here. I just don't know if the SNR / Signal Strength numbers are good/bad/indifferent.
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by Jonas Lang over 1 year ago
Ok. I generally decide that a signal is good enough if I can tune a mux and play a channel without breakup. I don’t generally get into the minutiae of the how’s and the why’s. Obviously that’s important to you here. I will say you could pick 5 different applications and attach them to the same setup and get varying results.
I use a Sat>IP Twin tuner. In TVH Status reports one tuner 46% while the other reports 103%. I’ve never bothered to investigate this as it has no real impact on my ability to tune the muxes nor view the corresponding channels. I imagine if I was hunting down a marginal signal or a hard to tune mux the db levels would be relevant to me.
It looks like you’re on top of the situation so I’ll leave it at that.
RE: measure DVB-C signal quality using USB adapter and Raspberry Pi - Added by Kevin Maguire over 1 year ago
I got TSDuck compiled (took a while on the pi!) and with tsscan got below output for the range of frequencies
strength consistently in -53 to -46 dB range
SNR in 34 - 37,5 dB range
The BER is shown as 1%, but tbh I don't really believe that as when using tvheadend I never see any BER above zero in that UI
This is my reference point.
All I can really do is move the pi + card to other locations, connect to cable signal and re-run, and see if results are massively different.
Brad's Ubuntu drivers would probably need me to flip from my existing Debian installation, which I'd rather not do as I have some other stuff already running on the Pi. (Yes, I know Ubuntu is derived from Debian, but I don't want to make a mess mixing the 2 systems. But I do have a spare Pi somewhere, so I can also in parallel try to get that installed with Ubuntu and try).
Thanks for the help.
# tsscan --nit-scan --delivery-system DVB-C/A --frequency 330000000 -g * Frequency: 330,000,000 Hz, locked: no, strength: -47 dB, SNR: 36.75 dB, BER: 1% Transport stream id: 1051, 0x041B * Frequency: 338,000,000 Hz, locked: no, strength: -52 dB, SNR: 35.5 dB, BER: 1% Transport stream id: 1101, 0x044D * Frequency: 346,000,000 Hz, locked: no, strength: -48 dB, SNR: 36.75 dB, BER: 1% Transport stream id: 10019, 0x2723 * Frequency: 354,000,000 Hz, locked: no, strength: -48 dB Transport stream id: 10016, 0x2720 * Frequency: 362,000,000 Hz, locked: no, strength: -48 dB, SNR: 36.75 dB, BER: 1% Transport stream id: 3, 0x0003 * Frequency: 370,000,000 Hz, locked: no, strength: -51 dB, SNR: 35.25 dB, BER: 1% Transport stream id: 10002, 0x2712 * Frequency: 378,000,000 Hz, locked: no, strength: -46 dB, SNR: 37.5 dB, BER: 1% Transport stream id: 4, 0x0004 * Frequency: 386,000,000 Hz, locked: no, strength: -47 dB, SNR: 37.25 dB, BER: 1% Transport stream id: 1, 0x0001 * Frequency: 394,000,000 Hz, locked: no, strength: -49 dB, SNR: 37 dB, BER: 1% Transport stream id: 10018, 0x2722 * Frequency: 402,000,000 Hz, locked: no, strength: -50 dB, SNR: 34.5 dB, BER: 1% Transport stream id: 10023, 0x2727 * Frequency: 410,000,000 Hz, locked: no, strength: -46 dB, SNR: 37 dB, BER: 1% Transport stream id: 10020, 0x2724 * Frequency: 418,000,000 Hz, locked: no, strength: -50 dB, SNR: 36.25 dB, BER: 1% Transport stream id: 10014, 0x271E * Frequency: 426,000,000 Hz, locked: no, strength: -51 dB Transport stream id: 10013, 0x271D * Frequency: 434,000,000 Hz, locked: no, strength: -54 dB, SNR: 35.25 dB, BER: 1% Transport stream id: 10012, 0x271C * Frequency: 442,000,000 Hz, locked: no, strength: -54 dB, SNR: 35 dB, BER: 1% Transport stream id: 10008, 0x2718 * Frequency: 450,000,000 Hz, locked: no, strength: -51 dB, SNR: 35.25 dB, BER: 1% Transport stream id: 1079, 0x0437 * Frequency: 458,000,000 Hz, locked: no, strength: -47 dB, SNR: 36.75 dB, BER: 1% Transport stream id: 1073, 0x0431 * Frequency: 466,000,000 Hz, locked: no, strength: -52 dB, SNR: 36.25 dB, BER: 1% Transport stream id: 10000, 0x2710 * Frequency: 474,000,000 Hz, locked: no, strength: -51 dB, SNR: 35.75 dB, BER: 1% Transport stream id: 10009, 0x2719 * Frequency: 482,000,000 Hz, locked: no, strength: -52 dB, SNR: 34.75 dB, BER: 1% Transport stream id: 10010, 0x271A * Frequency: 490,000,000 Hz, locked: no, strength: -52 dB, SNR: 35 dB, BER: 1% Transport stream id: 10011, 0x271B * Frequency: 498,000,000 Hz, locked: no, strength: -50 dB, SNR: 36.5 dB, BER: 1% Transport stream id: 10006, 0x2716 * Frequency: 522,000,000 Hz, locked: no, strength: -48 dB, SNR: 37 dB, BER: 1% Transport stream id: 6, 0x0006 * Frequency: 530,000,000 Hz, locked: no, strength: -50 dB Transport stream id: 13, 0x000D * Frequency: 538,000,000 Hz, locked: no, strength: -47 dB, SNR: 36.75 dB, BER: 1% Transport stream id: 10003, 0x2713 * Frequency: 546,000,000 Hz, locked: no, strength: -50 dB, SNR: 36.5 dB, BER: 1% Transport stream id: 10005, 0x2715 * Frequency: 554,000,000 Hz, locked: no, strength: -53 dB, SNR: 34 dB, BER: 1% Transport stream id: 12, 0x000C * Frequency: 562,000,000 Hz, locked: no, strength: -45 dB, SNR: 37.5 dB, BER: 1% Transport stream id: 10017, 0x2721 * Frequency: 610,000,000 Hz, locked: no, strength: -47 dB, SNR: 37 dB, BER: 1% Transport stream id: 10021, 0x2725