How to use w_scan2

I'm trying find out what I ned to have installed to be able to use multimedia/w_scan2

The description says:-

w_scan2 is a small channel scan tool which generates ATSC, DVB-C, DVB-S/S2 and DVB-T/T2 channels.conf files. It's based on the old "scan" tool from linuxtv-dvb-apps-1.1.0. The differences are: * no initial tuning data needed, because scanning without this data is exactly what a scan tool like this should do. * it detects automatically which DVB/ATSC card to use. * much more output formats, interfacing to other dtv software.
I'm trying to figure out how 'it detects automatically'... Is this via webcamd or should I have a device driver installed?

From what I can work out, firmware (for Linux) can be obtained using:-


I don't know if this firmware would be suitable for FreeBSD. In any case, the above script, which is in Perl has an error on line 11, which I can't resolve:-
Code:
1 #!/usr/bin/env perl                                                                                                                                                                             
  2 # SPDX-License-Identifier: GPL-2.0-or-later                                                                                                                                                     
  3 #     DVB firmware extractor                                                                                                                                                                   
  4 #                                                                                                                                                                                               
  5 #     (c) 2004 Andrew de Quincey                                                                                                                                                               
  6 #                                                                                                                                                                                               
  7                                                                                                                                                                                                 
  8 use File::Temp qw/ tempdir /;                                                                                                                                                                   
  9 use IO::Handle;                                                                                                                                                                                 
 10                                                                                                                                                                                                 
 11 @components = ( "sp8870", "sp887x", "tda10045", "tda10046",                                                                                                                                     
 12                 "tda10046lifeview", "av7110", "dec2000t", "dec2540t",                                                                                                                           
 13                 "dec3000s", "vp7041", "vp7049", "dibusb", "nxt2002", "nxt2004",                                                                                                                 
 14                 "or51211", "or51132_qam", "or51132_vsb", "bluebird",                                                                                                                           
 15                 "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718",                                                                                                                   
 16                 "af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395",                                                                                                                   
 17                 "lme2510c_s7395_old", "drxk", "drxk_terratec_h5",                                                                                                                               
 18                 "drxk_hauppauge_hvr930c", "tda10071", "it9135", "drxk_pctv",                                                                                                                   
 19                 "drxk_terratec_htc_stick", "sms1xxx_hcw", "si2165");                                                                                                                           
 20


I'm trying to obtain it9135.

Any pointers would be appreciated.

 
The LinuxTV wiki page seems to have some instructions on how to manually create the it9135 firmware files.

When you have the .fw files, put them in /boot/modules and when webcamd starts, it should create files in /dev/dvb e.g. /dev/dvb/adapter0/frontend0. At that point, you know that the hardware is working and available. Software like w_scan2 will then open the /dev/dvb files.

I should say that while I have this setup working with webcamd, there is no guarantee that the application will be supported. For example, minisatip works and does its job, but when I run w_scan2, it never finds any channels. Maybe it's my hardware or maybe there is some part of the DVB API missing in webcamd that w_scan2 uses.
 
The LinuxTV wiki page seems to have some instructions on how to manually create the it9135 firmware files.

When you have the .fw files, put them in /boot/modules and when webcamd starts, it should create files in /dev/dvb e.g. /dev/dvb/adapter0/frontend0. At that point, you know that the hardware is working and available. Software like w_scan2 will then open the /dev/dvb files.


By all account the firmware I want can be accessed via this Perl script:-


except it doesn't work for me. I get an error which stops it running... Maybe that's because I'm using it on FreeBSD.

I don't see any other way of getting hold of this driver...
 
The MD5 hash checks are failing in the Perl script but the hashes look OK. Maybe it's how the Perl script is invoking md5sum on FreeBSD. If you comment out or delete verify() on lines 710 and 714, the script runs and creates the firmware files.
 
The LinuxTV wiki page seems to have some instructions on how to manually create the it9135 firmware files.

When you have the .fw files, put them in /boot/modules and when webcamd starts, it should create files in /dev/dvb e.g. /dev/dvb/adapter0/frontend0. At that point, you know that the hardware is working and available. Software like w_scan2 will then open the /dev/dvb files.

Do I simply need to copy dvb-usb-it9135-01.fw to /boot/modules/ and reboot

...then expect to see a dvb device in /dev/ ?

Can't help wondering what /boot/firmware/ is for...
 
Yes, copy the firmware files to /boot/modules and reboot (although rebooting may not be necessary). You could put cuse into your kld_list in rc.conf but I think webcamd will load it automatically. If you don't see anything in /dev/dvb when webcamd starts, you could try running webcamd -l to see available command line options that might be needed.
 
Yes, copy the firmware files to /boot/modules and reboot (although rebooting may not be necessary). You could put cuse into your kld_list in rc.conf but I think webcamd will load it automatically. If you don't see anything in /dev/dvb when webcamd starts, you could try running webcamd -l to see available command line options that might be needed.
I've copied dvb-usb-it9135-01.fw to /boot/modules/ , rebooted, kldstat shows cuse.ko.

When I run w_scan2 I get:-

Code:
w_scan2-1.0.14 (compiled for DVB API 5.11)
https://github.com/stefantalpalaru/w_scan2

WARNING: could not guess your country. Falling back to 'DE'
guessing country 'DE', use -c <country> to override
using settings for GERMANY
DVB aerial
DVB-T Europe
scan type TERRESTRIAL, delivery system SYS_UNDEFINED, channellist 4
output format vdr-2.0
WARNING: could not guess your codepage. Falling back to 'UTF-8'
output charset 'UTF-8', use -C <charset> to override
Info: using DVB adapter auto detection.
main:4788: FATAL: ***** NO USEABLE TERRESTRIAL CARD FOUND. *****
Please check wether dvb driver is loaded and
verify that no dvb application (i.e. vdr) is running.

How can I tell if the driver loaded?

Am I right in thinking that the driver would load irrespective of whether the unit was faulty or not, and that the error msg would have been different? ie would the correct driver have created a /dev/dvb whether unit worked or not?

usbconfig -d ugen0.7:-
ugen0.7: <ITE Technologies, Inc. DVB-T TV Stick> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)

webcamd -d ugen0.7
webcamd 25080 - - Attached to ugen0.7[0]
webcamd 25080 - - webcamd: Cannot find USB device
 
If webcamd worked you should see /dev/dvb/adapter0/frontend0. If it's not there, then the device is not supported by webcamd or perhaps something went wrong with the firmware loading.

I'm not sure if the frontend0 file will appear if the firmware is not working. The driver loaded message from wscan_2 might just mean it can't find an appropriate frontend0 file.

As mentioned previously, if frontend0 is present you can have applications run properly (e.g. minisatip) but w_scan2 might fail to find channels. FWIW, here's what I see when w_scan2 starts:
Code:
# w_scan2 -c IE -f t1 -a0 -E0 -G

w_scan2-1.0.14 (compiled for DVB API 5.11)
https://github.com/stefantalpalaru/w_scan2

using settings for IRELAND
Country identifier IE not defined. Using defaults.
scan type TERRESTRIAL, delivery system SYS_DVBT, channellist 4
output format gstreamer
WARNING: could not guess your codepage. Falling back to 'UTF-8'
output charset 'UTF-8', use -C <charset> to override
-_-_-_-_ Getting frontend capabilities-_-_-_-_
Using DVB API 5.11
frontend 'DiBcom 3000MC/P' supports
INVERSION_AUTO
QAM_AUTO
TRANSMISSION_MODE_AUTO
GUARD_INTERVAL_AUTO
HIERARCHY_AUTO
FEC_AUTO
BANDWIDTH_AUTO not supported, trying 6/7/8 MHz.
FREQ (48.00MHz ... 860.00MHz)
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Scanning DVB-T...
Scanning 7MHz frequencies...
177500: (time: 00:00.147)

edit: I see you've just added the webcamd output - doesn't look promising...
 
That particular tuner is on an old PCI card (WinTV-NOVA-TD-500) so probably not of much use to you.

I have had success with both cheap and expensive RTL2832U USB tuners from eBay. I have the "RTL-SDR Blog V3 RTL2832" and it worked well.

I say worked because I have been moving away from using PCI and USB devices and am now using a SiliconDust HDHomeRun Flex for terrestrial and a Telestar Digibit R1 for satellite.
 
Is this the sort of thing that worked?

1705185291746.png
 
You don't need any extra firmware files for RTL2832 devices. Just run webcamd and the /dev/dvb files should appear. As mentioned above w_scan2 didn't find any channels for me but applications like minisatip and MythTV can access the device and receive content.
 
You don't need any extra firmware files for RTL2832 devices. Just run webcamd and the /dev/dvb files should appear. As mentioned above w_scan2 didn't find any channels for me but applications like minisatip and MythTV can access the device and receive content.
Does it find any DVB-T channels? I don't currently have satellite.

Have you tried it with tvheadend?
 
w_scan2 does not find channels when I run it. I don't know if that's because there is something missing from webcamd or there is some other reason. What's important is that while scanning with w_scan2 doesn't work, tuning with other applications certainly does.

I have used tvheadend in the past but am not sure if I tried it with the FreeBSD + RTL2832 combination. I have a couple of MythTV backends (on FreeBSD) and multiple MythTV frontends (Linux MiniMyth2). minisatip does not require satellite. SAT>IP can be used with DVB-T and DVB-C. I use minisatip to serve DVB-T via RTSP. The MythTV backend is configured to tune to the channels using RTSP URLs. You can also use HTTP streams, but RTSP works better with MythTV.

When minisatip runs, it opens /dev/dvb/adapter0/frontend0 and waits for a request from the network. In my case, I am in Ireland, so to watch RTE One TV with video, audio, subtitles etc, I use the URL rtsp://minisatip/?msys=dvbt&freq=570&pids=0,2101,2201,2301,2401,2501,2001
 
You don't need any extra firmware files for RTL2832 devices. Just run webcamd and the /dev/dvb files should appear. As mentioned above w_scan2 didn't find any channels for me but applications like minisatip and MythTV can access the device and receive content.
Thanks. But unfortunately it doesn't seem to support ATSC.

# w_scan2 -f a -c US -C UTF-8

w_scan2-1.0.14 (compiled for DVB API 5.11)

using settings for UNITED STATES
ATSC
VSB US/CA, DVB-T TW
scan type TERRCABLE_ATSC, channellist 1
output format vdr-2.0
output charset 'UTF-8'
Info: using DVB adapter auto detection.
/dev/dvb/adapter0/frontend0 -> "Realtek RTL2832 (DVB-T)" doesnt support TERRCABLE_ATSC -> SEARCH NEXT ONE.
main:4788: FATAL: ***** NO USEABLE TERRCABLE_ATSC CARD FOUND. *****
Please check wether dvb driver is loaded and
verify that no dvb application (i.e. vdr) is running.


I was hoping this would work because I have a Hauppauge WinTV HVR-950Q which
according to https://wiki.freebsd.org/WebcamCompat is compatible but I've
never been able to get it to work. It works fine under Linux.

I have cuse.ko loaded and dvb-fe-xc5000-1.6.114.fw copied to /boot/modules
but when I run webcamd it consumes 100% CPU. Running w_scan2 just hangs.
 
w_scan2 does not find channels when I run it. I don't know if that's because there is something missing from webcamd or there is some other reason. What's important is that while scanning with w_scan2 doesn't work, tuning with other applications certainly does.

I have used tvheadend in the past but am not sure if I tried it with the FreeBSD + RTL2832 combination. I have a couple of MythTV backends (on FreeBSD) and multiple MythTV frontends (Linux MiniMyth2). minisatip does not require satellite. SAT>IP can be used with DVB-T and DVB-C. I use minisatip to serve DVB-T via RTSP. The MythTV backend is configured to tune to the channels using RTSP URLs. You can also use HTTP streams, but RTSP works better with MythTV.

When minisatip runs, it opens /dev/dvb/adapter0/frontend0 and waits for a request from the network. In my case, I am in Ireland, so to watch RTE One TV with video, audio, subtitles etc, I use the URL rtsp://minisatip/?msys=dvbt&freq=570&pids=0,2101,2201,2301,2401,2501,2001


I've managed to get an RTL-SDR Blog V4 RTL2832U, started webcamd after kldloading cuse and the following appeared under /dev, so I guess I should be able receive some TV programs.

Code:
[root@X1 /dev]# ls -alR /dev/dvb
total 2
dr-xr-xr-x   3 root  wheel  512 Jan 29 13:02 .
dr-xr-xr-x  19 root  wheel  512 Jan 29 08:18 ..
dr-xr-xr-x   2 root  wheel  512 Jan 29 13:02 adapter0

/dev/dvb/adapter0:
total 1
dr-xr-xr-x  2 root     wheel      512 Jan 29 13:02 .
dr-xr-xr-x  3 root     wheel      512 Jan 29 13:02 ..
crw-rw----  1 webcamd  webcamd  0x1e2 Jan 29 13:02 demux0
crw-rw----  1 webcamd  webcamd  0x1e3 Jan 29 13:02 dvr0
crw-rw----  1 webcamd  webcamd  0x1e4 Jan 29 13:02 frontend0

w_scan2 works once webcamd has been started.


What's the easiest program to use to watch any channels?
 
What's the easiest program to use to watch any channels?
With w_scan2 -M ... you can make a channels.conf file that multimedia/mpv can use. Looks like this:
Code:
NPO 1:482000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_AUTO:FEC_AUTO:QAM_AUTO:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_AUTO:7011:7012+7017:710
NPO 2:482000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_AUTO:FEC_AUTO:QAM_AUTO:TRANSMISSION_MODE_AUTO:GUARD_INTERVAL_AUTO:HIERARCHY_AUTO:7021:7022+7027:720
  :

I start watching from a command line with /usr/local/bin/mpv -v --dvbin-file=~/mpv/channels.conf --autofit=2560x1440 --sid=no --no-sub-ass dvb://"NPO 1".
I start recording with /usr/local/bin/mpv --dvbin-file=~/mpv/channels.conf --stream-record=/tmp/video.mkv --sid=no dvb://"NPO 1".
 
Back
Top